Forums / General / Edit contentclass won't work
Philip K.
Monday 22 August 2011 8:25:18 am
Today I had to edit a contentclass in a 4.4 ez installation.
After I included a textarea field and set up its' properties I was not able to store my changes.
If I clicked the "OK" button I was redirected back to edit mode. If I clicked it again I was redirected to edit mode again with an error message that the new added field with id <some-id> already exists...
I have no idea what caused this problem. Error.log doesn't have any hints for me...
Any ideas?
Thanks a lot. Philip
Linux is like a wigwam; no windows, now gates, and apache inside!
Steven E. Bailey
Monday 22 August 2011 2:32:56 pm
How many attributes does the class have and are you running sohusin? See: http://share.ez.no/blogs/steven-e.-bailey/protip-suhosin
This will remove temporary drafts for all classes - might be useful to get out of the fubared state the class is in:
<?php require 'autoload.php'; $cli = eZCLI::instance(); $script = eZScript::instance( array( 'description' => ( "Displays Class attributes of either [CLASS] or all classes" ), 'use-session' => false, 'use-modules' => true, 'use-extensions' => true ) ); $script->startup(); $options = $script->getOptions( "", "[class]", array() ); $script->initialize(); $version = eZContentClass::VERSION_STATUS_TEMPORARY; $temporaryClasses = eZContentClass::fetchList( $version, true ); if ( !$temporaryClasses ) { echo "no draft(s)"; } else { //eZContentClass::removeTemporary(); $db = eZDB::instance(); $db->begin(); foreach ( $temporaryClasses as $class ) { echo $class->attribute('id')."\n"; $class->remove( true, $version ); } $db->commit(); } $script->shutdown(); ?>
Certified eZPublish developer http://ez.no/certification/verify/396111 Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com
Tuesday 23 August 2011 12:13:41 am
Thanks a lot - after editing some suhosin variables editing classes is possible again.