Extension talk:FlexForm

About this board

Issues making emailing work

10
JeremiPlazas (talkcontribs)

Thank you for a great extension. We're looking forward to making all the features work.

The email function is not working for us. When setting $wgFlexFormConfig['use_smtp'] to false, it should use the default configuration of the wiki, correct? Anyways, we've tried setting all the SMTP settings manually also and that gives us an error:

Wikimedia\Rdbms\DBQueryError: Error 1054: Unknown column 'persistent' in 'field list' (mariadb) Function: FlexForm\Core\Messaging::addMessage Query: INSERT INTO `flexformmsg` (user,type,title,message,persistent,initiator) VALUES (98,'danger','','SMTP Error: Could not connect to SMTP host.',0,98) in /var/www/html/includes/libs/rdbms/database/Database.php:1713 Stack trace:
 #0 /var/www/html/includes/libs/rdbms/database/Database.php(1697): Wikimedia\Rdbms\Database->getQueryException()
 #1 /var/www/html/includes/libs/rdbms/database/Database.php(1672): Wikimedia\Rdbms\Database->getQueryExceptionAndLog()
 #2 /var/www/html/includes/libs/rdbms/database/Database.php(1241): Wikimedia\Rdbms\Database->reportQueryError()
 #3 /var/www/html/includes/libs/rdbms/database/Database.php(2357): Wikimedia\Rdbms\Database->query()
 #4 /var/www/html/includes/libs/rdbms/database/Database.php(2337): Wikimedia\Rdbms\Database->doInsert()
 #5 /var/www/html/includes/libs/rdbms/database/DBConnRef.php(68): Wikimedia\Rdbms\Database->insert()
 #6 /var/www/html/includes/libs/rdbms/database/DBConnRef.php(369): Wikimedia\Rdbms\DBConnRef->__call()
 #7 /var/www/html/extensions/FlexForm/src/Core/Messaging.php(137): Wikimedia\Rdbms\DBConnRef->insert()
 #8 /var/www/html/extensions/FlexForm/src/Core/HandleResponse.php(385): FlexForm\Core\Messaging->addMessage()
 #9 /var/www/html/extensions/FlexForm/src/Core/HandleResponse.php(247): FlexForm\Core\HandleResponse->setCookieMessage()
 #10 /var/www/html/extensions/FlexForm/FlexForm.api.php(324): FlexForm\Core\HandleResponse->exitResponse()
 #11 /var/www/html/extensions/FlexForm/src/Specials/SpecialFlexForm.php(178): include_once('/var/www/html/e...')
 #12 /var/www/html/includes/specialpage/SpecialPage.php(600): FlexForm\Specials\SpecialFlexForm->execute()
 #13 /var/www/html/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run()
 #14 /var/www/html/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
 #15 /var/www/html/includes/MediaWiki.php(947): MediaWiki->performRequest()
 #16 /var/www/html/includes/MediaWiki.php(547): MediaWiki->main()
 #17 /var/www/html/index.php(53): MediaWiki->run()
 #18 /var/www/html/index.php(46): wfIndexMain()
 #19 {main}

Anybody has recent experience using the emailing functioning successfully?

Thanks so much,

Jeremi Plazas (talk) 11:39, 15 February 2024 (UTC)

Sen-Sai (talkcontribs)

Hi and thanks!

First thing I noticed, from the above error, is that after you install FlexForm, you need to run the update.php maintenance script as mentioned in the installation instructions. The error above happens because FlexForm wants to write the SMTP error to the messaging database, but the tables have not been set yet.

If you have $wgFlexFormConfig['use_smtp'] set to false, then FlexForm uses the default PHP settings for email. Can the Wiki itself send emails? I mean, if you use the "lost password" functionality from MediaWiki, does that work? If not, then you need to configure that part first, if MediaWiki can send email, FlexForm will also be able to send. Or you could set use_smtp to true and fill in all other smtp details :

$wgFlexFormConfig['use_smtp'] = true;

$wgFlexFormConfig['smtp_host'] = "";

$wgFlexFormConfig['smtp_authentication'] = true;

$wgFlexFormConfig['smtp_username'] = "";

$wgFlexFormConfig['smtp_password'] = "";

$wgFlexFormConfig['smtp_secure'] = "TLS";

$wgFlexFormConfig['smtp_port'] = "587";


Let me know if any of these steps have helped.

At the bottom of this Getting Started Page, there are also links to element and discord for help on FlexForm.

JeremiPlazas (talkcontribs)

Hi Sen-Sai,

Thanks for your reply, sorry for the belated reply. We had indeed ran the update script. At this point we've extensively tested the email functionality and it just doesn't work at all. I don't know if this points to any solution but we also can't access Special:FlexForm:

[1dace723ea3a707a4c79a754] /index.php/Special:FlexForm TypeError: MediaWiki\User\UserGroupManager::getUserEffectiveGroups(): Argument #1 ($user) must be of type MediaWiki\User\UserIdentity, StubGlobalUser given, called in /var/www/html/extensions/FlexForm/src/Specials/SpecialFlexForm.php on line 193
Backtrace:
from /var/www/html/includes/user/UserGroupManager.php(330)
#0 /var/www/html/extensions/FlexForm/src/Specials/SpecialFlexForm.php(193): MediaWiki\User\UserGroupManager->getUserEffectiveGroups()
#1 /var/www/html/includes/specialpage/SpecialPage.php(701): FlexForm\Specials\SpecialFlexForm->execute()
#2 /var/www/html/includes/specialpage/SpecialPageFactory.php(1428): SpecialPage->run()
#3 /var/www/html/includes/MediaWiki.php(316): MediaWiki\SpecialPage\SpecialPageFactory->executePath()
#4 /var/www/html/includes/MediaWiki.php(904): MediaWiki->performRequest()
#5 /var/www/html/includes/MediaWiki.php(562): MediaWiki->main()
#6 /var/www/html/index.php(50): MediaWiki->run()
#7 /var/www/html/index.php(46): wfIndexMain()
#8 {main}

15:31, 29 March 2024 (UTC)

Sen-Sai (talkcontribs)

Hi! What version of MediaWiki are you running? FlexForm supports only lts versions of MediaWiki.

JeremiPlazas (talkcontribs)

Yes, we were on 1.35, and have just upgraded to 1.39. We're getting the same errors.

MediaWiki 1.39.6
PHP 8.1.27 (apache2handler)
MariaDB 11.0.5-MariaDB-1:11.0.5+maria~ubu2204
ICU 72.1
Lua 5.1.5
Pygments 2.11.2
Elasticsearch 6.8.23
FlexForm 2.2.12

Also uploading files don't work using the input type="file" action="upload" tag. We get the following error as a red popup:

PHP move uploaded file error (file-handling)

Anything pointing in the direction of a particular solution?

Thanks so much! Jeremi Plazas (talk) 10:50, 1 April 2024 (UTC)

Sen-Sai (talkcontribs)

Have a look at this page : https://www.open-csp.org/DevOps:Doc/FlexForm/1.0/Error-messages at the bottom. Your error is described there.

You either have to give the set a temp folder in the configuration of FlexForm, or if you don't, the give the uploads folder inside the FlexForm extension folder, the correct rights for FlexForm to store temp files.


As for the error : Have you installed the 1.39 version of FlexForm from the REL1_39 branch? Because Argument #1 ($user) must be of type is used in the main branch or 1_35 branch, not in the 1_39 branch.

JeremiPlazas (talkcontribs)

Also, I'm noticing the following warning in the browser console:

Uncaught (in promise) ReferenceError: wgFlexFormSecure is not defined
    at fetchAllDecrypt (FlexForm.general.js:753:2)
    at FlexForm.general.js:1211:9

Even though we made sure to set $wgFlexFormConfig['secure'] = true; in settings. If that helps at all...

Sen-Sai (talkcontribs)

I think this also relates to the wrong branch?

JeremiPlazas (talkcontribs)

oh interesting. Thanks so much! We'll look into that.

Sen-Sai (talkcontribs)

Also, don't forget the Discord support. Most of the times someone is available to help out and you have the to opportunity to setup a call or do screen sharing.

Reply to "Issues making emailing work"

signature not showing

12
Christharp (talkcontribs)

Hi, first thanks for a great extension. I was testing all the features by copying over your help pages & have found the signature feature doesn't show (only the clear button does). I'm currently testing it in the Mediawiki default skin (Vector). It shows no error when I use <_form showmessages />. Unfortunately, it's on a local server so I can't provide a link. Thanks for any help you can give.

Sen-Sai (talkcontribs)

Hi! Thank you! I will have a look today and get back to you!

Sen-Sai (talkcontribs)

I will setup a new MediaWiki instance with 1.35.7 with the default Vector skin. Just in case .. what version are you using, as FlexForm only support the LTS versions of MediaWiki.

Sen-Sai (talkcontribs)

Ah nice, I could reproduce the problem. This has to do with parser caching.

If you would purge the page you have the signature on (most likely also on pages with tokens etc..) then the signature field will show. As you are basically telling MediaWiki you want it to create a new cache for the page. You can do a purge by going to the page with the Signature field and add ?action=purge to the end of the url.


Easier is to turn off parsercaching in your local settings. Then you do not have to purge a page manually.


$wgParserCacheType = CACHE_NONE;

Let me know if it worked for you!

Christharp (talkcontribs)

Hi thanks for the quick reply. The action purge didn't fix the problem. I'm working on the latest version of Mediawiki 1.38.2.

Sen-Sai (talkcontribs)

