Issue 2551320
Created on 2024-02-28 19:41 by rouilj, last changed 2024-03-07 03:04 by rouilj.
msg7950 |
Author: [hidden] (rouilj) |
Date: 2024-02-28 19:41 |
|
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.
|
msg7951 |
Author: [hidden] (rouilj) |
Date: 2024-02-28 20:47 |
|
Changes pushed in changeset: 7746:ad1e8e1f7fa7.
Will update attribution in CHANGES.txt when I get a response
from the team about who/how to list.
|
msg7959 |
Author: [hidden] (rouilj) |
Date: 2024-03-07 03:04 |
|
Updated attribution. Closing.
|
|
Date |
User |
Action |
Args |
2024-03-07 03:04:08 | rouilj | set | status: open -> fixed resolution: fixed messages:
+ msg7959 |
2024-02-28 20:50:55 | rouilj | set | status: new -> open priority: normal assignee: rouilj |
2024-02-28 20:47:31 | rouilj | set | messages:
+ msg7951 |
2024-02-28 20:25:25 | rouilj | set | title: user.help.search.html doesn't respect properties -> user.help-search.html doesn't respect properties |
2024-02-28 19:41:16 | rouilj | create | |
|