Skip Menu |

This queue is for tickets about the RT-Client-REST CPAN distribution.

Report information
The Basics
Id: 39927
Status: rejected
Priority: 0/
Queue: RT-Client-REST

People
Owner: Nobody in particular
Requestors: tonylambiris [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Fix for get_transaction_ids when using Forms.pm from RT 3.8.0's Interface/REST.pm
Date: Thu, 9 Oct 2008 12:23:53 -0500
To: bug-RT-Client-REST [...] rt.cpan.org
From: "Tony Lambiris" <tonylambiris [...] gmail.com>
This is sort of dependent on another ticket I have open: http://rt.cpan.org/Public/Bug/Display.html?id=39868 It appears the way RT::Client::REST currently builds a list of transaction IDs is by implementing a work-around from a bug in the way RT was handling strings with a pound sign in the string it was parsing in form_parse. After fixing it locally on my system and submitting a bug report (http://rt3.fsck.com//Ticket/Display.html?id=12593), I wasn't able to retrieve a list of IDs anymore. Upon further inspection, I found another issue in RT's Interface/REST.pm in the way it was handling it's fields (bug report here: http://rt3.fsck.com/Ticket/Display.html?id=12605). After fixing the regex, Forms.pm was now including a list of transaction IDs. All that was left was to fix the logic in RT::Client::REST.pm. Currently the sub get_transaction_ids populates a list of IDs in this fashion: if (!length($e)) { my $ex = RT::Client::REST::Exception->_rt_content_to_exception($c); unless ($ex->message =~ m~^0/~) { # We do not throw exception if the error is that no values # were found. $ex->throw; } } return $e =~ m/^(?:>> )?(\d+):/mg; As I said before, this relies on a bug being present in the way RT handles lines that begin with a pound sign. To fix this, all that was required was the following: if (!@$o && $c) { RT::Client::REST::Exception->_rt_content_to_exception($c)->throw; } return keys %{$k}; This allows me to retrieve a list of transaction IDs.
Subject: Re: [rt.cpan.org #39927] AutoReply: Fix for get_transaction_ids when using Forms.pm from RT 3.8.0's Interface/REST.pm
Date: Thu, 9 Oct 2008 14:38:29 -0500
To: bug-RT-Client-REST [...] rt.cpan.org
From: "Tony Lambiris" <tonylambiris [...] gmail.com>
My apologies, I hadn't realized until now what the exception check was for. Here is an updated version that will work fine with RT >= 3.8.0: if (!@$o && $c) { my $ex = RT::Client::REST::Exception->_rt_content_to_exception($c); unless ($ex->message =~ m~^0/~) { # We do not throw exception if the error is that no values # were found. $ex->throw; } } return keys %{$k}; There might be a better way to approach the return statement, but for now this appears to be fully functional. Thanks.
This bug is pretty old, and transactions seem to work OK. I am closing this. Please reopen should you see this problem again. Thank you for your report.