Page MenuHomePhabricator

References aren't readable to unprivileged users on Wikidata when an item is protected
Closed, ResolvedPublic8 Estimated Story Points

Description

Acceptance Criteria

  • references should be readable to unprivileged users on Wikidata when an item is protected
  • browser test for expected behaviour of references with protected items

Task Description

Try visiting https://www.wikidata.org/wiki/Q6691 when logged out - the links for the references are greyed out, and you can't click on them to display the reference. The same thing happens at https://www.wikidata.org/wiki/Q5 - but they work fine at https://www.wikidata.org/wiki/Q1513315 . And if you are logged in and view the same pages, they work fine.

It looks like this is related to whether the Wikidata entry is protected from editing or not (possibly just semi-protection?). However, page protection should not affect what information is visible on the Wikidata entry!

This issue was originally pointed out by Fram at:
https://en.wikipedia.org/wiki/Wikipedia_talk:Wikidata/2018_State_of_affairs/Archive_1#References_invisible_on_protected_Wikidata_items_when_not_logged_in?

Event Timeline

The fix for the other bug should now be deployed.
Thiemo says the code to fix this should be very similar to the one fixing T182767.

T182767: Can't see references on historic revisions of items on Wikidata is finally fixed (workaround removed). Now though no simple CSS workaround can be applied.

Just encountered this today: https://www.wikidata.org/wiki/Q39259 Ironic to not see the sources on - apparently - disputed data in particular.

I was looking into it this morning. The problem is in StatementHtmlGenerator.php on line 100:

view/src/StatementHtmlGenerator.php
$references->isEmpty() ? '' : 'wikibase-initially-collapsed'

This makes all references initially collapsed on all views. This is achieved using CSS, which on the other hand explicitly excludes diffs and old revisions:

view/resources/wikibase/wikibase.less
.client-js body:not( .wb-diffpage ):not( .wb-oldrevpage ) .wikibase-initially-collapsed {
    display: none;
}

For T196423, we could exclude another CSS class, mw-special-Undelete. But there's no CSS class for protected pages. Note that the rendering depends on the viewing user. For some users, the references should visible as usually, for the rest, they should be inactive and visible. This needs to be considered not to break HTML caching.

and even logged-in users also faced-to-faced this issue

matej_suchanek renamed this task from References aren't readable to logged-out users on Wikidata when an item is protected to References aren't readable to unprivileged users on Wikidata when an item is protected.Oct 21 2018, 9:20 AM

Change 474301 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/Wikibase@master] Fix hidden references on protected items

https://gerrit.wikimedia.org/r/474301

Change 476075 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/WikibaseLexeme@master] Adjust for upstream rename of private method

https://gerrit.wikimedia.org/r/476075

Change 476247 had a related patch set uploaded (by Michael Große; owner: Michael Große):
[mediawiki/extensions/Wikibase@master] Remove temporary method used for ci-migration

https://gerrit.wikimedia.org/r/476247

Change 474301 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Fix hidden references on protected items

https://gerrit.wikimedia.org/r/474301

Change 476075 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] Adjust for upstream rename of private method

https://gerrit.wikimedia.org/r/476075

Change 476247 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Remove temporary method used for ci-migration

https://gerrit.wikimedia.org/r/476247

That's awesome, people will be happy. When will it be deployed?

@Lea_Lacroix_WMDE Seems to be deployed:

Bildschirmfoto von 2018-11-29 14-53-41.png (789×1 px, 140 KB)

I think that's my workaround. Can't say for sure though.

Just tested, I still encounter the issue when logged out.
If you don't mind I'll keep it open and in the Needs Announcement column until I make sure that it's live and announce it :)

Hey! I just tested it with Human and realized that the reference section is unfolded by default, with no possibility to fold it.
This is different from the behaviour of the non-protected pages, where the content of references is folded (which makes sense especially when the content is very long), and one can click on "X references" to expand it.
Can we make the reference section folded by default?

Hey @Lea_Lacroix_WMDE,
that looks still like the workaround put in place by @Ladsgroup . When deployed, the references on protected pages should fold like on every other page as well. It doesn't look like this change is on the production or even test instance yet.

Actually it's testable in beta cluster: https://wikidata.beta.wmflabs.org/wiki/Q488197
(I just protected it for autoconfirmed users. Log out and try it out.)

Fancy \o/
Any idea when it's going to be deployed?

Fancy \o/
Any idea when it's going to be deployed?

As I understand the tag on this task, the patch should be part of 1.33.0-wmf.8 and that should be live on all wikis on Thursday: https://phabricator.wikimedia.org/T206662 (as least that is my impression)

Wikidata is in group1, meaning this will be live on Wednesday noonish if everything goes as expected. See https://wikitech.wikimedia.org/wiki/Deployments

Wikidata is in group1, meaning this will be live on Wednesday noonish if everything goes as expected. See https://wikitech.wikimedia.org/wiki/Deployments

Even better :)

It's deployed and it works well \o/ Example https://www.wikidata.org/wiki/Q6691
I think that @Ladsgroup's workaround is still in place on some items, like https://www.wikidata.org/wiki/Q5, can we disable it now?

It's not deployed yet (according to Special:Version, wikidata is still on wmf.6) It will be deployed in two hours.

Now the change is live (see Q39259) and we can disable the workaround :)

I rollbacked the workaround \o/

Deployed, announced, thanks for fixing this annoying bug \o/