Page MenuHomePhabricator

imagelinks should include ProofreadPage pages
Closed, ResolvedPublic

Description

Author: Bryan.TongMinh

Description:
Please add an entry in the imagelinks table when a page corresponding to an index is created. Do this via LinksUpdate so that GlobalUsage can properly add them to its index as well.


Version: unspecified
Severity: enhancement

Details

Reference
bz24322

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:04 PM
bzimport added a project: ProofreadPage.
bzimport set Reference to bz24322.

beau wrote:

Add image links from Page namespace to corresponding images.

If I understood you correctly I have prepared patch which insert image links form Page namespace. For example if there is a Page:Some book.djvu/001 there will be created link to File:Some booj.djvu.

I have put the code in ParserAfterTidy hook. I am not completly certain if it is the best place to do so.

After deployment, it would be a good idea to run refreshLinks.php maintenance script, but only after bug 23287 was fixed.

Attached:

Bryan.TongMinh wrote:

Looks good. I don't have a PRP setup ready, but I think this will work. Two points:

  • Use NS_FILE instead of NS_IMAGE
  • Check if the image exists: wfFindFile( $imageTitle );

beau wrote:

I disagree with the second point. Let's assume that I had created page Page:Abc.png, and then I have uploaded File:Abc.png. There will be missing link for that file until someone edits Page:Abc.png. Maybe the extension should block creation of Page:Abc.png if corresponding file does not exist?

Bryan.TongMinh wrote:

Good point. I forgot that also for regular image links is the link is registered regardless of whether the file exists.

beau wrote:

I have submitted change I6bd88f66 for review.

zaran.krleza wrote:

Thank you very much for the patch, but I am not sure I understand perfectly the need for this change.

I agree that it is important to see a link to the index page in the file page. For example you can see if a file is used on several wikisources etc. But a link for each individual page seems to be redundant: since pages of a book are direct subpages of the index page, knowing that a file is used in an index page automatically gives you the knowledge that all the pages use the same file.

beau wrote:

That might be true for multipaged documents. However under one index there may be more than one file, for example: https://pl.wikisource.org/wiki/Indeks:Jana_Kochanowskiego_dzie%C5%82a_polskie_(Lorentowicz)

zaran.krleza wrote:

That's very true, I didn't think of that. I was also afraid that having a list of 500+ links in the "file usage" section could be a bit annoying, but I guess it is not really a valid concern.