Last modified: 2012-05-07 17:26:44 UTC
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.
Created attachment 8980 [details] 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.
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 );
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?
Good point. I forgot that also for regular image links is the link is registered regardless of whether the file exists.
I have submitted change I6bd88f66 for review.
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.
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)
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.