From: Tom Hughes Date: Sat, 1 Jan 2022 12:06:44 +0000 (+0000) Subject: Switch VisualEditor to new style loading for MediaWiki 1.37 X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/6f4175313dccb09cfdfc1a738d9b5cc5a09191bf?hp=7302041c3f2c05098816f4fd9e3e538811f25a4e Switch VisualEditor to new style loading for MediaWiki 1.37 --- diff --git a/cookbooks/mediawiki/resources/site.rb b/cookbooks/mediawiki/resources/site.rb index 0baa9527f..39c0fd443 100644 --- a/cookbooks/mediawiki/resources/site.rb +++ b/cookbooks/mediawiki/resources/site.rb @@ -495,6 +495,7 @@ action :create do mediawiki_extension "VisualEditor" do site new_resource.site template "mw-ext-VisualEditor.inc.php.erb" + variables :version => new_resource.version update_site false end diff --git a/cookbooks/mediawiki/templates/default/mw-ext-VisualEditor.inc.php.erb b/cookbooks/mediawiki/templates/default/mw-ext-VisualEditor.inc.php.erb index a36e5c25f..ed9740571 100644 --- a/cookbooks/mediawiki/templates/default/mw-ext-VisualEditor.inc.php.erb +++ b/cookbooks/mediawiki/templates/default/mw-ext-VisualEditor.inc.php.erb @@ -4,7 +4,11 @@ $wgVirtualRestConfig['modules']['parsoid'] = array( ); $wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true; +<% if @version >= "1.37" -%> +wfLoadExtension( 'VisualEditor' ); +<% else -%> require_once($IP .'/extensions/VisualEditor/VisualEditor.php'); +<% end -%> // Enable by default for everybody $wgDefaultUserOptions['visualeditor-enable'] = 1;