Author: sevein
Date: Thu Jul 28 15:10:59 2011
New Revision: 9412

Log:
Adapt selfexcluding code from autocomplete action to slug routing

Modified:
   trunk/apps/qubit/modules/actor/actions/autocompleteAction.class.php
   trunk/apps/qubit/modules/function/actions/autocompleteAction.class.php

Modified: trunk/apps/qubit/modules/actor/actions/autocompleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/actor/actions/autocompleteAction.class.php Thu Jul 
28 12:26:09 2011        (r9411)
+++ trunk/apps/qubit/modules/actor/actions/autocompleteAction.class.php Thu Jul 
28 15:10:59 2011        (r9412)
@@ -44,9 +44,10 @@
 
     // Exclude the calling actor from the list
     $params = 
$this->context->routing->parse(Qubit::pathInfo($request->getReferer()));
-    if (isset($params['id']))
+    $resource = $params['_sf_route']->resource;
+    if (isset($resource->id))
     {
-      $criteria->add(QubitActor::ID, $params['id'], Criteria::NOT_EQUAL);
+      $criteria->add(QubitActor::ID, $resource->id, Criteria::NOT_EQUAL);
     }
 
     $this->pager = new QubitPager('QubitActor');

Modified: trunk/apps/qubit/modules/function/actions/autocompleteAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/function/actions/autocompleteAction.class.php      
Thu Jul 28 12:26:09 2011        (r9411)
+++ trunk/apps/qubit/modules/function/actions/autocompleteAction.class.php      
Thu Jul 28 15:10:59 2011        (r9412)
@@ -45,9 +45,10 @@
 
     // Exclude the calling function from the list
     $params = 
$this->context->routing->parse(Qubit::pathInfo($request->getReferer()));
-    if (0 < strlen ($refId = $params['id']))
+    $resource = $params['_sf_route']->resource;
+    if (isset($resource->id))
     {
-      $criteria->add(QubitFunction::ID, $refId, Criteria::NOT_EQUAL);
+      $criteria->add(QubitFunction::ID, $resource->id, Criteria::NOT_EQUAL);
     }
 
     // Page results

-- 
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