Page MenuHomePhabricator

Add the nowcommons template to the source wiki if requested
Closed, ResolvedPublic8 Estimated Story Points

Description

Mock

Bildschirmfoto 2019-06-19 um 08.56.02.png (532×1 px, 60 KB)

Texts

You can declare on the source wiki that this file has been imported to <target wiki>. This is done by adding a {{<template name>}} template to the original file page in your name.

  • mark source wiki file as imported to <target wiki>

Acceptance Criteria

  • Add a new section on the preview page as shown in the mock, which allows people to decide whether or not they want to inform the source wiki about the file move.
  • By default, the checkbox is set to “do the automated edit”
  • If the field is clicked and the transfer was successful, the edit is done automatically
  • The edit should be made in the name of the moving user, with the edit summary “This file is now on Wikimedia Commons (moved with FileImporter).”
  • This ticket does not include an changes to the success message handling.

Details

SubjectRepoBranchLines +/-
mediawiki/extensions/FileImportermaster+93 -22
mediawiki/extensions/FileImportermaster+45 -35
mediawiki/extensions/FileImportermaster+19 -9
operations/mediawiki-configmaster+2 -2
mediawiki/extensions/FileImporterwmf/1.34.0-wmf.13+43 -7
mediawiki/extensions/FileImportermaster+43 -7
mediawiki/extensions/FileImportermaster+1 -1
mediawiki/extensions/FileImportermaster+40 -1
mediawiki/extensions/FileImportermaster+2 -2
operations/mediawiki-configmaster+3 -0
mediawiki/extensions/FileImportermaster+39 -14
mediawiki/extensions/FileImportermaster+399 -3
mediawiki/extensions/FileImportermaster+589 -7
mediawiki/extensions/FileImportermaster+273 -37
integration/configmaster+1 -1
mediawiki/extensions/FileImportermaster+80 -1
Show related patches Customize query in gerrit

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 519415 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Post import handler does our success lifting

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

@JStrodt_WMDE @Lea_WMDE
What text should be presented to the user on a successful import with a successful source wiki template-addition?

@WMDE-Fisch As I understand it, that's included in T226075. @Lea_WMDE Correct?

@WMDE-Fisch As I understand it, that's included in T226075. @Lea_WMDE Correct?

Ah yeah, sorry I kind of overlooked that. Using The file has been successfully imported to <target wiki name>. from T226075 now.

So last message I'm missing:

For the case, that the user wants the auto source edit, but for some reason the auto source edit fails, I would then show this message
The import was successful. To declare that the file is now on <target wiki name>, please return to [[the original file]] and add this template: {{<template name>}}.
but would also want to show a warning, that the auto edit failed. Something along the lines of
Editing the source wiki automatically was not possible please follow the instructions above.

( the "warning" about the failed source wiki edit will be shown underneath the success message )

@JStrodt_WMDE

@WMDE-Fisch: I would prefer the error message to appear before describing the next step. How about this?

The import was successful, but the template {{<template name>}} could not be added automatically on the source wiki. Please return to [[the original file]] and manually add {{<template name>}} to declare that the file is now on <target wiki name>.

Question: Can we give more specifics about why the source wiki couldn't be edited automatically?

Question: Can we give more specifics about why the source wiki couldn't be edited automatically?

If that is not a 5 minute task, but we could theoretically do it, could you please create another ticket for it?
Thanks :)

Question: Can we give more specifics about why the source wiki couldn't be edited automatically?

If that is not a 5 minute task, but we could theoretically do it, could you please create another ticket for it?
Thanks :)

I'll split this into a new ticket, because this task's work is otherwise complete, and we have the same question for T226532.

Change 386205 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Allow automatic adding of the NowCommons template to the source wiki

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

Change 519294 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] Tests for source wiki editing

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

Change 520217 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] Assert status after post-import edit

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

Change 520234 had a related patch set uploaded (by Awight; owner: Awight):
[operations/mediawiki-config@master] Enable experimental FileImporter features on labs

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

Change 519294 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Tests for source wiki editing

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

Change 520217 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Assert status after post-import edit

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

Change 520234 merged by jenkins-bot:
[operations/mediawiki-config@master] Enable experimental FileImporter features on labs

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

Change 520438 had a related patch set uploaded (by Awight; owner: Awight):
[mediawiki/extensions/FileImporter@master] Include a newline with the template, so it always appears on its own line.

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

Change 520447 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] Option to edit source wiki should be enabled by default

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

Change 520438 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Include a newline with the template, so it always appears on its own line.

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

Change 520447 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Option to edit source wiki should be enabled by default

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

I don't manage to test this before my vacation anymore, my newly created account has too few rights, and my actual one too many :/ Could you please self test this one? Thank you!

Tiny note from translator: comma seems to be misplaced in message "Editing, the source wiki automatically was not possible please follow the instructions above."

Change 521227 had a related patch set uploaded (by WMDE-Fisch; owner: WMDE-Fisch):
[mediawiki/extensions/FileImporter@master] Remove misplaced comma

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

Tiny note from translator: comma seems to be misplaced in message "Editing, the source wiki automatically was not possible please follow the instructions above."

Thanks. I uploaded a fix for it.

Change 521227 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Remove misplaced comma

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

Change 522052 had a related patch set uploaded (by Andrew-WMDE; owner: Andrew-WMDE):
[mediawiki/extensions/FileImporter@master] [WIP] Fix bug involving file renaming and centralauth cleanup/delete

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

Change 522052 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Fix bug involving file renaming and centralauth cleanup/delete

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

Change 523618 had a related patch set uploaded (by Awight; owner: Andrew-WMDE):
[mediawiki/extensions/FileImporter@wmf/1.34.0-wmf.13] Fix bug involving file renaming and centralauth cleanup/delete

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

Change 523661 had a related patch set uploaded (by Awight; owner: Awight):
[operations/mediawiki-config@master] Enable FileImporter source wiki edit and delete

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

Change 523618 abandoned by Awight:
Fix bug involving file renaming and centralauth cleanup/delete

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

Planning to enable in production on Monday, July 22nd.

Change 523661 merged by jenkins-bot:
[operations/mediawiki-config@master] Enable FileImporter source wiki edit and delete

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

Mentioned in SAL (#wikimedia-operations) [2019-07-22T11:13:05Z] <awight@deploy1001> Synchronized wmf-config/CommonSettings.php: SWAT: [[gerrit:523661|Enable FileImporter source wiki edit and delete (T225617, T226532)]] (duration: 00m 56s)

Mentioned in SAL (#wikimedia-operations) [2019-07-22T11:14:36Z] <awight@deploy1001> Synchronized wmf-config/CommonSettings-labs.php: SWAT: [[gerrit:523661|Enable FileImporter source wiki edit and delete, (remove labs customizations) (T225617, T226532)]] (duration: 00m 54s)

This ran into blocking bug T228851: Source wiki editing and deletion always fails, but otherwise should be code complete.

Verified by import from test2 to testwiki:

Import preview page on testwiki:

image.png (1×3 px, 573 KB)

Automatic edit on test2 wiki:
https://test2.wikipedia.org/w/index.php?title=File:038pro01.jpg&oldid=409672

Destination file on testwiki:
https://test.wikipedia.org/w/index.php?title=File:038pro01.jpg&oldid=402873

Change 598981 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Actually check if source editing is allowed

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

Change 599033 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Make use of wfAppendQuery() in RemoteApiRequestExecutor

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

Change 599046 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/FileImporter@master] Expose less implementation details in RemoteApiActionExecutor

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

Change 599033 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Make use of wfAppendQuery() in RemoteApiRequestExecutor

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

Change 599046 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Expose less implementation details in RemoteApiActionExecutor

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

Change 598981 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Actually check if source editing is allowed

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