mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-05 09:04:19 +01:00
N°3203 - Fix regression: PHP notice on object with no class icon
This commit is contained in:
@@ -927,7 +927,8 @@ abstract class MetaModel
|
||||
{
|
||||
self::_check_subclass($sClass);
|
||||
|
||||
return self::$m_aClassParams[$sClass]["image_attcode"];
|
||||
// image_attcode isn't a mandatory class parameter, so it might not be in the $m_aClassParam array
|
||||
return isset(self::$m_aClassParams[$sClass]["image_attcode"]) ? self::$m_aClassParams[$sClass]["image_attcode"] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,8 +32,8 @@ class TitleFactory
|
||||
$sObjIconUrl = $oObject->GetIcon(false);
|
||||
// Note: Class icons are a square image with no margin around, so they need to be zoomed out in the medallion
|
||||
$sIconCoverMethod = Title::ENUM_ICON_COVER_METHOD_ZOOMOUT;
|
||||
// - Use object image from seantic attribute only if it's not the default image
|
||||
if(!$oObject->IsNew()){
|
||||
// - Use object image from semantic attribute only if it's not the default image
|
||||
if(!$oObject->IsNew() && MetaModel::HasImageAttributeCode($sObjClass)){
|
||||
$sImageAttCode = MetaModel::GetImageAttributeCode($sObjClass);
|
||||
if(!empty($sImageAttCode)){
|
||||
/** @var \ormDocument $oImage */
|
||||
@@ -47,7 +47,10 @@ class TitleFactory
|
||||
}
|
||||
|
||||
$oTitle = new TitleForObjectDetails($sObjClassName, $sObjName, $sId);
|
||||
$oTitle->SetIcon($sObjIconUrl, $sIconCoverMethod);
|
||||
|
||||
if(!empty($sObjIconUrl)) {
|
||||
$oTitle->SetIcon($sObjIconUrl, $sIconCoverMethod);
|
||||
}
|
||||
|
||||
$sStatusAttCode = MetaModel::GetStateAttributeCode($sObjClass);
|
||||
if (!empty($sStatusAttCode)) {
|
||||
|
||||
Reference in New Issue
Block a user