Implement a mechanism that allows the user to switch client templates with Commons templates.
Note: in the tool CommonsHelper by Magnus there is already some functionality that does template magic. We should look into this and find out what it does.
Note 2: there are several templates that would prevent the transfer of a file
Description
Description
Details
Details
Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
mediawiki/extensions/FileImporter | master | +125 -16 | Outline importing & template switching |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T140462 Correctly move files from Wikipedia to Commons (2013) | |||
Resolved | thiemowmde | T146666 Build a commons extension that moves files to Commons | |||
Resolved | thiemowmde | T156797 Mechanism for switching templates | |||
Resolved | thiemowmde | T171605 Analyze template substitution mechanism of CommonsHelper and ForTheCommonGood tools |
Event Timeline
Comment Actions
I worked much of this out when writing For the Common Good, at least for enwiki.
- The local wiki data files that describe the transformations ("replacements") and templates that prevent transfer ("potential problems") may be slightly out of date, but then CommonsHelper's logic probably is too. It would be great if you could combine the best of both into this new extension.
- The C# code for the extension contains various template-switching logic, including transforming local {{Information}} templates into the Commons equivalent. See https://github.com/atlight/ForTheCommonGood/blob/master/ForTheCommonGood/frmMain.cs#L393-L641 I know the code quality is quite poor, but the logic has been well-received by users, and re-using this logic could help avoiding reinventing the wheel.
[Note added 2017-08-18: see T171605#3485931]
Comment Actions
Change 339205 had a related patch set uploaded (by Addshore):
Outline importing & template switching
Comment Actions
Change 339205 merged by jenkins-bot:
[mediawiki/extensions/FileImporter] Outline importing & template switching