mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Develop (#5180)
* Enh #5169: Enable more than 50 groups to a user * - Enh #5049: Required profile field should not be required in administration (Fix for checkbox field type)
This commit is contained in:
parent
91d4b03b7a
commit
9b47fee4d2
@ -4,6 +4,7 @@
|
||||
- Fix #5174: Tour module crashes with enabled tags field
|
||||
- Fix #5176: Closing the action confirmation modal window on top close icon
|
||||
- Fix #5177: Move directory widgets
|
||||
- Enh #5049: Required profile field should not be required in administration (Fix for checkbox field type)
|
||||
|
||||
|
||||
1.9.0-beta.2 (July 14, 2021)
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
namespace humhub\modules\user\models\fieldtype;
|
||||
|
||||
use humhub\modules\user\models\Profile;
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
@ -29,7 +30,7 @@ class Checkbox extends BaseType
|
||||
/**
|
||||
* Rules for validating the Field Type Settings Form
|
||||
*
|
||||
* @return type
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
@ -41,7 +42,7 @@ class Checkbox extends BaseType
|
||||
/**
|
||||
* Returns Form Definition for edit/create this field.
|
||||
*
|
||||
* @return Array Form Definition
|
||||
* @return array Form Definition
|
||||
*/
|
||||
public function getFormDefinition($definition = [])
|
||||
{
|
||||
@ -81,8 +82,8 @@ class Checkbox extends BaseType
|
||||
/**
|
||||
* Returns the Field Rules, to validate users input
|
||||
*
|
||||
* @param type $rules
|
||||
* @return type
|
||||
* @param array $rules
|
||||
* @return array rules
|
||||
*/
|
||||
public function getFieldRules($rules = [])
|
||||
{
|
||||
@ -92,7 +93,7 @@ class Checkbox extends BaseType
|
||||
if (!$this->$attribute) {
|
||||
$this->addError($attribute, Yii::t('UserModule.profile', '{attribute} is required!', ['{attribute}' => $profileField->title]));
|
||||
}
|
||||
}];
|
||||
}, 'except' => Profile::SCENARIO_EDIT_ADMIN];
|
||||
} else {
|
||||
$rules[] = [$profileField->internal_name, 'in', 'range' => [0, 1]];
|
||||
}
|
||||
@ -126,4 +127,4 @@ class Checkbox extends BaseType
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user