From b860414bd80e55c8902e52ed4047528eb866ee13 Mon Sep 17 00:00:00 2001 From: Daniel Berthereau Date: Mon, 15 Apr 2019 00:00:00 +0200 Subject: [PATCH] Fixed use without fix omeka/omeka-s#1260. --- asset/js/ebook-admin.js | 4 ++-- config/module.ini | 2 +- src/Controller/Admin/EbookController.php | 6 ++++-- src/Form/EbookForm.php | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/asset/js/ebook-admin.js b/asset/js/ebook-admin.js index 30860cb..01f6c46 100644 --- a/asset/js/ebook-admin.js +++ b/asset/js/ebook-admin.js @@ -1,4 +1,4 @@ -// Kept for compatibility with Omeka < 1.2. +// Kept as long as pull request #1260 is not passed. Omeka.ebookManageSelectedActions = function() { var selectedOptions = $('[value="update-selected"], [value="delete-selected"], #batch-form .batch-inputs .batch-selected'); if ($('.batch-edit td input[type="checkbox"]:checked').length > 0) { @@ -33,7 +33,7 @@ Omeka.ebookManageSelectedActions = function() { $('').val(resourceType) ); - // Kept for compatibility with Omeka < 1.2. + // Kept as long as pull request #1260 is not passed. $('.select-all').change(function() { Omeka.ebookManageSelectedActions(); }); diff --git a/config/module.ini b/config/module.ini index 955e4be..6f652a7 100644 --- a/config/module.ini +++ b/config/module.ini @@ -8,5 +8,5 @@ author_link = "https://github.com/Daniel-KM" module_link = "https://github.com/Daniel-KM/Omeka-S-module-Ebook" support_link = "https://github.com/Daniel-KM/Omeka-S-module-Ebook/issues" configurable = true -version = "3.0.1-alpha.2" +version = "3.0.1-alpha.3" omeka_version_constraint = "^1.2.0" diff --git a/src/Controller/Admin/EbookController.php b/src/Controller/Admin/EbookController.php index ecc4f66..675e67b 100644 --- a/src/Controller/Admin/EbookController.php +++ b/src/Controller/Admin/EbookController.php @@ -102,7 +102,7 @@ public function createAction() } // Set default values to simplify checks. - $params += array_fill_keys(['resource_type', 'resource_ids', 'query', 'batch_action', 'ebook_all'], null); + $params += array_fill_keys(['resource_type', 'resource_ids', 'query', 'batch_action'], null); $resourceType = $params['resource_type']; $resourceTypeMap = [ @@ -124,7 +124,9 @@ public function createAction() ? (is_array($params['resource_ids']) ? $params['resource_ids'] : explode(',', $params['resource_ids'])) : []; $params['resource_ids'] = $resourceIds; - $selectAll = $params['batch_action'] ? $params['batch_action'] === 'ebook-all' : (bool) $params['ebook_all']; + // Manage Omeka with or without pull request #1260 (with or without + // param batch_action), so check $resourceIds. + $selectAll = $params['batch_action'] ? $params['batch_action'] === 'ebook-all' : empty($resourceIds); $params['batch_action'] = $selectAll ? 'ebook-all' : 'ebook-selected'; $controllers = [ diff --git a/src/Form/EbookForm.php b/src/Form/EbookForm.php index 78fc5eb..71b5c79 100644 --- a/src/Form/EbookForm.php +++ b/src/Form/EbookForm.php @@ -122,7 +122,7 @@ public function init() // TODO The Omeka param is a locale, not the language needed for ebook. $this->add([ 'name' => 'dcterms:language', - 'type' => 'LocaleSelect', + 'type' => 'Omeka\Form\Element\LocaleSelect', 'options' => [ 'label' => 'Language', // @translate ],