Modify

Opened 5 years ago

Last modified 5 years ago

#13755 new defect

BackLinksMacro lists pages which do not have backlinks

Reported by: Florian Berger Owned by:
Priority: normal Component: BackLinksMacro
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

The BackLinksMacro is supposed to "show you which wiki pages refer to the current page", .i.e. link to the current page.

However, the macro also lists pages that do not actually link to the current page.

Expected behaviour

A page linking to [[swallow]] should be listed in the backlinks of swallow. However, a page merely mentioning swallow outside of a link should not be listed as a backlink.

Actual behaviour

The macro lists all pages containing swallow, be it in a link or not. This clutters backlink listings with unwanted and useless links.

In our use case, we use backlinks as a sort oft tagging feature with auto-generated link lists. For example, we leave a [[Minutes]] link on minutes pages. The backlink list of the Minutes page then has a list of all minutes in the wiki.

Steps to reproduce

  1. Install the macro.
  2. Create a page mentioning swallow outside a link.
  3. Create the wiki page swallow and insert the [[BackLinks]] macro.
  4. The page will list the page mentioning swallow, although it does not actually link to the swallow page.

Possible Cause

The culprit apparently is the _get_backlinked_pages method in macro.py, which, as far as I understand the SQL, merely scans for the page name, but does not even seem to attempts to check whether it actually appears in a link.

Attachments (0)

Change History (1)

comment:1 Changed 5 years ago by Ryan J Ollos

You may have better luck with TracBackLinkPlugin.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.