Extension talk:Semantic Forms Select

About this board

Token input type in SFS

1
Paul LEMPERIERE (talkcontribs)
Reply to "Token input type in SFS"

Compatibility with the latest versions of MW, SMW and PF

2
Megajoule (talkcontribs)

This extension offers the possibility to create forms with responsive fields whose values adapt to the user's choices via another field. This is particularly useful for ensuring that data is consistent within the same class instance. It would be a great pity if this possibility were to disappear in the near future. Is there any hope that this great extension will be fixed to work with the latest versions of MW, SMW and PF? Thanks in advance and with all my support.

Open issue : https://github.com/SemanticMediaWiki/SemanticFormsSelect/issues/87

Kghbln (talkcontribs)
Reply to "Compatibility with the latest versions of MW, SMW and PF"

With the "label" option, the value returned to the template is not the correct one.

1
Megajoule (talkcontribs)

The value returned by the SF_Select field is not that of the property entered in the query (?Has Name) but the page that contains it. This is not what we expect, is it? To correct this, you have to modify res/scriptSelect.js (line 99) :

                element.options[i] = new Option(namevalues[i][1], namevalues[i][1]);
                if (jQuery.inArray(namevalues[i][0], selectedValues) != -1) {
                    element.options[i].selected = true;
                    newselected.push(namevalues[i][1]);
                }
Reply to "With the "label" option, the value returned to the template is not the correct one."

When you have Semantic Forms Select enabled issue with api.php

2
Squeak24 (talkcontribs)

Hi

MW 1.33 + SMW 3.02

When I have Semantic Forms Select enabled I get the error with the api.php

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "error": {
        "code": "internal_api_error_Error",
        "info": "[XVm@QqCSZXTU8d7eZpH0CAAAAUA] Caught exception of type Error",
        "errorclass": "Error"
    }
}

any idea what the problem is?

Kghbln (talkcontribs)
Reply to "When you have Semantic Forms Select enabled issue with api.php"

Selected options unexpexted label and value

2
Michele.Fella (talkcontribs)

Config: MW 1.32.0 + SMW 3.0.2 + SRF 3.0.1 + SF Select 3.0.0

1) It seems that latest SMW version have two different semantic search result types: List and Plain list.

You might want to use "format~Plain list" or the whole <span> tag will be considered as value.

2) In res/scriptSelect.js the SFSelect_processNameValues function is used for turning name values from 'Page (property)' results, eventually removing the brackets from the result value.

This function removes a number of leading/trailing characters from the result of the query.

I had no time to troubleshoot properly the code, but at least in my case the select options were wrongly updated no matther if the result of the query is a Page or a simple Text properties (probably missing checks and loop pointers not properly reset).

Assuming you are fine with "not post processing the result of the query" (this is my case) my quick and dirty workaround:




function SFSelect_processNameValues( values ) {
        var namevalues = [];
    for(var i=0; i<values.length; i++){
            // var openBr = 0;
            // var doneBr = 0;
            // var num = 0;
            var label = values[i];
            /*var labelArr = label.split("");
            var end = labelArr.length - 1;
            ... ...
            labelValue = ( labelArr.slice( startBr+1, endBr ) ).join("");
            labelKey = ( labelArr.slice( 0, startBr - 1 ) ).join("");
            */
            labelValue = label;
            labelKey = label;
            namevalues.push( [ labelKey, labelValue ] );
    }
    return namevalues;
}
Kghbln (talkcontribs)

Thanks for publishing your findings. Perhaps you would like to create a pull request at GitHub. @Toniher:

Reply to "Selected options unexpexted label and value"

SF_Select displaing bug

2
Sferg008 (talkcontribs)

Hello!

I upgrade my wiki to 1.31 version. Upgrade SMW to 3.0 version and PageForms to 4.4.1 version. Semantic Forms Select extension is 3.0.0 version. PHP version 7.2. I have some form with this code

{{{field |AllProtocols40 |input type=SF_Select |function=ask((Category:Some_category1));format~list;sep~,;link~non;headers~hide;limit~500 }}}

Prior to the update field AllProtocols40 worked well. But now, when I switch to the form editing mode, the field is displayed empty, even if before that a value was selected. If I select a value in the field and save it, the value will be saved in the template, but when I switch back to the edit mode, the field is again empty. And if I save the form, then an empty value will fall into the template.

Please help me figure it out.

Sferg008 (talkcontribs)

Someone help me please. It is very important for me. But I don’t have any ideas on what is not working.

Reply to "SF_Select displaing bug"

how to set a default value with SF_Select results

2
Revansx (talkcontribs)

If I have the following code for a Semantic Forms Select:

{{{field
|ActionItemRequestorIs
|input type=SF_Select
|query=((Category:User));format~list;sep~,;link~none;headers~hide;limit~500
}}}

How can I set one of the results as a default for a new page created by that form.

In other words, what should I provide in place of "{{mydefaultvalue}}" in the code below (which does not work):

{{{field
|ActionItemRequestorIs
|input type=SF_Select
|query=((Category:User));format~list;sep~,;link~none;headers~hide;limit~500
|default={{mydefaultvalue}}
}}}
69.5.131.1 (talkcontribs)

Same question

Reply to "how to set a default value with SF_Select results"
Jasonzhang (talkcontribs)

For support, please send email to user mail list in SemanticMediawiki. I may not monitor the talk page.

Revansx (talkcontribs)

Running:

Mediawiki 1.30
Page Forms 4.3 (c35e352)12:50, 14 March 2018
Semantic Forms Select () 3.1.0 (59ab714)05:26, 15 May 2018 from Gesinn-it - master

Was told that the branch at Gesinn-it works [0]

SFS loads but does not work.

Upon debug, I see that I am getting a:

Warning:Invalid argument supplied for foreach() in /opt/htdocs/mediawiki/extensions/SemanticFormsSelect/src/SemanticFormsSelectInput.php on line 172

message on form pages that use |input type=SF_Select|

[0] https://github.com/gesinn-it/SemanticFormsSelect

Reply to "Support Note"

SemanticFormsSelect::init not found

3
Summary by Kghbln

Until issue 64 is resolved you need to downgrade to Page Forms 4.1

Roux Stéphane (talkcontribs)

Dear all,

After install we get this issue when loading form with Select : "PHP Fatal error:  Class '\\SFS\\SemanticFormsSelect::init' not found in /opt/mediawiki/extensions/PageForms/includes/PF_FormPrinter.php on line 1617"

Install command used : php composer.phar require mediawiki/semantic-forms-select "~2.1"

Config:

MediaWiki: 1.27.3

PHP: 5.6.30 (apache2handler)

SFS_VERSION : 2.1.0-alpha

Same error here : https://sandbox.semantic-mediawiki.org/wiki/Sp%C3%A9cial:AjouterDonn%C3%A9es/DemoAjax1

Any idea ?

Cheers

Stéphane

Roux Stéphane (talkcontribs)
Paul LEMPERIERE (talkcontribs)

Hi,

Does anyone know if this problem will be solved soon? Does anyone work on it ?

Cheers

Paul

Reply to "SemanticFormsSelect::init not found"
Cavila (talkcontribs)

It would be great if we could use a Cargo query with either 'function' or 'query'. I've tried both options but haven't had any luck so far.

Cavila (talkcontribs)

It would be even easier if we could pass @@@@ to a template, which can then contain any kind of query (Cargo, SMW).

Reply to "Support for Cargo?"
Return to "Semantic Forms Select" page.