Extension talk:Semantic Forms Inputs

Jump to: navigation, search

About this board

By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL

Call to a member function registerInputType() on null

5
Summary by Kghbln

Semantic Forms Inputs was completely obsoleted with version 3.7 of Semantic Forms.

RacingRalf (talkcontribs)

After updating SemanticForms from 3.6 to 3.7 I get the following error:

PHP Fatal error:  Call to a member function registerInputType() on null in /srv/www/extensions/SemanticFormsInputs/SemanticFormsInputs.php on line 131

MW: 1.27.1

SFI: master

F.trott (talkcontribs)

SFI was discontinued and the most important inputs merged with SF 3.4.3.

RacingRalf (talkcontribs)

Ah, hehe, ok.

Maybe mention this somewhere?

Thx!

F.trott (talkcontribs)

Just done on the extension page. :)

Kghbln (talkcontribs)

I made this even more obvious and added explicit version information. I hope this is ok.

regexp input type is not working

8
Summary by F.trott

Regexp was fixed and transferred to SemanticForms 3.4.3. It was removed from SFI 0.10.

Ace.philscan (talkcontribs)

The regexp input type show here Extension:Semantic Forms Inputs#Regular expression filter is not working.

Attached is the error that I encountered when trying to save '0' integer

And the error message above can't be removed since the form cannot be resubmitted when the 'Save page' is click.

Here's the field definition:

{{{field|dividend_most_recent|placeholder=Most Recent|input type=regexp|regexp=/^\d*$/|message=Please enter decimal/numbers!|base type=regexp|base prefix=filter2|filter2.regexp=/^.{0,10}$/|filter2.message=Please enter only up to 10 digits!|filter2.base type=regexp}}}

Please help

Jongfeli (talkcontribs)

This has been reported a while back, see: T97023. Wich version of MW are you using?

Ace.philscan (talkcontribs)

These are the details of the installation.

Installed software

Ace.philscan (talkcontribs)

Also the Semantic Versions, thanks.

Installed extensions

Kc5vcx (talkcontribs)

regex input type seems broken in MW 1.26.0 too, doesn't do any checking.

Oetterer (talkcontribs)

For me (on mw 1.25.5), it works if I omit the enclosing slashes. So instead of writing

{{{field|foo|input type=regexp|regexp=/^[0-9A-Za-z ]+$/}}}

I use

{{{field|foo|input type=regexp|regexp=^[0-9A-Za-z ]+$}}}
F.trott (talkcontribs)

Regexp was fixed and transferred to SemanticForms 3.4.3. It was removed from SFI 0.10.

Ace.philscan (talkcontribs)

Thank you. It works :)..

Ubuntu SWM Semantic Form date picker error: jquery.ui.position: Error Module jquery.ui.position has failed dependencies

2
Fustbariclation (talkcontribs)

I'm having a problem with date picker in a Semantic Form. I'm getting this error message:

jquery.ui.position: Error Module jquery.ui.position has failed dependencies

I've tried to find a solution, but, so far, no luck. Any suggestions?

Ubuntu: 3.16.0-31-generic #43-Ubuntu SMP Tue Mar 10 17:37:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

MediaWiki Versions look OK - all current.

F.trott (talkcontribs)

No idea. Maybe you could try to set debug=true in the URL and then find the actual trigger of the error using Firebug or the like.

Some thing (talkcontribs)

this is an option in creating a form, though the value is not rendered as a text field in any form i have created. the markup appears instead. was this ever a viable option?

I wish to use SematicForms to select from a group of categories, and add the category to the page.

~~~~

Yaron Koren (talkcontribs)

"category" comes from Semantic Forms, not Semantic Forms Inputs - you should ask about it on the SF talk page.

datepicker doesn't render a popup calender, renders a basic input field

4
UlaniBlue (talkcontribs)

Using input type=datepicker on a form to render a popup calendar results and a plain text field is rendered.

Versions:

MediaWiki:1.26.2

SemanticForms: 3.4.2-alpha

SemanticFormsInputs: 0.10.1

Am I missing something in my setup?

F.trott (talkcontribs)

Datepicker is now part of SemanticForms, so no need for SemanticFormsInputs anymore (unless you have other inputs from SFI). Anyway, if you have pulled the latest SemanticForms it should work. Do you get any JavaScript errors? Are other inputs using JS working? Is your wiki public?

UlaniBlue (talkcontribs)

Hi,

As far as I can tell, I have the latest versions of the extensions installed.

The date time input works, just not datepicker.

Yes, it's public. You can see the problem here http://lnk2.biz/1Xqt2VT

I'm a little perplexed.

F.trott (talkcontribs)

Hmm, I do not have a login, so cannot edit. Anyway, it works for me with the latest SF (which is 3.4.3-alpha) and SFI (0.10.1). There were some issues fixed in SF 3.4.3-alpha, so there is a good chance that upgrading it will fix the problem.

Legaulph (talkcontribs)
MediaWiki 1.26.2

Semantic Forms 3.6-alpha

Semantic MediaWiki 2.3.1
Semantic Forms Inputs 0.10.0

I updated to the latest release of Semantic Forms and Semantic Forms Inputs.

I’m using |{{{field|cat|input type=categories|top category=category|hideroot}}}

It used to give me a list of categories with checkboxes for each category, now it creates a bulleted list.

Is there another way of getting the checkboxes back?

F.trott (talkcontribs)

Input type Category is not part of SFI.

104.236.47.218 (talkcontribs)

Because datepicker is moved to Semantic Forms, date time picker (SFI_DateTimePicker.php) can no longer call SFIDatePicker

F.trott (talkcontribs)

Normally this should not be a problem. The class is still available. Did you update SemanticForms?

104.236.47.218 (talkcontribs)

Yes both SemanticForms and SemanticFormInputs are updated via git clone.

However command "grep -r SFIDatePicker ." under both SemanticForms and SemanticFormInputs directories return only calls to the class in SFI_DateTimePicker.php, no class definition.

[root@server1 extensions]# git clone https://git.wikimedia.org/git/mediawiki/extensions/SemanticForms.git

[root@server1 extensions]# git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/SemanticFormsInputs.git

[root@server1 extensions]# grep -r SFIDatePicker .

./SemanticFormsInputs/includes/SFI_DateTimePicker.php:          $this->mDatePicker = new SFIDatePicker( $this->mInputNumber . '_dp', $dateString, $this->mInputName, $this->mIsDisabled, $this->mOtherArgs );

./SemanticFormsInputs/includes/SFI_DateTimePicker.php:                  SFIDatePicker::getParameters(),

[root@server1 extensions]#

F.trott (talkcontribs)

You are right. The class was renamed SFDatePicker when it was moved to SF.

F.trott (talkcontribs)

In fact the new name is SFDatePickerInput.

I just fixed it.

104.236.47.218 (talkcontribs)

Thank you.

I thinks it is "SFDatePickerInput".

Also after replacing SFIDatePicker with SFDatePickerInput in SFI_DateTimePicker.php, the form starts to render without any fatal php errors, but now pickers wont work and there is a javascript error, something to do with "window.SFI_DTP_init" (I am not good with javascript). Only 2 text input fields appear on the form.

Also there is a php notice now:

PHP Notice:  Undefined property: SFISettings::$datePickerDisableInputField

F.trott (talkcontribs)

I'll look at it tomorrow.

F.trott (talkcontribs)

I put in a fix that unbroke it for me. Could you give it a try?

104.236.47.218 (talkcontribs)

It works.

Thank you

Use of wfMsg was deprecated in MediaWiki 1.21.

2
Summary by Kc5vcx

Migrated.

Kc5vcx (talkcontribs)

Also, FYI...

Use of wfMsg was deprecated in MediaWiki 1.21.

