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 0bee3d2 commit 5eb0946
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions asset/js/zotero-import.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.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) {
Expand Down Expand Up @@ -33,7 +33,7 @@ Omeka.zoteroImportManageSelectedActions = 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.zoteroImportManageSelectedActions();
});
Expand Down
6 changes: 4 additions & 2 deletions src/Controller/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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;
Expand Down

0 comments on commit 5eb0946

Please sign in to comment.