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

Fatal error if you try to remove class with a nonexistent datatype

    Details

      Description

      If you try to remove a class with a nonexistent datatype, eZ will crash with a fatal error.

      This problably happens because "* ezpublish_legacy/kernel/classes/ezcontentclass.php#815*", removableInformation function

      // Check class attributes
      foreach ( $this->fetchAttributes() as $attribute )
      {
      	$dataType = $attribute->dataType();
      	if ( !$dataType->isClassAttributeRemovable( $attribute ) )
      	{
      		$info = $dataType->classAttributeRemovableInformation( $attribute, $includeAll );
      		$result['list'][] = $info;
      		if ( !$includeAll )
      			return $result;
      	}
      }
      

      It shouldn't be an impediment to remove a class with a nonexistent datatype.

      Steps to Reproduce

      1. Create a custom datatype. A simple way to do this is to install eZComments package. eZComments will change the article class and add its own custom datatype.
      2. Duplicate article class and name it "article_1".
      3. Remove the "article_1" class and confirm there will be no problem.
      4. Delete the ezcomments extension
      5. Try to remove article class and you will see a fatal error since the the comments datatype does not exist.

        Activity

        Show
        Joao Inacio (Inactive) added a comment - Merged in ezpublish-legacy/master: https://github.com/ezsystems/ezpublish-legacy/commit/26bee3892b7d88f2f5ec6007037480fef4f52170
        Hide
        André Rømcke added a comment -
        Show
        André Rømcke added a comment - Additional fix for regression by merge above: https://github.com/ezsystems/ezpublish-legacy/commit/95c7e5c22b6ac6ba5d0922a7f9212b7f9089a7f5
        Hide
        Pedro Resende (Inactive) added a comment -

        Tested and approved by Q.A.

        Show
        Pedro Resende (Inactive) added a comment - Tested and approved by Q.A.

          People

          • Assignee:
            Unassigned
            Reporter:
            Eduardo Fernandes (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: