[Bug 475771] [NEW] Subscription portlet breaks batch workflow state change

0 views
Skip to first unread message

Lennart Regebro

unread,
Nov 5, 2009, 3:08:30 PM11/5/09
to singing...@googlegroups.com
Public bug reported:

If you go to a folder_contents page, check a content and click "Change
state", you'll get a traversal error. This is because having the
Subscription portlet in the site will change the request.form['paths']
variable from a list of strings to a list of unicode struings, and
unrestrictedTraverse can't handle unicode.

The change happens somewhere within collective.dancing.browser.portlets.channelsubscribe.Renderer.setup_form()
A quick test seems to confirm that doing setup_form not in the __init__ but in the render of the portlet improves the situation. Possibly that's not a complete fix, but it's a start. Best of all would of course be if setup_form keeps it's fingers away from request.form. It seems like something there goes through everything in request.form and validates it or something. It's all very strange.

** Affects: singing-dancing
Importance: Undecided
Status: New

--
Subscription portlet breaks batch workflow state change
https://bugs.launchpad.net/bugs/475771
You received this bug notification because you are a member of Singing &
Dancing developers, which is the registrant for Singing & Dancing.

Status in Singing & Dancing: New

Bug description:
If you go to a folder_contents page, check a content and click "Change state", you'll get a traversal error. This is because having the Subscription portlet in the site will change the request.form['paths'] variable from a list of strings to a list of unicode struings, and unrestrictedTraverse can't handle unicode.

The change happens somewhere within collective.dancing.browser.portlets.channelsubscribe.Renderer.setup_form()
A quick test seems to confirm that doing setup_form not in the __init__ but in the render of the portlet improves the situation. Possibly that's not a complete fix, but it's a start. Best of all would of course be if setup_form keeps it's fingers away from request.form. It seems like something there goes through everything in request.form and validates it or something. It's all very strange.

Daniel Nouri

unread,
Nov 6, 2009, 7:23:22 AM11/6/09
to singing...@googlegroups.com
Hint: It's Products.Five.browser.decode.processInputs that's changing
request.form (via plone.z3cform.z2.switch_on). I think what you're
seeing is a general problem with all views or portlets that use
processInputs. processInputs will change items in the form to unicode
so that form libraries like formlib and z3c.form can work on
request.form.

Lennart Regebro

unread,
Nov 6, 2009, 1:23:57 PM11/6/09
to singing...@googlegroups.com
processInputs should in that case only be called when the z3c.form form
has been submitted, and only modify the form entries in the form.

Daniel Nouri

unread,
Nov 10, 2009, 7:25:38 AM11/10/09
to singing...@googlegroups.com
Patches welcome. :-)

maurits

unread,
Jun 4, 2010, 12:24:37 PM6/4/10
to singing...@googlegroups.com
Lennert, your suggestion to move the setup_form from the init to to
render method fixes the problem. I do not see it introducing other
problems. And the tests still pass. So I committed it on trunk in
http://dev.plone.org/collective/changeset/118701

** Changed in: singing-dancing
Status: New => Fix Committed

--
Subscription portlet breaks batch workflow state change
https://bugs.launchpad.net/bugs/475771
You received this bug notification because you are a member of Singing &
Dancing developers, which is the registrant for Singing & Dancing.

Status in Singing & Dancing: Fix Committed

maurits

unread,
Jun 11, 2010, 5:44:36 PM6/11/10
to singing...@googlegroups.com
** Changed in: singing-dancing
Status: Fix Committed => Fix Released

--
Subscription portlet breaks batch workflow state change
https://bugs.launchpad.net/bugs/475771
You received this bug notification because you are a member of Singing &
Dancing developers, which is the registrant for Singing & Dancing.

Status in Singing & Dancing: Fix Released

maurits

unread,
Jun 15, 2010, 9:44:53 AM6/15/10
to singing...@googlegroups.com
Errrr.... the applied patch fixes the problem when the portlet is added
in the right column. When the portlet is added in the left column, the
error surfaces again...?!??!?

BTW, this bug was marked by me as 'fix released'. This apparently means
that the bug is not listed anywhere anymore on launchpad. You can view
it, but only if you know the direct url. Does anyone know if there is a
setting for this in launchpad? Meanwhile, I will reopen the bug.

** Changed in: singing-dancing
Status: Fix Released => Confirmed

--
Subscription portlet breaks batch workflow state change
https://bugs.launchpad.net/bugs/475771
You received this bug notification because you are a member of Singing &
Dancing developers, which is the registrant for Singing & Dancing.

Status in Singing & Dancing: Confirmed

Reply all
Reply to author
Forward
0 new messages