Skip to content

Commit

Permalink
Released version 3.4.15.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Berthereau authored and Daniel Berthereau committed Oct 30, 2023
1 parent 77cf02c commit b2caffa
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/module.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ author_link = "https://gitlab.com/Daniel-KM"
module_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-EasyAdmin"
support_link = "https://gitlab.com/Daniel-KM/Omeka-S-module-EasyAdmin/-/issues"
configurable = false
version = "3.4.14"
version = "3.4.15"
omeka_version_constraint = "^3.1.0 || ^4.0.0"
dependencies = "Log"
30 changes: 30 additions & 0 deletions data/scripts/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
$messenger = $plugins->get('messenger');
$entityManager = $services->get('Omeka\EntityManager');

$config = $services->get('Config');
$basePath = $config['file_store']['local']['base_path'] ?: (OMEKA_PATH . '/files');

if (version_compare($oldVersion, '3.3.2', '<')) {
$this->installDir();
}
Expand Down Expand Up @@ -198,3 +201,30 @@
);
$messenger->addWarning($message);
}

if (version_compare($oldVersion, '3.4.14', '<')) {
$message = new Message(
'New tasks were added to set the primary media of all items and to check resources.' // @translate
);
$messenger->addWarning($message);
}

if (version_compare($oldVersion, '3.4.15', '<')) {
if (!$this->checkDestinationDir($basePath . '/backup')) {
$message = new \Omeka\Stdlib\Message(
'The directory "%s" is not writeable.', // @translate
$basePath
);
throw new \Omeka\Module\Exception\ModuleCannotInstallException((string) $message);
}

$message = new Message(
'A new task allow to backup Omeka installation files (without directory /files).' // @translate
);
$messenger->addSuccess($message);

$message = new Message(
'A new task allow to clear php caches (code and data), in particular after an update or direct modification of code.' // @translate
);
$messenger->addSuccess($message);
}
2 changes: 2 additions & 0 deletions src/Service/ViewHelper/DefaultSiteFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ public function __invoke(ContainerInterface $services, $requestedName, array $op
}
// Fix issues after Omeka install without public site, so very rarely.
if (empty($id)) {
// Search first public site first.
$slugs = $api->search('sites', ['is_public' => true, 'limit' => 1], ['initialize' => false, 'returnScalar' => 'slug'])->getContent();
[$id, $slug] = $slugs ? [(int) key($slugs), reset($slugs)] : [null, null];
// Else first site.
if (empty($id)) {
$slugs = $api->search('sites', ['limit' => 1], ['initialize' => false, 'returnScalar' => 'slug'])->getContent();
[$id, $slug] = $slugs ? [(int) key($slugs), reset($slugs)] : [null, null];
Expand Down

0 comments on commit b2caffa

Please sign in to comment.