Can't update Advanced Search to 3.4.20

Trying to update Advanced Search module to latest version, 3.4.20. I get the following error message:

Omeka\Module\Exception\ModuleStateInvalidException
Module "AdvancedSearch" is marked as "needs_upgrade" and cannot be activated

I followed the directions at Modules Management - Omeka S User Manual

For now I can revert to my former version, but could someone please fix the error or tell me what I can do to fix it?

Have you had this problem with other module upgrades, or just this one? (Or have you not done any others yet?)

I have updated several modules. This is the first time I have encountered this error message.

Did you try this one more than once?

You could get an error like that if, for example, you had the Modules page open, then changed out for the new module, and tried to click the “Activate” button on that page. But that would be resolved by just reloading the Modules page after putting the new copy of the module in place.

Now I have a new error:

**Error**
Failed opening required '/home/pvikarch/public_html/Staging/modules/Common/TraitModule.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php')

Details:

Error: Failed opening required '/home/pvikarch/public_html/Staging/modules/Common/TraitModule.php' (include_path='.:/opt/alt/php82/usr/share/pear:/opt/alt/php82/usr/share/php:/usr/share/pear:/usr/share/php') in /home/pvikarch/public_html/Staging/modules/AdvancedSearch/Module.php:38
Stack trace:
#0 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-loader/src/ModuleAutoloader.php(258): require_once()
#1 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-loader/src/ModuleAutoloader.php(210): Laminas\Loader\ModuleAutoloader->loadModuleFromDir()
#2 /home/pvikarch/public_html/Staging/application/src/Module/Manager.php(354): Laminas\Loader\ModuleAutoloader->autoload()
#3 /home/pvikarch/public_html/Staging/application/src/Module/Manager.php(304): Omeka\Module\Manager->getModuleObject()
#4 /home/pvikarch/public_html/Staging/application/src/Controller/Admin/ModuleController.php(250): Omeka\Module\Manager->upgrade()
#5 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\ModuleController->upgradeAction()
#6 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch()
#7 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners() 
#8 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil()
#9 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch() 
#10 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch()
#11 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners() 
#12 /home/pvikarch/public_html/Staging/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil() 
#13 /home/pvikarch/public_html/Staging/index.php(21): Laminas\Mvc\Application->run()
#14 {main}

I had the Modules page open.

  1. I deactivated module CSSEditor, which always says it needs updating even when it doesn’t.
  2. I deactivated module Advanced Search v. 3.4.14
  3. I removed folder Advanced Search from my modules directory on the server
  4. I uploaded and unzipped AdvancedSearch-3.4.20.zip into the modules directory
  5. Per your instructions, I refreshed the Modules page in the admin interface. Now the only button I see for Advanced Search is Upgrade. There is no Activate button
  6. I clicked Upgrade and got the error message above.

There is no Common directory in my modules directory.

Now what?

After getting the latest error, I did the following:

  1. I removed folder Advanced Search
  2. I refreshed my Modules page and got this message:

AdvancedSearch version 3.4.15 Error: module in database but not in filesystem

  1. I replaced folder Advanced Search with the one for version 3.4.15.
  2. I refreshed my Modules page. Advanced Search version 3.4.15 appears.
  3. I activated it and got a success message as well as New Version available message.

I tried again to update to 3.14.20 but got the same message as originally.

Omeka\Module\Exception\ModuleStateInvalidException
Module "AdvancedSearch" is marked as "needs_upgrade" and cannot be activated

I then reverted to 3.14.15 again. So now I have 3.14.15 installed, and it works. But how can I update to the latest version?

The procedure to upgrade you did where you refresh the Modules page and see the Upgrade button is the right procedure. I’m going to update our instructions on upgrading modules to clarify that.

The error you got, I did some looking into that. It looks like Daniel has updated that module to now require the module Common. So before upgrading, you’d need to install Common (it’s available here) first.

Then to upgrade, you want to refresh the Modules page after you put the new copy of AdvancedSearch in place, and you want to hit the Upgrade button.

Thanks for the link to Common module on Github. I respectfully request that you put it on the Modules download page (Omeka S - Modules) .

Success! I installed Common module then updated Advanced Search per your instructions. Now Advanced Search is installed properly.

I see that the documentation page for Advanced Search contains one line that says " This module is dependent of module Common, that should be installed first." Since this is a new requirement (prior versions of Advanced Search worked with out Common), please suggest to the author of that document to put a prominent notice at the top telling the user to install Common first.

You can suggest that directly on the plugin repository, since it’s created by a community developer. Also we can’t add modules to the directory until the developer registers them, so you could suggest that too.

Sorry, by “plugin repository” do you mean the Omeka S Modules page at Omeka S - Modules? I do not see a place to enter suggestions there.

No, I mean the actual repository for the module code, so here: Daniel-KM / Omeka-S-module-Common · GitLab You might need to make user account to do that, but those repositories are the best way to communicate with community developers if those folks haven’t noticed your issues on this forum.

Done. Thanks for the tip.

Yes, i’m replacing all my modules dependency from module Generic to module Common (Daniel-KM / Omeka-S-module-Common · GitLab), that is more flexible and more consistant, but not yet on omeka.org.

Please put it on the Modules download page (Omeka S - Modules . I tried to update Advanced Search from an earlier version and was baffled by (a) the error message and (b) the absence of Common module on the download page. Not friendly to user.