Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Checking of class removal

Add some checking to the removal of classes, if the class is considered a system critical class it should not be allowed to be removed.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/features/3.5/class_removal_checks.txt

*Title: Checking of class removal

Incentive:
Add some checking to the removal of classes, if the class is
considered a system critical class it should not be allowed to
be removed.

*Documentation:
Reasons for a class to be system critical:
- It is being used by a top-level node, removing it will result
  in the removal of the top-level node which will cause the system
  to malfunction. The only way to remove this class then is to
  first to swap the top-level node with another node which uses
  a different class.
- One of the attributes cannot be removed, possible reasons:
  ezuser:
    - The current user, admin user or anon user is made with this class,
      removing the class or attribute will remove the user or make them
      invalid as a user.
    - There are no more classes with this datatype, if no classes
      has this it will not be possible to login or access the site anymore.
      The only way then is to add some fields manually to the database.

In eZContentClass two new methods has been added to perform these checks,
- isRemovable() returns true if the class can be removed,
  the existing method remove() will use this to now allow
  removal of critical classes.
  Uses removableInformation() to figure it if it is possible. 
- removableInformation() returns a list of reasons why the
  class cannot be removed (if any)

In eZDataType two new methods has been added to allow certain datatypes
to perform these checks.
- isClassAttributeRemovable() returns true if the class attribute can be
  removed, the default implementation will use classAttributeRemovableInformation
  to figure this out so it is not required to reimplement.
- classAttributeRemovableInformation() returns a list of reasons why the
  class asttribute cannot be removed (if any)
  It returns false by default and must be reimplemented by datatypes
  which should do these checks.

Something wrong on this page? Report an error

Documentation license

This page was inherited from the documentation of the original software. It is not covered by the GNU Free Documentation License; it is distributed under the GNU General Public License, version 2.

Copyright (C) 1999 - 2014 eZ Systems AS and contributors