UIUCLibrary / teams

An Omeka S module to manage restrictions for users, sites and resources
GNU General Public License v3.0
6 stars 2 forks source link

browse request in public site calls getRole() #134

Closed mquantin closed 1 year ago

mquantin commented 1 year ago

Any request in the public site (non -logged users) creates an error: Call to a member function getRole() on null in /(...)/omeka-s/modules/Teams

url request example (live) https://epotec.univ-nantes.fr/s/ccinsn/item?resource_class_id[]=49

This kind of request can be configured by omeka in the UI admin panel Site -> Navigation -> add customLink -> Browse Advanced search also creates this kind of request in URL

It shouldn't imply any Teams role ! Please help this issue prevent from using a basic omeka fonction on the public side !

alexdryden commented 1 year ago

@mquantin Thanks for the report--which version of Teams are you seeing this issue with?

mquantin commented 1 year ago

v4.0.0-rc2 do you succeed in reproducing the error? full log is:

Error: Call to a member function getRole() on null in /(...)/modules/Teams/Module.php:742
Stack trace:
#0 /(...)/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Teams\Module->bypassTeamsSortSelector()
#1 /(...)/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\EventManager\EventManager->triggerListeners()
#2 /(...)/application/src/View/Helper/Trigger.php(60): Laminas\EventManager\EventManager->triggerEvent()
#3 /(...)/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(407): Omeka\View\Helper\Trigger->__invoke()
#4 /(...)/themes/centerrow/view/omeka/site/item/browse.phtml(49): Laminas\View\Renderer\PhpRenderer->__call()
#5 /(...)/vendor/laminas/laminas-view/src/Renderer/PhpRenderer.php(519): include('/home/epotec/ht...')
#6 /(...)/vendor/laminas/laminas-view/src/View.php(194): Laminas\View\Renderer\PhpRenderer->render()
#7 /(...)/vendor/laminas/laminas-view/src/View.php(222): Laminas\View\View->render()
#8 /(...)/vendor/laminas/laminas-view/src/View.php(187): Laminas\View\View->renderChildren()
#9 /(...)/vendor/laminas/laminas-mvc/src/View/Http/DefaultRenderingStrategy.php(98): Laminas\View\View->render()
#10 /(...)/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\View\Http\DefaultRenderingStrategy->render()
#11 /(...)/vendor/laminas/laminas-eventmanager/src/EventManager.php(171): Laminas\EventManager\EventManager->triggerListeners()
#12 /(...)/vendor/laminas/laminas-mvc/src/Application.php(360): Laminas\EventManager\EventManager->triggerEvent()
#13 /(...)/vendor/laminas/laminas-mvc/src/Application.php(341): Laminas\Mvc\Application->completeRequest()
#14 /(...)/index.php(21): Laminas\Mvc\Application->run()
#15 {main}
alexdryden commented 1 year ago

Thanks, yeah it looks like I can get a quick fix out this morning.

mquantin commented 1 year ago

Oh great! (Here is afternoon already ;-)

alexdryden commented 1 year ago

Okay, the fix is in release candidate 3 (https://github.com/UIUCLibrary/teams/releases/tag/v4.0.0-rc3). My institution had delayed implementing Omeka S v4 until later in the fall, but I'll put some time on my calendar for next week to do some additional testing for this since you are using it in production.

mquantin commented 1 year ago

great! thanks it fixes my issue. I just switched to v4 last week. Still some work here to port few perso works on v4... so no hurry on my side. It's a production instance dedicated to feeding the database and testing.