Opened 12 years ago

Closed 8 years ago

#9503 closed defect (fixed)

Doesn't catch all matches of pagename. — at Version 3

Reported by: anonymous Owned by: Ryan J Ollos
Priority: normal Component: BackLinksMacro
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by Ryan J Ollos)

I had to set up the sql like this to match more variations of the reference in web pages. The most common was page name at the end of a sentence.

        if thispage:
              sql += 'AND (w1.text LIKE \'%%[wiki:%s %%\'' % thispage
              sql += ' OR w1.text LIKE \'%%[wiki:%s]%%\'' % thispage
              sql += ' OR w1.text LIKE \'%%[%s %%\'' % thispage        #New
              sql += ' OR w1.text LIKE \'%%[%s]%%\'' % thispage        #New
              if self._check_unicode_camelcase(thispage):   
                      sql += ' OR w1.text LIKE \'%%\n%s %%\'' % thispage 
                      sql += ' OR w1.text LIKE \'%% %s %%\'' % thispage 
                      sql += ' OR w1.text LIKE \'%%\n%s\r%%\'' % thispage 
                      sql += ' OR w1.text LIKE \'%% %s\r%%\'' % thispage 
                      sql += ' OR w1.text LIKE \'%% %s.%%\'' % thispage        #New 
              sql += ')' 

Change History (3)

comment:1 Changed 12 years ago by Ryan J Ollos

(In [11969]) Refs #5903, #9175, #9503:

  • Merged codebases for BackLinksMacro and BackLinksMenuMacro.
  • Modified SQL query to utilize Trac's database agnostic API. Possible matches are captured with a LIKE clause, and then filtered with a regex in the Python code.

comment:2 Changed 12 years ago by Ryan J Ollos

Owner: changed from Trap to Ryan J Ollos

Feedback from testing is appreciated.

comment:3 Changed 8 years ago by Ryan J Ollos

Description: modified (diff)
Resolution: fixed
Status: newclosed

It appears to be working correctly now.

Note: See TracTickets for help on using tickets.