Amire80 edited the task description. (Show Details) |
EDIT DETAILS
ThisThe advantage of using the Wikibase _javascript_ Library is that it is simple—it just takes source and target titles and does everything else automatically. The disadvantage is that is may fail silently if the user closes the window too quickly, and possibly because of other reasons.
It would be better to stop using _javascript_ for this and make the sitelink adding part of the publishing API. Wikibase's LinkTitles class can be used for the actual linking and executed in a job similar to UpdateRepoOnMoveJob. However, doing this is more complicated than using the Wikibase _javascript_ Library. In particular, the linking should be done with the same username as the one that was used for publishing the translated article, but since the repo is on another site, it's non-trivial to reuse the log-in session in a backend job.
...
The current process is that the article is published [[ https://phabricator.wikimedia.org/diffusion/ECTX/browse/master/api/ApiContentTranslationPublish.php | using the cxpublish API ]]. It's a simple process that uses the usual edit API to save a wiki page with a bit of extra processing—edit summary, change tag, Echo notification, etc. Then the [[ https://phabricator.wikimedia.org/diffusion/ECTX/browse/master/modules/publish/ext.cx.wikibase.link.js | Wikibase _javascript_ Library is invoked ]] to add the sitelink.ThisThe advantage of using the Wikibase _javascript_ Library is that it is simple—it just takes source and target titles and does everything else automatically. The disadvantage is that is may fail silently if the user closes the window too quickly, and possibly because of other reasons.
It would be better to stop using _javascript_ for this and make the sitelink adding part of the publishing API. Wikibase's LinkTitles class can be used for the actual linking and executed in a job similar to UpdateRepoOnMoveJob. However, doing this is more complicated than using the Wikibase _javascript_ Library. In particular, the linking should be done with the same username as the one that was used for publishing the translated article, but since the repo is on another site, it's non-trivial to reuse the log-in session in a backend job.
TASK DETAIL
EMAIL PREFERENCES
To: Amire80
Cc: daniel, santhosh, hoo, KartikMistry, Ladsgroup, Lydia_Pintscher, Amire80, Jane023, Wittylama, Aklapper, Multichill, D3r1ck01, Nizil, Ixocactus, Izno, Wikidata-bugs, aude, Jsahleen, Arrbee, Mbch331
Cc: daniel, santhosh, hoo, KartikMistry, Ladsgroup, Lydia_Pintscher, Amire80, Jane023, Wittylama, Aklapper, Multichill, D3r1ck01, Nizil, Ixocactus, Izno, Wikidata-bugs, aude, Jsahleen, Arrbee, Mbch331
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs