From 7557dd39ed37be787c3dfad5dc6ed0bd05d6dc67 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Wed, 24 Jul 2013 10:30:41 +0100 Subject: [PATCH] Show error when trying to save in read-only mode We already correctly show the read only error if the user tries to load VE which the database is locked, but if the database gets locked after they've loaded VE, we also need to show the error when they try to save. Bug: 51636 Change-Id: I7a56f1b4387e7ea594a2a7f939c81626c9eee834 --- modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js index 860efc70cd..ff00664d8c 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.ViewPageTarget.js @@ -452,6 +452,13 @@ ve.init.mw.ViewPageTarget.prototype.onSaveError = function ( jqXHR, status, data return; } + if ( data.error ) { + ve.init.mw.Target.onSerializeError.call( + this, null, 'Unsuccessful request: ' + data.error.info, null + ); + return; + } + editApi = data && data.visualeditoredit && data.visualeditoredit.edit; // Handle spam blacklist error (either from core or from Extension:SpamBlacklist)