WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Hilfe & Support (deutsch) => General Help & Support => Module => Topic started by: Martin Hecht on July 18, 2015, 10:30:24 PM

Title: mpForm
Post by: Martin Hecht on July 18, 2015, 10:30:24 PM
Hi,

due to the new forum rules I'm starting a new thread here. In the previous version (1.1.10) of mpform my security fixes were a bit overshooting. The settings were already properly escaped before writing them to the database. My additional escaping lead to the behavior that all quotes were prefixed by backslashes after saving the settings. I'm sorry about that. Here is an updated version which corrects this regression of the previous version Any feedback is welcome.

Martin
Title: Re: mpForm
Post by: nibz on July 19, 2015, 02:01:18 AM
I will update my repo tomorrow

regards Nibz
Title: Re: mpForm
Post by: nibz on July 19, 2015, 10:47:34 PM
Updated the module on the github repo to the latest version.
Thanks to Martin for his work!
Title: a beta-version of a new mpform
Post by: Martin Hecht on July 23, 2015, 12:35:05 AM
Hi,

I got some feedback on mpform here:
http://forum.WebsiteBaker.org/index.php/topic,28504.0.html
and here:
http://forum.WebsiteBaker.org/index.php/topic,24617.0.html

now I have prepared a new version where some of the wishes are incorporated.
The most important change is that in upload-fields you may select multiple files. They are all uploaded at once.
The setting for the maximum file size has two meanings here:
- a single file may not be larger than that value
- files are uploaded and copied to the media folder until that much space is used up (actually a bit more, because I don't delete files already copied).
However the total amount of uploaded data is limited by the global php setting of post_max_size.

apart from this, if several upload boxes are displayed on one page, the maximum file size and allowed file types are displayed only once on a single form page. This might not be that interesting anymore, since I could already implement the multiple-files upload mentioned before.

The formatting of that hint was a hard-coded style setting which I have moved into the css file, so that it can be easily adjusted from the backend.

the next item on the wishlist would be that it's possible to temporarily disable individual fields. I would look for a solution to that, as well. Anyhow, I'd attach the current state of the module and would be happy if someone could test if the newly implemented features are working with all platforms / php versions / browsers that you are using in the field.

Martin
Title: another beta for mpForm
Post by: Martin Hecht on July 24, 2015, 12:37:31 AM
got some feedback again from dbs here
http://forum.WebsiteBaker.org/index.php/topic,28504.0/topicseen.html

and it took me ages to find out what goes wrong. I finally found that pear doesn't support array structures for $_FILES that deep. So, either you can use multiple upload fields on one page, or you can use multiple files in one form. We are still lucky: pear just picks the first entry (i.e. the first form field). So, after having these files uploaded, we can drop the first entry and present pear with the outcome of the next form field :-)
I also added some minor fixes, print out more error messages rather than silently ignore all files that go beyond the limit. And I have renamed the upload_one_file function, just in case the same name appears somewhere else and since I had to change the number of parameters I decided also to change the name, just to be sure that we call the right one.

I have attached another beta if you like to test it
Title: Update: mpForm
Post by: Martin Hecht on July 27, 2015, 08:55:23 PM
Hi,

here is the latest version 1.1.12 of mpform. You probably have seen the beta versions which I have posted here - I was working on a solution to allow uploading multiple files with a single upload box. In the latest beta version I still had a few bugs with the order of the array indexes.
Also I have lined up the field names with the upload fields now and fixed a little issue in the css file.

Martin
Title: Update: mpForm
Post by: Martin Hecht on July 28, 2015, 07:59:38 PM
Hi,

another minor upgrade: I have fixed two issues with the way the help messages and buttons are displayed.
These were reported by dbs here http://forum.WebsiteBaker.org/index.php/topic,28504.msg199752.html#msg199752

Edit: oops, one of the issues is not yet fixed. I have to look again.  I'll post another version later.

cheers, Martin
Title: Update: mpForm
Post by: Martin Hecht on July 28, 2015, 08:28:05 PM
Edit: oops, one of the issues is not yet fixed. I have to look again.  I'll post another version later.

ok, now here it is... just after the time limit for editing my previous post once more has expired ;-)

so, this is the fixed version 1.1.13. The problem was, when you have several help buttons (the little question marks) and you click around on them, it could happen that the help message was displayed with one row offset in the table. I hope I have fixed this for all combinations of clicks now. :-)

Martin
Title: Re: mpForm
Post by: Hans on July 28, 2015, 08:43:46 PM
Thanks a lot, Martin!
Title: Re: mpForm
Post by: nibz on July 28, 2015, 08:51:58 PM
Updated the github repo: https://github.com/WebsiteBaker-modules/mpform
Title: Update: mpForm
Post by: Martin Hecht on July 29, 2015, 08:48:16 AM
Hello again,

one feature request which was still on my agenda:
dbs proposed that it would be good to have the ability to disable some fields temporarily. This would allow you to prepare fields in the backend without showing them to the visitors of your page. Later, when you are ready to publicly show them, you would just enable them.

This is included in 1.1.14 now. I decided to have the fields 'active' when they are created (because that is how it has always been and many people are familiar with this behavior). However, when you have created a field, you are taken to the page where you can modify the freshly created field. Just check the new checkbox there to disable the field if you wish to do so and save the field again. It's a matter of a second perhaps, and you can continue preparing things (adding help text and so on), without showing it publicly until you are ready.

Ah, and by the way, in the backend disabled fields are shown with a gray star, and optional ones have a green star, now.

I was surprised myself how easy it was to include this into the existing code. I didn't even have to change the database structure.  If I knew that before, I would have put this and yesterday's fixes together in one release :-) However, this way I'm proud to present another update after 12 hours roughly. Now, I'm done with the list of bug reports and feature requests.

Martin
Title: Re: mpForm
Post by: nibz on August 11, 2015, 07:42:31 AM
Updated the github repo.

Sorry Martin for the delay, i completely missed your last post ;).
Title: Re: mpForm
Post by: Ruud on December 03, 2015, 11:45:10 PM
Just found a bug in the evalform.php

Looking back, since version 1.1.10 there is an " } else { " part missing after the " } elseif (!is_array($post_field)) { " block (line 416 in 1.1.14).
This makes that checkboxes (array of post data) is not seen anymore.

Since the customer was in a hurry (busy website) I fixed it by replacing evalform.php with a version 1.1.9 and did not look for a real fix.
The maintainers of the mod should have a look though :)



Title: Re: mpForm
Post by: Martin Hecht on December 04, 2015, 10:27:25 AM
Hi Ruud,

I'm sorry, but I can't find the place where you are missing some code. The genreral else-section (which starts with a line
//$email_body .= $field['title'].": \n";
that's commented out in both versions (1.1.14 and 1.1.9) is still there. The else-section at the end of the branch
elseif (!is_array($post_field))
where the database connection is made has been moved into mpform_escape_strin g() which is a wrapper function that does exactly the different types of connections depending on the wb-version.
which version of wb and php is this, where you are seeing this problem?

cheers, Martin
Title: Re: mpForm
Post by: Ruud on December 04, 2015, 10:50:26 AM
Ok, looked at the 1.1.14 code again and now I found the missing } else {. It was way "off screen" at the very end of line 434 (probably a lf - cr/lf editor issue)

The problem was that the form in question has 3 checkbox groups setup, and after upgrading (on WB283SP4) to 1.1.14 the selected checkboxes were not in the mail.
The mpform upgrade was necessary because the site upgraded tot SP4. The PHP version on that site is currently 5.3.29.

With the evalform.php from 1.1.9 it just works fine.
That one has fixes for MySQLi - so basically it is fine - but just no using the new wrapper.
I have no time to go deeper into the problem, so that's why I just reported it here.

Maybe a part of the problem is that the checkbox values all have the euro sign ( € ) in them??
Title: Re: mpForm
Post by: jacobi22 on December 05, 2015, 02:55:42 PM
found a bug in vers 1.1.14 (Vers from the addon area here (http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?filter=mpForm%20-%20Multi%20Purpose%20Form%20Module&id=0A702411))

view_submission.php  // line 104
the file delete_submission.p hp needs a IDKey for the submission_id, its not set in view_submission.php  // line 104
see: submission_id=<?php echo $admin->getIDKEY($submission_id); ?>

Originalcode
Code: [Select]
<button class="" onclick="javascript: confirm_link('<?php echo $TEXT['ARE_YOU_SURE']; ?>', '<?php echo $sModuleUrl?>/delete_submission.php?page_id=<?php
                
echo $page_id?>
&section_id=<?php echo $section_id?>&submission_id=<?php
                
echo $submission_id?>
');"><img src="<?php echo $sIconDir?>/delete.png" alt="" width="16" height="16" border="0" /> <?php echo $TEXT['DELETE']; ?></button>

solved with
Code: [Select]
<button class="" onclick="javascript: confirm_link('<?php echo $TEXT['ARE_YOU_SURE']; ?>', '<?php echo $sModuleUrl?>/delete_submission.php?page_id=<?php
                
echo $page_id?>
&section_id=<?php echo $section_id?>&submission_id=<?php echo $admin->getIDKEY($submission_id); ?>');"><img src="<?php echo $sIconDir?>/delete.png" alt="" width="16" height="16" border="0" /> <?php echo $TEXT['DELETE']; ?></button>


P.S: the most Back-URL's in the ID-Check show a wrong target, go's to ADMIN-URL, not to ADMIN_URL.'/pages/modify.php?page_id='.(int)$page_id

example:
Code: [Select]
$admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], ADMIN_URL);
can be

