Skip to content

Commit

Permalink
Fixed use without fix omeka/omeka-s#1260.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-KM committed Apr 14, 2019
1 parent 667f4d9 commit b860414
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions asset/js/ebook-admin.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -33,7 +33,7 @@ Omeka.ebookManageSelectedActions = function() {
$('<input type="hidden" name="resource_type">').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();
});
Expand Down
2 changes: 1 addition & 1 deletion config/module.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 4 additions & 2 deletions src/Controller/Admin/EbookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion src/Form/EbookForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
],
Expand Down

0 comments on commit b860414

Please sign in to comment.