Paladox has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/264196

Change subject: Workaround jenkins keep failing
......................................................................

Workaround jenkins keep failing

SemanticForms now uses extension.json which is causing this extension to
fail because extension.json dosent support defines very good meaning we
are using a define that is not used in extension.json.

Lets workaround this by only using mediawiki 1.24 or lower which would
show the error leaving mediawiki 1.25 error free from that error.

Reasons since extension.json is only supported in mediawiki 1.25 or
higher.

Change-Id: Ifdc568331eba805fad8f40f30988fc494e416c1c
---
A SemanticFormsInputs.hooks.php
M SemanticFormsInputs.php
2 files changed, 34 insertions(+), 9 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SemanticFormsInputs 
refs/changes/96/264196/1

diff --git a/SemanticFormsInputs.hooks.php b/SemanticFormsInputs.hooks.php
new file mode 100644
index 0000000..175e519
--- /dev/null
+++ b/SemanticFormsInputs.hooks.php
@@ -0,0 +1,29 @@
+<?php
+
+class SemanticFormsInputsHooks {
+       public static function onExtensionRegistration() {
+               global $sfigSettings, $wgScriptPath;
+
+               $sfigSettings = new SFISettings();
+
+               // load user settings
+               require_once __DIR__ . "/includes/SFI_Settings.php";
+       }
+
+       /**
+        * Registers the input types with Semantic Forms.
+        */
+       public function onSFISetup() {
+               global $sfgFormPrinter, $wgVersion;
+
+               $sfgFormPrinter->registerInputType( 'SFIDatePicker' );
+               $sfgFormPrinter->registerInputType( 'SFITimePicker' );
+               $sfgFormPrinter->registerInputType( 'SFIDateTimePicker' );
+               $sfgFormPrinter->registerInputType( 'SFIMenuSelect' );
+               $sfgFormPrinter->registerInputType( 'SFIRegExp' );
+               $sfgFormPrinter->registerInputType( 'SFITwoListBoxes' );
+               $sfgFormPrinter->registerInputType( 'SFIDateCheck' );
+
+               return true;
+       }
+}
diff --git a/SemanticFormsInputs.php b/SemanticFormsInputs.php
index b0effed..8fece12 100644
--- a/SemanticFormsInputs.php
+++ b/SemanticFormsInputs.php
@@ -26,16 +26,12 @@
        die( '<b>Error:</b> This version of <a 
href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs";>Semantic 
Forms Inputs</a> is only compatible with MediaWiki 1.17 or above. You need to 
upgrade MediaWiki first.' );
 }
 
-call_user_func(
-       function () {
-               if ( !\ExtensionRegistry::getInstance()->isLoaded( 
'SemanticForms' ) ) {
-                       die( '<b>Error:</b> <a 
href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs";>Semantic 
Forms Inputs</a> is a Semantic Forms extension. You need to install <a 
href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms";>Semantic 
Forms</a> first.' );
-               }
-       }
-);
-
 if ( version_compare( $GLOBALS['wgVersion'], '1.24c', '<' ) ) {
-       if ( version_compare( 'SF_VERSION', '2.4.2', 'lt' ) ) {
+       if ( !defined( 'SF_VERSION' ) ) {
+               die( '<b>Error:</b> <a 
href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs";>Semantic 
Forms Inputs</a> is a Semantic Forms extension. You need to install <a 
href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms";>Semantic 
Forms</a> first.' );
+       }
+
+       if ( version_compare( SF_VERSION, '2.4.2', 'lt' ) ) {
                die( '<b>Error:</b> This version of <a 
href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms_Inputs";>Semantic 
Forms Inputs</a> is only compatible with Semantic Forms 2.4.1 or above. You 
need to upgrade <a 
href="https://www.mediawiki.org/wiki/Extension:Semantic_Forms";>Semantic 
Forms</a> first.' );
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/264196
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifdc568331eba805fad8f40f30988fc494e416c1c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SemanticFormsInputs
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to