From c8be19776faab34eecf0eb7c20b191e2892e047b Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Thu, 13 Mar 2025 13:43:22 +0100 Subject: [PATCH] Don't reset additional registration form elements on init default elements (#7461) --- protected/humhub/modules/user/models/forms/Registration.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protected/humhub/modules/user/models/forms/Registration.php b/protected/humhub/modules/user/models/forms/Registration.php index e4dbb1781d..5d688963fa 100644 --- a/protected/humhub/modules/user/models/forms/Registration.php +++ b/protected/humhub/modules/user/models/forms/Registration.php @@ -94,8 +94,9 @@ class Registration extends HForm */ protected function setFormDefinition() { - $this->definition = []; - $this->definition['elements'] = []; + if (!isset($this->definition['elements']) || !is_array($this->definition['elements'])) { + $this->definition['elements'] = []; + } $this->definition['elements']['User'] = $this->getUserFormDefinition(); $this->definition['elements']['GroupUser'] = $this->getGroupFormDefinition(); if ($this->enablePasswordForm) {