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

    XMLWordPrintable

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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: