Skip to content

Commit 8fb03e1

Browse files
committed
Mylist shows empty select box entries for profile fields #2014
1 parent 29f73ad commit 8fb03e1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

modules/groups-roles/mylist.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
}
8585
}
8686

87-
// create html page object
87+
// create HTML page object
8888
$page = PagePresenter::withHtmlIDAndHeadline('admidio-mylist', $headline);
8989

9090
ChangelogService::displayHistoryButton($page, 'lists', 'lists,list_columns', true, array('uuid' => $getListUuid));
@@ -235,7 +235,7 @@ function createProfileFieldsArray() {
235235
}
236236
}
237237
}
238-
238+
239239
$arrAdditionalColumns = array(
240240
array('cat_name' => $gL10n->get('SYS_PROFILE_INFORMATION'), 'usf_name_intern' => 'usr_photo', 'usf_name' => $gL10n->get('SYS_PHOTO')),
241241
($gCurrentUser->isAdministratorUsers() ? array('cat_name' => $gL10n->get('SYS_PROFILE_INFORMATION'), 'usf_name_intern' => 'usr_login_name', 'usf_name' => $gL10n->get('SYS_USERNAME')) : []),
@@ -257,12 +257,14 @@ function createProfileFieldsArray() {
257257

258258
// after the profile fields add some special profile information e.g. username, photo, created at ...
259259
foreach ($arrAdditionalColumns as $column) {
260-
$javascriptCode .= '
260+
if (is_array($column) && count($column) > 0) {
261+
$javascriptCode .= '
261262
userFields[' . ++$i . '] = {
262263
"cat_name" : "' . $column['cat_name'] . '",
263264
"usf_name" : "' . $column['usf_name'] . '",
264265
"usf_name_intern" : "' . $column['usf_name_intern'] . '",
265266
};';
267+
}
266268
}
267269

268270
$javascriptCode .= '
@@ -273,7 +275,7 @@ function createColumnsArray()
273275
{
274276
var defaultFields = [];';
275277

276-
// now add all columns to the javascript row objects
278+
// now add all columns to the JavaScript row objects
277279
$actualColumnNumber = 1;
278280
array_map(
279281
function ($col, $sort = null, $cond = null) use (&$javascriptCode, &$actualColumnNumber) {

0 commit comments

Comments
 (0)