openfoodfacts-server icon indicating copy to clipboard operation
openfoodfacts-server copied to clipboard

Move all images to the deleted folder when product is deleted without deleting individual images first

Open teolemon opened this issue 1 year ago • 8 comments

What

  • Move all images to the deleted folder when product is deleted without deleting individual images first

teolemon avatar Feb 13 '24 11:02 teolemon

Related code is in lib/ProductOpener/Product.pm + Images.pm

To delete a product, you have to be an admin. Create a user in your local product opener website (use the Sign-in button), then in lib/ProductOpener/Config_off.pm add your userid.

stephanegigandet avatar Mar 14 '24 08:03 stephanegigandet

I have started working on this issue @stephanegigandet kindly assign me

kemsguy7 avatar Mar 14 '24 10:03 kemsguy7

@kemsguy7, please are you still working on this issue ?

Payne680 avatar Mar 18 '24 14:03 Payne680

@kemsguy7, please are you still working on this issue ?

yes @Payne680, I'm creating a PR soon

kemsguy7 avatar Mar 23 '24 13:03 kemsguy7

@kemsguy7 Are you still working on this?

tchen0125 avatar Apr 06 '24 21:04 tchen0125

Can I work on this issue?

andrewhuanggg avatar Apr 13 '24 21:04 andrewhuanggg

Removing an image is calling process_image_move with "trash" as destination

Removing a product is about setting $product_ref->{deleted} to 'on', so image removal should happen in store_product, after initial checks, when we see it is deleted.

alexgarel avatar Apr 18 '24 07:04 alexgarel

I am working on this. I should be submitting PR tomorrow with @andrewhuanggg

tchen0125 avatar Apr 29 '24 01:04 tchen0125