Caching would most likely be the issue. However FlexForm has been written and tested for the latest LTS release only.( 1.35x ). In November there will be a new LTS release.

On Monday I will install your version and have a quick look, perhaps it's an easy fix. Perhaps not necessary to mention, but the signature field is a JavaScript component, so JavaScript should not be disabled.

I'll get back to you on Monday!

Sen-Sai (talkcontribs)

I have installed version 1.38.2 and made a simple test :

<_form showmessages />

<_form action="get">

<_input type="signature"  fname="Signature-test" ftype="png" pagecontent="boe" guideline="true" clearbuttonclass="btn btn-primary" />

</_form>

For me this does work, see screenshot..


Are you seeing any message in your browsers inspector perhaps?

What version of FlexForm are you using?

Christharp (talkcontribs)

Okay truly bizarre behavior. When I view the page in Edge the page shows, but without the signature showing. But when I view the page through another browser it shows a fatal error. When I go to the command line & try to run update.php I get message saying I'm missing one or more components of php (even more bizarre since I've ran it before & got no such error). So, I'm thinking whatever is going on it's not your great extension. Sorry for wasting your time. All the best...& thanks again.

Sen-Sai (talkcontribs)

Well, as I mentioned earlier, FlexForm hasn't been tested for any versions above 1.35x. As the first release candidate for 1.39 is now available, we will start work in supporting that new lts version.

Egel (talkcontribs)

Hi Charlot, when can we expect a 1.39.x supporting version?

Sen-Sai (talkcontribs)

Hi! It's actually next on the list to be completed. My hopes are this month!

Sen-Sai (talkcontribs)

Been working in it. You can try the REL1_39 branch. Let me know if you still run into troubles..

Reply to "signature not showing"

How does Edit works ?

2
Ypermat (talkcontribs)
Sen-Sai (talkcontribs)

Hi!

I just had a look, my French is not very good, but it seems i need to login?


Il n’y a pour l’instant aucun texte sur cette page. Vous pouvez faire une recherche sur ce titre dans les autres pages, ou rechercher dans les journaux associés, mais vous n’avez pas la permission de créer cette page.

Also, make sure to put, like in a head section of a page, <_form showmessages />. This will show success or error messages from FlexForm

Reply to "How does Edit works ?"

Create multiple pages with the same template

7
Paul LEMPERIERE (talkcontribs)

I'd like to create two pages using the same template. There are two fields : "Prenom" and "Nom". Each page must have differents values for them.


Something like that :


<_form action="get" >

<_create mwwrite="PERS-1" mwtemplate="Personne" mwfields="Nom, Prenom" />

<_input type="text" name="Nom" />

<_input type="text" name="Prenom" />

<_create mwwrite="PERS-2" mwtemplate="Personne" mwfields="Nom, Prenom" />

<_input type="text" name="Nom" />

<_input type="text" name="Prenom" />

<_input type="submit" value="submit" />

</_form>


If I use the same name for my inputs, it's impossible for FlexForm to know which one goes in which page.

And if I use a different name, for exemple "Nom2" and "Prenom2" for the second page, this will not fit with the fileds of my template.


Is there a way to solve this problem ? Maybe with the parsepost parameter ?


Thanks !

Sen-Sai (talkcontribs)

hi Paul!

First off, an HTML Form cannot have inputs with the same name. Actually it can, but only the last input element in a Form will actually be submitted. This is default HTML behavior.

That doesn't solve your issue, but just so you know.

The _edit function does have the functionality to assign a different name to an input field, but _create does not.

I do find it to be a useful addition, so I will add it to the next release of FlexForm. I'll post an update here when it is done.

Paul LEMPERIERE (talkcontribs)

Thank you a lot !

Sen-Sai (talkcontribs)

No problem. I've added this to version 1.1.19. It is not released as yet as I always want another pair of eyes looking at code before it is released. But I guess it will be available tomorrow. Documentation is already updated.

mwfields = comma separated names of form elements that need to be included. Only works when using multiple _create.

If you are creating multiple pages and want to re-assign form fields to template variables, you still add the form field name to mwfields, but add "::" and then the name of the template variable. So if you want to tell mwfields to use formfield "name2", but add it to the template as "Name", add : "name2::Name" to mwfields.

Sen-Sai (talkcontribs)
Sen-Sai (talkcontribs)

<_form action="get" >

<_create mwwrite="PERS-1" mwtemplate="Personne" mwfields="Nom, Prenom" />

<_create mwwrite="PERS-2" mwtemplate="Personne" mwfields="Nom2::Nom, Prenom2::Prenom" />

<_input type="text" name="Nom" />

<_input type="text" name="Prenom" />

<_input type="text" name="Nom2" />

<_input type="text" name="Prenom2" />

<_input type="submit" value="submit" />

</_form>

