Extension talk:CIForms

About this board

Specify multiple groups for Special:CIFormsManage

1
BakiDance1 (talkcontribs)

I'm trying to set global access to the form management page via $wgCIFormsDataAccess. I see that the groups here are supposed to be comma separated, but I can't seem to figure out exactly how to get it to work. No matter what I specify in my LocalSettings.php, form visibility still defaults to sysop (which isn't even a valid group on my installation.)

EG:

$wgCIFormsDataAccess = array ( 'cubey', 'owner', 'admin', 'mod', 'support' );
Reply to "Specify multiple groups for Special:CIFormsManage"

Page status indicators after upgrading MediaWiki

5
Cru121 (talkcontribs)

I had our MediaWiki software updated from 1.35 to 1.39. After the upgrade, the number "1" started appearing on all our wiki pages that use CIForms, in the top right corner of the page, in the title line.

<div class="mw-indicators">
<div id="mw-indicator-ciform" class="mw-indicator"><div class="mw-parser-output">1</div></div>
</div>

Apparently, this is a page status indicator. Any tips how to turn it off? I guess I could hide it via CSS.

Ciencia Al Poder (talkcontribs)

You should locate the indicator in the page source (or template) and remove it from the page. Hiding it with CSS is just hiding the problem, not solving it.

Cru121 (talkcontribs)

Neither the page source nor the template adds the indicator. Even a brand new page with the following code displays it.

{{#CI form: title = Hello world}}
Ciencia Al Poder (talkcontribs)

I don't know what's #CI form and what it does. Can you create a page with *only* Hello world?

Also, what extensions have you installed? Maybe one of the extensions is adding it

Thomas-topway-it (talkcontribs)

@Cru121 and @Ciencia Al Poder I'm sorry for the delay, I plan to publish a version that solves the issue as soon as possible, with some new feature

Reply to "Page status indicators after upgrading MediaWiki"

Added a second database table, changed mail body filled with form data

1
Parzival1200 (talkcontribs)

I added a second databasetable defined in LocalSettings, because I needed to export a cleaner Json with only selected fields an less dataoverhead. it is checked whether the database exists, if not it is created, if that fails nothing is done.

I am not very familiar with coding in mediawiki extensions nor in php. May be you want to take a look https://github.com/marcwoge/mediawiki-extensions-JSonForms (I only edited CIFormsSubmit.php) Would appreciate any feedback.

Created some new functions:

- createJson

- updateDBsecondtable

- create_output

and made a few changes to function execute()


I will need to clean up the email-body as it looks not really nice (it's only the pdf html with all the missing css) .

My next steps are to add a new Inputtype (email to/cc/bcc). Making it possible to submit the form anonymously with a Inputfield and as a form setting.

Reply to "Added a second database table, changed mail body filled with form data"

Problem with text formatting in Czech language

3
Jachym16 (talkcontribs)

Hi,

I want to inform you about an issue I encountered with the CIForms extension, specifically related to text formatting in the Czech language.

After viewing the source code, I discovered that a particular line was causing problems with text formatting in Czech. It is caused by this line in CIFormsSubmit.php:

$mail->CharSet = "text/html; charset=UTF-8;";

After changing it to $mail->CharSet = "UTF-8"; the text is formatted correctly for both subject and e-mail message.

Is it possible to fix it?

Thomas-topway-it (talkcontribs)

hello @Jachym16, ok, I will do a commit as soon as possible with this patch and the request below.

Jachym16 (talkcontribs)

That is great. Thank you for the quick reply.

Reply to "Problem with text formatting in Czech language"

Sending Email to the form-sender

3
Parzival1200 (talkcontribs)

Is there a way to also send the pdf-form to the user who filled the formula?


I shy away from editing the extention code directly but I think there is no other way?

Can you help me with that?

Parzival1200 (talkcontribs)

I solved it...

I added th the CIFormsSubmit.php on line 137 this:

if ($user->getEmail() !== '') {

        $mail->addAddress( $user->getEmail() );

        }

Now the Mail es sent to the user who filld the formula if he/she is loggend-in and has a email-adress in user. may be not the best solution but works

Thomas-topway-it (talkcontribs)

@Parzival1200 thank you, I will take it into account at the next release

Reply to "Sending Email to the form-sender"

Error 504 when trying to submit CI Form data and no Email Notifications

2
Tarunjoseph93 (talkcontribs)

Hi,

Just to give you some context before I lay out the issues, our organisation has enabled the extension CIForms for users to submit feedback data as a feedback form. Composer updates are run on all folders within the extensions/ folder before the site is deployed. This MediaWiki site uses MySQL for its database. The composer.local.json file even contains the latest phpmailer version (^6.5) and a few other dependencies. The way I run composer is I download composer-2 in a shell script, self-update, update --no-dev -o, install --no-dev -o and then remove the composer instance. Every extension uses the REL1_39 package because this site's MediaWiki version is 1.39.2 and uses PhP 8.1. The site is even setup to send emails when users request accounts to the admin, and it works. It even sends back a temp password to the user to sign up, once the admin approves the user. So SMTP is setup properly as well.


#Issue 1

Currently, when testing out the feedback form as admin, I fill out the form and hit submit. The page takes a long time to load and then times out with a "504 Error".

When I check the Special:CIFormsManage page, I can see that the form has been submitted. I'm able to view and download the PDF as well. But I'm not sure why the page times out when Submit is clicked. I've done a Network inspect, but Special:CIFormsSubmit just seems to be in a pending state before throwing a 504 Gateway Timeout Nginx error.

I've checked the Nginx logs and the error on Timeout is as follows: [error] 35#35: *226301113 upstream timed out (110: Operation timed out) while reading response header from upstream, client: <Masked_IP_Address>, server: <Masked_DNS_Address>, request: "POST /index.php/Special:CIFormsSubmit HTTP/1.1".

#Issue 2

Although the feedback form data seems to be present on the Special:CIFormsManage page and can be downloaded, an email doesn't seem to be sent to the admin. As stated above, emails for account requests work, so SMTP is configured correctly in LocalSettings.php and $wgEnableEmail = true as well as $wgEnableUserEmail = true. Even under the wfLoadExtension( 'CIForms' ) line, $wgCIFormsSenderEmail is set to the admin's email as well as $wgCIFormsEmailTo. Even PhPMailer is set to its latest version.

Not sure why the admin nor I receive emails on submission of these feedback forms.

Any help will do please! Thanks in advance!

Thomas-topway-it (talkcontribs)

@Tarunjoseph93 thanks for the detailed explanation. I've not much experience with the use of CIForms in conjunction with Nginx, however it could be an issue related to the PhpMailer and Nginx interaction. After googling quickly I've found the following:


https://stackoverflow.com/questions/27945676/phpmailer-is-causing-504-timeout-error-on-my-digital-ocean-server-using-nginx#:~:text=The%20504%20you're%20getting,you're%20getting%20no%20feedback.


https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting


Not sure if it does solve the issue but your description matches the workflow: the Special page SubmitForms first saves the submission data in the database and following sends the email, so it seems it just halts at this 2nd step.

Just keep me updated if playing with the troubleshooting fixes the issue.

(Thomas)

Reply to "Error 504 when trying to submit CI Form data and no Email Notifications"

uploading pictures and documents to the form

2
Parzival1200 (talkcontribs)

May be it is possible to add a attach-button to add documents or pictures to the form. It would be great if a user can attach files. They can be safed may be in the DB or in the filesystem, I think DB would be much easier.

But I don't know if I can do that on my own...

Thomas-topway-it (talkcontribs)
Reply to "uploading pictures and documents to the form"

Email notification settings clarification

7
School4schools (talkcontribs)

Doing my best to follow instructions for installation/ configuration. I've run the terminal commands and the form works fine w/ output to the special page.

However, I can't figure out email notification settings.

As best I can understand, the proper place to add the user for default email notifications in the file /extensions/CIForms/includes/CIForms.php ? It's the only place I can find 'email to' => null. I changed the null to 'username' but it doesn't produce an email. (I have $wgEnableEmail enabled, and I assumed the terminal command installed PHPmailer (per composer update --no-dev inside the folder extensions/CIForms)

The /extensions/CIForms/vendor/phpmailer seems to have installed ok.

Many thanks for your help. I'm code illiterate and just want my wiki to function properly -- your extension will be a great asset for it. Here for my wiki https://school4schools.wiki

Thomas-topway-it (talkcontribs)

no, it's in LocalSettings.php, as follows:

$wgCIFormsEmailTo = 'your email address';

School4schools (talkcontribs)

Tks for quick reply. That function didn't show in LocalSettings.php I added it manually on last line, but it still doesn't work. So I have now in LocalSettings.php :

wfLoadExtension( 'CIForms' );

define( 'CIFORMS_VALUE_IF_NULL', 0 );

define( 'CIFORMS_VALUE_OVERRIDE', 1 );

define( 'CIFORMS_VALUE_APPEND', 2 );

$wgCIFormsEmailTo = 'name@domain.com';

Thomas-topway-it (talkcontribs)

hello, yes, it is a parameter, it must be added in LocalSettings.php.

Can you also verify thatwgEnableEmail is set to true and the wiki has been already configured for sending emails ?

School4schools (talkcontribs)

That setting is "true" but when I ran a test an email via the special page http://YOURWIKIURL/index.php?title=Special:EmailUser/ it returned a php error. I ran some Cpanel tests and reset DNS, so will see if that changes the behavior by tomorrow. Tks for your help.

School4schools (talkcontribs)

Thank you for your help. I had my host verify email functionality, and they ended up screwing up the DNS... ugh. Now a few weeks later, I fixed it myself w/ full site email functionality, but email still not working on the wiki. So I followed the email troubleshooting guide: Manual:$wgSMTP - MediaWiki to replace the default settings in LocalSettings.php $wgEmergencyContact = "apache@🌻.invalid"; and $wgPasswordSender = "apache@🌻.invalid"; w/ the admin email and it's all working now. Thank you!

Thomas-topway-it (talkcontribs)
Reply to "Email notification settings clarification"

Configuration instructions for notifications

2
School4schools (talkcontribs)

I didn't want to directly edit it, but the Configuration section instructions read:

Insert the following code after wfLoadExtension( 'CIForms' ); in LocalSettings.php (this facilitates setting the global variables listed below)

define( 'CIFORMS_VALUE_IF_NULL', 0 );
define( 'CIFORMS_VALUE_OVERRIDE', 1 );
define( 'CIFORMS_VALUE_APPEND', 2 )

That last line needs a closing semicolon (I think? w/o it it broke my site)

Thomas-topway-it (talkcontribs)

thanks, fixed

Reply to "Configuration instructions for notifications"
Idris, the wise (talkcontribs)

I have mediawiki 1.35.5 installed and I installed the latest 1.2.1 version of the extension.

When I enter the codes, I have the forms and they are working correctly, but their design is as simple as possible and not at all like the pictures.

What is my problem? I had this extension on 1 MW 1.37.1 on a localhost and the graphic design was ok


thnx

Thomas-topway-it (talkcontribs)

@Idris, the wise it could be related to the css, which is not loading. Do you have a screenshot or a link or can you check that the css load correctly ? (for instance hard-refreshing the browser)

Idris, the wise (talkcontribs)

[SOLVED]

Update:

I copied the contents of Style.css (found in /extensions/CIForms/resources/style.css) inside the /index.php/MediaWiki:Common.css.

It is working now


@Thomas-topway-it thanks for the tip to the css load problem

Thomas-topway-it (talkcontribs)

hello @Idris, the wise, I think it's related to the skin chameleon, the resources (css and javascript) are not loading, you can add them manually or I will check it as soon as possible

Idris, the wise (talkcontribs)

@Thomas-topway-it

but I found that this problem reoccurred with other skins too.

However my issue is solved now

I edited my previous comment.

Thomas-topway-it (talkcontribs)

@Idris, the wise but still the Javascript is not loading, so you need to load it in some way

Idris, the wise (talkcontribs)
Thomas-topway-it (talkcontribs)

yes but the validation will not work well

Idris, the wise (talkcontribs)
Thomas-topway-it (talkcontribs)

perhaps yes, but the Javascript select (for long lists of options) will not work

Idris, the wise (talkcontribs)
Thomas-topway-it (talkcontribs)

@Idris, the wise that should have been solved in the latest version! there was a mistake in the js and css module declaration, now fixed

Reply to "Design Problem"
Return to "CIForms" page.