Modify

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#2350 closed defect (fixed)

Error in ListTagged macro if specified expression returns no hits.

Reported by: anonymous Owned by: Alec Thomas
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Error message appears in ListTagged macro if expression is specified which returns no hits.

[[ListTagged(expression="foo+closed", tagspace=ticket)]]

Error: Macro ListTagged(expression="foo+closed", tagspace=ticket) failed.

Add instance has no attribute 'nodes'

Attachments (0)

Change History (5)

comment:1 Changed 17 years ago by Alec Thomas

Status: newassigned

Looks like you're using trunk/0.6. The macro syntax has changed completely in that version. The equivalent of your example would now be:

[[ListTagged(foo closed realm:ticket)]]

I haven't updated the documentation yet and the error message could certainly be clearer. I'll leave this open until I've clarified the docs.

comment:2 Changed 17 years ago by Joshua Schmidlkofer

This is a valid problem, I am using trunk, as of the latest patch. I have a few default pages for the sites I create. I know that I will eventually fill in the tags, so I put them up. Then I Include them in a few other stock pages. Hence, I hit this right away. I will try to cook up a patch.

this line

[[ListTagged(network realm:wiki)]]

When no wiki pages are tagged network

generates

Traceback (most recent call last):
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/wiki/formatter.py", line 465, in _macro_formatter
    return macro.process(args, in_paragraph=True)
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/wiki/formatter.py", line 179, in process
    text = self.processor(text)
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/wiki/formatter.py", line 166, in _macro_processor
    text)
  File "build/bdist.linux-x86_64/egg/tractags/macros.py", line 79, in expand_macro
  File "build/bdist.linux-x86_64/egg/tractags/api.py", line 175, in query
  File "build/bdist.linux-x86_64/egg/tractags/api.py", line 101, in get_tagged_resources
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/db/util.py", line 50, in execute
    return self.cursor.execute(sql_escape_percent(sql), args)
ProgrammingError: syntax error at or near ")"
LINE 1: ... tag FROM tags WHERE tagspace='wiki' AND name IN () ORDER BY...

comment:3 Changed 17 years ago by Alec Thomas

Resolution: fixed
Status: assignedclosed

This was fixed in r3067.

comment:4 Changed 17 years ago by Alec Thomas

(note to self: I should probably put in a warning if people use the old syntax)

comment:5 Changed 17 years ago by Alec Thomas

Warning added in r3068.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.