That would be the code to use in v1.1.19

Paul LEMPERIERE (talkcontribs)

Hello,

sorry for the late reply, I didn't expect such a quick update !

I'll try tomorrow and I'll keep you informed.

Reply to "Create multiple pages with the same template"
Paul LEMPERIERE (talkcontribs)

Hello !

Is it possible with Flexform to reccord XY coordinates with a map input (like in PageForm) ?

Thks

Sen-Sai (talkcontribs)

Hi Paul!

FlexForm by default does not have an input field to record coordinates.

If you are a bit familiar with HTML Forms and JavaScript you can simply add e.g. Google maps to a FlexForm and store coordinates.

Here's an example when dealing with a normal HTML Form : https://gist.github.com/ardianta/a302efc7f9360f60206bac021bfbf2b8

If you find that a bit to difficult, then I can add it to the Wish list of FlexForm to add the coordinates input feature.

Paul LEMPERIERE (talkcontribs)

Hi Sen-Sai,

Thank you ! It's a bit difficult but i think i can deal with it

Reply to "Map Input"

Recaptcha not working?

4
InnerCitadel (talkcontribs)

I've created a contact form. I put recaptcha-v3-action="contactform" as a value in <_form/>, plus the two keys in local settings, but recaptcha isn't working. It sends the email but without using recaptcha. It doesn't show the icon on the bottom right suggesting it isn't loading at all. Getting about one spam email an hour. Any ideas? This is my form:

<_form action="email" id="contactform" messageonsuccess="Thank you for your message." recaptcha-v3-action="contactform" restrictions="lifted">
<_email template="MediaWiki:FlexForm_mail_template"></_email>
<_label for="name">Name</_label>
<_input type="text" id="name" name="name" required="required" placeholder="Your name.."/>
<_label for="email">Email</_label>
<_input type="text" id="email" name="email" required="required" placeholder="Your email.."/>
<_label for="subject">Subject</_label>
<_input type="text" id="subject" name="subject" placeholder="Your subject.."/>
<_label for="message">Message</_label>
<_input type="textarea" rows="10" id="message" name="message" required="required" placeholder="Your message.."/>
<_input type="submit" value="Submit"/>
</_form>

In the meantime I'm testing the following, which displays the recaptcha logo on the bottom right:

<html>
<script src="https://www.google.com/recaptcha/api.js"></script>
<script>
function onSubmit(token) {
document.getElementById("contactform").submit();
}
</script>
</html>
<div class="container-contact">
<_form action="email" id="contactform" messageonsuccess="Thank you for your message." recaptcha-v3-action="contactform" restrictions="lifted">
<_email template="MediaWiki:FlexForm_mail_template"></_email>
<_label for="name">Name</_label>
<_input type="text" id="name" name="name" required="required" placeholder="Your name.."/>
<_label for="email">Email</_label>
<_input type="text" id="email" name="email" required="required" placeholder="Your email.."/>
<_label for="subject">Subject</_label>
<_input type="text" id="subject" name="subject" placeholder="Your subject.."/>
<_label for="message">Message</_label>
<_input type="textarea" rows="10" id="message" name="message" required="required" placeholder="Your message.."/>
<_input type="submit" value="Submit "class="g-recaptcha" data-sitekey="KEY REDACTED FOR THIS POST" data-callback='onSubmit' data-action='submit'/>
</_form>
</div>
Sen-Sai (talkcontribs)

I have released 1.1.6. Could you give that a try ?

InnerCitadel (talkcontribs)

@Sen-Sai It is working now thank you!!!

Sen-Sai (talkcontribs)

Sorry for the late response, I was on holidays.

I had a quick look and noticed some not converted WSForm code in the reCaptcha part of FlexForm. We were thinking of implementing reCaptcha v2 as we thought v3 was less reliable and I guess it was left alone and unfortunately also untested.

I will release an update the soonest with a working version!

Reply to "Recaptcha not working?"

"Please log in first"

4
InnerCitadel (talkcontribs)

@Sen-Sai Thanks for sharing this creation. I am getting an error "please log in first." This sometimes shows up when loading the form, and also when trying to submit a form. After submitting the form no longer loads and just shows "please log in first." It also shows up on the documentation page for FlexForm.

Sen-Sai (talkcontribs)

Ah yes. I'll put that in the manual. By default only logged-in users can use/see/submit a form. What Cavils said works. When creating a form use the restrictions=lifted. I just might create a setting for it, to turn it on/off.


Example :

<_form action="addToWiki" restrictions="lifted" >

InnerCitadel (talkcontribs)
Cavila (talkcontribs)

I had the same problem and solved it by adding restrictions="lifted". if you offer the form for editing pages, be sure though to make it available only to users you can trust (as opposed to, say, anonymous visitors to your site).

Reply to ""Please log in first""
There are no older topics