Author: sevein
Date: Tue Oct 19 14:54:40 2010
New Revision: 8309

Log:
Comparing objects with the identity operator (===) is problematic because these 
objects are not the same instance of the same class? Fixes issue 1806.

Modified:
   trunk/lib/model/QubitInformationObject.php
   trunk/lib/model/QubitTerm.php

Modified: trunk/lib/model/QubitInformationObject.php
==============================================================================
--- trunk/lib/model/QubitInformationObject.php  Tue Oct 19 12:50:20 2010        
(r8308)
+++ trunk/lib/model/QubitInformationObject.php  Tue Oct 19 14:54:40 2010        
(r8309)
@@ -1620,7 +1620,7 @@
       foreach (QubitInformationObject::get($criteria) as $item)
       {
         // Keep track of position of $currentNode in array
-        if ($item === $currentNode)
+        if ($item->id == $currentNode->id)
         {
           $curIndex = count($tree);
         }
@@ -1718,7 +1718,7 @@
         $node['moveUrl'] = sfContext::getInstance()->routing->generate(null, 
array($item, 'module' => 'default', 'action' => 'move'));
         $node['expandUrl'] = sfContext::getInstance()->routing->generate(null, 
array($item, 'module' => 'informationobject', 'action' => 'treeView'));
 
-        if (isset($options['currentNode']) && $options['currentNode'] === 
$item)
+        if (isset($options['currentNode']) && $options['currentNode']->id == 
$item->id)
         {
           $node['style'] = 'ygtvlabel currentTextNode';
         }

Modified: trunk/lib/model/QubitTerm.php
==============================================================================
--- trunk/lib/model/QubitTerm.php       Tue Oct 19 12:50:20 2010        (r8308)
+++ trunk/lib/model/QubitTerm.php       Tue Oct 19 14:54:40 2010        (r8309)
@@ -860,7 +860,7 @@
     foreach (QubitTerm::get($criteria) as $item)
     {
       // Keep track of position of $currentNode in array
-      if ($item === $currentNode)
+      if ($item->id == $currentNode->id)
       {
         $curIndex = count($tree);
       }
@@ -979,7 +979,7 @@
           $node['expandUrl'] = 
sfContext::getInstance()->routing->generate(null, array($item, 'module' => 
'term', 'action' => 'treeView'));
         }
 
-        if (isset($options['currentNode']) && $options['currentNode'] === 
$item)
+        if (isset($options['currentNode']) && $options['currentNode']->id == 
$item->id)
         {
           $node['style'] = 'ygtvlabel currentTextNode';
         }

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to