Page MenuHomePhabricator

Protected image captions can't be edited, API query points at null
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:
On Commons main page, click on the picture of the day.
Enter a caption and click "Publish".

Actual Results:
Nothing happens, caption is not saved and no error is shown.

Expected Results:
You probably shouldn't be offered a caption "edit" button on protected images.

Notes:
This might be unusually tricky because it has cascading protection from the main page.

On beta, the code doesn't remove the edit option completely but does show warning messages when the user attempts to Publish.

For captions (the missing template shouldn't be a problem on prod):

For statements (again, templates should be on prod, need to double check things display properly there though):

Current Commons practice does not inform the user that featured images are protected until an edit attempt is made. It's probably okay to continue with that model, but we would need prod to work like Beta.

Acceptance criteria:

  • User sees an appropriate and accurate error message when clicking publish on a structured data panel
  • The error messages includes community-managed templates, displayed properly.

Event Timeline

Abit created this task.Apr 10 2019, 8:45 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 10 2019, 8:45 PM
Abit updated the task description. (Show Details)Apr 10 2019, 9:06 PM
Ramsey-WMF updated the task description. (Show Details)
Ramsey-WMF added a subscriber: PDrouin-WMF.
Ramsey-WMF added a subscriber: Cparle.

Assigning to Matthias for now, our statement panel master :)

Ramsey-WMF triaged this task as Normal priority.Apr 10 2019, 9:26 PM
Ramsey-WMF updated the task description. (Show Details)
Ramsey-WMF moved this task from Untriaged to Next up on the Multimedia board.

The "caption is not saved and no error is shown" thing is T220665 - I'll ignore this submission failure here.

The other thing in this ticket is the error messages.

  • Captions seems to work just fine (except for T220665), this is what I just got on Common's POTD:

  • Depicts error message seems unable to handle HTML - I'll work on this.

(What's that url you tested this on on beta? I don't have permissions to go protect one myself for testing...)

Change 502954 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] Error messages can be HTML

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

Should we disable edit mode on protected pages for unprivileged users, rather than having them find out on save?

Change 502954 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Error messages can be HTML

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

Should we disable edit mode on protected pages for unprivileged users, rather than having them find out on save?

I've been thinking about this. It's always been a pet peeve of mine that Commons doesn't make it more obvious that protected files are protected. If we were to disable edit links on our panels, we would certainly have to explain *why* the edit button is missing not just on captions, but all statements. Some sort of template messaging will be needed for that.

I think doing it the "right" way may involve a certain level of effort that I'm hesitant to take on this close to release, so having things work as they already do on beta is probably the best way to go for now, but we should certainly put it on the list of things to do for a subsequent release.

I'll throw it over to @PDrouin-WMF for further thought.

@matthiasmullie I protected this file on Beta for testing: https://commons.wikimedia.beta.wmflabs.org/wiki/File:3dcrystal.gif

The "caption is not saved and no error is shown" thing is T220665 - I'll ignore this submission failure here.
The other thing in this ticket is the error messages.

  • Captions seems to work just fine (except for T220665), this is what I just got on Common's POTD:

  • Depicts error message seems unable to handle HTML - I'll work on this.

(What's that url you tested this on on beta? I don't have permissions to go protect one myself for testing...)

I agree with both @Jdforrester-WMF and @Ramsey-WMF - it's better for the user to know beforehand not to try and edit a protected page, but because of the timing, it'll take some effort, and we probably don't have the time to get it in the forthcoming release, but we should definitely fit this into a subsequent release.

Tried it on beta (with link provided by @Ramsey - thanks) and HTML is now displayed.

I agree that, in the future, it would be cool to not let users go make elaborate edits, only to found out later that they can't submit them.
Let's create a separate ticket once we want to pursue that :)

2 more minor issues, though, but unrelated for this ticket:

  • template doesn't show: that's a beta-only thing because the template doesn't exist - it will work in production
  • it shows a <no-permission> thing - that's supposed to be actual useful text (filed T220955 in Wikidata)

I'll move this one to 'Verify on production' - just verified the relevant part (depicts/statements shows the error messages properly) here on beta myself.

Ramsey-WMF closed this task as Resolved.Apr 24 2019, 1:26 AM

The solution we came up with for launch (just make sure the proper errors are shown on edit) works on production mostly, with T220955 still to be finished. For a better long-term solution we'll explore T221732