Skip to content

Commit

Permalink
BUGFIX: Check for getCopyrightNotice() method before use
Browse files Browse the repository at this point in the history
On Neos older than 4.2 the `Asset` has no `getCopyrightNotice()`,
but since this package claims compatibility, it needs to check before
calling it.

Fixes #26
  • Loading branch information
kdambekalns authored Sep 26, 2019
1 parent de1b0b9 commit 9159c97
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/Domain/ExtractionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,19 @@ protected function buildAssetMetaData(Asset $asset, MetaDataCollection $metaData
$collections[] = $collectionObject->getTitle();
}

$assetDto = new Dto\Asset([
$properties = [
'Caption' => $asset->getCaption(),
'CopyrightNotice' => $asset->getCopyrightNotice(),
'Identifier' => $asset->getIdentifier(),
'Title' => $asset->getTitle(),
'FileName' => $asset->getResource()->getFilename(),
'Collections' => $collections,
'Tags' => $tags,
'AssetObject' => $asset,
]);
];
if (method_exists($asset, 'getCopyrightNotice')) {
$properties['CopyrightNotice'] = $asset->getCopyrightNotice();
}
$assetDto = new Dto\Asset($properties);
$metaDataCollection->set('asset', $assetDto);
}

Expand Down

0 comments on commit 9159c97

Please sign in to comment.