Fix #3862: Profile field type checkbox list with multiple values broken

This commit is contained in:
Lucas Bartholemy 2020-02-13 13:25:48 +01:00
parent dfefaea11c
commit 451eb944c8
2 changed files with 3 additions and 2 deletions

View File

@ -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)
------------------------

View File

@ -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])) {