From ab6c7a385d864a38f95a44330a6a169f557d4bd7 Mon Sep 17 00:00:00 2001 From: Gabriel Jenik Date: Tue, 1 Jun 2021 10:20:05 -0300 Subject: [PATCH] Fixed issue: Database error when editing a quota and text is too long --- application/models/Quota.php | 1 + application/models/QuotaLanguageSetting.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/application/models/Quota.php b/application/models/Quota.php index 4d98eaba35c..3175347c046 100644 --- a/application/models/Quota.php +++ b/application/models/Quota.php @@ -89,6 +89,7 @@ public function rules() array('action', 'numerical', 'integerOnly' => true, 'min' => '1', 'max' => '2', 'allowEmpty' => true), // Default is null ? array('active', 'numerical', 'integerOnly' => true, 'min' => '0', 'max' => '1', 'allowEmpty' => true), array('autoload_url', 'numerical', 'integerOnly' => true, 'min' => '0', 'max' => '1', 'allowEmpty' => true), + array('name', 'length', 'min' => 0, 'max' => 255), ); } diff --git a/application/models/QuotaLanguageSetting.php b/application/models/QuotaLanguageSetting.php index ccf06a36248..f3a23705a1d 100644 --- a/application/models/QuotaLanguageSetting.php +++ b/application/models/QuotaLanguageSetting.php @@ -74,6 +74,9 @@ public function rules() array('quotals_urldescrip', 'LSYii_Validators'), array('quotals_url', 'filter', 'filter' => 'trim'), array('quotals_url', 'urlValidator'), + array('quotals_name', 'length', 'min' => 0, 'max' => 255), + array('quotals_url', 'length', 'min' => 0, 'max' => 255), + array('quotals_urldescrip', 'length', 'min' => 0, 'max' => 255), ); } public function urlValidator()