Pim-community-dev: Image product never delete ?

Created on 5 Apr 2016  路  4Comments  路  Source: akeneo/pim-community-dev

Hi,

I use Akeneo v1.4.22.

I have noticed that product's images are never delete. Neither when delete image of a product nor when we execute a mass product import with image.

It's a bug or it's good ?

Is there a way to delete all image not link at a product ?

Thank's you

Most helpful comment

Hi @juliensnz

Out of curiosity, was IM-491 ever implemented in a newer version of Akeneo?

I'm having a task to cleanup images no longer associated to products on an Akeneo CE 2.3 installation and I'm wondering if this feature ever made it in this version or a newer version, because I can't seem to find it at first sight.

Thanks!

All 4 comments

Hello @lpxavi
This issue seems to be related with #3572

Here is the @juliensnz answer

What you try to achieve is already the normal behaviour on Akeneo PIM:
When a media is removed from a product field, we keep it in the media table and keep it on the file system. We only break the relation between the product value and the media in database.

Did I miss something ?

@lpxavi See this part of orm mapping

# ProductValue.orm.yml

Pim\Bundle\CatalogBundle\Model\ProductValue:
    type: entity
    table: pim_catalog_product_value
    changeTrackingPolicy: DEFERRED_EXPLICIT
    # ......
        manyToOne:
        # ........
        media:
            targetEntity: Akeneo\Component\FileStorage\Model\FileInfoInterface
            cascade:
                - remove
                - persist
                - refresh
                - detach
            joinColumns:
                media_id:
                    referencedColumnName: id
                    onDelete: 'SET NULL' # this line

I confirm this information. It's too dangerous remove a file from the file system. You can create a command to remove unused files if needed.

I also add this command idea to our backlog (reference IM-491)

Regards,

Julien

Hi @juliensnz

Out of curiosity, was IM-491 ever implemented in a newer version of Akeneo?

I'm having a task to cleanup images no longer associated to products on an Akeneo CE 2.3 installation and I'm wondering if this feature ever made it in this version or a newer version, because I can't seem to find it at first sight.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings