Last modified: 2013-05-17 04:39:11 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 T39107, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37107 - Upload Wizard should check for protection status of titles
Upload Wizard should check for protection status of titles
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
UploadWizard (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nischay Nahata
:
: 31766 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-25 01:33 UTC by Erik Moeller
Modified: 2013-05-17 04:39 UTC (History)
6 users (show)

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


Attachments
worksforme (24.03 KB, image/png)
2012-08-26 00:08 UTC, Derk-Jan Hartman
Details

Description Erik Moeller 2012-05-25 01:33:43 UTC
Rightly or wrongly, the Wikimedia Commons community uses protection on pages like "File:Desert.jpg" to enforce meaningful titles.

Upload Wizard should ideally notify the user of this as part of the other checks (title blacklist, title existence, etc.) while the user is typing and surface the protection reason through the UI. At minimum it should enable the user to correct the issue in the final step. Right now it fails in the final step with "[api-error-protectedpage]".
Comment 1 Mark Holmquist 2012-05-25 21:16:16 UTC
I think this conflicts with another solution--UW won't always send the actual filename to the server, because it might cause unrecoverable errors, and suppress errors we care about. In order to solve _this_ problem, we would need to know about the filename on the server side, so unless we want to either send two API requests (which is technically possible, but not ideal) or modify the API to make it accept two filenames, one ideal and one actual (which is nice, but might break other things), then we are stuck here for a bit.
Comment 2 Erik Moeller 2012-05-25 21:55:35 UTC
We're already doing dynamic title existence checks in the "Describe" step, why don't we just add it there?
Comment 3 Mark Holmquist 2012-06-01 23:35:05 UTC
*** Bug 31766 has been marked as a duplicate of this bug. ***
Comment 4 Mark Holmquist 2012-08-20 16:46:01 UTC
OK, after revisiting (finally) I've discovered that we already get an error back on the last step, so it should be relatively simple to handle it. Standby.
Comment 5 Mark Holmquist 2012-08-22 23:17:29 UTC
Took me long enough: https://gerrit.wikimedia.org/r/#/c/21155/
Comment 6 Erik Moeller 2012-08-23 21:54:05 UTC
Testing in production, unfortunately issues with protected titles persist.

Steps to reproduce:

1) Pick a protected title (use protection log to identify one with sysop-level protection enabled) and ensure you're logged in without sufficient privileges to edit protected pages. I picked File:Rene.jpg as a filename.

2) Ensure the file you're uploading wouldn't trigger other issues (e.g. previously deleted).

3) Try to advance through UploadWizard to upload.

Expected behavior: It should prompt me to rename the file, ideally in the third ("Describe") step.

Actual behavior: I'm getting the pop-up of doom, "please wait, still checking the title for uniqueness" (in Chrome 21.0.1180.81) ad infinitum and can't advance past the "Describe" step.
Comment 7 matanya 2012-08-25 23:02:39 UTC
patch was merged, can this be closed?
Comment 8 Erik Moeller 2012-08-25 23:27:51 UTC
No, as I wrote in the comment right above yours, this issue is not resolved.
Comment 9 matanya 2012-08-25 23:37:28 UTC
sorry, skimmed too fast. Thanks
Comment 10 Derk-Jan Hartman 2012-08-26 00:08:21 UTC
Created attachment 11008 [details]
worksforme

It works for me on the master branch. Perhaps the change was not yet deployed when Erik tested it ?
Comment 11 Mark Holmquist 2012-08-27 16:01:44 UTC
Or there may have been caching issues? I know ResourceLoader can be naughty about caching, especially when testing things very quickly.
Comment 12 Mark Holmquist 2012-08-27 22:05:56 UTC
With latest master, I get proper errors....a few versions behind Erik, but Chromium nonetheless. Some more testing is necessary, I think. Erik, can you do more digging on this please?
Comment 13 Erik Moeller 2012-08-27 22:06:52 UTC
I'm testing in production, with both Chrome and Firefox. I'm still getting the issue pointed out in comment 6, with the test file being a random image renamed to "Rene.jpg" (which is a currently protected title). I've validated in Chrome's dev tools that the JS file loaded is indeed the version that includes https://gerrit.wikimedia.org/r/#/c/21155/
Comment 14 Ryan Kaldari 2012-08-28 02:08:36 UTC
Pop-up of doom should be fixed in the trunk version (along with a lot of other error handling). The current behavior in the case of protected pages is that the UploadWizard will error at the very last step and then let the user change the file name. Ideally, we should have it make the check when it is doing the other filename checks in the Describe step as suggested by Erik.
Comment 15 Derk-Jan Hartman 2012-08-29 22:31:08 UTC
ideally, we need to add something to the API to 'testrun' the upload, because we now need separate api checks for everything that can possibly go wrong.

Instead we should have a mode where it just goes trough all the checks but doesn't 'commit' the file and page. We then have all title, protection, blocklogs, illegal filenames and what not handled in the SAME way as the final upload will report. Instead of using 4 separate checks on in our mw.DestinationChecker (which then runs the danger of getting out of sync with 'core'
Comment 16 Mark Holmquist 2012-08-29 22:34:10 UTC
DJ, I think the thing we need is to add in protection-checking to the TitleBlacklist / uniqueness API call(s) that we already perform. It should be relatively simple, but will take a core change.

Until then, I'd say, the while-uploading check is our best bet.
Comment 17 Derk-Jan Hartman 2012-09-06 21:40:15 UTC
https://gerrit.wikimedia.org/r/23007
Comment 18 Derk-Jan Hartman 2013-03-20 19:29:33 UTC
Change abandoned, due to lack of time by author to guide this trough the process.
Comment 19 Nischay Nahata 2013-03-27 22:36:30 UTC
Before I start working on this one, let me clear a confusion. A page that is protected will already be a duplicate name (already used) so that error would pop-up, right?
Comment 20 Mark Holmquist 2013-03-27 23:14:56 UTC
No. The issue is that you can protect pages that do not exist - or files that don't exist - and so we need to check for both errors.
Comment 21 Nischay Nahata 2013-03-28 08:22:16 UTC
I am trying to fix this by adopting the change by DJ in https://gerrit.wikimedia.org/r/56371 
I am yet to test this though.
Comment 22 Nischay Nahata 2013-05-17 04:39:11 UTC
The change is merged and this is fixed. However I have one doubt:

If a page named File:Hello.jpg is protected the error "This title corresponds to a protected page on this wiki. Please choose a different one." pops up on entering the image title "Hello" as expected. However, it would be better to say

"The title corresponds to a protected page File:Hello.jpg on this wiki. Please choose a different one."

The ".jpg" part can lead to some confusion. If anybody else thinks this is a possible problem lets open a new bug for it.

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


Navigation
Links