Roundup Tracker - Issues

Message7950

Author rouilj
Recipients rouilj
Date 2024-02-28.19:41:16
Message-id <1709149276.93.0.621702729293.issue2551320@roundup.psfhosted.org>
In-reply-to
The software engineering team that is implementing the classhelper web-component
noticed that the user classhelper (user.help.html, user.help-search.html) doesn't
respect the properties setting of the classhelp url. The testing was done with the
classic template, but I suspect all of them (except maybe the jinja2 template)
share the issue.

Given:

http://localhost:8917/demo/user?
@startwith=0&@template=help&properties=username,realname,address&property=nosy&form=itemSynops
is&type=checkbox&@sort=username&@pagesize=50

I should see a three column table with the search results. The columns
should be:

   username realname address

(address is email address). Instead, I see a 5 column table with:

   	username 	realname 	phone 	organisation 	roles

this 5 column layout is coded in a hidden form field in html/user.help-search.html.

   <input type="hidden" value="username,realname,phone,organisation,roles" name="properties">

Changing this to read:

  <input type="hidden" tal:attributes="value python:','.join(cols)" name="properties">

almost works in that it uses the default cols value defined on the form tag with:

  tal:define=" ...
  cols python:request.columns or 'id username address realname roles'.split();
   ..."

however columns is not defined in the URL, properties is used instead. I am not
sure if this is a thinko by the programmer, or if the classhelper was supposed
to use the index @columns parameter. There is very little info in the VCS
checkin messages for that file. A quick search of the mailinglist from that time frame
(2005-2006ish) didn't turn up anything either.

Changing the above cols define to:

   props python:('properties' in request.form and request.form['properties'].value.split(',') 
) or [];
   cols python:request.columns or props or 'id username address realname roles'.split();

produces the expected output.

Note that a missing properties setting causes the _generic.help-submit.html template
to error.
History
Date User Action Args
2024-02-28 19:41:16rouiljsetrecipients: + rouilj
2024-02-28 19:41:16rouiljsetmessageid: <1709149276.93.0.621702729293.issue2551320@roundup.psfhosted.org>
2024-02-28 19:41:16rouiljlinkissue2551320 messages
2024-02-28 19:41:16rouiljcreate