Last modified: 2012-01-03 09:18:32 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 T34946, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 32946 - Moving a page doesn't update its category links if the category depends on page relative magic words.
Moving a page doesn't update its category links if the category depends on pa...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Categories (Other open bugs)
1.18.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review, platformeng
: 30819 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-10 11:53 UTC by JulesWinnfield-hu
Modified: 2012-01-03 09:18 UTC (History)
5 users (show)

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


Attachments
Patch to add a refreshLinksJob when moving a page. (514 bytes, patch)
2011-12-19 23:21 UTC, Bawolff (Brian Wolff)
Details

Description JulesWinnfield-hu 2011-12-10 11:53:48 UTC
If categories are included through templates, moving a page doesn't update its category links. A null edit resolves the problem. [[w:hu:Sablon:Népesség/Ciobanu]], [[w:hu:Kategória:Hibásan használt sablonok]].
Comment 1 Bawolff (Brian Wolff) 2011-12-10 23:46:42 UTC
Is this reproducible always, or did this just happen once?
Comment 2 JulesWinnfield-hu 2011-12-11 22:48:20 UTC
Reproducible, any time.
Comment 3 Bawolff (Brian Wolff) 2011-12-15 21:21:30 UTC
Can you describe exact steps to reproduce?

This is what I did to try to reproduce:
*Created page http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bawolff/testbug32946 with a template ( http://hu.wikipedia.org/wiki/Szerkeszt%C5%91:Bawolff/testbug32946-template ) The template contained a category [[hu:Kategória:User:Bawolff/testbug32946]].
* Moved [[hu:Szerkesztő:Bawolff/testbug32946]] to [[hu:Szerkesztő:Bawolff/testbug32946-moved]]
* Both [[hu:Kategória:User:Bawolff/testbug32946]] and http://hu.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=category:User:Bawolff/testbug32946&cmprop=sortkey|sortkeyprefix|ids|title seemed to be updated to reflect the move, without requiring any null edits.
Comment 4 Bawolff (Brian Wolff) 2011-12-15 21:26:24 UTC
Oh, I just took a closer look at the template you linked. You mean that if the sortkey (prefix) for a category contains page-relative variables ({{PAGENAME}}, {{SUBPAGENAME}}, etc) they aren't updated on page move.


I vaguely remember this being discussed when the new category stuff was being implemented. I don't really know what a good way of detecting that the sortkeyprefix depends on page name would be.
Comment 5 JulesWinnfield-hu 2011-12-16 15:52:16 UTC
I set up the pages to reproduce the error. After a null edit you can repeat the procedure. Not the sort key is the problem, but the category listing itself. Even now there's a false listing in the [[[w:hu:Kategória:Hibásan használt sablonok]].
Comment 6 Rob Lanphier 2011-12-19 22:15:18 UTC
Mark, any reason why this was marked highest priority?  Is there a workaround for this issue?
Comment 7 Bawolff (Brian Wolff) 2011-12-19 22:29:17 UTC
(In reply to comment #6)
> [...] Is there a workaround
> for this issue?

Yes, just do a null edit. The number of people this would affect is somewhat limited. Only pages where categories are included based on a #if conditional that varies with something like {{PAGENAME}}, or people who stick things like {{PAGENAME}} in the sortkey, which I don't think is all that common (but that's just a guess. I don't know how common those two situations are in reality).

re comment 4:
>I don't really know what a good way of detecting that the
>sortkeyprefix depends on page name would be.

Actually, I suppose that doesn't overly matter, we could just add a RefreshLinksJob regardless of if its needed or not.
Comment 8 Bawolff (Brian Wolff) 2011-12-19 23:21:46 UTC
Created attachment 9745 [details]
Patch to add a refreshLinksJob when moving a page.

So one possible way of addressing this, is to on every page move add a RefreshLinksJob so that the page gets its links updated (at some point anyway). I'm not really sure if how i did that in this patch is right though, perhaps it should be just directly doing a LinksUpdate there (but then that could take a while if you have subpage option enabled, and also move 100 subpages at same time)
Comment 9 Tim Starling 2011-12-19 23:24:01 UTC
This has always been the case, hasn't it? What is the application for including {{PAGENAME}} in the category sort key? If it hasn't come up before then I assume it's fairly rare that it's required.
Comment 10 JulesWinnfield-hu 2011-12-20 11:44:35 UTC
Not the sort key, but the category itself! Example:
{{#ifeq: {{{2}}} | {{SUBPAGENAME}} | [[Category:Some tracking category]] }}
On the moved page looks good, but on the category page doesn't.
See also Bug 28876 [[28876]].
Comment 11 Tim Starling 2011-12-20 21:41:39 UTC
(In reply to comment #10)
> Not the sort key, but the category itself! Example:
> {{#ifeq: {{{2}}} | {{SUBPAGENAME}} | [[Category:Some tracking category]] }}
> On the moved page looks good, but on the category page doesn't.
> See also Bug 28876 [[28876]].

I assume neither will update. That doesn't answer my question though. I need to know why you want this, for the purposes of prioritisation.
Comment 12 JulesWinnfield-hu 2011-12-21 00:42:33 UTC
(In reply to comment #11)
Certain tracking categories like [[hu:Kategória:Hibásan használt sablonok]] lose their functionality. Templates like [[Template:Country data Washington]] have parameter values that have to match part of the page title.
Comment 13 Bawolff (Brian Wolff) 2012-01-02 11:46:53 UTC
*** Bug 30819 has been marked as a duplicate of this bug. ***
Comment 14 Krinkle 2012-01-02 12:43:55 UTC
(In reply to comment #8)
> Created attachment 9745 [details]
> Patch to add a refreshLinksJob when moving a page.

What about the rest of the page though ? Or is that already re-parsed when moving the page ? Because info/notice/message templates often change depending on in which namespace they are used.
Comment 15 Bawolff (Brian Wolff) 2012-01-03 09:18:32 UTC
(In reply to comment #14)
> (In reply to comment #8)
> > Created attachment 9745 [details]
> > Patch to add a refreshLinksJob when moving a page.
> 
> What about the rest of the page though ? Or is that already re-parsed when
> moving the page ? Because info/notice/message templates often change depending
> on in which namespace they are used.

Yes, that's already done - the page_touched timestamp gets updated.

However, it appears iAlex has (possibly accidentally) fixed this bug in r107636. Hence marking fixed

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


Navigation
Links