Last modified: 2010-05-15 15:38:18 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T5620, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 3620 - records in pagelinks table do not disappear after removal of the respective outgoing links
records in pagelinks table do not disappear after removal of the respective o...
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.5.x
PC Windows XP
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-05 23:30 UTC by Hans
Modified: 2010-05-15 15:38 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Hans 2005-10-05 23:30:03 UTC
When removing an outgoing link from an article A, linking to article B (A->B),
the corresponding record in the "pagelinks" table seems to *only* be removed if
there exists no link from B to a (B->A).

If I have a link from article B to article A, and another one in article A
linking to article B, and I try to remove the one on page A linking to B, it
will not be removed from the pagelinks table.

I seem to find no way to fix this.
Comment 1 Brion Vibber 2005-10-05 23:54:04 UTC
Works for me; tested on REL1_5 and HEAD current.

1) Create page [[A]] with text "link to [[b]]"
2) Create page [[B]] with text "link to [[a]"

mysql> select page_namespace as ns,page_title,pl_from,pl_namespace,
pl_title from page,pagelinks where page_id=pl_from and
page_namespace=0 and page_title in ('A','B');
+----+------------+---------+--------------+----------+
| ns | page_title | pl_from | pl_namespace | pl_title |
+----+------------+---------+--------------+----------+
|  0 | B          |    6391 |            0 | A        |
|  0 | A          |    6390 |            0 | B        |
+----+------------+---------+--------------+----------+

3) Edit [[A]], change text to "remove link" and save.

mysql> select page_namespace as ns,page_title,pl_from,pl_namespace,
pl_title from page,pagelinks where page_id=pl_from and
page_namespace=0 and page_title in ('A','B');
+----+------------+---------+--------------+----------+
| ns | page_title | pl_from | pl_namespace | pl_title |
+----+------------+---------+--------------+----------+
|  0 | B          |    6391 |            0 | A        |
+----+------------+---------+--------------+----------+
Comment 2 Brion Vibber 2005-10-05 23:54:55 UTC
obviously that's:
2) Create page [[B]] with text "link to [[a]]"
Comment 3 Hans 2005-10-06 01:16:24 UTC
I suppose it must have something to do with the fact that I'm trying to create
an extension at the moment. It is supposed to get a list of all ingoing and
outgoing links for the current article, much like the respective MediaWiki
"special pages", and list them in a separate box on the same page with the
article itself, so that the user may click on them without having to go to the
special pages.

I'm setting up my extension via parser hook:

$wgParser->setHook("contextbar" , "contextbarHook");

Would this be the correct thing to do, or should it be hooked into the MediaWiki
system in some other location, in order not to interfere with any database or
other update activity? I can't seem to figure out just why the record (A->B)
won't get deleted from the database, unless I remove the incoming link (B->A)
first, and then do a manual update on the page (A).
Comment 4 Brion Vibber 2005-10-06 03:25:41 UTC
Most likely your extension causes it to do a lookup of the page for the link, which 
causes it to be listed in the outgoing links when the link cache is saved into the 
pagelinks table on edit.

Try disabling the link cache ($wgLinkCache) while you run your lookups, or try to 
otherwise avoid it.
Comment 5 Hans 2005-10-06 12:47:02 UTC
Hi Brion!

That was exactly what caused the problem. Your suggestion fixed it like a charm.
Thanks again!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links