Ticket #9503 (new defect)

Opened 2 years ago

Last modified 8 months ago

Doesn't catch all matches of pagename.

Reported by: anonymous Assigned to: rjollos
Priority: normal Component: BackLinksMacro
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

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 like: Details at SandBox.

        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 += ')' 

Attachments

Change History

09/11/12 07:10:11 changed by rjollos

(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.

09/11/12 07:43:33 changed by rjollos

  • owner changed from trapanator to rjollos.

Feedback from testing is appreciated.


Add/Change #9503 (Doesn't catch all matches of pagename.)




Change Properties
Action