Thursday 07 October 2010 2:40:17 am
Currently I am facing multiple issues regarding the new eZFind 2.3 and indexing/updating objects that are not within the table 'ezcontentobject_tree' thus have no node-object in its attribute 'main_node'. When having such objects in your database and using eZFind 2.3 (official stable release) the cronjob fails with:
Fatal error: Call to a member function attribute() on a non-object in
...../extension/ezfind/search/plugins/ezsolr/ezsolr.php on line 357 After poking in the code, I found the glitch that has been introduced in 2.3. 2.2 does not have this issue:
355: // Get global object values
356: $mainNode = $contentObject->attribute( 'main_node' );
357: $mainNodePathArray = $mainNode->attribute( 'path_array' ); Line 357 failes, because the return value $mainNode from line 356 is not checked before calling methods on this object (or in my case it's not an object, it is null). I have this patch to provide a workaround and continue state to index other objects that are 'valid' and have a main-node ...
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -354,7 +354,7 @@
}
// Get global object values
$mainNode = $contentObject->attribute( 'main_node' );
- $mainNodePathArray = $mainNode->attribute( 'path_array' );
+
// initialize array of parent node path ids, needed for multivalued path field and subtree filters
$nodePathArray = array();
if ( !$mainNode )
@@ -362,6 +362,9 @@
eZDebug::writeError( 'Unable to fetch main node for object: ' . $contentObject->attribute( 'id' ), 'eZSolr::addObject()' );
return false;
}
+ // get main-node contentobject-tree-node
+ $mainNodePathArray = $mainNode->attribute( 'path_array' );
+
//included in $nodePathArray
//$pathArray = $mainNode->attribute( 'path_array' );
$currentVersion = $contentObject->currentVersion(); But I am also curious. What is the reason, that i got contentobjects floating around without any node/tree attachment? What may be the possible initial cause for those ghost-objects? Thanks, chris PS: eZPublish 4.2, imported content using the data_import extension, ezFind 2.2 manually updated to 2.3 due to 'date null import errors' in eZFind 2.2.
Hannover, Germany
eZ-Certified http://auth.ez.no/certification/verify/395613
|