Bug in RT::Queue::AddRights RT 4.0.7

Hi,

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.

Attached the patch that fixed the problem for me. I took this from
RT::System::AddRights.
If this fix is right, then you should check the AddRights and
AddRightCategories methods on other objects as there have partly also
this bug.

Chris

Hi,

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.

Attached the patch that fixed the problem for me. I took this from
RT::System::AddRights.
If this fix is right, then you should check the AddRights and
AddRightCategories methods on other objects as there have partly also
this bug.

Chris

queue_addrights.patch (385 Bytes)

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 Add ->AddRights method to other right-enabled models · bestpractical/rt@a0bd499 · GitHub
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