Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-21324: image files can be removed by mistake #825

Merged
merged 2 commits into from Nov 7, 2013

Conversation

4 participants
@bdunogier
Copy link
Member

bdunogier commented Nov 5, 2013

Fixes http://jira.ez.no/browse/EZP-21324, replaces #792.

Since copies of archived versions aren't processed by eZDatatype::onPublish(), they still reference the same images than the original.

The eZImageAliasHandler::removeAliases() method didn't take this into account, and could delete images that were actually used by the original content.

This patch prevents the method from deleting images that don't have an entry in the ezimagefile table, since they are not created during copy, except for the version that gets republished.

TODO

  • Cherry-pick tests from #792
@@ -749,6 +749,11 @@ function removeAliases( $contentObjectAttribute )
{
$filepath = $alias['url'];
// If there are no ezimagefile references for this file & ezcontentobject_attribute id, we don't do anything

This comment has been minimized.

Copy link
@lolautruche

lolautruche Nov 5, 2013

Contributor

Maybe add a more explicit comment

EZP-21324: image files can be removed by mistake
Since copies of archived versions aren't processed by eZDatatype::onPublish,
they still reference the same images than the original.

The removeAliases() method didn't take this into account, and could
delete images that were actually used by the original content.

This patch prevents the method from deleting images that don't have
an entry in ezimagefile.
@lolautruche

This comment has been minimized.

Copy link
Contributor

lolautruche commented Nov 6, 2013

+1

@dpobel

This comment has been minimized.

Copy link
Contributor

dpobel commented Nov 6, 2013

+1

1 similar comment
@andrerom

This comment has been minimized.

Copy link
Member

andrerom commented Nov 6, 2013

+1

EZP-21324: Added tests
Taken from #792

bdunogier added a commit that referenced this pull request Nov 7, 2013

Merge pull request #825 from ezsystems/fix/EZP-21324-removing_archive…
…_copy_removes_file

EZP-21324: image files can be removed by mistake

@bdunogier bdunogier merged commit e5a1776 into master Nov 7, 2013

1 check passed

default The Travis CI build passed
Details

@bdunogier bdunogier deleted the fix/EZP-21324-removing_archive_copy_removes_file branch Nov 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.