Modify

Opened 3 years ago

Last modified 2 years ago

#9503 new defect

Doesn't catch all matches of pagename.

Reported by: anonymous Owned by: 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 (0)

Change History (2)

comment:1 Changed 2 years ago 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.

comment:2 Changed 2 years ago by rjollos

  • Owner changed from trapanator to rjollos

Feedback from testing is appreciated.

Add Comment

Modify Ticket

Action
as new The owner will remain rjollos.
Author


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

 
Note: See TracTickets for help on using tickets.