i found a little bug:
if you use mpform and you want to clone it:
1) in the mod_mpform_settings => field tbl_suffix there is the "old" section_id
2) if you clone the mpform and not modify any fields the table "mod_mpform_results_
SECTION_ID" is missing.
the $tpl_suffix in tool_doclone.php must look like this:
$tbl_suffix = addslashes($section_id);
And after the
$database->query("INSERT INTO ".TABLE_PREFIX."mod_mpform_fields (section_id, page_id, position, title, type, required, value, extra, help) VALUES ('$section_id','$page_id','$position','$title','$type','$required','$value','$extra', '$help')");
}
You must add a little code like this:
$results = TABLE_PREFIX . "mod_mpform_results_" . $section_id;
$s = "CREATE TABLE `$results` ( `session_id` VARCHAR(20) NOT NULL,"
. ' `started_when` INT NOT NULL DEFAULT \'0\' ,' // time when first form was sent to browser
. ' `submitted_when` INT NOT NULL DEFAULT \'0\' ,' // time when last form was sent back to server
. ' `referer` VARCHAR( 255 ) NOT NULL, ' // referer page
. ' PRIMARY KEY ( `session_id` ) '
. ' )';
$database->query($s);
// load field ID's
$sql = "SELECT field_id FROM ".TABLE_PREFIX."mod_mpform_fields WHERE section_id = ".$section_id;
$get_field_id = $database->query($sql);
while ($is_fieldid=$get_field_id->fetchRow()) {
$fieldSQL = "ALTER TABLE `$results` add `field" . $is_fieldid["field_id"] . "` TEXT NOT NULL";
$database->query($fieldSQL);
}
note: it's just a quick & dirty solution