[rt-devel] bug in RT::Queue::AddRights RT 4.0.7

Alex Vandiver alexmv at bestpractical.com
Fri Sep 7 15:51:02 EDT 2012

On Fri, 2012-09-07 at 14:17 +0200, Christian Loos wrote:
> preparing the upgrade from 3.8.13 to 4.0.7 I found out that adding
> rights on queues didn't work anymore.
> Here is the part from my extension file:
> use RT::Queue;
> RT::Queue::AddRights(
>     ShowWorkPackages       => 'Show Work Packages',        #loc_pair
>     ModifyWorkPackageOrder => 'Modify Work Package Order', #loc_pair
> );
> With 3.8.13 this works fine. With 4.0.7 I get this warning if I restart
> apache:
> Odd number of elements in hash assignment at
> /opt/rt4/sbin/../lib/RT/Queue.pm line 172.

The RT::Queue::AddRights method has _always_ only been callable as a
class method.  See https://github.com/bestpractical/rt/commit/a0bd499
which added the method in question.  I don't see how the code you show
above could have worked in a stock 3.8.13.

> Attached the patch that fixed the problem for me. I took this from
> RT::System::AddRights.

I expect that we're going to want to refactor the AddRights code in 4.2
into being on RT::Record, which will _require_ that it be called as a
class method.  As such, I feel that we're much more likely to remove the
code from RT::System that allows for calling it as a function, rather
than the other way around.
 - Alex

More information about the rt-devel mailing list