Daniel-KM / Omeka-S-module-Annotate

Module for Omeka S that implements the W3C Web Annotation Ontology to annotate (tag, comment, rate, highlight, draw, etc.) any resource.
Other
8 stars 1 forks source link

Omeka S error ("Call to a member function id() on null") when trying to display an item if the module is activated #3

Closed gtnbssn closed 4 years ago

gtnbssn commented 4 years ago

I am running Omeka S version 2.1.2, and version 3.1.3.5 of the Annotate module. I have installed the module with git, checked out a branch with the proper version tag, done composer install, npm install and gulp. (No errors, some warnings in npm install.)

Once i install and activate the module in the staff interface though, trying to display an item results in the following error. I have also disabled all other modules, to no avail.)

Have i missed something or is it an issue with the module?

Error
Call to a member function id() on null

Details:

Error: Call to a member function id() on null in /var/www/html/omeka-s/modules/Annotate/Module.php:1062
Stack trace:
#0 /var/www/html/omeka-s/modules/Annotate/Module.php(984): Annotate\Module->displayForm(Object(Zend\EventManager\Event))
#1 /var/www/html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Annotate\Module->displayListAndForm(Object(Zend\EventManager\Event))
#2 /var/www/html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\EventManager\Event))
#3 /var/www/html/omeka-s/application/src/View/Helper/Trigger.php(61): Zend\EventManager\EventManager->triggerEvent(Object(Zend\EventManager\Event))
#4 [internal function]: Omeka\View\Helper\Trigger->__invoke('view.show.after')
#5 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(397): call_user_func_array(Object(Omeka\View\Helper\Trigger), Array)
#6 /var/www/html/omeka-s/application/view/omeka/admin/item/show.phtml(89): Zend\View\Renderer\PhpRenderer->__call('trigger', Array)
#7 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(506): include('/var/www/html/o...')
#8 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/View.php(207): Zend\View\Renderer\PhpRenderer->render(NULL)
#9 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/View.php(236): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#10 /var/www/html/omeka-s/vendor/zendframework/zend-view/src/View.php(200): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#11 /var/www/html/omeka-s/vendor/zendframework/zend-mvc/src/View/Http/DefaultRenderingStrategy.php(105): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#12 /var/www/html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\View\Http\DefaultRenderingStrategy->render(Object(Zend\Mvc\MvcEvent))
#13 /var/www/html/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent))
#14 /var/www/html/omeka-s/vendor/zendframework/zend-mvc/src/Application.php(367): Zend\EventManager\EventManager->triggerEvent(Object(Zend\Mvc\MvcEvent))
#15 /var/www/html/omeka-s/vendor/zendframework/zend-mvc/src/Application.php(348): Zend\Mvc\Application->completeRequest(Object(Zend\Mvc\MvcEvent))
#16 /var/www/html/omeka-s/index.php(21): Zend\Mvc\Application->run()
#17 {main}
gtnbssn commented 4 years ago

Made some progress here.

It seems installing the module did not install and setup the different files found in the data subfolder. As a result there is no Annotation resource template, the web annotation ontology vocabulary is not imported, etc.

Is there something missing to make sure these are properly setup when installing?

Daniel-KM commented 4 years ago

Indeed, this issue means that the vocabulary "Open Annotation" is not installed. You can install it manually, and the custom vocabs and templates too. I just fixed the issue, but you have to reinstall. I don't understand why your files were not installed. Note that if you have installed the module Generic, you should use the last version.