Edgewall Software
Modify

Opened 4 years ago

Closed 4 years ago

#13260 closed defect (fixed)

duplicated #warning elements when ticket validation reports errors

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.4.2
Component: ticket system Version: 1.4
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Fixed duplicate #warning id on ticket page.

Description

It seems that the issue occurs due to call of ${jmacros.warnings(chrome.warnings)} in ticket_box.html and/or ticket_change.html.

$ git grep '{jmacros.warnings(chrome.warnings\>'
trac/templates/theme.html:      ${jmacros.warnings(chrome.warnings)}
trac/ticket/templates/ticket.html:        ${jmacros.warnings(chrome.warnings, 'trac-preview-warning', close_message=False)}
trac/ticket/templates/ticket_box.html:  ${jmacros.warnings(chrome.warnings)}
trac/ticket/templates/ticket_change.html:${jmacros.warnings(chrome.warnings)}
trac/ticket/templates/ticket_preview.html:${jmacros.warnings(chrome.warnings, 'trac-preview-warning', close_message=False)}
======================================================================
ERROR: runTest (trac.ticket.tests.functional.main.TestTicketMaxSummarySize)
Test `[ticket] max_summary_size` option.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "trac/ticket/tests/functional/main.py", line 85, in runTest
    tc.submit('submit')
  File "trac/tests/functional/better_twill.py", line 161, in better_submit
    b.submit(fieldname, formname)
  File "trac/tests/functional/better_twill.py", line 157, in better_browser_submit
    old_submit(fieldname)
  File "/venv/py27/local/lib/python2.7/site-packages/twill/browser.py", line 467, in submit
    self._journey('open', request)
  File "/venv/py27/local/lib/python2.7/site-packages/twill/browser.py", line 549, in _journey
    callable(func_name, *args, **kwargs)
  File "trac/tests/functional/better_twill.py", line 95, in _validate_html
    (len(errors), url, '\n'.join(errors)))
AssertionError: tidylib found 1 error(s) in testenv/trac/log/TestTicketMaxSummarySize.html

line 396 column 5 - Warning: <div> anchor "warning" already defined

======================================================================
ERROR: runTest (trac.ticket.tests.functional.main.TestTicketNoSummary)
Creating a ticket without summary should fail
----------------------------------------------------------------------
Traceback (most recent call last):
  File "trac/ticket/tests/functional/main.py", line 134, in runTest
    tc.submit('submit')
  File "trac/tests/functional/better_twill.py", line 161, in better_submit
    b.submit(fieldname, formname)
  File "trac/tests/functional/better_twill.py", line 157, in better_browser_submit
    old_submit(fieldname)
  File "/venv/py27/local/lib/python2.7/site-packages/twill/browser.py", line 467, in submit
    self._journey('open', request)
  File "/venv/py27/local/lib/python2.7/site-packages/twill/browser.py", line 549, in _journey
    callable(func_name, *args, **kwargs)
  File "trac/tests/functional/better_twill.py", line 95, in _validate_html
    (len(errors), url, '\n'.join(errors)))
AssertionError: tidylib found 1 error(s) in testenv/trac/log/TestTicketNoSummary.html

line 396 column 5 - Warning: <div> anchor "warning" already defined

======================================================================
ERROR: runTest (trac.ticket.tests.functional.main.TestTicketManipulator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "trac/ticket/tests/functional/main.py", line 177, in runTest
    tc.submit('submit')
  File "trac/tests/functional/better_twill.py", line 161, in better_submit
    b.submit(fieldname, formname)
  File "trac/tests/functional/better_twill.py", line 157, in better_browser_submit
    old_submit(fieldname)
  File "/venv/py27/local/lib/python2.7/site-packages/twill/browser.py", line 467, in submit
    self._journey('open', request)
  File "/venv/py27/local/lib/python2.7/site-packages/twill/browser.py", line 549, in _journey
    callable(func_name, *args, **kwargs)
  File "trac/tests/functional/better_twill.py", line 95, in _validate_html
    (len(errors), url, '\n'.join(errors)))
AssertionError: tidylib found 1 error(s) in testenv/trac/log/TestTicketManipulator.html

line 400 column 5 - Warning: <div> anchor "warning" already defined

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 4 years ago

Owner: set to Jun Omae
Status: newassigned

The 3 failures would go away by the following patch. The changes specify 'trac-preview-warning' because jmacros.warnings() is called when preview_mode is true.

  • trac/ticket/templates/ticket_box.html

    diff --git a/trac/ticket/templates/ticket_box.html b/trac/ticket/templates/ticket_box.html
    index f9fa14215..25d670099 100644
    a b  
    2525#}
    2626<div id="ticket">
    2727  # if not ticket.exists and preview_mode:
    28   ${jmacros.warnings(chrome.warnings)}
     28  ${jmacros.warnings(chrome.warnings, 'trac-preview-warning')}
    2929  # endif
    3030  <div id="ticketbox"${
    3131     {'class': ['trac-content', 'ticketdraft' if preview_mode],

comment:2 by Ryan J Ollos, 4 years ago

The change looks good.

comment:3 by Ryan J Ollos, 4 years ago

Internal Changes: modified (diff)
Resolution: fixed
Status: assignedclosed

Duplicate id also occurs when editing ticket comment, as noted from grep output in comment:description.

Committed comment:1 change to 1.4-stable in r17345, merged to trunk in r17346.

Modify Ticket

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