Skip to content

Commit 7e3bab5

Browse files
committed
closes #18
1 parent 08aaac7 commit 7e3bab5

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

code/Module.class.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class Module extends CoreModule
1818
protected $author = "Ben Keen";
1919
protected $authorEmail = "ben.keen@gmail.com";
2020
protected $authorLink = "https://formtools.org";
21-
protected $version = "2.0.5";
22-
protected $date = "2018-04-17";
21+
protected $version = "2.0.6";
22+
protected $date = "2018-04-25";
2323
protected $originLanguage = "en_us";
2424

2525
// important! This needs to be updated any time the default template set filename changes
@@ -71,7 +71,7 @@ public function install($module_id)
7171
form_offline_page_content mediumtext,
7272
review_page_title varchar(255) DEFAULT NULL,
7373
thankyou_page_title varchar(255) DEFAULT NULL,
74-
offline_date datetime NOT NULL,
74+
offline_date datetime DEFAULT NULL,
7575
list_order smallint(6) NOT NULL,
7676
PRIMARY KEY (published_form_id)
7777
) ENGINE=InnoDB DEFAULT CHARSET=utf8
@@ -214,6 +214,10 @@ public function uninstall($module_id)
214214
public function upgrade($module_id, $old_module_version)
215215
{
216216
$this->resetHooks();
217+
218+
if ($this->version === "3.0.6") {
219+
$this->updateOfflineDateFieldAllowNulls();
220+
}
217221
}
218222

219223

@@ -566,4 +570,11 @@ public function onDeleteView($info)
566570
}
567571
}
568572
}
573+
574+
private function updateOfflineDateFieldAllowNulls()
575+
{
576+
$db = Core::$db;
577+
$db->query("ALTER TABLE {PREFIX}module_form_builder_forms CHANGE offline_date offline_date DATETIME NULL");
578+
$db->execute();
579+
}
569580
}

0 commit comments

Comments
 (0)