Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/FrontendIntegration/InsertTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author Sven Baumann <baumann.sv@gmail.com>
* @author David Molineus <david.molineus@netzmacht.de>
* @author Richard Henkenjohann <richardhenkenjohann@googlemail.com>
* @copyright 2012-2019 The MetaModels team.
* @license https://github.com/MetaModels/core/blob/master/LICENSE LGPL-3.0-or-later
* @filesource
Expand Down Expand Up @@ -256,12 +257,14 @@ protected function getItem($metaModelIdOrName, $mixDataId, $intIdRenderSetting,
* @param string $strOutput Name of output. Default:raw|text|html5|xhtml|...
*
* @return boolean|string Return false when nothing was found or return the value.
*
* @throws \RuntimeException If $intDataId does not provide an existingMetaModel ID.
*/
protected function getAttribute($metaModelIdOrName, $intDataId, $strAttributeName, $strOutput = 'raw')
{
// Get the MM.
$objMM = $this->loadMetaModel($metaModelIdOrName);
if ($objMM == null) {
if (null === $objMM) {
return false;
}

Expand All @@ -272,6 +275,9 @@ protected function getAttribute($metaModelIdOrName, $intDataId, $strAttributeNam

// Get item.
$objMetaModelItem = $objMM->findById($intDataId);
if (null === $objMetaModelItem) {
throw new \RuntimeException('MetaModel item not found: ' . $intDataId);
}

// Parse attribute.
$arrAttr = $objMetaModelItem->parseAttribute($strAttributeName);
Expand Down