Ticket #48 (closed defect: fixed)

Opened 6 years ago

Last modified 15 months ago

Backlinks action bug: listing of obsolete pages

Reported by: dartar Owned by: DotMG
Priority: normal Milestone: 1.3.1
Component: actions Version: 1.1.6.0
Severity: normal Keywords:
Cc:

Description (last modified by dartar) (diff)

The backlinks action may list pages that don't "exist" any more, in the sense that they (apparently) still are in the database but without any active version.

Status

coded

Note

This probably affects the backlinks handler too

Ref

 http://wikka.jsnx.com/WikkaBugs#hn_Backlinks_LoadPagesLinkingTo

Related comments migrated from WikkaBugs

Backlinks/LoadPagesLinkingTo()

I just discovered that the backlinks action may list pages that don't "exist" any more, in the sense that they (apparently) still are in the database but without any active version (seemingly as a result of a rename action. I added an example on my own page where you can see a supposed backlink from ReleaseNotes (which was replaced by WikkaReleaseNotes).

The cause is apparently in the LoadPagesLinkingTo() method which is used by backlinks action. It currently is implemented like this:

function LoadPagesLinkingTo($tag) { return $this->LoadAll("select from_tag as tag from ".$this->config["table_prefix"]."links where to_tag = '".mysql_real_escape_string($tag)."' order by tag"); }

I think replacing this by:

	function LoadPagesLinkingTo($tag) { return $this->LoadAll("select from_tag as tag from ".$this->config["table_prefix"]."links where to_tag = '".mysql_real_escape_string($tag)."' and latest = 'Y' order by tag"); }

might do the trick to avoid deceased pages - but please test! --JavaWoman

It wont do, since the link-table has no latest col ;). But shouldn't the delete-handler delete these links from the table anyway? --NilsLindenberg

Indeed it is the delete handler that is at fault here by not deleting all records from the links table that refer to the (to be) deleted page. This is simple enough to fix (by extending the query a little to match both the "from_tag" and "to_tag" columns) but for a future version to be released with such a fix there should also be an (admin-only) utility to clear left-behind records from the links table that should have been deleted before. --JavaWoman

Change History

Changed 6 years ago by dartar

  • milestone changed from 1.1.6.1 to 1.1.6.2

Changed 6 years ago by dartar

  • description modified (diff)

Changed 6 years ago by NilsLindenberg

  • milestone changed from 1.1.6.2 to 1.1.6.3

Changed 6 years ago by DotMG

  • owner changed from unassigned to DotMG
  • status changed from new to assigned

Will add a little script in 1.1.7 setup to rebuild the links table. Then this ticket can be closed.

Changed 6 years ago by DotMG

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in [181] and [179]. On page deletion, links table is now properly cleaned up. On install of (or on upgrade to) 1.1.7, the links table will be entirely (re-)generated, thus, obsolete pages won't be present anymore on links table.

Changed 3 years ago by DarTar

  • milestone changed from 1.2 to 1.3

Retargeting to 1.3, this ticket has already been closed in trunk, from which 1.3 will be branched. Consider backporting urgent issues to 1.2.X

Changed 15 months ago by BrianKoontz

  • milestone changed from 1.3 to 1.3.1

Updated milestone to 1.3.1

Note: See TracTickets for help on using tickets.