Page MenuHomePhabricator

Do not overwrite content from community members/bots on re-upload
Closed, ResolvedPublic

Description

the toolset currently allows batch updates that can potentially overwrite any added content to a mediafile’s file page. for example, if a bot or community member has added additional information, or corrected an error on a mediafile’s file page, another batch upload that contains alterations to the metadata or categories would overwrite that added content.


Version: unspecified
Severity: normal

Details

Reference
bz63638

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:21 AM
bzimport set Reference to bz63638.
bzimport added a subscriber: Unknown Object (MLST).

Change 124347 had a related patch set uploaded by Dan-nl:
protect community member or bot added content

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

Created attachment 15247
sample dataset to be used for reproducing the error

Attached:

Created attachment 15248
mapping template to be used when reproducing the bug

Attached:

steps to reproduce

login

  1. login to a local wiki instance that has GWToolset installed or into the beta cluster, http://commons.wikimedia.beta.wmflabs.org/wiki/Special:GWToolset
  2. go to step 1: metadata detection

step 1

  1. nothing to add
  2. Artwork
  3. use the attached legermuseum.json file to create a mapping GWToolset:Metadata_Mappings/YourUserName/legermuseum.json and enter that
  4. nothing to add
  5. select the attached legermuseum-sampe-11-records.xml file

step 2

  1. click on the “Preview batch” button at the bottom of the page

step 3

  1. click on the “Process the batch” button
  2. if on a local wiki run the maintenance script runJobs.php unless you already have it running on a cronjob. note, you may need to sudo -u www php maintenance/runJobs.php depending on local permissions

step 4

  1. go to the Special:NewFiles page
  2. select one of the 11 items that uploaded.
  3. click on the edit or edit source link
  4. in the artwork template change the object history line to | object history = testing overwrite of the wikitext
  5. save the change
  6. verify that the change is visible in the template
  7. keep this page open

step 5

  1. go through steps 1-3 again
  2. notice the object history line in the template
  3. refresh the page that you kept open
  4. notice that the object history line no longer has the change you made

I've tried following these steps locally, but on step 3 I get:

[90372859] /wiki/Special:GWToolset Exception from line 143 of /vagrant/mediawiki/extensions/GWToolset/includes/Handlers/Forms/MetadataMappingHandler.php: Please contact a developer. This issue must be addressed before you can continue. Please add the following text to your report:
</p><p>Could not create batch job for the metadata file.

the resolution of bug 64931 should take care of this exception. i rebased the patch, so if you’re working locally, you should be able to update the extension with the latest version of https://gerrit.wikimedia.org/r/#/c/124347/ and continue.

Change 124347 merged by jenkins-bot:
Do not overwrite content from community members/bots on re-upload

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

(In reply to Gilles Dubuc from comment #5)

I've tried following these steps locally, but on step 3 I get:

[90372859] /wiki/Special:GWToolset Exception from line 143 of
/vagrant/mediawiki/extensions/GWToolset/includes/Handlers/Forms/
MetadataMappingHandler.php: Please contact a developer. This issue must be
addressed before you can continue. Please add the following text to your
report:
</p><p>Could not create batch job for the metadata file.

2014-05-09 20:10:43 mw1013 commonswiki: [c408a967] [no req] Exception from line 143 of /usr/local/apache/common-local/php-1.24wmf3/extensions/GWToolset/includes/Handlers/Forms/MetadataMappingHandler.php: Please contact a developer. This issue must be addressed before you can continue. Please add the following text to your report:
</p><p>Could not create batch job for the metadata file.
#0 /usr/local/apache/common-local/php-1.24wmf3/extensions/GWToolset/includes/Handlers/Forms/MetadataMappingHandler.php(451): GWToolset\Handlers\Forms\MetadataMappingHandler->createMetadataBatchJob(Array)
#1 /usr/local/apache/common-local/php-1.24wmf3/extensions/GWToolset/includes/Handlers/Forms/MetadataMappingHandler.php(549): GWToolset\Handlers\Forms\MetadataMappingHandler->processMetadata(Array)
#2 /usr/local/apache/common-local/php-1.24wmf3/extensions/GWToolset/includes/Jobs/UploadMetadataJob.php(55): GWToolset\Handlers\Forms\MetadataMappingHandler->processRequest(Array)
#3 /usr/local/apache/common-local/php-1.24wmf3/extensions/GWToolset/includes/Jobs/UploadMetadataJob.php(140): GWToolset\Jobs\UploadMetadataJob->processMetadata()
#4 /usr/local/apache/common-local/php-1.24wmf3/maintenance/runJobs.php(110): GWToolset\Jobs\UploadMetadataJob->run()
#5 /usr/local/apache/common-local/php-1.24wmf3/maintenance/doMaintenance.php(109): RunJobs->execute()
#6 /usr/local/apache/common-local/php-1.24wmf3/maintenance/runJobs.php(279): require_once('/usr/local/apac...')
#7 /usr/local/apache/common-local/multiversion/MWScript.php(97): require_once('/usr/local/apac...')
#8 {main}

thanks for posting the exception message. it should go away with the release of patch https://gerrit.wikimedia.org/r/#/c/131749/, which gergo took care of. the deploy is scheduled for tuesday, 13 may 2014 between 18:00–20:00 UTC with the release of https://www.mediawiki.org/wiki/MediaWiki_1.24/wmf4#GWToolset.

we already have an email thread on the glamtools list about this issue: http://lists.wikimedia.org/pipermail/glamtools/2014-May/000133.html. i have sent this confirmation to the list and asked that no one uses the tool until after the deploy.

The two patches mentioned here have been merged and deployed.
Can somebody elaborate what else is needed here?

Gilles triaged this task as Unbreak Now! priority.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Needs Triage.Dec 4 2014, 11:22 AM