[Erp5-dev] [BUG?] Base_print - selection functionality gone

Pelletier Vincent vincent at nexedi.com
Thu Oct 5 18:56:26 CEST 2006


Le Jeudi 5 Octobre 2006 12:04, Lukasz Nowak a écrit :
> Well. Changes on file
> erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/ERP5XhtmlSt
>yle_filterParameterList.xml between revisions 10251 and 10261 disabled that
> functionality.
>
> I do not now how to give back that functionality correctly, log and comment
> do not explain me enough, sorry.

This is a complete de-commit of 10251, because the latest had huge 
side-effects which were not detected by the interface tests, and I did not 
want to risk hot-fixing, and prefered rolling back changes.

So #10261 should be exactly the same as 9801.

Then, the idea for 10251 :
Back when I designed xhtml style "arguments propagation", I wanted to make a 
system requiring no modifications at all if we ever require some special 
arguments.
The application we already had which made me feel a need for argument 
propagation is erp5_web. When you're browsing an erp5_web website, you can 
pass the "editable_mode=1" parameter to switchto editable mode - providing 
you have the right to. If after that, you move to another page, you must 
provide this argument again in the url, which ended up in hardcoding many 
parameters in most generated links.
What I thought as a solution was to just blindly take all received arguments, 
filter out some known arguments which are always generated "when they 
should", ie form fields, listbox fields, etc.
But there were 2 major drawbacks :
-the url might contain unchecked values
  Even if it doesn't hurt as long as scripts check their inputs, more 
agressive checks won't hurt.
-some values were not possible to filter out cleanly. For example, listbox 
search fields must be named after the property they filter, so the filter 
would have had to contain the names of all possible properties...

So the new (10251 reverted by 10261 and commited again in 10290) version names 
the values to keep, because their names are much easier to enumerate. The 
drawback compared to original design is that the filter must be edited to 
handle more variables. The advantage is that there are no more "wild" 
variables passed around.

So, back to that precise bug:
Before, dialog_category - which is the variable responsible for displaying the 
dropdown menu in the dialog allowing to choose the print action to execute - 
was passed around implicitely. Now, it has to be put explicitelly as a kept 
variable when redirecting from Folder_print to the print action dialog :
  return context.ERP5XhtmlStyle_redirect('%s/Base_print' % 
(context.absolute_url(), ), keep_items={'dialog_category': 'object_print'}, 
**kw)
I'll commit this fix in a few minutes, along with a test in erp5_ui_tests.

-- 
Vincent Pelletier



More information about the Erp5-dev mailing list