From d4be3dcef6000ac7e07161320eee832df409bb60 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 25 Feb 2022 12:05:02 +0800 Subject: [PATCH] missing variable --- DataObjects/Core_person.php | 2 ++ I18n.php | 3 +-- UpdateDatabase.php | 9 ++++++--- sql/I18n.sql | 2 +- sql/core_person.sql | 10 +++++----- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/DataObjects/Core_person.php b/DataObjects/Core_person.php index 2c5e7747..5e30028f 100644 --- a/DataObjects/Core_person.php +++ b/DataObjects/Core_person.php @@ -48,6 +48,8 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject public $phone_direct; // varchar(32) NOT NULL DEFAULT ''; public $countries; // VARCHAR(128) NULL; + public $language; + /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE diff --git a/I18n.php b/I18n.php index 5f70c7a4..6536b2f4 100644 --- a/I18n.php +++ b/I18n.php @@ -86,8 +86,7 @@ class Pman_Core_I18n extends Pman $this->sessionState(0); $lang = !$this->authUser || empty($this->authUser->lang ) ? 'en' : $this->authUser->lang; - - /// verify the selected language.. + /// verify the selected language.. $i = DB_DataObject::Factory('I18n'); $i->ltype = 'l'; // string(1) not_null multiple_key $i->lkey = $lang; // string(8) not_null diff --git a/UpdateDatabase.php b/UpdateDatabase.php index d5eb4da2..043a5188 100644 --- a/UpdateDatabase.php +++ b/UpdateDatabase.php @@ -613,7 +613,10 @@ class Pman_Core_UpdateDatabase extends Pman $extra[] = "create sequence {$tbl}_seq;"; } - + if ($tbl && preg_match('#engine=\S+#i', $l, $m)) { + $l = preg_replace('#engine=\S+#i', '', $l); + + } if (preg_match('#alter\s+table\s+(\`[a-z0-9_]+\`)#i', $l, $m)){ $l = preg_replace('#alter\s+table\s+(\`[a-z0-9_]+\`)#i', "ALTER TABLE {$tbl}", $l); } @@ -951,11 +954,11 @@ class Pman_Core_UpdateDatabase extends Pman $g = DB_DataObject::Factory('core_group')->lookup('name',$data['bcc_group']); - if (empty($g->id)) { + if (empty($g->id)) { // Admin group as bcc will not have any member at initialization. $this->jerr("bcc_group {$data['bcc_group']} does not exist when importing template $name"); } - if (!$g->members('email') && $g->name != 'Empty Group') { + if (!$g->members('email') && $g->name != 'Empty Group' && $g->name != 'Administrators') { $this->jerr("bcc_group {$data['bcc_group']} does not have any members"); } diff --git a/sql/I18n.sql b/sql/I18n.sql index e40f77fd..e5773906 100644 --- a/sql/I18n.sql +++ b/sql/I18n.sql @@ -4,7 +4,7 @@ CREATE TABLE i18n ( id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (id) -) ENGINE=InnoDB; +); ALTER TABLE i18n ADD COLUMN ltype varchar(1) NOT NULL DEFAULT ''; ALTER TABLE i18n ADD COLUMN lkey varchar(8) NOT NULL DEFAULT ''; diff --git a/sql/core_person.sql b/sql/core_person.sql index 2044aade..c4dfe732 100644 --- a/sql/core_person.sql +++ b/sql/core_person.sql @@ -14,7 +14,7 @@ ALTER TABLE core_person ADD COLUMN lastname_alt varchar(128) NOT NULL DEFAULT -- chose title is like a nickname -ALTER TABLE core_person ADD COLUMN chosen_title TEXT NOT NULL; +ALTER TABLE core_person ADD COLUMN chosen_title TEXT NOT NULL DEFAULT ''; ALTER TABLE core_person ADD COLUMN role varchar(254) NOT NULL DEFAULT ''; @@ -55,7 +55,7 @@ ALTER TABLE core_person ADD COLUMN no_reset_sent int(11) default '0'; ALTER TABLE core_person ADD COLUMN deleted_by INT(11) NOT NULL default 0 ; -ALTER TABLE core_person ADD COLUMN deleted_dt DATETIME ; +ALTER TABLE core_person ADD COLUMN deleted_dt DATETIME no null default '1000-01-01 00:00:00'; -- social @@ -64,9 +64,9 @@ ALTER TABLE core_person ADD COLUMN url_blog VARCHAR(256) NULL ; ALTER TABLE core_person ADD COLUMN url_twitter VARCHAR(256) NULL ; ALTER TABLE core_person ADD COLUMN linkedin_id VARCHAR(256) NULL ; ALTER TABLE core_person ADD COLUMN url_linkedin VARCHAR(256) NULL ; -ALTER TABLE core_person ADD COLUMN url_google_plus TEXT NOT NULL; -ALTER TABLE core_person ADD COLUMN url_blog2 TEXT NOT NULL; -ALTER TABLE core_person ADD COLUMN url_blog3 TEXT NOT NULL; +ALTER TABLE core_person ADD COLUMN url_google_plus TEXT NOT NULL DEFAULT ''; +ALTER TABLE core_person ADD COLUMN url_blog2 TEXT NOT NULL DEFAULT ''; +ALTER TABLE core_person ADD COLUMN url_blog3 TEXT NOT NULL DEFAULT ''; -- 2.39.2