Backtrace:
  • SFI_DatePicker.php line 91 calls wfMsg()
  • SFI_DatePicker.php line 45 calls SFIDatePicker::setup()
  • SF_FormInput.php line 329 calls SFIDatePicker->__construct()
  • - line - calls SFFormInput::getHTML()
  • SF_FormPrinter.php line 2027 calls call_user_func_array()
  • SF_FormPrinter.php line 1475 calls SFFormPrinter->formFieldHTML()
  • SF_AutoeditAPI.php line 886 calls SFFormPrinter->formHTML()
  • SF_AutoeditAPI.php line 115 calls SFAutoeditAPI->doAction()
  • SF_FormEdit.php line 92 calls SFAutoeditAPI->execute()
  • SF_FormEditAction.php line 205 calls SFFormEdit->printForm()
  • SF_FormEditAction.php line 27 calls SFFormEditAction::displayForm()
  • MediaWiki.php line 458 calls SFFormEditAction->show()
  • MediaWiki.php line 255 calls MediaWiki->performAction()
  • MediaWiki.php line 682 calls MediaWiki->performRequest()
  • MediaWiki.php line 476 calls MediaWiki->main()
  • index.php line 41 calls MediaWiki->run()
Kghbln (talkcontribs)

This has now been migrated. Thanks for noting.

"style module should define its position explicitly" when used with 1.26alpha (776aee4)

11
Summary by Kc5vcx

Datepicker was fixed and transferred to SemanticForms 3.4.3. It was removed from SFI 0.10.

Jongfeli (talkcontribs)

The datepicker input type stopped working under SMW-1.26alpha. The form loads but the datepicker does not. This warning is shown:

Warning: OutputPage::getModuleStyles: style module should define its position explicitly: jquery.ui.datepicker ResourceLoaderFileModule 
[Called from OutputPage::getModuleStyles in C:\Apache\htdocs\mediawiki\includes\OutputPage.php at line 621] in 
C:\Apache\htdocs\mediawiki\includes\debug\MWDebug.php on line 300

Warning: OutputPage::getModuleStyles: style module should define its position explicitly: ext.semanticformsinputs.datepicker ResourceLoaderFileModule 
[Called from OutputPage::getModuleStyles in C:\Apache\htdocs\mediawiki\includes\OutputPage.php at line 621] in 
C:\Apache\htdocs\mediawiki\includes\debug\MWDebug.php on line 300

In the console:

Uncaught ReferenceError: jQuery is not defined

I can find a lot of references on style module should define its position explicitly but I don't know how to fix this. There is no SFI_Datepicker.css in the skins directory. Regards.

88.130.78.137 (talkcontribs)

For the style module should define its position explicitly the solution is this:

Go to the skins.json or extension.json file of the skin or extension, which defines the jquery.ui.datepicker module.

