Modify

Opened 5 years ago

Closed 12 months ago

#9503 closed defect (fixed)

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 (last modified by rjollos)

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

Attachments (0)

Change History (3)

comment:1 Changed 4 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 4 years ago by rjollos

  • Owner changed from trapanator to rjollos

Feedback from testing is appreciated.

comment:3 Changed 12 months ago by rjollos

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from new to closed

It appears to be working correctly now.

Add Comment

Modify Ticket

Action
as closed The owner will remain rjollos.
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.