Author Topic: mpForm  (Read 9132 times)

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #25 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());                                
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
mpForm update - next attempt for version 1.1.15
« Reply #26 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

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
mpForm update
« Reply #27 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

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #28 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
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
mpForm update
« Reply #29 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

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #30 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)



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)

Can this be the problem? but is has nothing to do with the output from a list
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
Re: mpForm
« Reply #31 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.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
Re: mpForm
« Reply #32 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

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #33 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!!
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
mpForm update
« Reply #34 on: January 14, 2016, 12:22:23 PM »
I have created a new release which contains this fix for windows environments

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #35 on: January 14, 2016, 05:13:57 PM »
geht gleich in den Addon-Bereich (wenn Dietmar nicht schneller war), muß mich nur erst etwas sammeln  :|
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #36 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%;
}

Wer nicht will, findet Gründe, wer will, findet Wege.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
Update: mpForm
« Reply #37 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)

Offline Mux

  • Posts: 189
Re: mpForm
« Reply #38 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...

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #39 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!
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline Mux

  • Posts: 189
Re: mpForm
« Reply #40 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...

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #41 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?
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #42 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());
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline jacobi22

  • Posts: 5843
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: mpForm
« Reply #43 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)
Wer nicht will, findet Gründe, wer will, findet Wege.

Offline Mux

  • Posts: 189
Re: mpForm
« Reply #44 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...

Offline Mux

  • Posts: 189
Re: mpForm
« Reply #45 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

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 586
  • Gender: Male
    • meine Homepage
Re: mpForm
« Reply #46 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.

Offline Mux

  • Posts: 189
Re: mpForm
« Reply #47 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?

Offline Mux

  • Posts: 189
Re: mpForm
« Reply #48 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:  :|

Offline Mux

  • Posts: 189
Re: mpForm
« Reply #49 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...

 

postern-length