From 7fbd158addacbdeb1758764e134585a9cbc5c611 Mon Sep 17 00:00:00 2001 From: ChoboHub Date: Mon, 15 Aug 2016 14:15:28 -0400 Subject: [PATCH 1/3] Fix missing validator in database - Added update (needed to add validator to older version) - New release --- extension.driver.php | 12 ++++++++++++ extension.meta.xml | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/extension.driver.php b/extension.driver.php index d194d68..859d898 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -11,9 +11,21 @@ public function install(){ CREATE TABLE `tbl_fields_email` ( `id` int(11) unsigned NOT NULL auto_increment, `field_id` int(11) unsigned NOT NULL, + `validator` varchar(255) default NULL, PRIMARY KEY (`id`), KEY `field_id` (`field_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; "); } + + public function update($previousVersion = false){ + + if (version_compare($previousVersion, '1.2.2', '<=')) { + Symphony::Database()->query( + "ALTER TABLE `tbl_fields_email` + ADD COLUMN `validator` varchar(255) default NULL;" + ); + } + + } } diff --git a/extension.meta.xml b/extension.meta.xml index f9d880d..252defd 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -13,6 +13,11 @@ + + - Supported on PHP 7 + - Added update for older version + - Fixed install missing validator + - Minor updates to method signatures for forward compatibility From 33952430680548c38c3d8ec9d5b0de467ed5b292 Mon Sep 17 00:00:00 2001 From: ChoboHub Date: Mon, 15 Aug 2016 14:34:08 -0400 Subject: [PATCH 2/3] Removing validation field --- extension.driver.php | 12 ------------ fields/field.email.php | 10 ++++++++-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index 859d898..d194d68 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -11,21 +11,9 @@ public function install(){ CREATE TABLE `tbl_fields_email` ( `id` int(11) unsigned NOT NULL auto_increment, `field_id` int(11) unsigned NOT NULL, - `validator` varchar(255) default NULL, PRIMARY KEY (`id`), KEY `field_id` (`field_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; "); } - - public function update($previousVersion = false){ - - if (version_compare($previousVersion, '1.2.2', '<=')) { - Symphony::Database()->query( - "ALTER TABLE `tbl_fields_email` - ADD COLUMN `validator` varchar(255) default NULL;" - ); - } - - } } diff --git a/fields/field.email.php b/fields/field.email.php index e54b0e5..916b218 100644 --- a/fields/field.email.php +++ b/fields/field.email.php @@ -50,9 +50,15 @@ private function __applyValidationRule($data) { public function displaySettingsPanel(XMLElement &$wrapper, $errors = null) { parent::displaySettingsPanel($wrapper, $errors); + if ($this->get('id')) { + $wrapper->removeChildAt(5); + $wrapper->removeChildAt(4); + } else { + $wrapper->removeChildAt(4); + $wrapper->removeChildAt(3); + } $div = new XMLElement('div', NULL, array('class' => 'two columns')); - $this->appendRequiredCheckbox($div); - $this->appendShowColumnCheckbox($div); + $wrapper->appendChild($div); } From 8865e6c1ea2871eccfc97917977befcd8e7a5adb Mon Sep 17 00:00:00 2001 From: ChoboHub Date: Mon, 15 Aug 2016 15:35:18 -0400 Subject: [PATCH 3/3] Need update to repair broken validator --- extension.driver.php | 14 +++++++++++++- fields/field.email.php | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index d194d68..58bd48b 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -11,9 +11,21 @@ public function install(){ CREATE TABLE `tbl_fields_email` ( `id` int(11) unsigned NOT NULL auto_increment, `field_id` int(11) unsigned NOT NULL, + `validator` varchar(255) default NULL, PRIMARY KEY (`id`), KEY `field_id` (`field_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; "); } - } + + public function update($previousVersion = false){ + + if (version_compare($previousVersion, '1.2.2', '<=')) { + Symphony::Database()->query( + "ALTER TABLE `tbl_fields_email` + ADD COLUMN `validator` varchar(255) default NULL;" + ); + } + + } + } \ No newline at end of file diff --git a/fields/field.email.php b/fields/field.email.php index 916b218..588cfb3 100644 --- a/fields/field.email.php +++ b/fields/field.email.php @@ -70,7 +70,7 @@ public function commit(){ $fields = array(); $fields['field_id'] = $id; - + return FieldManager::saveSettings($id, $fields); }