Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/242871
Change subject: MWExtensionNode: Copy mw data before modifying ...................................................................... MWExtensionNode: Copy mw data before modifying Otherwise we are directly modifying model.element.attributes which is very bad. Change-Id: Icf066a5848b9c67c2c4b3fcafd72d0142996e48d --- M modules/ve-mw/ce/nodes/ve.ce.MWExtensionNode.js 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/71/242871/1 diff --git a/modules/ve-mw/ce/nodes/ve.ce.MWExtensionNode.js b/modules/ve-mw/ce/nodes/ve.ce.MWExtensionNode.js index 21d8bbb..bac7d55 100644 --- a/modules/ve-mw/ce/nodes/ve.ce.MWExtensionNode.js +++ b/modules/ve-mw/ce/nodes/ve.ce.MWExtensionNode.js @@ -52,15 +52,15 @@ ve.ce.MWExtensionNode.prototype.generateContents = function ( config ) { var xhr, attr, wikitext, deferred = $.Deferred(), - mwData = this.getModel().getAttribute( 'mw' ), + mwData = ve.copy( this.getModel().getAttribute( 'mw' ) ), extsrc = config && config.extsrc !== undefined ? config.extsrc : mwData.body.extsrc, attrs = config && config.attrs || mwData.attrs, tagName = this.getModel().getExtensionName(); // undefined means omit the attribute, not convert it to string 'undefined' - for ( attr in mwData.attrs ) { - if ( mwData.attrs[ attr ] === undefined ) { - delete mwData.attrs[ attr ]; + for ( attr in attrs ) { + if ( attrs[ attr ] === undefined ) { + delete attrs[ attr ]; } } -- To view, visit https://gerrit.wikimedia.org/r/242871 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf066a5848b9c67c2c4b3fcafd72d0142996e48d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits