Last modified: 2011-03-25 19:37:05 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 T29836, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27836 - Some images do not display unless user is logged-in
Some images do not display unless user is logged-in
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
FlaggedRevs (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-03 15:15 UTC by Mulat
Modified: 2011-03-25 19:37 UTC (History)
7 users (show)

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


Attachments
screenshots showing the same page for unlogged and logged-in user (240.05 KB, image/jpeg)
2011-03-03 15:15 UTC, Mulat
Details
Fetch files by sha1, avoiding blue link on rename+no redirect (3.72 KB, patch)
2011-03-21 16:24 UTC, Aaron Schulz
Details
Updated patch (6.12 KB, patch)
2011-03-22 20:38 UTC, Aaron Schulz
Details

Description Mulat 2011-03-03 15:15:52 UTC
Created attachment 8237 [details]
screenshots showing the same page for unlogged and logged-in user

In Polish Wikipedia (http://pl.wikipedia.org) random graphic files do not display for users not logged-in (or not registered). The same images display well for logged-in users in the same time. This error is not persistent (after a time -- hours, days perhaps -- images show up). Usually these are thumbnails of images inserted via templates, but not only. No correlation with browser type, operating system, time of day etc. has been found. Also images affected seem to be totally random, and they do not stay affected long.
Recent example: on page [http://pl.wikipedia.org/wiki/Herb_powiatu_%C5%BCni%C5%84skiego] the image [:File:POL województwo kujawsko-pomorskie COA.svg] included via template  [http://pl.wikipedia.org/wiki/Szablon:Herby_kujawsko-pomorskich_powiat%C3%B3w] shows up today only for logged-in users. The same image displays well for all users when they open template page itself [http://pl.wikipedia.org/wiki/Szablon:Herby_kujawsko-pomorskich_powiat%C3%B3w], or image page [http://pl.wikipedia.org/wiki/Plik:POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg]. 
This error has been reported to Polish Wikipedia bug reporting system many times by diffrent users. Probably also already reported on Bugzilla, but still not corrected.
Comment 1 Bryan Tong Minh 2011-03-03 15:27:35 UTC
HTML as logged-in user:

<td style="width:0%;padding:0px 0px 0px 2px;" rowspan="3"><a href="/wiki/Plik:POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg" class="image" title="Herb województwa kujawsko-pomorskiego"><img alt="Herb województwa kujawsko-pomorskiego" src="http://upload.wikimedia.org/wikipedia/commons/thumb/7/79/POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg/50px-POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg.png" width="50" height="62" /></a></td>

HTML as anonymous user:
<td style="width:0%;padding:0px 0px 0px 2px;" rowspan="3"><a href="/wiki/Plik:POL_wojew%C3%B3dztwo_kujawsko-pomorskie_COA.svg" title="Plik:POL województwo kujawsko-pomorskie COA.svg">Herb województwa kujawsko-pomorskiego</a></td> 


Does plwiki have flaggedrevs? I think it may have something to do with that.
Comment 2 Aaron Schulz 2011-03-10 07:18:51 UTC
The behavior should already improve with the changes in r82917.

Some of the old stable versions still have blue linked files:
http://pl.wikipedia.org/w/index.php?title=Herb_powiatu_%C5%BCni%C5%84skiego&stableid=14947063

This normally implies the version of that file used when that old revision of "Herb..." was reviewed no longer exists. However, I can't find any signs of deletion...
Comment 3 Aaron Schulz 2011-03-15 18:09:08 UTC
Many older reviewed (stableid=x in URL) versions of pages that use that file also have blue links. Newer ones don't. The ones that have blue links are page versions reviewed before the file was uploaded (jan 2011). That suggest two possibilities:
(i) The templates (header boxes, portal boxes) used on those pages referenced the coat of arms file before it was created and it was a redlink when the pages where reviewed. I doubt people reviewed pages with a bunch of redlinked files though.
(ii) The templates didn't reference the coat of arms file when those pages were reviewed, but the current *stable version* of the templates *now* use the file. This means that the reviewed version of the pages using the templates now use the file too, but the reviewer never specified a version. What *should* happen is that the current file is used in that case, not a blue link. I'll look at this further.
Comment 4 Aaron Schulz 2011-03-15 19:09:58 UTC
I recreated scenario (ii) on my testwiki, but the page correctly shows the current file version, so that doesn't seem to be the problem.

Looking at http://pl.wikipedia.org/w/index.php?title=Szablon:Wojew%C3%B3dztwo_kujawsko-pomorskie&action=history it looks like Plik:POL województwo kujawsko-pomorskie COA.svg was "used" before it was even created. Is this correct?
Comment 5 Mulat 2011-03-17 12:03:15 UTC
(In reply to comment #4)
> I recreated scenario (ii) on my testwiki, but the page correctly shows the
> current file version, so that doesn't seem to be the problem.
> 
> Looking at
> http://pl.wikipedia.org/w/index.php?title=Szablon:Wojew%C3%B3dztwo_kujawsko-pomorskie&action=history
> it looks like Plik:POL województwo kujawsko-pomorskie COA.svg was "used" before
> it was even created. Is this correct?

* It looks exactly like you describe: the file creation date is Jan 22 2011 but template edition which uses this filename is from Jan 27 201. I can't explain this. Whether there were once a file with this name on Commons (deleted and re-created) or there is a bug in article history or it is a consequence of a trick with nested templates, I cannot tell. I may ask someone on Commons to check it up.
Comment 6 Aaron Schulz 2011-03-17 12:49:22 UTC
I didn't see anything in the deletion/move logs though.
Comment 7 Mulat 2011-03-17 15:21:53 UTC
(In reply to comment #6)
> I didn't see anything in the deletion/move logs though.

In fact, the file File:POL województwo kujawsko-pomorskie COA.svg has been
replaced on Jan 22 2011 (previous version moved to another name, new version
uploaded), so creation date is correctly _after_ its first usage. But there
_was_ a file with this name all the time, only with different content.

This is a listing I have received from Masur (http://commons.wikimedia.org/wiki/User:Masur)– sorry, in Polish:

* (pokaż/ukryj) 16:37, 22 sty 2011 JDavid (dyskusja | edycje | zablokuj) przesłał File:POL województwo kujawsko-pomorskie COA.svg ‎ ({{Information | Description = {{pl|Herb województwa województwa kujawsko-pomorskiego}} {{en|Kuyavian-Pomeranian Voivodship Coat of Arms}} | Source = * Uchwała Nr 444/2000 Sejmiku Województw)
* (pokaż/ukryj) 16:33, 22 sty 2011 JDavid (dyskusja | edycje | zablokuj) File:POL województwo kujawsko-pomorskie COA.svg przeniesiono do File:POL województwo kujawsko-pomorskie COA alt.svg ‎ (place for office pattern COA) (cofnij)
* (pokaż/ukryj) 23:13, 31 lip 2006 Bastianow (dyskusja | edycje | zablokuj) przesłał File:POL województwo kujawsko-pomorskie COA.svg ‎ (correction)
* (pokaż/ukryj) 23:10, 31 lip 2006 Bastianow (dyskusja | edycje | zablokuj) przesłał File:POL województwo kujawsko-pomorskie COA.svg ‎ (== Description == Herb województwa kujawsko-pomorskiego *Kuyavian-Pomeranian Voivodship Coat of Arms
Comment 8 Aaron Schulz 2011-03-17 16:01:15 UTC
I still don't get why http://pl.wikipedia.org/w/index.php?title=Specjalna%3ARejestr&type=&user=&page=Plik%3APOL+wojew%C3%B3dztwo+kujawsko-pomorskie+COA.svg&year=&month=-1&tagfilter=&hide_review_log=0 is empty though.

Anyway, if image is moved from title X to Y and a new one uploaded over X, stable versions of pages using X will look for the version of the file named X with the proper timestamp. This will fail, since that version is now under title Y. As long as the page using X shows up as having pending file changes (it will after r82917), this is more tolerable.

FlaggedRevs does store the sha1 of the proper version of files that it want's to use. This means that it could fetch the files it wants by (sha1,timestamp), which, in this case, would get around this problem (since it isn't using the name).
Comment 9 Mulat 2011-03-18 11:12:16 UTC
(In reply to comment #8)
> I still don't get why
> http://pl.wikipedia.org/w/index.php?title=Specjalna%3ARejestr&type=&user=&page=Plik%3APOL+wojew%C3%B3dztwo+kujawsko-pomorskie+COA.svg&year=&month=-1&tagfilter=&hide_review_log=0
> is empty though.
> 
> Anyway, if image is moved from title X to Y and a new one uploaded over X,
> stable versions of pages using X will look for the version of the file named X
> with the proper timestamp. This will fail, since that version is now under
> title Y. As long as the page using X shows up as having pending file changes
> (it will after r82917), this is more tolerable.
> 
> FlaggedRevs does store the sha1 of the proper version of files that it want's
> to use. This means that it could fetch the files it wants by (sha1,timestamp),
> which, in this case, would get around this problem (since it isn't using the
> name).

Could you please translate it into English? ;-) I do not understand if there is hope or not? More: do you suggest that this practice on Commons (replacing files by moving previous version under new name and uploading new one) is wrong? (Or rather potentially can cause technical problems?) This knowledge should then be transferred to Commons folks to avoid problems.
Comment 10 Aaron Schulz 2011-03-18 11:18:41 UTC
Basically, there is already one fix in the development code (/trunk) that will have pages with blue-linked images like this *actually say* that "template/file changes need review" like it should. Right now, these pages act like the stable and latest versions have no pending changes and silently give different behavior for logged-out users (which is bad). This will be fixed.

The other thing is whether the above improvement is good enough. If it's not, I can try to actually have the thumbnails show in these cases rather than blue links. It would require some potentially tricky change to the MediaWiki parser code though.
Comment 11 Aaron Schulz 2011-03-21 16:24:43 UTC
Created attachment 8317 [details]
Fetch files by sha1, avoiding blue link on rename+no redirect

Here is what the code to use the hash to find files might be like. Needs sanity check and review.
Comment 12 Aaron Schulz 2011-03-22 20:38:59 UTC
Created attachment 8323 [details]
Updated patch
Comment 13 Aaron Schulz 2011-03-23 18:36:40 UTC
Should be fixed in r84591, r84610, r84618, r84619.
Comment 14 Mulat 2011-03-25 09:27:34 UTC
New example (I hope it may help): on page http://pl.wikipedia.org/wiki/Pomnik_Bohater%C3%B3w_Warszawy the image File:Fotothek df ps 0005997 Denkmäler - Denkmale - Ehrenmäler - Ehrenmale ^ Kriegsden.jpg does not show for IP users, and shows OK for logged-in users. 
This photo was created in 2009 and placed in plwiki in 2011; no templates nor inclusions involved at all. Even the way it is placed is standard (only parameters are "thumb" & "left"), so this case suggests another mechanism behind the error. I consider this error NOT FIXED yet.
Comment 15 Aaron Schulz 2011-03-25 10:58:42 UTC
The change isn't even live yet. Bugs are closed once the /trunk code is fixed.
Comment 16 Mark A. Hershberger 2011-03-25 15:19:10 UTC
I've tagged the Aaron's revisions for review and merging.  Hopfully, we'll have it done this weekend.
Comment 17 Aaron Schulz 2011-03-25 19:37:05 UTC
(In reply to comment #16)
> I've tagged the Aaron's revisions for review and merging.  Hopfully, we'll have
> it done this weekend.

r82917 should be merged, not the others.

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


Navigation
Links