N°3421 - Attributes of class Person are not accessible from :current_contact in portal anymore. Only attributes of class Contact are.

This commit is contained in:
acognet
2020-11-30 09:24:35 +01:00
parent a2a4cd4e7a
commit eb537f45f4

View File

@@ -4166,11 +4166,7 @@ abstract class MetaModel
}
if (count($aCurrentUser) > 0)
{
$oSearch = DBObjectSearch::FromOQL("SELECT User WHERE id = :id");
$oSearch->AllowAllData();
$oSet = new DBObjectSet($oSearch, array(), array('id' => UserRights::GetUserId()));
$oSet->OptimizeColumnLoad($aCurrentUser);
$oUser = $oSet->fetch();
$oUser = MetaModel::GetObject("User", UserRights::GetUserId(),true,true);
$aPlaceholders['current_user->object()'] = $oUser;
foreach ($aCurrentUser as $sField)
{
@@ -4179,10 +4175,7 @@ abstract class MetaModel
}
if (count($aCurrentContact) > 0)
{
$oSearch = DBObjectSearch::FromOQL("SELECT Contact WHERE id = :id");
$oSet = new DBObjectSet($oSearch, array(), array('id' => UserRights::GetContactId()));
$oSet->OptimizeColumnLoad(['Contact' => $aCurrentContact]);
$oUser = $oSet->fetch();
$oUser = MetaModel::GetObject("Person", UserRights::GetContactId(),true,true);
foreach ($aCurrentContact as $sField)
{
$aPlaceholders['current_contact->'.$sField] = $oUser->Get($sField);