Issue 2551391
Created on 2025-01-15 04:15 by rouilj, last changed 2025-01-16 07:38 by rouilj.
msg8271 |
Author: [hidden] (rouilj) |
Date: 2025-01-15 04:15 |
|
When I was groveling through the template code, I came across this:
def _set_input_default_args(dic):
# 'text' is the default value anyway --
# but for CSS usage it should be present
dic.setdefault('type', 'text')
# useful e.g for HTML LABELs:
if 'id' not in dic:
try:
if dic['text'] in ('radio', 'checkbox'):
dic['id'] = '%(name)s-%(value)s' % dic
else:
dic['id'] = dic['name']
except KeyError:
pass
I think dic['text'] is wrong and dic['type'] was meant.
It looks like an attempt to create a series of
checkbox/radiobutton with unique id's.
Anybody have an alternate view?
|
msg8283 |
Author: [hidden] (rouilj) |
Date: 2025-01-16 07:38 |
|
It's more insidious than this. The dic['text'] causes a KeyError. This is why
part of issue 1513369 exists. The KeyError prevents the else from executing
resulting in no id at all.
AFAICT it has existed since 2006 but was missed in testing 8-(.
Tests fixed and committed on changeset: 8277:669dfccca898.
|
|
Date |
User |
Action |
Args |
2025-01-16 07:38:00 | rouilj | set | status: new -> fixed resolution: remind -> fixed messages:
+ msg8283 |
2025-01-15 04:15:35 | rouilj | set | resolution: remind |
2025-01-15 04:15:22 | rouilj | create | |
|