diff --git a/asset/js/zotero-import.js b/asset/js/zotero-import.js index 907db36..0bf4ef9 100644 --- a/asset/js/zotero-import.js +++ b/asset/js/zotero-import.js @@ -1,4 +1,4 @@ -// Kept for compatibility with Omeka < 1.2. +// Kept as long as pull request #1260 is not passed. Omeka.zoteroImportManageSelectedActions = 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.zoteroImportManageSelectedActions = 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.zoteroImportManageSelectedActions(); }); diff --git a/src/Controller/IndexController.php b/src/Controller/IndexController.php index 519286a..03800da 100644 --- a/src/Controller/IndexController.php +++ b/src/Controller/IndexController.php @@ -124,7 +124,7 @@ public function exportAction() } // Set default values to simplify checks. - $params += array_fill_keys(['resource_type', 'resource_ids', 'query', 'batch_action', 'zotero_all'], null); + $params += array_fill_keys(['resource_type', 'resource_ids', 'query', 'batch_action'], null); $resourceType = $params['resource_type']; $resourceTypeMap = [ @@ -143,7 +143,9 @@ public function exportAction() ? (is_array($params['resource_ids']) ? $params['resource_ids'] : explode(',', $params['resource_ids'])) : []; $params['resource_ids'] = $resourceIds; - $selectAll = $params['batch_action'] ? $params['batch_action'] === 'zotero-all' : (bool) $params['zotero_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'] === 'zotero-all' : empty($resourceIds); $params['batch_action'] = $selectAll ? 'zotero-all' : 'zotero-selected'; $query = null;