Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Bug #4869 Variable references should be returned
Submitted: 2005-07-20 07:20 UTC
From: benpeti at sourceforge dot net Assigned: datenpunk
Status: Closed Package: DB_NestedSet
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2005-07-20 07:20 UTC] benpeti at sourceforge dot net
Description: ------------ After upgrade PHP to 4.4 I got the following errors: Only variable references should be returned by reference in /usr/local/lib/php/DB/NestedSet/DB.php on line 52 Only variable references should be returned by reference in /usr/local/lib/php/DB/NestedSet/TreeMenu.php on line 77 Only variable references should be returned by reference in /usr/local/lib/php/DB/NestedSet/Output.php on line 109 I'm using the 1.3.6 version of NestedSet

Comments

 [2005-10-25 23:31 UTC] datenpunk at php dot net
I was able to "Fix" this "Bug" in output.php but I can'T find the other lines. Seems as if we are on different versions. Please provide the offending lines in your version of DB_NestedSet. Sorry for the delay and thanks for your help! -- Daniel Khan
 [2006-11-01 11:29 UTC] datenpunk at php dot net (Daniel Khan)
No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you.
 [2007-10-12 08:48 UTC] uplink (Uplink Coherent Solutions)
the bug still exists as of php 5.2.4 and db_nestedset 1.3.6- beta: [12-Oct-2007 10:44:02] PHP Notice: Only variable references should be returned by reference in .../DB/NestedSet/Output.php on line 109 in Output.php and Menu.php ... stack trace: [12-Oct-2007 10:46:20] PHP Stack trace: [12-Oct-2007 10:46:20] PHP 1. {main}() /web/pear/nested_sets_treemenu/test2.php:0 [12-Oct-2007 10:46:20] PHP 2. DB_NestedSet::factory() /web/pear/nested_sets_treemenu/test2.php:83 [12-Oct-2007 10:46:20] PHP 3. DB_NestedSet_DB- >DB_NestedSet_DB() /opt/local/lib/php/DB/NestedSet.php:346 [12-Oct-2007 10:46:20] PHP Notice: Only variable references should be returned by reference in /opt/local/lib/php/DB/NestedSet/Menu.php on line 64 and [12-Oct-2007 10:46:20] PHP Stack trace: [12-Oct-2007 10:46:20] PHP 1. {main}() /web/pear/nested_sets_treemenu/test2.php:0 [12-Oct-2007 10:46:20] PHP 2. DB_NestedSet_Output::factory() /web/pear/nested_sets_treemenu/test2.php:115 [12-Oct-2007 10:46:20] PHP 3. DB_NestedSet_Menu- >DB_NestedSet_Menu() /opt/local/lib/php/DB/NestedSet/Output.php:109 [12-Oct-2007 10:46:20] PHP Notice: Only variable references should be returned by reference in /opt/local/lib/php/DB/NestedSet/Output.php on line 109 when doing: require_once('DB/NestedSet.php'); require_once('DB/NestedSet/Output.php'); $dsn = 'mysql://xxx:xxx@localhost/dev'; $params = array( 'id' => 'id', 'parent_id' => 'rootid', 'left_id' => 'l', 'right_id' => 'r', 'order_num' => 'norder', 'level' => 'level', 'name' => 'name', ); $nestedSet =& DB_NestedSet::factory('DB', $dsn, $params); // we want the nodes to be displayed ordered by name, so we add the secondarySort attribute $nestedSet->setAttr(array( 'node_table' => 'nested_set', 'lock_table' => 'nested_set_locks', 'secondarySort' => 'name', ) ); // get data (important to fetch it as an array, using the true flag) $data = $nestedSet->getAllNodes(true); // }}} // {{{ manipulate data // add links to each item foreach ($data as $id => $node) { $data[$id]['link'] = '?id=' . $node['id']; } // }}} // {{{ render output $params = array( 'structure' => $data, 'textField' => 'name', 'linkField' => 'link', 'options' => array('icon' => 'folder.gif', 'expandedIcon' => 'folder-expanded.gif'), ); require_once('HTML/Menu.php'); // require_once('DB/NestedSet/Menu.php'); require_once 'HTML/Menu/DirectTreeRenderer.php'; $output1 =& DB_NestedSet_Output::factory($params, 'Menu'); $structure = $output1->returnStructure(); $menu = & new HTML_Menu($structure, 'tree'); $currentUrl = $_SERVER['PHP_SELF'].'?nodeID=' . $_GET['nodeID']; $menu->forceCurrentUrl($currentUrl); $menu->show(); $output =& DB_NestedSet_Output::factory($params, 'TreeMenu'); // Create the javascript menu. // You'll need to copy over the images directory and TreeMenu.js file that // comes with HTML_TreeMenu into a web-accessible directory. // Set the location of the images for the menu here echo '<script src="js/TreeMenu.js" language="JavaScript" type="text/javascript"></script>'; $output->setOptions('printTree', array('images' => 'i')); $output->printTree();
 [2007-10-21 20:17 UTC] datenpunk (Daniel Khan)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.