Code: [Select]
$backlink = ADMIN_URL.'/pages/modify.php?page_id='.(int)$page_id;
        if (!$submission_id) {
                $admin->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $backlink);
                exit();
        }
Title: Re: mpForm
Post by: Martin Hecht on December 05, 2015, 06:53:46 PM
Thanks to Jacobi22,

I have updated my sources and I'll come up with a new version once I have fixed the problem which Ruud has reported (thanks to him, too).
I believe that I understand what's the problem, now, but I have to do some more analysis.

Martin
Title: Re: mpForm
Post by: jacobi22 on December 05, 2015, 07:16:03 PM
Quote from: martin
I have updated my sources and I'll come up with a new version.....

is it possible, to add a field, called "position" in the database table mod_mpform_submissi ons?

if you delete a submission via ajax, the ajax.php start's a re-order of the submissions, based on the not existing position-field
see ajax.php, case 'delete_record', line 116ff
Title: Re: mpForm
Post by: Martin Hecht on December 06, 2015, 04:40:33 PM
what would "position" contain then? And what should it be used for? Probably for ordering the posts... Maybe the current submission ID would be ok for this and we should just drop the "re-ordering" inside ajax? (at least as long as we don't support moving posts up and down)
Title: Re: mpForm
Post by: jacobi22 on December 06, 2015, 05:09:21 PM
Quote
Maybe the current submission ID would be ok for this and we should just drop the "re-ordering" inside ajax?
the Script (ajax.php) submitted a field called "position" in line 117  :wink:
Code: [Select]
$order = new order($sDbRecordTable, 'position', $sDbColumn, 'section_id');
and the next function in line 118
Code: [Select]
$order->clean($_POST['iSectionID']);starts a reorg, depending on the (field) submission_id

submissions_id is a auto_increment-field and the primary key, i think, its not a good idea, to rewrite the submissions_id in a clean-progress, so a position-field looks like a good and fast solution for that

i'm not sure, if somebody needs a function to change the order of the submissions in the backend, so you dont need a function to change it in the submissions_output_ table (move up, move down), but it solve'd the problems intern
Title: Re: mpForm
Post by: Martin Hecht on December 08, 2015, 03:06:27 PM
I'm sorry, I didn't understand your initial request to add the field. My first solution to skip the reordering doesn't work either, because that code is used for both, submissions and form fields, if I understood it correctly now. So, the solution would in fact be to introduce a new column, called "position", probably auto-increment as well, just to satisfy the ajax code which would do a re-ordering here. I put it on my todo-list together with a few other minor bug fixes that I have collected during the last days. Thanks for pointing me to this issue.
Title: mpForm Update pre release
Post by: Martin Hecht on December 12, 2015, 01:07:08 AM
Hello,

I have a pre-release for an update of mpform 1.1.15 ready. SInce there are quite a number of fixes and code changes, It would be great if some of you could test this package.

The changes are:

- A the ftan bug when deleting submissions which was reported by jacobi22 is fixed , thanks to him
- The backlinks for the print_error calls now should point back to the specific page, thanks again to jacobi22 for reporting
- Old calls to get_error() are replaced by the use of the database class, thanks to ruud for reporting this issue
- Check boxes, radio buttons and select lists were not terminated correctly. This is also fixed. This might have been the cause for the problems which ruud has experienced at a customers site (depending which browser is used). Thanks again to ruud for his attempts to debug this issue, even if we could never pin down the exact conditions for the missing selections in the submissions.
- With this version emails are not sent anymore if private_function_be fore_email returns false. Thanks to hansis100 for reporting this unexpected behavior.
- For those of you who were relying on this as a feature I have  introduced a private_function_af ter_email. Just move the code which would return false and stop further processing there, and you will still get notifications by email, but no entries in the submission table.
- You can specify a distinct value for checkboxes, radio buttons and select lists, now which differs from the text shown to the user. To do so, I have introduced a separator string which is adjustable in the advanced options. For instance you can have a value of "50" and a label at the radio button, which reads "50 €". Just enter both, the value and the label, separated by the current separator string. This was a feature request by hansis100.
BTW the default separator string is "&#0;" just to ensure that existing pages are not screwed up by this change. However, as I mentioned, you can choose a more convenient separator string if you like.
- Also discussed here, I have added a column called "position" to the submissions table to satisfy the ajax delete function. Thanks to jacobi22 for spotting this problem and for reporting and explainig it to me.
- Another fix for better handling html special characters inside options is included.

I have attached the pre-release to this post. (the version number after my testing is currently 1.1.14.20)

Cheers, Martin
Title: Re: mpForm
Post by: jacobi22 on December 12, 2015, 09:53:14 AM
install.php // Ln 79 + upgrade.php // Ln79
Exception: "BLOB/TEXT column 'value_option_separator' can't have a default value"

module doesnt work is mysql strict mode, it doesnt possible to send empty fields  (maybe a not required field is empty)
a new form-post was added to the submission-table, but not to the request-table - All fields without a default value needs a definition in the table-insert

Quote
I'm sorry, I didn't understand your initial request to add the field
its solved now, but i read your question to late, here the answer:
after delete a submission, the ajax.php starts a reorg of the submission-table, based on the common-field called "position"
WB 2.8.3 has no problems,  if there is no position-field in the table and if the debug-mode is off, but its crashed with the debug-mode == on.
P.S.: and also the WB 2.8.4 crash

Title: Re: mpForm
Post by: Martin Hecht on December 12, 2015, 08:48:43 PM
Hello jacobi22,

thank you for testing. It seems your sql is more strict than mine ;-)
install.php // Ln 79 + upgrade.php // Ln79
Exception: "BLOB/TEXT column 'value_option_separator' can't have a default value"
ok, I have changed it to a VARCHAR so I can set DEFAULT values.

Quote
module doesnt work is mysql strict mode, it doesnt possible to send empty fields  (maybe a not required field is empty)
is this something new? You are talking about the frontend, right? So I should add some code that inserts default values for all empty fields which might be an empty string for instance...

Quote
a new form-post was added to the submission-table, but not to the request-table - All fields without a default value needs a definition in the table-insert
and could you be more precise about the request-table? I have difficulties to understand what I should change in the code.

thanks, Martin
Title: Re: mpForm
Post by: jacobi22 on December 13, 2015, 12:17:32 AM
Quote from: jacobi22
a new form-post was added to the submission-table, but not to the request-table - All fields without a default value needs a definition in the table-insert
and could you be more precise about the request-table? I have difficulties to understand what I should change in the code.

take a look into the database table mod_mpform_results_ Section_id. in my test-form i have a
required field - type short text
optional email field
2 fields type date
1 longtext
1 selectfield with 3 options
1 controll-box field with 3 options
and some more short text fields


for every used field (in the frontend), you have a field in the database table, called field 2 - field 14 in my example
database field type is TEXT Not Default

(https://i.gyazo.com/782315c5ed92570f02abd78ae8835828.png)

Here is the INSERT after send (evalform.php // LN 649)
Code: [Select]
$qs = "INSERT INTO ".TABLE_PREFIX."mod_mpform_results_$suffix (session_id, started_when, referer) VALUES ('$us', '$started_when', '". $_SESSION['href'] ."')";
the script say's: if i've here a error in the INSERT, stop and set succsess to false

the INSERT doenst use the fields and because of that, i have errors like this in the strict mode
Quote
Field 'field2' doesn't have a default value

the insert for the fields comes in the next step via this code in line 660
Code: [Select]
$qs = "UPDATE ".TABLE_PREFIX."mod_mpform_results_$suffix SET ". str_replace($lf, " ", $felder) ." WHERE session_id = '$us' LIMIT 1";
take a look into the form module to see the way (read the table structure from the result_table and compare table fields with POST-Array ) :wink:
Title: Re: mpForm
Post by: jacobi22 on December 13, 2015, 12:31:03 AM
It seems your sql is more strict than mine ;-)

my.ini setting for strict mode:

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,STRICT_ALL_TABLES

maybe a print_error helps
Code: [Select]
$admin->print_error($database->get_error());                                
Title: mpForm update - next attempt for version 1.1.15
Post by: Martin Hecht on December 15, 2015, 07:03:37 PM
Hi,

first of all thanks to all who have tested and reported bugs so far.  Basically, version 1.1.15 should not become that big release to make mpform completely ready for the future. Nevertheless, I have the ambition to improve the module step by step (at least to avoid introducing regressions in the bugfix releases). Therefore, I have fixed the sql-strict problems reported so far (the one about submissions in the frontend however was a new issue, not discussed before I came up with my first pre-release, right? Anyhow, it should be fixed now).

I'm pretty sure that there are more issues in sql strict mode, but could we first focus on the things that were reported already and finish this release, and in a next step make the module compliant with sql strict mode?

I have prepared another pre-release for version 1.1.15 now, which fixes the two issues in strict mode. For the one about inserting value_option_separa tor in the upgrade script I have also included a section that should hopefully adjust the data type of that column in case it was already introduced in your database by the first pre-release. This code will vanish in the final release, because its only purpose is to make a smooth transition from one pre-release to the next version.

If there are no further reports about regressions due to the changes in this release (or only minor ones that don't need additional testing) within the next two weeks I would like to finish version 1.1.15 between the years.

For all issues about sql strict mode I would propose to go for a version 1.2.0 that would be fully compliant with sql strict mode and maybe contains other changes that require some more effort than just fixing small bugs (I still have "cleaning up the code"... on my list).

Martin
Title: mpForm update
Post by: Martin Hecht on December 30, 2015, 10:47:19 AM
Hi,

since I have not received any further bug reports I'm publishing this release now.
I have disabled the section in the upgrade script which converts value_option_separa tor to varchar.
If anyone has installed the first pre-release, please first upgrade to the second pre-release, before installing this one
(or manually uncomment the second half of the section marked with "// new in 1.1.15" in the upgrade script).

Martin
Title: Re: mpForm
Post by: jacobi22 on December 30, 2015, 12:19:54 PM
Warum hast du die Lösung von marmot nicht übernommen? -> http://forum.WebsiteBaker.org/index.php/topic,28838.msg202366.html#msg202366
Title: mpForm update
Post by: Martin Hecht on December 30, 2015, 03:07:32 PM
Hello,

...and version 1.1.16 follows straight away. It contains Marmots fix now, of which I wasn't aware until today.

Warum hast du die Lösung von marmot nicht übernommen?
Just having made the release, the first feedback arrives for which I have been waiting for about 2 weeks now  :evil:

Please post your feedback in this thread (or at least link other threads here) or send me a PM! Thanks!

Martin
Title: Re: mpForm
Post by: jacobi22 on January 13, 2016, 04:38:15 PM
found a problem in vers. 1.1.16 in type checkbox and radio-list. my separator in this field settings are <br /> or <br>, but see the result (see the < in the last lines of every list)

(https://i.gyazo.com/63638361cacb7d1d370e72f13ff584c8.png)

if i make a print_r(); for the params-array, i see a problem with the chars (this is the delimiter from the advanced options)
(https://i.gyazo.com/4164586ec55f1b32ee02be5bd71d4931.png)
Can this be the problem? but is has nothing to do with the output from a list
Title: Re: mpForm
Post by: Martin Hecht on January 13, 2016, 10:34:01 PM
does the problem go away if you append/prepend a space character to the separator?
If the problem is only with the latest version, I suspect that a bug has sneaked in on line 470 of paintform.php
I'm a bit in a hurry. I'll try to reproduce it the next days. Thanks for reporting.
Title: Re: mpForm
Post by: Martin Hecht on January 14, 2016, 08:59:56 AM
Hi jacobi22,

I can't reproduce the problem on a linux host. Is it a windows host on which you see it? My suspicion is that the following fix might help:
Code: [Select]
<?php // paintform.php line 471, original code:
$options[count($options)-1]=substr_replace($options[count($options)-1],"",-strlen($field['extra'])-1);
// change to:
$options[count($options)-1]=substr_replace($options[count($options)-1],"",-strlen($field['extra'])-strlen(PHP_EOL));

strlen(PHP_EOL) is 1 in my linux environment, but it might be 2 on other platforms

...and the same change for the radio buttons etc.

Martin
Title: Re: mpForm
Post by: jacobi22 on January 14, 2016, 10:45:32 AM
yes, it was a (locale) Xampp-server on windows - i was not finish at the moment (when i write my post) to go online with this project

it was showing on the windows-server only and your solution solve the Problem

 (Y)

Thanks again for your fast replay!!
Title: mpForm update
Post by: Martin Hecht on January 14, 2016, 12:22:23 PM
I have created a new release which contains this fix for windows environments
Title: Re: mpForm
Post by: jacobi22 on January 14, 2016, 05:13:57 PM
geht gleich in den Addon-Bereich (http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411) (wenn Dietmar nicht schneller war), muß mich nur erst etwas sammeln  :|
Title: Re: mpForm
Post by: jacobi22 on January 16, 2016, 10:18:21 AM
i search for a problem on a user-website here and the validator means, something is wrong and send a network error. this link doesnt work

http://orthointern/include/jscalendar/menuarrow.gif

i search for this link in the module and found it in frontend.css for this definition here
Line 320
Quote
.calendar .nav {
  background: ButtonFace url(http://orthointern/include/jscalendar/menuarrow.gif) no-repeat 100% 100%;
}

@ Martin: please put it on your to-do-list for one of the next versions

@ all others

here the correct definition
Quote
.calendar .nav {
  background: ButtonFace url(../../include/jscalendar/menuarrow.gif) no-repeat 100% 100%;
}

Title: Update: mpForm
Post by: Martin Hecht on January 16, 2016, 12:32:01 PM
I have decided to publish fixes for minor issues straight away. I think this makes tracking of code changes easier, and for one-line fixes we usually don't need much testing :-)

@jacobi22 thanks for the bug report and for helping this user. In the updated style file I have omitted the 'http' protocol so that the image can be loaded as well if the web server runs on https only (and if I recall correctly, for relative links the browser should stay with the same protocol as the source file has been delivered)
Title: Re: mpForm
Post by: Mux on January 24, 2016, 09:17:52 PM
hi, I have a database error in mpform , think it's happening since upgrading to mysql 5.6 (strict mode?)

when sending a message in the form it will be saved but with an error message:
Database INSERT INTO wb_mod_mpform_resul ts_8 (session_id, started_when, referer) VALUES ('56zv7q8n', '1453665527', 'http://www.blabla.com')Error

I don't know what's producing this error...
Title: Re: mpForm
Post by: jacobi22 on January 24, 2016, 10:23:46 PM
Code: [Select]
I don't know what's producing this error...
this message comes, if there is a error in the INSERT (evalform.php Ln 644), normalize followed with the complete SQL-Error in the next line, in strict mode mostly something like this
Field 'field4' doesn't have a default value

use the code from here in a code- or code²-section to check the sql-mode

Code: [Select]
<?php
$sql 
'SELECT @@global.sql_mode';
$strictMode $database->get_one($sql);

    if ((
strpos($strictMode'STRICT_TRANS_TABLES') != false)OR(strpos($strictMode'STRICT_ALL_TABLES') != false)) {
        echo 
"MySQL run in strict mode!\n";
    }else{
    echo 
"MySQL strict mode not set!\n";
    }

output in the frontend is one of this two messages
MySQL run in strict mode!  or MySQL strict mode not set!
Title: Re: mpForm
Post by: Mux on January 24, 2016, 10:55:52 PM
strange things: I could not fill in any code to code-section nor code2-section - after saving the window always remains empty.
so, i added your code into the section of evalform.php where the error message is created. Here your code says that there is no strict mode...
I got many problems with different websites after the mysql-upgrade, maybe it's because of this, that code in the two code-modules can't be saved in the database...
Title: Re: mpForm
Post by: jacobi22 on January 24, 2016, 10:59:16 PM
Quote
Database INSERT INTO wb_mod_mpform_resul ts_8 (session_id, started_when, referer) VALUES ('56zv7q8n', '1453665527', 'http://www.blabla.com')Error

do you have here more information about the part behind this message or is there only the Word "Error" on the last place?
Title: Re: mpForm
Post by: jacobi22 on January 24, 2016, 11:06:24 PM
on my locale xampp-testarea  - if there is a problem, the message was sent, but there is no insert for this message

and in my version of mpform, i change this line 645 in evalform.php
Code: [Select]
echo $TEXT['DATABASE']. " " . $qs."<br />". $database->get_error();
with a simple Ouptut of this error - i dont need the complete insert code for my visitors

my line 645
Code: [Select]
$admin->print_error($database->get_error());
Title: Re: mpForm
Post by: jacobi22 on January 24, 2016, 11:10:03 PM
I got many problems with different websites after the mysql-upgrade, maybe it's because of this, that code in the two code-modules can't be saved in the database...

do you use the latest version of this module?
http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?filter=Code%202&id=0C49DE21

this works for me without problem in SP5 under PHP 5.6.x or PHP 7.0.1 and mysql-strict mode also (Mysql 5.6.21)
Title: Re: mpForm
Post by: Mux on January 24, 2016, 11:11:35 PM
There is no more than this message.  And correct,  in my case,  the message is sent but no insert.  And because the error message appears and no confirmation for the sent message the visitors think that the message has not been sent and try it again...
Title: Re: mpForm
Post by: Mux on January 24, 2016, 11:13:02 PM
I used 1.04 and then upgraded to I think 1.18, but same in both versions
Title: Re: mpForm
Post by: Martin Hecht on January 25, 2016, 10:26:13 AM
Maybe the database structure got screwed up during the update? I think it's worth trying to make a backup of the database, drop the tables and play back the data from the backup.
If this is not an option for you, you could create a new form with the same fields and test it there. Due to the new section_id of the new form the results go into a new table which might have not these problems.
Title: Re: mpForm
Post by: Mux on January 25, 2016, 01:32:33 PM
what I don't understand is, what's this mpform_results for? The message is stored in mpform_submissions and in the backend I can see all messages. So what is mpform_results for? Can I ignore it?
Title: Re: mpForm
Post by: Mux on January 25, 2016, 01:43:42 PM

my line 645
Code: [Select]
$admin->print_error($database->get_error());[/quote]

When I changed the code to this line, I get a "field does not have a default value" - so this is a typical error message in strict mode....
So I tried to set the field's standard values to NULL in phpmyadmin -> that's also not working and ends up with an error message within phpmyadmin:

 Abfrage-Fehler:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=utf8 COLLATE utf8_general_ci NULL DEFAULT NULL' at line 1

arrghh... :-o :oops: :oops:  :|
Title: Re: mpForm
Post by: Mux on January 25, 2016, 01:49:14 PM
now I changed the INSERT statement to

$qs = "INSERT INTO ".TABLE_PREFIX."mod_mpform_results_$suffix (session_id, started_when, referer, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12, field13) VALUES ('$us', '$started_when', '". $_SESSION['href'] ."','','','','','','','','','','','','')";


this works successfully...
Title: Re: mpForm
Post by: jacobi22 on January 25, 2016, 02:27:21 PM
this works for exactly this used form with exact this number of fields, but not in another form with more or less fields
my personal opinion is: for the actual database table structure you need a for each loop for a empty insert of every submitted field (like your example, but dynamic)
or set a default value for the fields in the result-table

P.S. your insert-example shows my, that its a mysql-script-problem (needs definition for every submitted field) - and it show's me also, that my script to ask for the sql-mode doesnt work  :roll:

P.S.: Martin Hecht offert a new version of the module, but its need a lot of work and a lot of input from the users and maybe also any brain storming about the best solution for some problems like this with the sql-mode
Title: Re: mpForm
Post by: Mux on January 25, 2016, 02:38:38 PM
this works for exactly this used form with exact this number of fields, but not in another form with more or less fields
Yes I know,  it's only a solution for me....
Quote
P.S. your insert-example shows my, that its a mysql-script-problem (needs definition for every submitted field) - and it show's me also, that my script to ask for the sql-mode doesnt work  :roll:
Yes,  I noticed this ;-)
[/quote]

The bad thing is that this problem is happening for nearly all modules and as I have a couple of websites it's really a lot of manual work to fix it all :-(
I already tried a work around by temporally switching off the strict mode but it did not work,  maybe I inserted the necessary code in a wrong file...
Title: Re: mpForm
Post by: Ruud on January 25, 2016, 02:43:12 PM
The bad thing is that this problem is happening for nearly all modules and as I have a couple of websites it's really a lot of manual work to fix it all :-(
I already tried a work around by temporally switching off the strict mode but it did not work,  maybe I inserted the necessary code in a wrong file...

I had some good results with adding the next line to the config.php (below the last line calling initialize.php)
Code: [Select]
$database->query("SET SESSION sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");
Title: Re: mpForm
Post by: Martin Hecht on January 25, 2016, 02:49:47 PM
P.S.: Martin Hecht offert a new version of the module, but its need a lot of work and a lot of input from the users and maybe also any brain storming about the best solution for some problems like this with the sql-mode

at the moment I have a few other things in the queue, but yes, I recognize that sql strict is becoming more and more common. I have noted your settings for enabling it in my test environment, and definitely, I'll start with mpform when going through the modules and making them "future-proof".
We can  also collect modifications here in the forum and I can merge them into a fork of my current source-tree which then can replace the current module, once it has become stable.
Title: Re: mpForm
Post by: jacobi22 on January 25, 2016, 03:44:59 PM
I had some good results with adding the next line to the config.php (below the last line calling initialize.php)
Code: [Select]
$database->query("SET SESSION sql_mode = 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");

from my point of view: this cannot be the (official) solution
of course - it works, but mysql and the providers offert this strict mode as a "secure feauture" on more and more providers used this mode now and if i switched off and my provider shows me, this was the entry for a hacker, i lost my account and have to pay for the trouble on other domains on the same server. maybe, its allowed in other countries, but i see some possible trouble with the rules in germany

the core and his modules works in strict mode and for some small modules like bookmark, color4code, code2 we found (together with the module autors) a solution and build a upgrade, but its not possible for all the modules at the same time. i talk also with some autors of other modules and not everybody means, a upgrade for mysql-strict-mode make sense  :roll:
so, what can i do? build my own module fork?  :roll: :roll: No, thats not my way

the target must be: all modules in addon area works in strict mode!
not today or tomorrow, but in the next half year
Title: Re: mpForm
Post by: Martin Hecht on February 03, 2016, 05:53:10 PM
Hi,

first of all sorry for the delayed reply.
what I don't understand is, what's this mpform_results for? The message is stored in mpform_submissions and in the backend I can see all messages. So what is mpform_results for? Can I ignore it?
actually, this is a good question. I have been talking to the former developers of the module (except for Frank who is not active in WB anymore). The only note I can find in the Changelog is Frank's comment in the very first version when he forked mpform. The results tables actually are not read at all in the module. It might be an interface to other modules (maybe shops?) which query these submissions from the results tables. But that's just speculation. Maybe it's simply unfinished code which we could strip off.
If anyone has some more insight into the purpose of the results tables, please contact me. Otherwise I would start to clean up the code of mpform with the goal to achieve sql strict compatibility and more stability. I'm pretty sure this can not be done over night, but let's say at some point in the near future.

Martin
Title: Update: mpForm
Post by: Martin Hecht on February 21, 2016, 08:22:13 PM
no response about the results-tables so far? well... ok. maybe we can remove it in a future release, but for now I have an update:
- this update does not overwrite the css files and the private functions anymore. At some point in the past this feature got lost.
- in the latest version 1.1.20 you can configure the replyto-address now. This was a feature request by user "noname8"

Title: Re: mpForm
Post by: instantflorian on March 07, 2016, 08:27:22 AM
The "email recipient" feature does not work, unfortunately.
I tested with WB 2.8.3 SP6 and "the other one"™.
I entered the example adresses from the backend (btw, it should be reading "staff" and not "stuff", in english, I think, and maybe one should better use "example.com" as placeholder domain), and just email adresses without names. In all cases, the select box does not work, for each address only
Code: [Select]
<option value=""></option>is created.
If I switch on PHP error messages, I get
Quote
Notice: Undefined offset: 2 in /.../modules/mpform/paintform.php on line 32
Warning: explode(): Empty delimiter in /.../modules/mpform/paintform.php on line 35
Notice: Undefined offset: 0 in /.../modules/mpform/paintform.php on line 46
for each possible entry.
Problem seems to be caused at line 433 of paintform.php
Code: [Select]
array_walk($options, 'make_option', array((isset($_SESSION['mpf']['field'.$iFID])?$_SESSION['mpf']['field'.$iFID]:array()), false));It would be nice if you could have a look at it.
Title: Re: mpForm
Post by: Martin Hecht on March 07, 2016, 10:21:30 AM
Problem seems to be caused at line 433 of paintform.php
you are right. An updated package is attached. I forgot to add the new parameter $value_option_separator at this particular place  in release 1.1.15.
Title: Re: mpForm
Post by: instantflorian on March 07, 2016, 10:38:05 AM
Thank you, now it works
Title: Re: mpForm
Post by: Luisehahne on March 07, 2016, 05:18:29 PM
Hello Florian,


By using this forum, you agree to the following terms and conditions:

Account Signatures
The following rules apply to account signatures:

    Only use one picture if you need it, maximal size: 600x100 Pixel and 20kb.
    The “most important rules” of course are also valid here.
    Only 1 normal, non-commercial link to a WB-site is allowed. Shortened links are not allowed (tinyurl, etc)

So please, remove your signature, i have no fun to ban users.

Dietmar

Title: Update: mpForm
Post by: Martin Hecht on March 23, 2016, 11:56:24 AM
- I have noticed that I had a mistake in the notation of the html special characters with acute-accents. This affected the French language support. I have corrected this in the attached release.
Title: Re: mpForm
Post by: jacobi22 on March 23, 2016, 03:23:21 PM
links in the help are wrong
Title: Re: mpForm
Post by: Martin Hecht on March 23, 2016, 04:05:26 PM
links in the help are wrong
I know. I have downloaded the old documentation, but I still have to update it. And I'm still busy with the major mpform upgrade which will then include the documentation. I have already cleaned up large parts of the code, but one thing I still have on the agenda is to make it sql-strict-compatible, and developing a mechanism to repair/recreate the results tables. The release posted today is just a bug fix the French language file.

BTW: I have found the answer what the results-tables are good for: It's indeed an interface to access the posted data, either from another module, or by exporting the tables using the csv-export module.

Another point: Does anybody have a backup of the import-section and export-section modules?

Cheers, Martin
Title: Re: mpForm
Post by: Ruud on March 23, 2016, 04:10:24 PM
Another point: Does anybody have a backup of the import-section and export-section modules?

Found these two, not sure if they are the latest..
Title: Re: mpForm
Post by: robo77 on March 24, 2016, 09:52:28 AM

Another point: Does anybody have a backup of the import-section and export-section modules?

I have found these versions...
Title: Re: mpForm
Post by: Martin Hecht on March 24, 2016, 02:51:58 PM
Great. According to archive.org (https://web.archive.org/web/20150908014326/http://wbdemo.heysoft.de/pages/de/export-import.php) the latest ones were 0.2.4 - but these are at least better than nothing (because the zip files have not been archived there)
The reason why I'm looking for these modules is that the old mpform documentation contains a few pages that rely on them, e.g. here (https://web.archive.org/web/20150502192537/http://wbdemo.heysoft.de/pages/de/mpform/standardformular-installieren.php), and I think it makes sense at least to look at these "helper" modules as well. I'm not eager to maintain more modules, but maybe I can include the needed functionality into mpform (i.e. importing and exporting forms). I'll  have a look.
Title: Re: mpForm
Post by: dbs on April 05, 2016, 05:00:18 PM
Hi, my error_log is full of missing success.png which is called in /modules/mpform/ajax/jNotify.jquery.css
Can you confirm this?
Title: Re: mpForm
Post by: jacobi22 on April 05, 2016, 05:30:18 PM
Quote
Hi, my error_log is full of missing success.png which is called in /modules/mpform/ajax/jNotify.jquery.css

missings pics only visible for one or two second after a ajax-action - simple solution is : edit the /modules/mpform/ajax/jNotify.jquery.css and use there the three images from the mpform-images-folder
this images has a size from 16 x 16

the original images to this script has a size from 22 x 22
Title: Re: mpForm
Post by: Martin Hecht on April 06, 2016, 09:19:26 AM
Hi, my error_log is full of missing success.png which is called in /modules/mpform/ajax/jNotify.jquery.css Can you confirm this?

it seems these images got lost at some point back in the past - or, more likely, they were never included.

An updated version of the module is attached. It contains the original jnotify images.
I have also updated the links for the documentation, pointing to the web archive now (it's really just a workaround until I have a major update for the module ready).
Title: mpForm Update
Post by: Martin Hecht on July 28, 2016, 11:08:50 PM
promised long ago and finally finished: Here is the major update of the mpForm module with the following changes:

New Features
------------

In the backend of the module you can import and export the whole form
(including all fields and settings) as xml file. The submissions and
results tables however are not exported. This mechanism can also be
used to install the standard forms which is available together with
the documentation (sse below).

There is a new wizard now, which allows to populate html code sections
such that div-sections are shown or hidden, depending on the current
selection of another form element of your choice. They are called
conditionally displayed blocks. They are not really a field type
but you can easily populate a html code block with sophisticated
code, which you can distribute later across several html sections
in order to show/hide whole parts of the form.

Hidden fields are now available for inserting data into the form
submission which is hidden to the user - this can be useful for handing
over data between different pages of multi page forms.

Italian language support has been added and the language support in the
Ajax helpers has been improved.

Feature Enhancements
--------------------

The switch to enable/disable fields is available to all field types now,
including html code and headings.

In the past the results tables often were a source of trouble. In this
version of mpform their structure is always kept up to date. If you happen
to change the suffix for the results table in the settings, add or copy
fields the table is created or the column is inserted if needed.

Additionally, if you wish not to make use of the results tables at all,
you can disable them completely by setting the suffix to the string
"DISABLED".

For html code fields there is a new switch which allows to specify where
the code shall be used: In the form on the web page, in the html code
for the site owner, and/or the html code for the user confirmation.

In html code sections normal html comments can be inserted which are
shown in the output as well, but as a new feature, if the inner part
of the html comment is additionally commented out with php comments,
it is suppressed in the output: <!--/* vanishing comment */-->

API Changes
-----------

The private functions take more arguments now, because the mpform
module does not make use of global variables anymore. Of course, the
usual globals like the database object and the superglobals like the
session are available. For details see the private.default.php .
The examples are more detailed now and better commented.


Documentation
-------------

The documentation has been updated and included in the module.
(unfortunately the forum software forced me to split it up again into
separate zip files - you can copy the content of the documentation
into the module in a folder called "docs" so that you can call it from
the backend. You might want to protect that directory via .htaccess).

Bug fixes
---------

The results tables are correctly removed now, when a mpform section is
removed. In the past unused results tables were kept in the database
after removing the forms until one eventually uninstalls the module.
This change also implies that you should make a backup of the submissions
when you remove the form. The results table is of course kept in the case
when multiple forms write to the same results table.


General Changes
---------------

Promised a long time ago and finally finished: The module works in sql
strict mode now.

In general the code has been reworked a lot. Long lines have been wrapped
and properly indented for better readability of the code and to assist
users when they try to identify a bug. It is not a complete rewrite of the
code but nearly. Module specific global variables are not used anmore.

Old code for WB 2.7 has been removed and code for backwards compatibility
to versions of WB 2.8 earlier than 2.8.3 have been made consistent throughout
the whole code. IDKEY and FTAN are two examples. These features are only
used when the core supports them. In general it is not recommended to
run old versions without such security features. But anyhow, in the previous
versions of mpform, there were checks which allowed to run without them,
but not in all parts of the module.

When sending http headers to redirect the user to another page, there is
an additional check now, if the headers have already been sent. If so,
an alternative redirection link is presented to the user. This can help
when other modules/snippets interfere with the way how the content is
buffered or sent to the user.


...please test if everything works again as expected...
Title: mpForm Documentation
Post by: Martin Hecht on July 28, 2016, 11:10:19 PM
here the updated documentation in German (I have to post it separately, sorry)
Title: mpForm Documentation
Post by: Martin Hecht on July 28, 2016, 11:11:28 PM
and here the English version of the doc
Title: Re: mpForm
Post by: dbs on July 29, 2016, 07:32:51 AM
Hi, before i download again, have you fixed the module? there are in all files a text-area bevor php-code.
Title: Re: mpForm
Post by: Martin Hecht on July 29, 2016, 01:29:19 PM
Hi, before i download again, have you fixed the module? there are in all files a text-area bevor php-code.
I don't quite understand. All php files start with the string
Code: [Select]
<?php
and there is no other text before that (maybe there was, in very old versions). There is a header comment, but that's commented out in php and should not disturb at all, or did I miss something?
Title: Re: mpForm
Post by: jacobi22 on July 29, 2016, 02:00:54 PM
please look into the zip-file from your last here  ;-)

a screenshot from add.php, the php-section starts here in line 37. in some file are shorter text, in other are longer text, but its in nearly every file

(https://i.gyazo.com/e7b01a2d30faa7f01224fd049386dacf.png)

i think, the captcha-patch is not longer needed. if i remember correct, the problem exist only in 2.8.3 (Rev 1611) and 2.8.3 SP1 (Rev 1638) and was fixed in the next versions

P.S.:  a very big image... sorry, but i cannot change the image size :|
Title: Re: mpForm
Post by: Martin Hecht on July 29, 2016, 02:34:40 PM
oh, damned, something in the build process went wrong. Also the link to the documentation in the backend didn't correctly redirect.
both is fixed in the attached version. sorry, it was late yesterday
Title: mpForm Update
Post by: Martin Hecht on August 02, 2016, 10:53:34 PM
I have received the feedback that in the new private.default.php a curly brace was missing.
This is fixed in the final version of the 1.2 branch now.
Also I have noticed that the help link in the backend didn't work correctly under all circumstances.
I have pushed the release to github now:

https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.2.1

From there you can download a full package which includes the module and the documentation in German and English.
Unfortunately I can't post such a zip file here due to the limitation of the forum settings.
Title: mpForm update
Post by: Martin Hecht on August 21, 2016, 12:18:57 AM
I have updated mpForm on the github repo:
https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.2.3

for convenience I have also attached the (smaller) zip archive which does not include the documentation (However, there were no changes to the docu this time), just a few minor fixes to the code:

  -      fix query for position in upgrade script, thanks to norhei for reporting
  -      fix drag and drop in ajax helper, thanks to florian for reporting
  -      honor redirection_timer in ajax notifications, thanks to florian for this hint
  -      two typo fixes in view_submissions, thanks to norhei for reporting

Cheers, Martin
Title: Re: mpForm
Post by: noname8 on October 11, 2016, 10:14:57 AM
I upgraded from old version 1.1.17
and worked nice, but missed couple images, import.png, export.png
but found those from the master, thanks!
Title: Re: mpForm
Post by: jacobi22 on October 11, 2016, 11:24:28 AM
i add this pictures to the Download-Version in Addon-Area -> http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411
Title: Re: mpForm
Post by: Martin Hecht on October 11, 2016, 04:06:50 PM
...but found those from the master, thanks!
yes, the github is a little bit beyond the 1.2.3 version published here. Based on the feedback that I have received I'm currently working  on a new release which will hopefully be ready soon.
Title: mpForm Update
Post by: Martin Hecht on October 16, 2016, 12:16:02 AM
I have prepared a new version of mpForm:

Release Notes for mpForm 1.3.x

General Changes
---------------
By default switched to a div-based layout. All pages created with earlier versions
of course keep their layout as it is (by default it was a table based layout in the past)

The style file has been cleaned up and a few new definitions have been added
for the help popup dialog in div-based layout. Remember to copy the default style
files manually (or merge the changes into your local modifications) in order to
pick up the improved style settings.

New Features
------------
In multi page forms the access to following pages is denied to all following pages
unless the previous page has been submitted successfully

Feature Improvements
--------------------
In multi page forms submissions are handed over between the individual pages so that
the last page can send confirmation mails about all the submissions of the current page
and now also all previous pages. The data is stored in the session indexed by the
submission id and could in principle be used in the private functions as well.

The {HELP} placeholder works not only in table based layouts, but in general now.

French and Italian language support did not cover the error messages in the pear
file uploader tool. These missing language files have been added now.

Security Enhancements
---------------------

IDKEYs were not used throughout the module. In fact they were only used when
Javascript and therefore Ajax was disabled. Now the Ajax-Helpers also use IDKEYs.
Also the Noscript-fallbacks for moving fields up and down use IDKEYs now.

Documentation
-------------
The feature changes described here are also reflected in the documentation.
The standard forms have also been updated and are based on div-layout now.

Bug fixes
---------
In the 1.2.x releases the icons for import/export for these buttons have been missing.
Now they are included in the module package.

The ajax drag&drop helper did use a wrong url for a icon in one of the message boxes.
It has been corrected now.

A few other minor fixes in Ajax-Helpers, and their Noscript-fallbacks.

Due to the limitations of the forum I have to provide the documentation in a separate zip Archive
Title: Update of the German Documentation
Post by: Martin Hecht on October 16, 2016, 12:17:35 AM
here the updated German Documentation
Title: Update of the English Documentation
Post by: Martin Hecht on October 16, 2016, 12:19:08 AM
and here the English documentation package
Title: mpForm Update
Post by: Martin Hecht on October 16, 2016, 12:35:34 AM
the full package mpform 1.3.0 including the documentation is available at github (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.0) now
Title: Re: mpForm
Post by: jacobi22 on October 16, 2016, 10:31:35 AM
and also in our addon area here -> http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?filter=mpform&id=0A702411
Title: Re: mpForm
Post by: Martin Hecht on October 20, 2016, 09:42:01 PM
I have just pushed an updated version to the github-repository (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.1)

from the changelog (only changes between 1.3.0 and this release):
        add export for results table
        introduce constants.user.php and move the defaults for the field loop there
        let delete_submission.p hp also delete entries from the results table
        for this, also introduce submission_id in new results tables
        fix javascript bug in view_submission.php
        update documentation, especially the faq page

For a more prosa-like version see the description at the above-link. It is however a combined description of all changes in the 1.3.x branch with respect to prior versions.
Title: mpForm Update
Post by: Martin Hecht on December 08, 2016, 10:49:53 PM
I have released a new version of mpForm on github (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.2).

here the changelog
        fix language files (thanks to florian for reporting)
        merge Bugfix for deleting fields in backend (Dietrich Roland Pehlke: 14-Nov-2016)
        added maxlength option for textareas (thanks to alexx for suggesting)
        add place holder {EMAIL} within mail templates (thanks to John for suggesting)
        introduce field templates to locally override the field loop if desired
        support mod_opf_Email as a replacement of the classical email output filter
        updated documentation in a few places and the hints in the backend
        highlight missing required radio/checkbox fields (thanks to alexx for reporting)
        keep uploaded files when returning to paintform (thanks to alexx for suggesting)
        correctly enclose  body in tags in html mails (thanks to astrid for reporting)
        add more css classes for more styling flexibility (gottfried, florian)
        insert newlines in xml export for better readability (request by gottfried)
        insert field number in backend overview (thanks to gottfried for suggesting)

cheers, Martin
Title: mpForm Update
Post by: Martin Hecht on December 21, 2016, 11:37:07 PM
I have updated mpForm to Version 1.3.3 on Github (https://github.com/WebsiteBaker-modules/mpform)

here the change log entry:

        *** 1.3.3 (Martin Hecht: 19-Dec-2016) ***
        fix the local template so that indeed all place holders are allowed there
        introduce {TEMPLATE1} ... {TEMPLATE9} for a single line of the local template
        correctly decode html special characters for html emails (thanks to astrid)
        allow to specify success_email_from by field or by logged on user (astrid)
        for consistency also allow to specify success_email_fromn ame by field
        fix missing single quote in most of the language files (thanks to colinax)
        allow to select multiple name fields for the sender name (astrid)
        allow place holders {FIELD...} in subject lines (request by astrid)
        fixed default form footer and correctly implement place holder {SUBMIT}
        correct the html code in the backend template for the basic settings
        offer a setting for user defined classes inside the fields and
        introduce place holder {FORMATTED_FIELD} in the field loop for that (florian, gottfried)
        avoid collision of the {TEMPLATE} place holder with the template for heading fields
        correctly detect if we use table layout or not for the output of headings
        repair update script to add the column for the field template (colinax)
        avoid multiply including the department in notification mails
        trim email_to when saving basic settings
        update documentation and example forms
Title: mpForm Update
Post by: Martin Hecht on January 30, 2017, 08:14:30 PM
Hello,

I have just published an update for mpform on Github (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.4)

implemented feature requests:
    allow use of {TEMPLATE} place holders in notification mails (request by gottfried)
    implement css for mails (to site owner and to submitter)
bugfixes:
    fix warning in disabled file upload fields (thanks to dbs for reporting)
    fix warning when saving fields

cheers, Martin
Title: Re: mpForm
Post by: hgs on January 31, 2017, 12:16:25 PM
Or in the addon area
http://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411
Title: Re: mpForm
Post by: jacobi22 on January 31, 2017, 11:00:43 PM
@hgs: bitte vorher in das ZIP schauen. Das Paket von GitHub ist keine in WB installierbare Datei. Github baut systembedingt einen Ordner mit Modulnamen um die Dateien, der mit gezippt wird. Dadurch stimmt die Struktur nicht mehr, die WB und die Forks erwarten
Habe das Paket heute mittag ausgetauscht (31.01.17)

@ Martin: bitte in den nächsten Versionen übernehmen

evalform.php  ~Zeile 173
erstellt ein Sendeprotokoll mit eingeschaltetem DEBUG-Modus. Weitere Info in class.phpmailer.php * Zeile 318

Code: [Select]
$myMail->set('SMTPDebug', ((defined('DEBUG') && DEBUG)?2:0));    // Enable verbose debug output
$myMail->set('Debugoutput', 'error_log');

Nach Stand heute wird es mit der nächsten WB-Version Probleme mit mpForm geben  - aber möglich, das sich noch etwas ändert
Title: Re: mpForm
Post by: hgs on February 01, 2017, 08:32:33 AM
Danke, bist der Beste. (Y)
Title: Re: mpForm
Post by: Martin Hecht on February 01, 2017, 06:55:15 PM
Hallo,

Github baut systembedingt einen Ordner mit Modulnamen um die Dateien, der mit gezippt wird. Dadurch stimmt die Struktur nicht mehr, die WB und die Forks erwarten
ja, leider. Aber man kann glaub ich den Link nicht so angeben, dass github das anders packen würde. Und hier im Forum gibt es das 512 kB Limit. Zusammen mit der Doku krieg ich das Modul nicht so klein gequetscht.

Quote
@ Martin: bitte in den nächsten Versionen übernehmen...
hab ich mir vorgemerkt

Quote
Nach Stand heute wird es mit der nächsten WB-Version Probleme mit mpForm geben  - aber möglich, das sich noch etwas ändert
kannst du mir Detials zukommen lassen? Was genau wird sich ändern und wie muss ich mpForm anpassen, damit es unter der nächsten Version noch läuft?

viele Grüße,
Martin
Title: Re: mpForm
Post by: jacobi22 on February 01, 2017, 08:14:36 PM
Github baut systembedingt einen Ordner mit Modulnamen um die Dateien, der mit gezippt wird. Dadurch stimmt die Struktur nicht mehr, die WB und die Forks erwarten
ja, leider. Aber man kann glaub ich den Link nicht so angeben, dass github das anders packen würde. Und hier im Forum gibt es das 512 kB Limit. Zusammen mit der Doku krieg ich das Modul nicht so klein gequetscht.

laß mal die Methode so, wie sie ist. Link zu GitHub posten reicht vollkommen.  (Y)
Title: Re: mpForm
Post by: DarkViper on September 28, 2017, 09:54:44 PM
**push**
Title: Re: mpForm
Post by: hgs on September 29, 2017, 07:48:30 AM
neuste Version von mpForm 1.3.10 unter der neuen Version von WB erfolgreich getestet.
Title: mpForm
Post by: Martin Hecht on September 29, 2017, 10:09:31 AM
Hi,

nachdem der Foren-Thread jetzt wieder offen ist (Danke an DV), kann ich die von hgs erwähnte neue Version 1.3.10 (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.10) auch ankündigen. Momentan gibt es sie auf github und man muss wie dort üblich erst die Dateien entpacken und in ein neues Zip mit flacherer Verzeichnisstruktur wieder einpacken.

Es sind ein paar Kleinigkeiten gefixt:

Beim Anlegen von Feldern sollte es nun egal sein, ob zuerst Feldname oder Feldtyp ausgewählt wurde. Das war zwar bisher auch der Fall, nur musste man nach Eingabe des Namens noch die Textbox mit dem Cursor verlassen (z.B. durch Drücken von TAB), um den Speichern-Button aktiviert zu bekommen. In der neuen Version reicht es auch, mit der Maus über den Speichern-Button zu fahren (was man ja macht, wenn man diesen anklicken will).

Das upgrade-Skript prüft jetzt am Anfang gleich ob die Konstante TP_MPFORM definiert ist und ob es eine dazu passende Settings-Tabelle gibt und gibt klare Fehler aus,wenn eines von beiden nicht erfüllt ist. Wenn jemand TP_MPFORM umdefiniert hatte und diese Einstellung beim Upgrade verloren ging, dann hat das in der Vergangenheit zu nicht ganz leicht verständlichen Fehlern geführt :-)

Ein Leerzeichen hat in der Ausgabe von Email Input Feldern im erzeugten HTML code gefehlt (github issue #4 (https://github.com/WebsiteBaker-modules/mpform/issues/4))

Eine Version des Moduls, bei der die Dokumentation nicht enthalten ist, hänge ich mit an diesen Post an (mit Doku wäre das Zip zu groß fürs Forum, aber an der Doku hat sich diesmal auch nix geändert).

Martin
Title: Re: mpForm
Post by: hgs on September 29, 2017, 11:53:00 AM
oder komplett im addon-Bereich
https://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411
Title: Re: mpForm
Post by: CodeALot on September 29, 2017, 02:00:10 PM
Fails to install, no error messages. Just freezes. Directories are written, but module is not visible in WB backend.  ( WB 2.10.0 ) ( PHP 5.6 )
Title: Re: mpForm
Post by: Martin Hecht on September 29, 2017, 02:18:55 PM
strange. I have just upgraded mpform on one of my sites with the package that I have downloaded again from the addons repo.
Do you have any log entries that give a hint on what exactly went wrong in your case?
Can you reload the installed modules and run the upgrade/install script manually?
(BTW: you did a fresh install of the module, right? so i will have to try to uninstall and install again)
Title: Re: mpForm
Post by: dbs on September 29, 2017, 02:21:14 PM
Fyi. Can't confirm. 2x fresh install in 2.10 with PHP 7 & 5.6. No problems.
Title: Re: mpForm
Post by: CodeALot on September 29, 2017, 03:08:27 PM
Fresh WB 2.10.0, MPForm installed through "Extras", returns blank page. MPForm does not show in the list of installed modules
Back into "Extras", "Advanced", rescan modules, MPForm shows up in the list of installed modules.
Created testpage with the MPform module, OK
Tried to remove the page with the MPForm module - Failed
Manually had to remove the directory /modules/mpform and rescan modules in Extras before I could delete the page containing the MPForm section.
 
Test site is located in a SUBdomain. Haven't tried other installs yet.
 
EDIT: Tried another FRESH install of WB 2.10.0 on another domain, tried MPForm -> Exactly the same behaviour. Sorry.
NO entries in errorlogs. It just freezes on install.
Title: Re: mpForm
Post by: dbs on September 29, 2017, 03:34:31 PM
Quote
Test site is located in a SUBdomain.
Hm, next test in a subdomain (PHP7), also no problems.
Maybe the problem is not 2.10 or mpForm. You have no other problems on this installation?
Title: Re: mpForm
Post by: jacobi22 on September 29, 2017, 06:27:58 PM
pls look in your infowindow to the (Mysql-) Server-Version - is STRICT MODE activated?, looks like

Server-Version: 10.1.21-MariaDB [STRICT]
Title: Re: mpForm
Post by: CodeALot on September 29, 2017, 06:56:31 PM
"Strict mode   MySQL strict mode not active"
 
Nope. No other issues with this installation, now with 16 modules loaded :)
Title: Re: mpForm
Post by: hgs on September 30, 2017, 04:27:49 PM
Just once again an installation on a WB 2.10.0 test page with php5.6 successfully done. No problem.
https://56.umojasingers.de/pages/mpform.php
Title: mpform updated
Post by: Martin Hecht on October 17, 2017, 10:37:29 PM
Hi,

I have just released a new version 1.3.11 on github (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.11). Here the changelog:

        *** 1.3.11 (Martin Hecht: 17-Oct-2017) ***
        add option to select server email for sender email
        by default use this new option when creating a new form
        update documentation and sample forms
        correctly assign css for site owner and for user mails (thanks to florian)
        for headings add the possibility to suppress them in the mails (request by blitzliht12)
        introduce css classes depending on the field type also in the confirmation mails

as usual with github repos: you  would have to unzip it, enter the directory and zip the files again in order to create an archive with a flatter directory structure, so that WB understands it.

best regards
Martin

PS: If anyone finds out the root cause in mpform for the problems reported here, I would be glad to provide an improved package.
Title: Re: mpForm
Post by: hgs on October 18, 2017, 07:42:31 AM
WB format in the add-on area
https://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411
Title: mpForm update
Post by: Martin Hecht on January 09, 2018, 01:32:39 PM
Hi,

I have released Version 1.3.16 (http://forum.WebsiteBaker.org/index.php/topic,28496.0.html) on github.
It contains a fix for an upcoming wb version

cheers, Martin

PS: the intermediate versions contain changes which I did not announce here because they fix an issue with a specific fork of wb
Title: Re: mpForm
Post by: hgs on January 09, 2018, 01:58:31 PM
WB format in the add-on area
https://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411
Title: Re: mpForm
Post by: dbs on February 02, 2018, 11:02:08 PM
Hello, i use mpform 1.3.16 in WB 2.10 and the section is in the middle of the page.
After submitting the form the page reload kicks the page to the top. The user can't see any message from form.
I think the anchor in paintform.php line 337 is wrong:
Code: [Select]
. $sActionAttr .'#wb_section_'.$iSID.'" method="post">'.PHP_EOL;should be:
Code: [Select]
. $sActionAttr .'#wb_'.$iSID.'" method="post">'.PHP_EOL;
Title: Re: mpForm
Post by: jacobi22 on February 03, 2018, 12:16:31 AM
you can use thy dynamic SEC_ANCHOR instead of a hard-coded anchor
add this line before you call the form
Code: [Select]
$sSectionIdPrefix = (defined( 'SEC_ANCHOR' ) && ( SEC_ANCHOR != '' )  ? SEC_ANCHOR : '' );
example-code

Code: [Select]
. $sActionAttr .'#'.$sSectionIdPrefix.$iSID.'" method="post">'.PHP_EOL;
Title: Re: mpForm
Post by: Martin Hecht on February 07, 2018, 10:44:26 PM
you can use thy dynamic SEC_ANCHOR instead of a hard-coded anchor [...]

Hi,

I have just drafted a new release 1.3.17 (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.17) on github which contains this approach (thanks to jacobi22), and also the fix for the French language file and a fix when running in debugging mode with disabled idkeys

Martin
Title: Re: mpForm
Post by: dbs on February 07, 2018, 11:34:44 PM
Hi, there is a dot missing in paintform line 339
Code: [Select]
<?php
   
$sActionAttr .'#'$sSectionIdPrefix.$iSID.'" method="post">'.PHP_EOL;

In some installations no section anchor is in use (WB settings > section anchor: none).
They  can't use this nice feature.  :-)


Title: Re: mpForm
Post by: jacobi22 on February 07, 2018, 11:52:25 PM
@dbs: only, to say it: your solution in #112 was also a dead solution, because, there is no anchor in the source for the mpform-output..  :roll:

maybe, the best solution is a hardcoded anchor in combination with the Section-ID like this

(paintform.php  Ln 338 + 339)
Code: [Select]
echo '<form name="form_'.$iSID.'" id="form_'.$iSID.'"  enctype="multipart/form-data" action="'
            . $sActionAttr .'#form_'.$iSID.'" method="post">'.PHP_EOL;
Title: Re: mpForm
Post by: Martin Hecht on February 08, 2018, 12:24:28 AM
Hi,

damned, again I should have tested this before making it a release.
First, I didn't notice the missing dot, although I did compare the lines of old and new code. But well,  a dot is quite small ;-)
Second, I thought the anchor would be added by WB around the section. What about this fix on current master (https://github.com/WebsiteBaker-modules/mpform/commit/9ebb5f194058fd0fc168c51ca3795620ba9f490e)?

Good night, Martin
Title: Re: mpForm
Post by: jacobi22 on February 08, 2018, 01:17:46 AM
if the section anchor in the advanced wb-settings is defined as "none", wb will not build the "normal", wb-typical  section anchors around every section.
some users report's problem with the anchors, if they use a accordion etc, that why the possible settings "none" for "No Anchor"

with a setting "section anchor = none", you get a action-url in my case (with short-url) like this
Code: [Select]
action="/mpform/#none_245"
and as result (for me) a 404 in the redirect, because, there is no valid ID with this "none_245" somewhere - the name-attribute in the form-tag is not supported by HTML5
you have to set a id instead of the name for the anchor (like my example). see also the red marked line's here -> https://www.w3schools.com/tags/tag_a.asp

P.S.: see it in the source code now
the name-attribute has a underline, the action-url has no underline

Quote
<form name="form_245"  enctype="multipart/form-data" action="/mpform/#none245" method="post">
Title: Re: mpForm
Post by: dbs on February 08, 2018, 07:44:57 AM
Quote from: jacobi22
@dbs: only, to say it: your solution in #112 was also a dead solution, because, there is no anchor in the source for the mpform-output..  :roll:
My solution was the solution for my project. The anchor was the WB generated section anchor "wb_", but mpform expected a generated anchor like "wb_section_". Do you understand?

Quote from: Martin
But well,  a dot is quite small ;-)
Therefore we not talk about. ;-)
Title: mpForm update
Post by: Martin Hecht on February 08, 2018, 11:25:27 PM
Hi,

I have drafted another release 1.3.18 on github (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.18).

I hope that I have caught all cases for missing anchors now. mpform tries to add its own section anchor in cases when the framework does not do so. Now, this might be undesired behavior for some users, therefore I have added a configuration switch MPFORM_NO_ANCHOR in constants.php where you can  suppress this behavior. Then it tries the procedure proposed by jacobi22. However, when data is submitted successfully, the result page would not contain a form anymore. That's why I have tried hard to cover most cases with an anchor. btw, it is not the hard-coded wb_section_ anymore, but the globally adjustable section_anchor. So, I think this was the main bug: probably at some point in the past this was not adjustable, or at least the default setting was a different one.

I have also fixed another bug: When {HELPTXT} was used and this text contained links or images, the quotes inside the links were escaped by an additional backslash which should not be there.

kind regards,
Martin
Title: mpForm update
Post by: Martin Hecht on February 22, 2018, 08:24:20 PM
Hi,

I have drafted a new release 1.3.19 (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.19) with a couple of minor improvements:
        do not store entries in submissions table when template is left empty
        correctly clean up results table when limit of entries is reached
        allow moving options up and down (thanks to jonas for this suggestion)
        updated documentation, mainly appended faq

Martin
Title: Re: mpForm
Post by: jacobi22 on February 23, 2018, 12:06:40 AM
Module updated to vers 1.3.20 in Addons

Download (https://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411)
Title: Re: mpForm
Post by: Martin Hecht on March 18, 2018, 10:42:21 PM
Hi, I have just released version 1.3.21 (https://github.com/WebsiteBaker-modules/mpform/releases/tag/1.3.21) on github.

It contains the following fixes and improvements:
    correctly restore selected option fields containing commata from the session, thanks to jonas
    correct the documentation about enforcing choices by the user
    added hints about how to avoid storing submitted data (thanks to ice)

cheers, Martin
Title: Re: mpForm
Post by: hgs on March 19, 2018, 08:31:25 AM
Module updated to vers 1.3.21 in Addons

https://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411 (https://addon.WebsiteBaker.org/pages/en/browse-add-ons.php?id=0A702411)

A hint for Martin.
The button "Submit form" is not visible on the smartphone
Title: Re: mpForm
Post by: Martin Hecht on March 19, 2018, 09:43:41 AM
A hint for Martin.
The button "Submit form" is not visible on the smartphone
Hi Harald,
this might be a problem of the template or the Browser. I have just checked one of my pages with Firefox on Android and there I have seen the button. Can you send me a link to the form where you have observed this?
Title: Re: mpForm
Post by: paulchen on March 19, 2018, 11:14:36 AM
Hallo,
das ist zwar spezielles Thema zu mpform, ist mir aber bei der Installation der Version 1.21 (wieder einmal) aufgefallen:

Nach dem Durchlauf des Updates werden die Ergebnisse der Installation angezeigt. Dann schaltet die Anzeige wieder auf das WB-Backend zurück. Bei mir ist die Anzeige nur so kurz zu sehen, dass ich nicht mitbekomme, was hier angezeigt wird. Bei Fehlermeldungen habe ich somit keine Chance, einen Screenshot vom angezeigten Problem zu machen und dies beim Einholen von Hilfe zu posten.

Könnte man die Rückschaltung für alle (!) Erweiterungsinstall ationen nicht so gestalten, dass  man eine Taste drücken muss / eine Schaltfläche anklicken muss, um ins Backend zurückzukehren?

Sorry, wenn ich dies hier offtopic sein sollte...

mfg
Paulchen

Title: Re: mpForm
Post by: evaki on March 19, 2018, 11:48:04 AM
Das Thema wurde schon mal anderswo (https://forum.WebsiteBaker.org/index.php/topic,30560.0.html) angeschnitten. Ob die DEV da was" in Arbeit" haben? Mußt Du dort mal fragen.
MfG. Eavki
Title: Re: mpForm
Post by: Luisehahne on March 19, 2018, 12:15:01 PM

Könnte man die Rückschaltung für alle (!) Erweiterungsinstall ationen nicht so gestalten, dass  man eine Taste drücken muss / eine Schaltfläche anklicken muss, um ins Backend zurückzukehren?

Optionen->erweiterte Einstellungen->Allgemeine Optionen
zur Einstellung Weiterleitung nach: Wert -1 eingeben
Das wars

Dietmar
Title: Re: mpForm
Post by: evaki on March 19, 2018, 12:32:24 PM
Da bin ich wohl weit übers Ziel hinausgeschossen  :-)
Einstellung Weiterleitung nach: Wert -1 eingeben  (Y)

Title: Re: mpForm
Post by: paulchen on March 19, 2018, 11:19:25 PM
Optionen->erweiterte Einstellungen->Allgemeine Optionen
zur Einstellung Weiterleitung nach: Wert -1 eingeben
Das wars

Dietmar

Besten Dank, Dietmar! - Das ist genau das, was ich schon längere Zeit wollte.
Ich hätte doch früher fragen sollen  :roll:

Vielen Dank für diese Information.  (Y)

Und das will ich auch noch an dieser Stelle loswerden:
Mit der Version 2.11 hat ihr eine ganz tolle Arbeit abgeliefert. Ihr habt meinen aufrichtigen Respekt dafür - ich habe bisher noch kein Upgrade eines so umfangreichen Projektes erlebt, das - wie bei mir - ohne einen einzigen Fehler durchlief!

mfg
Paulchen