Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2350 closed defect (fixed)

Error in ListTagged macro if specified expression returns no hits.

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


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 9 years ago by athomas

  • Status changed from new to assigned

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 9 years ago by joshland

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


Traceback (most recent call last):
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/wiki/", 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/", 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/", line 166, in _macro_processor
  File "build/bdist.linux-x86_64/egg/tractags/", line 79, in expand_macro
  File "build/bdist.linux-x86_64/egg/tractags/", line 175, in query
  File "build/bdist.linux-x86_64/egg/tractags/", line 101, in get_tagged_resources
  File "/var/trac-0.11b1/lib/python2.4/site-packages/Trac-0.11b1-py2.4.egg/trac/db/", 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/", 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 9 years ago by athomas

  • Resolution set to fixed
  • Status changed from assigned to closed

This was fixed in r3067.

comment:4 Changed 9 years ago by athomas

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

comment:5 Changed 9 years ago by athomas

Warning added in r3068.

Add Comment

Modify Ticket

as closed The owner will remain athomas.
The resolution will be deleted. Next status will be 'reopened'.

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

Note: See TracTickets for help on using tickets.