PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_TreeMenu » Bug #2259

Two nodes (one empty) for only one node in the xml tree

Details

Submitted2004-08-31 16:06 UTC
Frompascal dot maes at elec dot ucl dot ac dot be
Assignedrichard
StatusBogus
PackageHTML_TreeMenu
PHP Version5.0.0RC3 (Release Candidate 3)
OSSolaris
Roadmaps(Not assigned)

Comments

[2004-08-31 16:06 UTC] pascal dot maes at elec dot ucl dot ac dot be

Description:
------------
PHP 5.0.0RC3
Solaris 2.9
HTML_TreeMenu 1.1.9

with the xml.example.php given, each node in the xml
tree will give to lines in the treemenu :

newNode = objTreeMenu_1.addItem(new TreeNode('', null,
null, false, true, '', '', null));
newNode = objTreeMenu_1.addItem(new TreeNode('Node 1',
'folder.gif', null, false, true, '', '', 'folder-
expanded.gif'));

The first one is full of "null" but is displayed.

Reproduce code:
---------------
the xml.example.php file provided with the package.
This can be reproduced with another xml tree.

Expected result:
----------------
Only one line per node

[2004-08-31 16:39 UTC] pascal dot maes at elec dot ucl dot ac dot be

It seems that is more a problem from the package
Tree.php (1.0.3)

Here is the output for the $xmlTree variable.
We could see that the first item [0] has null attribute.
The following item [1] matches the first node
This is repeated for all node :

[root] => XML_Tree_Node Object
(
[attributes] => Array
(
)

[children] => Array
(
[0] => XML_Tree_Node Object
(
[attributes] => Array
(
)

[children] => Array
(
)

[content] =>

[name] =>
[namespaces] => Array
(
)

[error] =>
[use_cdata_section] =>
[lineno] => 3
)

[1] => XML_Tree_Node Object
(
[attributes] => Array
(
[text] => Node 1
[icon] => folder.gif
[expandedIcon] =>
folder-expanded.gif
)
...