Details
-
Bug
-
Resolution: Duplicate
-
Medium
-
None
-
3.9.0
-
None
-
Operating System: FreeBSD
PHP Version: (please be specific, like '4.4.x')
Description
This bug appears in a particular situation
In the loop in :
/lib/ezxml/classes/ezdomnode.php at line 435
if ( $child->attributeValue( $attr ) == $value )
trhow a fatal error because $child isn't a object
I have added a test before and the problem is solved.
function &elementByAttributeValue( $attr, $value ) { foreach ( array_keys( $this->Children ) as $key ) { $child =& $this->Children[$key]; if (is_object($child)) { if ( $child->attributeValue( $attr ) == $value ) { return $child; } } } $child = false; return $child; }
Steps to reproduce
I tried to import a subtree which contains 2 differents classes.
One of my classe was already in the eZ destination instance.
I have evolved this classe so the remote_id was diffferent...
In a step of the importation package, I had a error :"Remote id is not correct" or something equivalent.
I have decided to report the old remote_id (in the eZ instance source) in the eZinstance destination (directly in the BDD)
I will redo the import and I have the fatal error, with the correction the import is OK
Attachments
Issue Links
- is duplicated by
-
EZP-8427 elementByAttributeValue destroys Children array, in eZDOMNode - patch included
- Closed