omeka-s-modules / Scripto

Transcribe and translate items
GNU General Public License v3.0
7 stars 8 forks source link

Admin: Project throws error if using deleted item set #4

Closed kimisgold closed 6 years ago

kimisgold commented 6 years ago

Use case: I was cleaning out my item sets, and deleted one that my Scripto project had been using. I went to the project to set a different item set, but was unable to access the edit project interface due to the error that the original item set couldn't be found.

Error
Call to a member function id() on null

Details:

Error: Call to a member function id() on null in /Users/kim/Sites/omeka-s/modules/Scripto/src/Controller/Admin/ProjectController.php:63
Stack trace:
#0 /Users/kim/Sites/omeka-s/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Scripto\Controller\Admin\ProjectController->editAction()
#1 /Users/kim/Sites/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#2 /Users/kim/Sites/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#3 /Users/kim/Sites/omeka-s/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#4 /Users/kim/Sites/omeka-s/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#5 /Users/kim/Sites/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#6 /Users/kim/Sites/omeka-s/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure))
#7 /Users/kim/Sites/omeka-s/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent))
#8 /Users/kim/Sites/omeka-s/index.php(21): Zend\Mvc\Application->run()
#9 {main}

(This is definitely an edge case scenario from my own weird workflow.)