From ad9b80d5cf63dbedaeb80f2cc4f764d7e68229d4 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 26 Feb 2024 00:00:00 +0000 Subject: [PATCH] Released version 3.6.19. --- Module.php | 6 ++++-- config/module.ini | 2 +- data/scripts/upgrade.php | 33 +++++++++++++++++++++++++++++---- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Module.php b/Module.php index 07df8b5..4ddc048 100644 --- a/Module.php +++ b/Module.php @@ -82,10 +82,10 @@ protected function preInstall(): void $translate = $plugins->get('translate'); $translator = $services->get('MvcTranslator'); - if (!method_exists($this, 'checkModuleActiveVersion') || !$this->checkModuleActiveVersion('Common', '3.4.53')) { + if (!method_exists($this, 'checkModuleActiveVersion') || !$this->checkModuleActiveVersion('Common', '3.4.54')) { $message = new \Omeka\Stdlib\Message( $translate('The module %1$s should be upgraded to version %2$s or later.'), // @translate - 'Common', '3.4.53' + 'Common', '3.4.54' ); throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message); } @@ -288,6 +288,8 @@ public function handleAfterSaveItem(Event $event): void 'query' => ['id' => $item->getId()], ]; + // TODO Use a direct strategy since manifest is created quickly now. + /** @var \Omeka\Job\Dispatcher $dispatcher */ $dispatcher = $services->get(\Omeka\Job\Dispatcher::class); $dispatcher->dispatch(\IiifServer\Job\CacheManifests::class, $args); diff --git a/config/module.ini b/config/module.ini index 473fe68..9daa590 100644 --- a/config/module.ini +++ b/config/module.ini @@ -8,5 +8,5 @@ author_link = "https://gitlab.com/Daniel-KM" module_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-IiifServer" support_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-IiifServer/-/issues" configurable = true -version = "3.6.18" +version = "3.6.19" omeka_version_constraint = "^4.0.0" diff --git a/data/scripts/upgrade.php b/data/scripts/upgrade.php index ef0d45e..e03e659 100644 --- a/data/scripts/upgrade.php +++ b/data/scripts/upgrade.php @@ -27,10 +27,10 @@ $defaultConfig = require dirname(__DIR__, 2) . '/config/module.config.php'; $defaultSettings = $defaultConfig['iiifserver']['config']; -if (!method_exists($this, 'checkModuleActiveVersion') || !$this->checkModuleActiveVersion('Common', '3.4.53')) { +if (!method_exists($this, 'checkModuleActiveVersion') || !$this->checkModuleActiveVersion('Common', '3.4.54')) { $message = new \Omeka\Stdlib\Message( $translate('The module %1$s should be upgraded to version %2$s or later.'), // @translate - 'Common', '3.4.53' + 'Common', '3.4.54' ); throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message); } @@ -309,10 +309,10 @@ $messenger->addSuccess($message); $settings->set('iiifserver_manifest_cache', true); - $settings->delete('iiifserver_manifest_cache_derivativemedia', true); + $settings->delete('iiifserver_manifest_cache_derivativemedia'); $message = new PsrMessage( - 'A new option allows to cache the manifests on save. It is set on, but may be disabled in settings. A job was launched to create all manifests.' // @translate + 'A new option allows to cache the manifests on save. It is set on, but may be disabled in settings.' // @translate ); $messenger->addSuccess($message); @@ -325,8 +325,33 @@ $messenger->addSuccess($message); } + /* // Disable caching on upgrade. require_once dirname(__DIR__, 2) . '/src/Job/CacheManifests.php'; $dispatcher = $services->get(\Omeka\Job\Dispatcher::class); $args = ['query' => []]; $dispatcher->dispatch(\IiifServer\Job\CacheManifests::class, $args); + */ +} + +if (version_compare($oldVersion, '3.6.19', '<')) { + if ($this->isModuleActive('ImageServer') && !$this->isModuleVersionAtLeast('ImageServer', '3.6.16')) { + $message = new \Omeka\Stdlib\Message( + $translate('The module %1$s should be upgraded to version %2$s or later.'), // @translate + 'ImageServer', '3.6.16' + ); + throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message); + } + + $settings->set('iiifserver_manifest_summary_property', $settings->get('iiifserver_manifest_description_property', 'template')); + $settings->delete('iiifserver_manifest_description_property'); + + $message = new PsrMessage( + 'The creation of manifests is now a lot quicker and can be done in real time in most of the cases. The cache is still available for big manifests and for instant access.' // @translate + ); + $messenger->addSuccess($message); + + $message = new PsrMessage( + 'If you use the feature "table of contents", a new format was integrated. Management of the old ones will be removed in version 3.6.20. A job is added in module EasyAdmin (version 3.4.17) to do the conversion.' // @translate + ); + $messenger->addWarning($message); }