From 451eb944c83a7631ab34d11892498ecce9599d79 Mon Sep 17 00:00:00 2001 From: Lucas Bartholemy Date: Thu, 13 Feb 2020 13:25:48 +0100 Subject: [PATCH] Fix #3862: Profile field type checkbox list with multiple values broken --- protected/humhub/docs/CHANGELOG.md | 1 + .../humhub/modules/user/models/fieldtype/CheckboxList.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index 10d9876162..2980b0ece8 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -7,6 +7,7 @@ HumHub Change Log - Fix #3852: Error when OpenSSL extension is not installed - Fix #3849: ModuleCleanupJob produces an error due to ".." in path - Fix #3860: Console/Cli Marketplace actions broken +- Fix #3862: Profile field type checkbox list with multiple values broken 1.4.0 (February 4, 2020) ------------------------ diff --git a/protected/humhub/modules/user/models/fieldtype/CheckboxList.php b/protected/humhub/modules/user/models/fieldtype/CheckboxList.php index 9fe039e782..41a03251d6 100644 --- a/protected/humhub/modules/user/models/fieldtype/CheckboxList.php +++ b/protected/humhub/modules/user/models/fieldtype/CheckboxList.php @@ -140,7 +140,7 @@ class CheckboxList extends BaseType public function beforeProfileSave($values) { if (is_array($values)) { - return implode(',', $values); + return implode("\n", $values); } return $values; } @@ -183,7 +183,7 @@ class CheckboxList extends BaseType $options = $this->getSelectItems(); $translatedValues = []; - foreach (explode(',', $value) as $v) { + foreach (explode("\n", $value) as $v) { if ($v === 'other' && !empty($user->profile->$internalNameOther)) { $translatedValues[] = Html::encode($user->profile->$internalNameOther); } elseif (isset($options[$v])) {