[Rt-commit] r14188 - rt/3.8/trunk/share/html/Elements

ruz at bestpractical.com ruz at bestpractical.com
Wed Jul 16 19:49:24 EDT 2008


Author: ruz
Date: Wed Jul 16 19:49:21 2008
New Revision: 14188

Modified:
   rt/3.8/trunk/share/html/Elements/ListActions

Log:
html/Elements/ListActions
* add backwards compatibility
* add support for empty key '', so people can push something

Modified: rt/3.8/trunk/share/html/Elements/ListActions
==============================================================================
--- rt/3.8/trunk/share/html/Elements/ListActions	(original)
+++ rt/3.8/trunk/share/html/Elements/ListActions	Wed Jul 16 19:49:21 2008
@@ -56,11 +56,19 @@
 </div>
 <%init>
 
+# backward compatibility, don't use array in new code, but use keyed hash
+if ( ref( $session{'Actions'} ) eq 'ARRAY' ) {
+    unshift @actions, @{ delete $session{'Actions'} };
+}
+
+if ( ref( $session{'Actions'}{''} ) eq 'ARRAY' ) {
+    unshift @actions, @{ delete $session{'Actions'}{''} };
+}
+
 my $actions_pointer = $m->request_args->{'results'};
 
 if ($actions_pointer &&  ref( $session{'Actions'}->{$actions_pointer} ) eq 'ARRAY' ) {
-    unshift @actions, @{ $session{'Actions'}->{$actions_pointer} };
-    delete $session{'Actions'}->{$actions_pointer};
+    unshift @actions, @{ delete $session{'Actions'}->{$actions_pointer} };
 }
 
 # XXX: run callbacks per row really crazy idea


More information about the Rt-commit mailing list