Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-26591

RemoveField should not result in fatal errors due to problems with the ezcontentobject_attribute table rows

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Confirmed
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 5.4.8
    • Fix Version/s: Customer request
    • Component/s: Legacy bridge
    • Labels:
      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.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            eduardo.fernandes-obsolete@ez.no Eduardo Fernandes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: