Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#5099 closed defect (fixed)

Remaining issues with Genshi post-509

Reported by: Emmanuel Blot Owned by: Jonas Borgström
Priority: high Milestone: 0.11
Component: general Version: devel
Severity: normal Keywords: genshi
Cc: trac@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I'm not sure this is the right way to proceed (feel free to close this ticket if it isn't), but there are some remaining issues with the current trunk and Genshi, so rather than opening one ticket per encountered issue, I'll post the description of several of them within the same ticket.

Attachments (0)

Change History (18)

comment:1 by Emmanuel Blot, 18 years ago

with [5187], Genshi 532

File "/local/engine/trac/trac/templates/diff_div.html", line 91, in <Expression u'longcol'>
  <th title="$longcol $item.old.rev">

This error occurs while attempting to review a wiki change.

comment:2 by Emmanuel Blot, 18 years ago

Another issue while previewing a wiki page: NameError with 'diff'.

The following patch seems to fix up the issue (although I'm not confident in it and won't commit it…):

  • wiki/templates/wiki_edit.html

     
    4646            </tbody>
    4747          </table>
    4848          <fieldset id="preview" py:choose="">
    49             <legend>${diff and 'Review Changes' or 'Preview'} (<a href="#edit">skip</a>)</legend>
    50             <div py:when="diff" class="diff">
     49            <legend>${'diff' in req.args and 'Review Changes' or 'Preview'} (<a href="#edit">skip</a>)</legend>
     50            <div py:when="'diff' in req.args" class="diff">
    5151              <xi:include href="diff_div.html" py:with="no_id=True" />
    5252            </div>
    5353            <div py:otherwise="" class="wikipage">${wiki_to_html(context, page.text)}</div>

comment:3 by Emmanuel Blot, 18 years ago

When an attachment cannot be previewed

  • trac/templates/macros.html

     
    128128  -
    129129  -->
    130130  <py:def function="preview_file(preview)">
     131    <py:if test="'rendered' in preview">
    131132    ${preview.rendered}
     133    </py:if>
    132134    <py:choose>
    133       <p py:when="not preview.rendered">
     135      <p py:when="'rendered' not in preview">
    134136        <strong>HTML preview not available</strong>,
    135137        <py:choose>
    136138          <py:when test="preview.max_file_size_reached">

in reply to:  1 ; comment:4 by Emmanuel Blot, 18 years ago

Replying to eblot:

Another diff rendering issue occurs while viewing changeset changes.

data['no_id'] = ...

is not defined in changeset.py

comment:5 by Emmanuel Blot, 18 years ago

Another small issue when attempting to add a new milestone (milestones is not defined)

  • trac/ticket/templates/milestone_edit.html

     
    6666                     value="${format_date(milestone.completed) or format_date}" />
    6767              <em>Format: ${datetime_hint}</em>
    6868            </label>
    69             <py:if test="milestones">
     69            <py:if test="defined('milestones')">
    7070              <br/>
    7171              <input type="checkbox" id="retarget" name="retarget" checked="checked" />
    7272              <label>Retarget associated open tickets to milestone:

comment:6 by anonymous, 18 years ago

Cc: trac@… added

in reply to:  1 comment:7 by Christian Boos, 18 years ago

Replying to eblot:

This error occurs while attempting to review a wiki change.

Fixed in r5192.

in reply to:  4 comment:8 by Christian Boos, 18 years ago

Replying to eblot:

Another diff rendering issue occurs while viewing changeset changes.

Also fixed in r5192.

comment:9 by Christian Boos, 18 years ago

Keywords: genshi added

Remaining issues fixed in r5193. Not closing the ticket though, as there are likely more issues with this.

In general for the fixes, we shouldn't use defined(), as it was only defined itself since [Genshi 510] and we want to retain compatibility with [Genshi 509]. I also tend to favor setting up the correct default values in the model, rather than making the templates look ugly (i.e. using the .get('...') calls).

in reply to:  9 comment:10 by Emmanuel Blot, 18 years ago

Replying to cboos:

In general for the fixes, we shouldn't use defined(), as it was only defined itself since [Genshi 510] and we want to retain compatibility with [Genshi 509].

Ok, I did not know that and I'll look at your changes to understand how to write clean fixes.

comment:11 by Emmanuel Blot, 18 years ago

  • Error when some fields have been changed but no comment has been added to a ticket
    • ticket.html

       
      216216                    </py:choose>
      217217                  </li>
      218218                </ul>
      219                 <div py:if="change.comment" class="comment searchable">
       219                <div py:if="'comment' in change" class="comment searchable">
      220220                  ${wiki_to_html(context, change.comment)}
      221221                </div>
      222222              </div>

comment:12 by Emmanuel Blot, 18 years ago

Error with any ticket that does not contain a value for a custom field.
This is the case for tickets that have not been edited after new custom field is added to the configuration file.

UndefinedError is triggered on source:trunk/trac/ticket/templates/ticket.html@5178#L119

   <py:if test="field">${ticket[field.name]}</py:if>

comment:13 by Emmanuel Blot, 18 years ago

I'm not sure about how to reproduce this one, anyway:

UndefinedError is triggered on source:trunk/trac/ticket/templates/ticket.html@5178#L164

 <span class="threading" py:if="replies and 'cnum' in change"
  py:with="change_replies = replies[str(change.cnum)]">

It seems that the replies array contains unicode keys, as a typical error is

UndefinedError: {u'2': [3]} has no member named "1"

comment:14 by Emmanuel Blot, 18 years ago

When a new ticket is created then updated with the following actions:

  1. status is changed
  2. a file is attached

next rendering of the ticket triggers a UndefinedError on source:trunk/trac/ticket/templates/ticket.html@5178#L191

  <ul py:if="change.fields" class="changes">
    <li py:for="field_name, field in change.fields.items()"
        py:with="filed_type = field_types[field_name]">
      <strong>${field_name}</strong>
UndefinedError: {'status': 'radio', [...]} has no member named "attachment"

in reply to:  12 comment:15 by Christian Boos, 18 years ago

Replying to eblot:

Error with any ticket that does not contain a value for a custom field.
This is the case for tickets that have not been edited after new custom field is added to the configuration file.

Fixed in r5197.

in reply to:  13 comment:16 by Christian Boos, 18 years ago

Replying to eblot:

I'm not sure about how to reproduce this one

comment threading issues fixed in r5198.

in reply to:  11 comment:17 by Christian Boos, 18 years ago

Priority: normalhigh

Replying to eblot:

  • Error when some fields have been changed but no comment has been added to a ticket

Replying to such changes also triggered an error, fixed by r5212.

comment:18 by Christian Boos, 18 years ago

Resolution: fixed
Status: newclosed

Looks like we're done with all those little issues.

Modify Ticket

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