Jump to content

Topic on Extension talk:FlexForm

Issues making emailing work

10
Summary by JeremiPlazas

We resolved things over their Discord support. Once we had the correct branch: REL1_39. And had gotten a few kinks ironed out, things worked out. Developer responsiveness was phenomenal. Thank you!

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.