ezsystems/ezpublish-legacy — pull request #1001 by yannickroger (2014-06-18 14:35:03+00:00)
Title: [WIP] Fix EZP-22615: Not possible to remove an image from an object

Link: https://jira.ez.no/browse/EZP-22615
## Description
When an image is removed:
- aliases are deleted
- contentobject's data_text is updated with a a xml with no images.

The problem is was that the list of attribute was loaded in the beginning of attribute_edit.php:
https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/content/attribute_edit.php#L55

Then attributes are fetched:
https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/content/attribute_edit.php#L288

During the fetch, when we are deleting, objectattribute's content is modified:
https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/classes/datatypes/ezimage/ezimagetype.php#L478

This ends up triggering the method updated by this patch to know if the the attribute needs to be stored. This method was always returning true making the attribute being stored with it's old value.

## Test
Manual tests

## TODO
- [ ] See what travis thinks about it