Details
-
Improvement
-
Resolution: Unresolved
-
High
-
5.4.8
-
None
Description
Let's say that, for some reason, we have data for a specific archived content object version in the ezcontentobject_version table but we do not have any data for that content object version in the ezcontentobject_attribute. Among other hyphotesis, I believe it's possible that this happens if there are problems with MySQL cluster synchronization.
Now we must perform a change in our content types and remove some content attributes. When RemoveField will try to map the attributes for that specific version – since the attributes do not exist – it will result in a fatal error.
Legacy/Content/Type/ContentUpdater/Action/RemoveField.php
public function apply($contentId) { ... foreach ($versionNumbers as $versionNo) { $contentRows = $this->contentGateway->load($contentId, $versionNo); $contentList = $this->contentMapper->extractContentFromRows($contentRows, $nameRows); //Here is the fatal error, since there is no $contentList $content = $contentList[0];
If this happens, RemoveField should not return errors. Instead, it should check if contentList is_set and, if not, ignore that version with just a warn.