ruote-rest fails when doing PUT on a workitem

0 views
Skip to first unread message

Gonzalo Suarez

unread,
Jun 18, 2009, 9:29:46 AM6/18/09
to openwferu-users
hi all,

i've just installed a fresh copy of ruote-rest and i have found an
issue. these are the steps i took:

1. launch ruote-rest
2. launch the default process
3. check workitems and select one
4. add new keys to attributes and hit PUT in order to just update the
payload (no "proceed" selected)
5. the following error shows in the browser:

undefined method `href' for nil:NilClass
/ruote-rest-check/lib/patching.rb:178:in `href'
/ruote-rest-check/lib/res/workitems.rb:66:in `call'
/ruote-rest-check/vendor/rufus-sixjo/lib/rufus/sixjo.rb:267:in `service'
/ruote-rest-check/vendor/rufus-sixjo/lib/rufus/sixjo.rb:265:in `catch'
/ruote-rest-check/vendor/rufus-sixjo/lib/rufus/sixjo.rb:265:in `service'
/ruote-rest-check/vendor/rufus-sixjo/lib/rufus/sixjo.rb:125:in `call'
/ruote-rest-check/lib/auth.rb:42:in `call'
/ruote-rest-check/lib/auth.rb:48:in `call'
/var/lib/gems/1.8/gems/rack-1.0.0/lib/rack/showexceptions.rb:24:in `call'
/var/lib/gems/1.8/gems/rack-1.0.0/lib/rack/commonlogger.rb:20:in `_call'
/var/lib/gems/1.8/gems/rack-1.0.0/lib/rack/commonlogger.rb:13:in `call'
/var/lib/gems/1.8/gems/rack-1.0.0/lib/rack/builder.rb:60:in `call'
/var/lib/gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:13:in `call'
/var/lib/gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in `call'
/var/lib/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61:in `process'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `initialize'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/var/lib/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
/var/lib/gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:34:in `run'
lib/start.rb:104

additional notes:

1. if "proceed" is checked, everything works fine. the payload gets
updated and passed to the following participant(s).
2. i tried updating and commiting the workitem from a REST client
using XML format and everything worked fine.

Then, it seems that doing PUT (no proceed checked) on a workitem from
a web browser fails. Is anyone having the same issue?

Thanks for your info.
Regards.

Gonzalo.

Gonzalo

unread,
Jun 18, 2009, 9:56:35 AM6/18/09
to Ruote (OpenWFEru) users
Hi again,

This may be a "quick&dirty" workaround:

"lib/res/workitems.rb"
66 #render_reply(200, "workitem at #{owi.href} updated")
67 render_reply(200, "workitem updated")


It seems that, for some reason, owi has a nil value and then accessing
'href' attribute fails.
I'll dig a little more to find out what is happening...:)

Best regards.
Gonzalo.

John Mettraux

unread,
Jun 19, 2009, 3:29:05 AM6/19/09
to openwfe...@googlegroups.com

Hello Gonzalo,

thanks for reporting that one. I'm working on adding it to the test
suite and then providing a fix.


Best regards,

--
John Mettraux - http://jmettraux.wordpress.com

John Mettraux

unread,
Jun 19, 2009, 5:51:51 AM6/19/09
to openwfe...@googlegroups.com
On Fri, Jun 19, 2009 at 4:29 PM, John Mettraux<jmet...@openwfe.org> wrote:
> On Thu, Jun 18, 2009 at 10:56 PM, Gonzalo<gonzalo....@gmail.com> wrote:
>>
>> Hi again,
>>
>> This may be a "quick&dirty" workaround:
>>
>> "lib/res/workitems.rb"
>> 66       #render_reply(200, "workitem at #{owi.href} updated")
>> 67        render_reply(200, "workitem updated")
>>
>>
>> It seems that, for some reason, owi has a nil value and then accessing
>> 'href' attribute fails.
>> I'll dig a little more to find out what is happening...:)
>
> Hello Gonzalo,
>
> thanks for reporting that one. I'm working on adding it to the test
> suite and then providing a fix.

Hi Gonzalo,

I've added a test and fixed the issue :

http://github.com/jmettraux/ruote-rest/commit/953396e3f91a8004c68628e7636db0449ee53610


Thanks for reporting, have a nice week-end !

Gonzalo

unread,
Jun 19, 2009, 6:05:11 AM6/19/09
to Ruote (OpenWFEru) users
Hi John,

Thanks for the fix.
Have a nice week-end too!

Gonzalo.



On Jun 19, 11:51 am, John Mettraux <jmettr...@openwfe.org> wrote:
> On Fri, Jun 19, 2009 at 4:29 PM, John Mettraux<jmettr...@openwfe.org> wrote:
> > On Thu, Jun 18, 2009 at 10:56 PM, Gonzalo<gonzalo.llore...@gmail.com> wrote:
>
> >> Hi again,
>
> >> This may be a "quick&dirty" workaround:
>
> >> "lib/res/workitems.rb"
> >> 66       #render_reply(200, "workitem at #{owi.href} updated")
> >> 67        render_reply(200, "workitem updated")
>
> >> It seems that, for some reason, owi has a nil value and then accessing
> >> 'href' attribute fails.
> >> I'll dig a little more to find out what is happening...:)
>
> > Hello Gonzalo,
>
> > thanks for reporting that one. I'm working on adding it to the test
> > suite and then providing a fix.
>
> Hi Gonzalo,
>
> I've added a test and fixed the issue :
>
>  http://github.com/jmettraux/ruote-rest/commit/953396e3f91a8004c68628e...
Reply all
Reply to author
Forward
0 new messages