Edit contentclass won't work

Author Message

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

Philip K.

Tuesday 23 August 2011 12:13:41 am

Thanks a lot - after editing some suhosin variables editing classes is possible again.

Linux is like a wigwam; no windows, now gates, and apache inside!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 29 2025 13:47:28
Script start
Timing: Jan 29 2025 13:47:28
Module start 'layout'
Timing: Jan 29 2025 13:47:28
Module start 'content'
Timing: Jan 29 2025 13:47:28
Module end 'content'
Timing: Jan 29 2025 13:47:28
Script end

Main resources:

Total runtime0.0106 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0040 588.1250151.2109
Module start 'layout' 0.00400.0018 739.335936.6563
Module start 'content' 0.00570.0037 775.992294.2500
Module end 'content' 0.00950.0011 870.242233.9766
Script end 0.0106  904.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002119.4309140.0001
Check MTime0.00109.2483140.0001
Mysql Total
Database connection0.00043.701110.0004
Mysqli_queries0.001816.520730.0006
Looping result0.00000.073910.0000
Template Total0.00087.710.0008
Template load0.00065.713010.0006
Template processing0.00021.955910.0002
Override
Cache load0.00044.012510.0004
General
dbfile0.00098.695080.0001
String conversion0.00000.044840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs