Skip to content

Commit 0263d3c

Browse files
committed
Release v1.10.3
1 parent e6368ec commit 0263d3c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

upload/modules/Forms/module.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function __construct($language, $forms_language, $pages, $user, $navigati
2323

2424
$name = 'Forms';
2525
$author = '<a href="https://partydragen.com" target="_blank" rel="nofollow noopener">Partydragen</a>';
26-
$module_version = '1.10.2';
26+
$module_version = '1.10.3';
2727
$nameless_version = '2.0.1';
2828

2929
parent::__construct($this, $name, $author, $module_version, $nameless_version);
@@ -442,6 +442,16 @@ private function initialiseUpdate($old_version) {
442442
echo $e->getMessage() . '<br />';
443443
}
444444
}
445+
446+
if ($old_version < 1103) {
447+
try {
448+
$this->_db->query('ALTER TABLE nl2_forms_fields ADD `regex` varchar(64) DEFAULT NULL');
449+
$this->_db->query('ALTER TABLE nl2_forms_fields ADD `default_value` varchar(64) NOT NULL DEFAULT \'\'');
450+
} catch (Exception $e) {
451+
// unable to retrieve from config
452+
echo $e->getMessage() . '<br />';
453+
}
454+
}
445455
}
446456

447457
private function initialise() {
@@ -501,7 +511,7 @@ private function initialise() {
501511

502512
if (!$this->_db->showTables('forms_fields')) {
503513
try {
504-
$this->_db->createTable("forms_fields", " `id` int(11) NOT NULL AUTO_INCREMENT, `form_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `type` int(11) NOT NULL, `required` tinyint(1) NOT NULL DEFAULT '0', `min` int(11) NOT NULL DEFAULT '0', `max` int(11) NOT NULL DEFAULT '0', `placeholder` varchar(255) NULL DEFAULT NULL, `options` text NULL, `info` text NULL, `deleted` tinyint(1) NOT NULL DEFAULT '0', `order` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`)");
514+
$this->_db->createTable("forms_fields", " `id` int(11) NOT NULL AUTO_INCREMENT, `form_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `type` int(11) NOT NULL, `required` tinyint(1) NOT NULL DEFAULT '0', `min` int(11) NOT NULL DEFAULT '0', `max` int(11) NOT NULL DEFAULT '0', `placeholder` varchar(255) NULL DEFAULT NULL, `options` text NULL, `info` text NULL, `regex` varchar(64) DEFAULT NULL, `default_value` varchar(64) NOT NULL DEFAULT '', `deleted` tinyint(1) NOT NULL DEFAULT '0', `order` int(11) NOT NULL DEFAULT '1', PRIMARY KEY (`id`)");
505515

506516
$this->_db->insert('forms_fields', array(
507517
'form_id' => 1,

0 commit comments

Comments
 (0)