diff --git a/protected/humhub/modules/ui/form/widgets/SortOrderField.php b/protected/humhub/modules/ui/form/widgets/SortOrderField.php index b64a836913..82f25384a2 100644 --- a/protected/humhub/modules/ui/form/widgets/SortOrderField.php +++ b/protected/humhub/modules/ui/form/widgets/SortOrderField.php @@ -44,12 +44,16 @@ class SortOrderField extends InputWidget */ public function run() { - $this->field->label(Yii::t('UiModule.form', 'Sort Order')); - $this->field->hint(Yii::t('UiModule.form', 'Values between 0 and 10000, the existing elements usually use steps of 100.')); - $model = $this->model; $attribute = $this->attribute; + if (!$model->getAttributeLabel($attribute)) { + $this->field->label(Yii::t('UiModule.form', 'Sort Order')); + } + if (!$model->getAttributeHint($attribute)) { + $this->field->hint(Yii::t('UiModule.form', 'Values between 0 and 10000, the existing elements usually use steps of 100.')); + } + if ($this->defaultValue !== null && !is_numeric($model->$attribute)) { $model->$attribute = $this->defaultValue; }