#12724 closed defect (fixed)
CC field is incorrect when full name but not email set in prefs
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.2.2 |
Component: | ticket system | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fixed incorrect CC field when full name but not email set in preferences. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
When the user full name but not email is set in prefs, the Add to CC field shows (example full name is Joe Smith):
Also, I think we should remove rather than disable the checkbox when email is not set in prefs (#11804):
Attachments (3)
Change History (12)
by , 8 years ago
Attachment: | Screen Shot 2017-03-12 at 13.38.43.png added |
---|
by , 8 years ago
Attachment: | Screen Shot 2017-03-12 at 13.38.20.png added |
---|
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Milestone: | 1.2.1 → 1.2.2 |
---|
comment:4 by , 8 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
by , 8 years ago
Attachment: | Screen Shot 2017-03-30 at 20.39.09.png added |
---|
comment:5 by , 8 years ago
The Remove from Cc text wraps. A simple fix for trunk would be:
-
trac/ticket/web_ui.py
diff --git a/trac/ticket/web_ui.py b/trac/ticket/web_ui.py index efc4903b9..e3fc92235 100644
a b class TicketModule(Component): 1599 1599 cc_update = 'cc_update' in req.args \ 1600 1600 and 'revert_cc' not in req.args 1601 1601 field['edit_label'] = { 1602 'add': _("Add toCc"),1603 'remove': _("Remove fromCc"),1602 'add': _("Add Cc"), 1603 'remove': _("Remove Cc"), 1604 1604 None: _("Cc")}[cc_action] 1605 1605 field['cc_action'] = cc_action 1606 1606 field['cc_entry'] = cc_entry
comment:7 by , 8 years ago
The test failures are only seen with Python 2.6, but it appears the problem exists with Python 2.7 and the trunk as well, which had already eliminated the disabled checkbox.
The issue is that the label
in the th
has a for
attribute, but the target of the for
does not exist when email is not set in preferences, now that the input
element is only conditionally rendered. The solution I'm considering is to keep the disabled checkbox, but hide it:
-
trac/ticket/templates/ticket.html
commit e5de0605112602f43d787a2fb80b26543fad28ff Author: Ryan J Ollos <ryan.j.ollos@gmail.com> Date: Fri Mar 31 00:16:49 2017 -0700 Another try at fixing diff --git a/trac/ticket/templates/ticket.html b/trac/ticket/templates/ticket.html index 23b75aabd..ee61e87cc 100644
a b ${value}</textarea> 287 287 <em py:when="field.cc_action is None" i18n:msg=""> 288 288 Set your email in <a href="${href.prefs()}" class="trac-target-new">Preferences</a> 289 289 </em> 290 <label py:otherwise="" py:strip="not field.cc_action"for="field-cc"><em>$field.cc_entry</em></label>290 <label py:otherwise="" for="field-cc"><em>$field.cc_entry</em></label> 291 291 <input type="checkbox" id="field-cc" name="cc_update" 292 292 title="This checkbox allows you to add or remove yourself from the CC list." 293 py:if="field.cc_action" checked="${field.cc_update or None}" /> 293 style="${'display: none' if field.cc_action is None else None}" 294 disabled="${field.cc_action is None or None}" checked="${field.cc_update or None}" /> 294 295 </py:when> 295 296 <!--! Unauthenticated user without TICKET_EDIT_CC and no email set in prefs --> 296 297 <py:when test="field.cc_action is None">
The net changes with [15734,15738] is just the addition of the style
attribute.
comment:8 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Changes in log:rjollos.git:t12724_ticket_cc_field, however I'll do more testing and add tests.