Page MenuHomePhabricator

WSF 2.8 throws warning: Missing argument 2 for WikiEditorHooks::editPageShowEditFormInitial()
Closed, ResolvedPublic

Description

Author: mitchell_neill

Description:
Hi.

I have MW 1.23.3 including its bundled WikiEditor, SF 2.8 and SMW 1.9.2.

When a form is edited the following warning is shown, one for each textarea input on the form:

Warning: Missing argument 2 for WikiEditorHooks::editPageShowEditFormInitial(), called in /var/www/webapps/localoffer_pilot_dev/extensions/SemanticForms/includes/forminputs/SF_TextAreaInput.php on line 151 and defined in /var/www/webapps/localoffer_pilot_dev/extensions/WikiEditor/WikiEditor.hooks.php on line 162 Notice: Undefined property: SFTextAreaInput::$contentModel in /var/www/webapps/localoffer_pilot_dev/extensions/WikiEditor/WikiEditor.hooks.php on line 163 Warning: Missing argument 2 for WikiEditorHooks::editPageShowEditFormInitial(), called in /var/www/webapps/localoffer_pilot_dev/extensions/SemanticForms/includes/forminputs/SF_TextAreaInput.php on line 151 and defined in /var/www/webapps

Just thought you'd like to know.

Thanks


Version: master
Severity: normal

Details

Reference
bz71172

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:48 AM
bzimport set Reference to bz71172.

what's a workaround - how should the missing outputPage Parameter be set?

Here is a fix / work-around:

diff --git a/includes/forminputs/SF_TextAreaInput.php b/includes/forminputs/SF_T
extAreaInput.php
index 23b4902..cdb9ab6 100644
--- a/includes/forminputs/SF_TextAreaInput.php
+++ b/includes/forminputs/SF_TextAreaInput.php
@@ -13,7 +13,7 @@
  * @ingroup SFFormInput
  */
 class SFTextAreaInput extends SFFormInput {
-
+  public $contentModel=CONTENT_MODEL_WIKITEXT;
 	protected $mUseWikieditor = false;
 
 	/**
@@ -138,7 +138,7 @@ class SFTextAreaInput extends SFFormInput {
 
 	protected function getTextAreaAttributes() {
 
-		global $sfgTabIndex, $sfgFieldNum;
+		global $sfgTabIndex, $sfgFieldNum,$wgOut;
 
 		// Use a special ID for the free text field -
 		// this was originally done for FCKeditor, but maybe it's
@@ -148,7 +148,7 @@ class SFTextAreaInput extends SFFormInput {
 		if ( $this->mUseWikieditor ) {
 
 			// load modules for all enabled features
-			WikiEditorHooks::editPageShowEditFormInitial( $this );
+			WikiEditorHooks::editPageShowEditFormInitial( $this ,$wg
Out);
 			$className = 'wikieditor ';
 		} else {
 			$className = '';
Yaron_Koren set Security to None.

I believe this has been fixed for a while.