Modify

Opened 5 years ago

Closed 5 years ago

#6189 closed defect (fixed)

Bug - Macro doesn't work anyway

Reported by: tom@… Owned by: XayOn
Priority: high Component: TicketBackLinksMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

The Plungin doesn't work as I installed it.
I got this Error:

Error: Macro TicketBackLinks(##ticket nr##) failed
1146Table '####db name#####.WIKI' doesn't exist

I didn't use it anymore - after about a month I looked back at the code and found this bug:

You wrote - starting with Line 44:

        sql = 'SELECT w1.name FROM wiki w1, ' + \
                  '(SELECT name, MAX(version) AS VERSION FROM WIKI GROUP BY NAME) w2 ' + \
                  'WHERE w1.version = w2.version AND w1.name = w2.name '
	sql += 'AND ( w1.text LIKE \'%%[ticket:%s]%%\' ' % thispage
	sql += 'OR w1.text LIKE \'%%#%s %%\' )' % thispage

correct:

        sql = 'SELECT w1.name FROM wiki w1, ' + \
                  '(SELECT name, MAX(version) AS VERSION FROM wiki GROUP BY NAME) w2 ' + \
                  'WHERE w1.version = w2.version AND w1.name = w2.name '
	sql += 'AND ( w1.text LIKE \'%%[ticket:%s]%%\' ' % thispage
	sql += 'OR w1.text LIKE \'%%#%s %%\' )' % thispage

There is two times the Table - wiki - but once in small the second time in big letters.

To make the Plugin work

  1. edit macro.py on line 45 to
    '(SELECT name, MAX(version) AS VERSION FROM wiki GROUP BY NAME) w2 ' + \
    
  2. cd to the directory with the setup.py and >python setup.py install
  3. restart your webserver
  4. activate the plugin in your admin or config if you haven't allready.

kind regards ToM

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by anonymous

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

Add Comment

Modify Ticket

Action
as closed The owner will remain XayOn.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.