PMCORE-3368 Array access to undefined index

This commit is contained in:
Roly Gutierrez
2021-09-24 00:21:49 -04:00
parent 0e655985ab
commit 71217b2bc4
2 changed files with 4 additions and 1 deletions

View File

@@ -933,8 +933,8 @@ class Language extends BaseLanguage
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$oDataset->next();
$aRow = $oDataset->getRow();
$aRow['LANGUAGE_NAME'] = $aRow['LAN_NAME'];
if (is_array($aRow)) {
$aRow['LANGUAGE_NAME'] = $aRow['LAN_NAME'];
return $aRow;
} else {
throw (new Exception("The language '$langId' doesn\'t exist!"));

View File

@@ -195,6 +195,9 @@ class Users extends BaseUsers
$role = $roles->loadByCode($aFields['USR_ROLE']);
$aFields['USR_ROLE_NAME'] = $role['ROL_NAME'];
if (empty($aFields['USR_DEFAULT_LANG'])) {
$aFields['USR_DEFAULT_LANG'] = 'en';
}
$translations = new Language();
$translation = $translations->loadByCode($aFields['USR_DEFAULT_LANG']);
$aFields['USR_DEFAULT_LANG_NAME'] = $translation['LANGUAGE_NAME'];