Edgewall Software
Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#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:

Description (last modified by Ryan J Ollos)

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)

Screen Shot 2017-03-12 at 13.38.43.png (14.4 KB ) - added by Ryan J Ollos 3 years ago.
Screen Shot 2017-03-12 at 13.38.20.png (9.6 KB ) - added by Ryan J Ollos 3 years ago.
Screen Shot 2017-03-30 at 20.39.09.png (24.9 KB ) - added by Ryan J Ollos 3 years ago.

Download all attachments as: .zip

Change History (12)

by Ryan J Ollos, 3 years ago

by Ryan J Ollos, 3 years ago

comment:1 by Ryan J Ollos, 3 years ago

Description: modified (diff)

comment:2 by Ryan J Ollos, 3 years ago

Changes in log:rjollos.git:t12724_ticket_cc_field, however I'll do more testing and add tests.

comment:3 by Ryan J Ollos, 3 years ago

Milestone: 1.2.11.2.2

comment:4 by Ryan J Ollos, 3 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Primary change committed in r15734, merged in r15735. Refactoring committed in r15736, merged in r15737.

by Ryan J Ollos, 3 years ago

comment:5 by Ryan J Ollos, 3 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):  
    15991599                    cc_update = 'cc_update' in req.args \
    16001600                                and 'revert_cc' not in req.args
    16011601                    field['edit_label'] = {
    1602                             'add': _("Add to Cc"),
    1603                             'remove': _("Remove from Cc"),
     1602                            'add': _("Add Cc"),
     1603                            'remove': _("Remove Cc"),
    16041604                            None: _("Cc")}[cc_action]
    16051605                    field['cc_action'] = cc_action
    16061606                    field['cc_entry'] = cc_entry

comment:6 by Ryan J Ollos, 3 years ago

Resolution: fixed
Status: closedreopened

Reopen to fix build failure.

comment:7 by Ryan J Ollos, 3 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>  
    287287                                  <em py:when="field.cc_action is None" i18n:msg="">
    288288                                    Set your email in <a href="${href.prefs()}" class="trac-target-new">Preferences</a>
    289289                                  </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>
    291291                                  <input type="checkbox" id="field-cc" name="cc_update"
    292292                                         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}" />
    294295                                </py:when>
    295296                                <!--! Unauthenticated user without TICKET_EDIT_CC and no email set in prefs -->
    296297                                <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 Ryan J Ollos, 3 years ago

Resolution: fixed
Status: reopenedclosed

Fixed on 1.2-stable in r15739. Fixed on trunk in r15741.

comment:9 by Ryan J Ollos, 3 years ago

comment:5 changes committed in r15744.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to as closed The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.