msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

22 Sep 2007 Corrupt Content Objects in eZ Publish

On my eZDB I’ve found two different scenarios of corrupt objects, they must have become corrupt when not having transaction enabled, and eZp or the user breaks out of a content object creation, og content object edit:

  1. a content object exist only in table ezcontentobject, no referernces to object in any other ezcontentobject*-tables. SOLUTION: delete row from ezcontentobject.
  2. a content object has attributes etc., but it has a ezcontentobject.current_version that doesn’t have attributes. SOLUTION: roll back version number.

This script report, and does the required job:

<?php

// Script for finding and handling content_objects that are not completely created
// That may occur under some circustances when using a database without transations enabled
//
//
// 2007.09.20, jonny.bergkvist@hit.no

// $doUpdate, true or false. Set to false for at dry test-run
$doUpdate = true;

include_once( 'kernel/common/template.php' );
include_once( "lib/ezutils/classes/ezhttptool.php" );
include_once( 'lib/ezutils/classes/ezcli.php' );
include_once( 'kernel/classes/ezscript.php' );
include_once( 'lib/ezdb/classes/ezdb.php' );

$cli =& eZCLI::instance();
$script =& eZScript::instance();
$script->initialize();
$db =& eZDB::instance();
set_time_limit( 0 );

$arrayResult1 = $db->arrayQuery( "SELECT id, current_version FROM ezcontentobject" );
echo "First checking for content objects that has no contentobject_attributes at all...n";

$i = 0;

foreach( $arrayResult1 as $item) {
        //check if object has no attributes of any version stored
        $hasAttribute = $db->arrayQuery( "SELECT contentobject_id FROM ezcontentobject_attribute WHERE contentobject_id = " . $item['id'] );

        if ( empty( $hasAttribute ) ) {
                echo "Corrupt object: " . $item['id'] . ". ";
                if ( $doUpdate ) {
                        echo "Deleting corrupt object with no attributes...n";
                        $db->query( "DELETE FROM ezcontentobject WHERE ezcontentobject.id = " . $item['id'] );
                }
        $i++;
        }
}

echo "Total corrupt objects with no attributes: " . $i . "nn";

$arrayResult2 = $db->arrayQuery( "SELECT id, current_version FROM ezcontentobject" );
echo "Then checking for content objects that has contentobject_attributes, but not of the current_version...n";
$i = 0;
foreach( $arrayResult2 as $item) {
        //check if current_version has content attributes
        $hasAttribute = $db->arrayQuery( "SELECT contentobject_id FROM ezcontentobject_attribute WHERE contentobject_id = " . $item['id'] . " AND version = " . $item['current_version'] );

        if ( empty( $hasAttribute ) ) {
        echo "Corrupt object: " . $item['id'] . ", current_version: " . $item['current_version'] . ". ";
                if ( $doUpdate ) {
                        $previousCurrentVersion = $item['current_version'] - 1;
                        echo "Setting back to version: " . $previousCurrentVersion . "n";
                        $db->query( "UPDATE ezcontentobject SET current_version = " . $previousCurrentVersion . " WHERE id = " . $item['id'] );
                }
        $i++;
        }
}
echo "Total objects with wrong current_version: " . $i . "n";

$script->shutdown();
?>

Source: http://ez.no/developer/forum/general/problem_corrupt_contentobjects

Tags: , , ,

Posted by

20 Apr 2007 Transaction failed on admin.flaubris.no and URI /content/edit/1780/f/nor-NO with ID TRANSID-799da63a4fda91bfa7be12bd574d79f1

eZ Publish kom med denne feilmelding i dag jeg fikk ikke endret eller laget nye artikler, eller for den saks skyld lagt til nytt innhold generelt. I loggen til eZ Publish sto følgende feilmelding
Transaction in progress failed due to DB error, transaction was rollbacked.
Feilen viste seg å være at databasen til eZ Publish var full, bruker innodb og den har en hardkodet max størrelse.

Fikset dette ved å øke databasestørrelsen til 512MB

innodb_data_file_path = ibdata1:10M:autoextend:max:512M

Tags: , , ,

Posted by

27 Jan 2007 WebDAV with cadaver

Upload multiple files:

cadaver mput DSC*

Uploads all files named DSC* in reverse order, greatest number first.

I’m using cadaver to upload files to my eZ Publish CMS site.

Tags: , ,

Posted by