From 8c9605921c9eb222a0898676f32b78995cde9e38 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Thu, 25 Jul 2024 12:27:53 -0400 Subject: [PATCH] DesktopArticleTarget: Set wgCurRevisionId and wgRevisionId once publish goes through Bug: T370771 Change-Id: I0100c155352ec55275f40616f87e69af52d6e97b --- .../init/targets/ve.init.mw.DesktopArticleTarget.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index 381c52042c..7fc7f31652 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -840,8 +840,15 @@ ve.init.mw.DesktopArticleTarget.prototype.saveComplete = function ( data ) { } ); } - // Actually fire the postEdit hook now that the save is complete if ( data.newrevid !== undefined ) { + // (T370771) Update wgCurRevisionId and wgRevisionId (!) + // Mirror of DiscussionTools's cb5d585b93d83f9a7b4df10a71a0d574295f861c + mw.config.set( { + wgCurRevisionId: data.newrevid, + wgRevisionId: data.newrevid + } ); + + // Actually fire the postEdit hook, now that the save is complete require( 'mediawiki.action.view.postEdit' ).fireHook( 'saved' ); } }