]> git.openstreetmap.org Git - chef.git/commitdiff
Switch VisualEditor to new style loading for MediaWiki 1.37
authorTom Hughes <tom@compton.nu>
Sat, 1 Jan 2022 12:06:44 +0000 (12:06 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 1 Jan 2022 12:06:44 +0000 (12:06 +0000)
cookbooks/mediawiki/resources/site.rb
cookbooks/mediawiki/templates/default/mw-ext-VisualEditor.inc.php.erb

index 0baa9527f8d473004c687d39d2adba19a9910063..39c0fd4437af8a2e240125df8a8998cbfbaec5b8 100644 (file)
@@ -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
 
index a36e5c25f490530060601f4190370cf14dc969c8..ed9740571b388039280d68f728ce548dc5906adc 100644 (file)
@@ -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;