Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/216140
Change subject: Defer RC tag addition in the publish API
......................................................................
Defer RC tag addition in the publish API
Bug: T100439
Change-Id: Ia3b41a419ee2cb4a316343cd1e4ab8a1a8c01f28
---
M api/ApiContentTranslationPublish.php
1 file changed, 14 insertions(+), 10 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/40/216140/1
diff --git a/api/ApiContentTranslationPublish.php
b/api/ApiContentTranslationPublish.php
old mode 100644
new mode 100755
index c87cade..473ecba
--- a/api/ApiContentTranslationPublish.php
+++ b/api/ApiContentTranslationPublish.php
@@ -189,16 +189,20 @@
if ( $editStatus === 'Success' ) {
if ( isset( $saveresult['edit']['newrevid'] ) ) {
- ChangeTags::addTags(
- 'contenttranslation',
- null,
- intval( $saveresult['edit']['newrevid']
),
- null,
- FormatJson::encode( array(
- 'from' => $params['from'],
- 'to' => $params['to'],
- ) )
- );
+ // Add the tags post-send, after RC row
insertion
+ $revId = intval(
$saveresult['edit']['newrevid'] );
+ DeferredUpdates::addCallableUpdate( function()
use ( $revId, $params ) {
+ ChangeTags::addTags(
+ 'contenttranslation',
+ null,
+ $revId,
+ null,
+ FormatJson::encode( array(
+ 'from' =>
$params['from'],
+ 'to' => $params['to'],
+ ) )
+ );
+ } );
}
$result = array(
--
To view, visit https://gerrit.wikimedia.org/r/216140
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3b41a419ee2cb4a316343cd1e4ab8a1a8c01f28
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits