From 58ca4430341d6180a9c11d2fc52e3f33251c47b8 Mon Sep 17 00:00:00 2001 From: Jens Giessmann Date: Tue, 6 Jun 2023 13:43:38 +0200 Subject: [PATCH] do not restrict access_owner to int, allow varchar 255 as in other access_ cols --- ...06_120121_change_access_owner_col_format.php | 17 +++++++++++++++++ models/BaseTree.php | 10 ++++++++-- models/Tree.php | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 migrations/m230606_120121_change_access_owner_col_format.php diff --git a/migrations/m230606_120121_change_access_owner_col_format.php b/migrations/m230606_120121_change_access_owner_col_format.php new file mode 100644 index 0000000..f893aa1 --- /dev/null +++ b/migrations/m230606_120121_change_access_owner_col_format.php @@ -0,0 +1,17 @@ +alterColumn("{{%dmstr_page}}", "access_owner", $this->string(255)); + } + + public function down() + { + return false; + } +} diff --git a/models/BaseTree.php b/models/BaseTree.php index 77abec5..a58d85a 100644 --- a/models/BaseTree.php +++ b/models/BaseTree.php @@ -457,6 +457,13 @@ public function rules() '{0} should not contain any uppercase and special chars!', ['{attribute}'] ) ], + [ + [ + self::ATTR_ACCESS_OWNER, + ], + 'filter', + 'filter' => 'strval' + ], [ [ self::ATTR_DOMAIN_ID, @@ -467,6 +474,7 @@ public function rules() self::ATTR_ICON, self::ATTR_DEFAULT_META_KEYWORDS, self::ATTR_REQUEST_PARAMS, + self::ATTR_ACCESS_OWNER, self::ATTR_ACCESS_READ, self::ATTR_ACCESS_UPDATE, self::ATTR_ACCESS_DELETE, @@ -522,7 +530,6 @@ public function rules() [ [ self::ATTR_ROOT, - self::ATTR_ACCESS_OWNER, ], 'integer', 'integerOnly' => true, @@ -530,7 +537,6 @@ public function rules() [ [ self::ATTR_ROOT, - self::ATTR_ACCESS_OWNER, self::ATTR_COLLAPSED, self::ATTR_ICON_TYPE ], diff --git a/models/Tree.php b/models/Tree.php index 37225bf..36f5d03 100755 --- a/models/Tree.php +++ b/models/Tree.php @@ -38,7 +38,7 @@ * @property string $default_meta_keywords * @property string $default_meta_description * @property string $request_params - * @property int $access_owner + * @property string $access_owner * @property string $access_domain * @property string $access_read * @property string $access_update