[issue2551320] user.help.search.html doesn't respect properties
John Rouillard <[email protected]> Wed, 28 Feb 2024 19:41:16 +0000
| Newsgroups | gmane.comp.bug-tracking.roundup.devel |
|---|---|
| Message-ID | <[email protected]> |
New submission from John Rouillard:
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.
----------
components: Web interface
messages: 7950
nosy: rouilj
severity: normal
status: new
title: user.help.search.html doesn't respect properties
type: behavior
_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551320>
_________________________________________________