Item Sets not displayed in the backend

Hi there.
After batch update some itemes (to add them to a newly created ItemSet), the ItemSet menu (from the admin interface) does not display anything and gives this error: Omeka S encountered an error

In the apache error log I have this:

[Mon Sep 07 12:37:12.276819 2020] [php7:notice] [pid 1776] [client 10.1.1.15:33114] PHP Notice: Undefined offset: 0 in /var/www/***********************/application/src/Api/Representation/ItemSetRepresentation.php on line 70, referer: https://**********************/admin/item

I have a production installation of omeka s 3 years old now. Here is the system information table:

Omeka S
Version 2.1.2
PHP
Version 7.4.3
SAPI apache2handler
Memory Limit 512M
POST Size Limit 58M
File Upload Limit 50M
Garbage Collection Yes
Extensions apache2handler, bz2, calendar, Core, ctype, curl, date, dom, exif, FFI, fileinfo, filter, ftp, gd, gettext, hash, iconv, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets, sodium, solr, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib
Disabled Functions , pcntl_alarm, pcntl_async_signals, pcntl_exec, pcntl_fork, pcntl_getpriority, pcntl_get_last_error, pcntl_setpriority, pcntl_signal, pcntl_signal_dispatch, pcntl_signal_get_handler, pcntl_sigprocmask, pcntl_sigtimedwait, pcntl_sigwaitinfo, pcntl_strerror, pcntl_unshare, pcntl_wait, pcntl_waitpid, pcntl_wexitstatus, pcntl_wifcontinued, pcntl_wifexited, pcntl_wifsignaled, pcntl_wifstopped, pcntl_wstopsig, pcntl_wtermsig
MySQL
Server Version 5.5.5-10.3.22-MariaDB-1ubuntu1
Client Version mysqlnd 7.4.3
Mode STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION
OS
Version Linux 5.4.0-45-generic x86_64

Follow these instructions from the manual on how to get details about the error.

Thanks!

This is the error that I get when accessing Item Sets in the admin interface:

Error
Call to a member function primaryMedia() on null

Details:

Error: Call to a member function primaryMedia() on null in /var/www/digital.bibliotecaarad.ro/application/src/Api/Representation/ItemSetRepresentation.php:71 Stack trace: #0 /var/www/digital.bibliotecaarad.ro/application/src/View/Helper/Thumbnail.php(22): Omeka\Api\Representation\ItemSetRepresentation->primaryMedia() #1 /var/www/digital.bibliotecaarad.ro/application/src/Api/Representation/AbstractResourceEntityRepresentation.php(562): Omeka\View\Helper\Thumbnail->__invoke() #2 /var/www/digital.bibliotecaarad.ro/modules/Next/view/omeka/admin/item-set/browse.phtml(83): Omeka\Api\Representation\AbstractResourceEntityRepresentation->linkPretty() #3 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(506): include(‘/var/www/digita…’) #4 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-view/src/View.php(207): Zend\View\Renderer\PhpRenderer->render() #5 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-view/src/View.php(236): Zend\View\View->render() #6 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-view/src/View.php(200): Zend\View\View->renderChildren() #7 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-mvc/src/View/Http/DefaultRenderingStrategy.php(105): Zend\View\View->render() #8 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\View\Http\DefaultRenderingStrategy->render() #9 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners() #10 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-mvc/src/Application.php(367): Zend\EventManager\EventManager->triggerEvent() #11 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-mvc/src/Application.php(348): Zend\Mvc\Application->completeRequest() #12 /var/www/digital.bibliotecaarad.ro/index.php(21): Zend\Mvc\Application->run()

The error message indicates that this is a problem with the module “Next”.

You could try upgrading it, or simply disabling it.

Module Next is deactivated. Still got this error:

Error
Call to a member function primaryMedia() on null

Details:

Error: Call to a member function primaryMedia() on null in /var/www/digital.bibliotecaarad.ro/application/src/Api/Representation/ItemSetRepresentation.php:71 Stack trace: #0 /var/www/digital.bibliotecaarad.ro/application/src/View/Helper/Thumbnail.php(22): Omeka\Api\Representation\ItemSetRepresentation->primaryMedia() #1 /var/www/digital.bibliotecaarad.ro/application/src/Api/Representation/AbstractResourceEntityRepresentation.php(562): Omeka\View\Helper\Thumbnail->__invoke() #2 /var/www/digital.bibliotecaarad.ro/application/view/omeka/admin/item-set/browse.phtml(101): Omeka\Api\Representation\AbstractResourceEntityRepresentation->linkPretty() #3 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-view/src/Renderer/PhpRenderer.php(506): include(‘/var/www/digita…’) #4 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-view/src/View.php(207): Zend\View\Renderer\PhpRenderer->render() #5 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-view/src/View.php(236): Zend\View\View->render() #6 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-view/src/View.php(200): Zend\View\View->renderChildren() #7 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-mvc/src/View/Http/DefaultRenderingStrategy.php(105): Zend\View\View->render() #8 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\View\Http\DefaultRenderingStrategy->render() #9 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-eventmanager/src/EventManager.php(171): Zend\EventManager\EventManager->triggerListeners() #10 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-mvc/src/Application.php(367): Zend\EventManager\EventManager->triggerEvent() #11 /var/www/digital.bibliotecaarad.ro/vendor/zendframework/zend-mvc/src/Application.php(348): Zend\Mvc\Application->completeRequest() #12 /var/www/digital.bibliotecaarad.ro/index.php(21): Zend\Mvc\Application->run() #13 {main}

I reversed, step by step, the last actions that I did before receiving the error, that is deleting the item sets that I created just before item sets menu broke.

It seems that there was one item set that triggered the error, deleting that set fixed this issue

Well, good to hear that you worked around the issue.

Out of curiosity, what was the role of the user you were using when you had this problem? One of the Administrator roles or something lower?

The user role was Global Administrator

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.