Then in the configuration of that module, add an entry for its position. E.g.

	"ResourceModules": {
		"jquery.ui.datepicker.styles": {
			"position": "top",
			"styles": {
				...
CayceP (talkcontribs)

What do I do if I get this on a custom skin that does not have a skins.json?

Kc5vcx (talkcontribs)

I'm also having the issue with datepicker in MW 1.26.0 and not sure how to fix it, getting these messages in debugger console...

Warning OutputPage::getModuleStyles: style module should define its position explicitly: ext.semanticformsinputs.datepicker ResourceLoaderFileModule OutputPage::getModuleStyles
Warning OutputPage::getModuleStyles: style module should define its position explicitly: jquery.ui.datepicker ResourceLoaderFileModule OutputPage::getModuleStyles
Kc5vcx (talkcontribs)

For anybody else having this problem, it's in resources/Resources.php. This works now.

'jquery.ui.datepicker' => array(

    'position' => 'top',

    'scripts' => 'resources/lib/jquery.ui/jquery.ui.datepicker.js',

       

Topic:Sthbopqp2podznfo

Ralfk (talkcontribs)

Hm, datapicker does also not work for me any more after updating to MW 1.26 (stable). Even the workaround with '''position' => 'top'" does not help.

Ralfk (talkcontribs)

Oh, just wait - after a while (even though I restarted Apache and reloaded the form different times) the datepicker appears now. The workaround seemed to fix it in deed.

Kc5vcx (talkcontribs)

I'm actually still having intermittent issues with mine too, in cases with multiple instances some work and some don't. In chrome inspector I see this error "Uncaught ReferenceError: jQuery is not defined", looking at the html source it doesn't appear that the jquery script includes are at the very top of the list.

Kc5vcx (talkcontribs)

I submitted the bug to phabricator https://phabricator.wikimedia.org/T121964

F.trott (talkcontribs)

Datepicker was fixed and transferred to SemanticForms 3.4.3. It was removed from SFI 0.10.

Kc5vcx (talkcontribs)

Updated and after a quick check looks fixed, thanks!

Kghbln (talkcontribs)

The Menuselect input type is depending on the Semantic TreeView extension. Are there plans to further support this input type or will it be phased out? I guess a note about this should be on this extension's page. Cheers

F.trott (talkcontribs)

Semantic TreeView is IMHO not maintainable. Instead I improved the tree format of Extension:SemanticResultFormats. Guess I should also update the menuselect documentation,

M art in (talkcontribs)

I have got an other question abou menuselect: is it possible to select a value the type comma and selcet a second value? Becau in my case the first value is always been overwritten! Thanks for help.

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

Sorry, it is not possible to create a comma separated list with menuselect.

M art in (talkcontribs)

Thank you for the fast answer! What do you recommend instead? More multiselcet fields in a row mapping the same Property? Or maybe change the JavaScript of multiselect? If yes: where?

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

You could try some other input type, e.g. the twolistboxes input type available in the development version of the extension. You could of course also have several inputs or use a multiple template form. If you want to patch menuselect, have a look at the libs/menuselect.js file.

M art in (talkcontribs)

If I put more multiselctfields in a row for the same property the last textfield overwrites the others. So I will try to change the libs/menuselect.js file.

This post was posted by M art in, but signed as Zym.

M art in (talkcontribs)

Ok, First sucess. Line 219-227 was: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" );

// set visible value and leave input inputShow .attr( "value", content.text() ) .blur(); I changed to: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" ); if(inputShow.val()) {var mycontent=inputShow.val()+','+content.text();} else {var mycontent=content.text();}

// set visible value and leave input inputShow .attr( "value", mycontent) .blur();

But after clicking "Save" the last value is taken! What do I do wrong? what's missing?

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

There is a difference between the displayed value and the value sent back to the server. With your change you only change the displayed value. Try finding a line like jQuery( "#" + inputID ).attr( "value", content.text() ); and work on that.

M art in (talkcontribs)

Thank you for your help!

I made some changes from line 219-246. Origin was: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" );

// set visible value and leave input inputShow .attr( "value", content.text() ) .blur();

// set hidden value that gets sent back to the server var link = content.children( "a" );

// if content is link if ( link.length == 1 ) {

// use title set by MW jQuery( "#" + inputID ).attr( "value", link.data( "title" ) );

} else {

// just use text of list item jQuery( "#" + inputID ).attr( "value", content.text() );

} return false;

} );

Now my code: // clicked list item .mousedown( function() {

var content = jQuery( this ).children( "table" ).find( ".cont" ); if(inputShow.val()) {var mycontent=inputShow.val()+','+content.text();} else {var mycontent=content.text(); }

// set visible value and leave input inputShow .attr( "value", mycontent) .blur();

// set hidden value that gets sent back to the server var link = content.children( "a" );

// if content is link if ( link.length == 1 ) {

// use title set by MW jQuery( "#" + inputID ).attr( "value", link.data( "title" ) );

} else {

// just use text of list item jQuery( "#" + inputID ).attr( "value", inputShow.val() );

} return false;

} );

It works ;-)

This post was posted by M art in, but signed as Zym.

M art in (talkcontribs)

Just an other idea: Could it possible to define the behavier in the form with something like:

field|foo|input type=menuselect |structure=... |behavier=add/overwrite

But I'm not so much into php to change this.

This post was posted by M art in, but signed as Zym.

F.trott (talkcontribs)

I'll have to think about it. Could you raise an enhancement bug on https://bugzilla.wikimedia.org ?

Reply to "Menuselect"