openfoodfacts/openfoodfacts-server

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

Open

#9,794 创建于 2024年2月13日

在 GitHub 查看
 (8 评论) (1 反应) (0 负责人)Perl (477 star) (236 fork)batch import
good first issue👮 Moderation

描述

What

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

Why

Code pointers

  • 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.
  • 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.

贡献者指南