Hey,
I’m working with IiifPresentation module and having a little trouble attaching to its events. First, I’m not sure what to use in the identifier when attaching. I tried use IiifPresentation\v3\Controller\Item
but that didn’t seem to work so I’m just using *
which does, ie.
$sharedEventManager->attach(
'*',
'iiif_presentation.3.item.manifest',
[$this, 'updateIiifThumbnail']
);
That works, but I’m wondering if it’s better to more specific. Next issue, which I wonder if it’s related in any is that when I get the item
from the parameters it reads as null unless I first check if it exist, which is a little funny but maybe I’m not doing something correctly.
So, if I do something like this it throws an error saying, “Call to a member function id() on null”
$manifest = $event->getParam('manifest');
$item = $event->getParam('item');
echo $item->id();
But if I first check to see if $item
has value, everything works as I want it, ie
$manifest = $event->getParam('manifest');
$item = $event->getParam('item');
if ($item) {
echo $item->id();
...
Thanks,
Joe