Edgewall Software

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9290 closed enhancement (fixed)

Adding field data to ticket diff data

Reported by: Mitar Owned by: Remy Blank
Priority: normal Milestone: 0.12
Component: ticket system Version: 0.11.4
Severity: normal Keywords:
Cc: mmitar@… Branch:
Release Notes:
API Changes:
Internal Changes:


I would like to request that field given to version_info in ticket displaying would be added to returned data (and thus data used for displaying ticket diff changes). Because otherwise it is very hard (and impossible to do it nicely) to determine for what a diff in changes list is for, when you want to post-process data in post_process_request.

So simply adding field would be it:

return {'path': path, 'rev': rev, 'shortrev': shortrev,
        'href': get_resource_url(self.env, t, req.href),
        'field': field}

Attachments (0)

Change History (4)

comment:1 by Remy Blank, 10 years ago

Your suggestion duplicates the field name in both change.old and change.new. How about this instead? It also adds the field name for non-text fields.

  • trac/ticket/web_ui.py

    diff --git a/trac/ticket/web_ui.py b/trac/ticket/web_ui.py
    a b  
    812812                old, new = old_ticket[k], new_ticket[k]
    813813                if old != new:
    814814                    label = field_labels.get(k, k.capitalize())
    815                     prop = {'name': label,
     815                    prop = {'name': label, 'field': k,
    816816                            'old': {'name': label, 'value': old},
    817817                            'new': {'name': label, 'value': new}}
    818818                    rendered = self._render_property_diff(req, ticket, k,
    845845                                ignore_case='-i' in diff_options,
    846846                                ignore_space_changes='-b' in diff_options)
    848             changes.append({'diffs': diffs, 'props': [],
     848            changes.append({'diffs': diffs, 'props': [], 'field': field,
    849849                            'new': version_info(tnew, field),
    850850                            'old': version_info(told, field)})

comment:2 by Mitar, 10 years ago

Sounds great.

comment:3 by Remy Blank, 10 years ago

Milestone: 0.12
Resolution: fixed
Status: newclosed

Patch applied in [9622].

comment:4 by Remy Blank, 10 years ago

Owner: set to Remy Blank

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank 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.