Skip to content

Commit

Permalink
[bulk actions] remove timeout before doing bulk actions
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Jan 18, 2024
1 parent 21e159c commit a238724
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions ext/bulk_actions/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,26 +170,19 @@ public function onPageRequest(PageRequestEvent $event): void
$items = null;
if (isset($_POST['bulk_selected_ids']) && !empty($_POST['bulk_selected_ids'])) {
$data = json_decode($_POST['bulk_selected_ids']);
if (empty($data)) {
if (!is_array($data) || empty($data)) {
throw new BulkActionException("No ids specified in bulk_selected_ids");
}
if (is_array($data)) {
$items = $this->yield_items($data);
}
} elseif (isset($_POST['bulk_query']) && $_POST['bulk_query'] != "") {
$items = $this->yield_items($data);
} elseif (isset($_POST['bulk_query']) && !empty($_POST['bulk_query'])) {
$query = $_POST['bulk_query'];
if (!empty($query)) {
$items = $this->yield_search_results($query);
}
$items = $this->yield_search_results($query);
} else {
throw new BulkActionException("No ids selected and no query present, cannot perform bulk operation on entire collection");
}

$bae = new BulkActionEvent($action, $items);

if (is_iterable($items)) {
send_event($bae);
}
shm_set_timeout(null);
$bae = send_event(new BulkActionEvent($action, $items));

if ($bae->redirect) {
$page->set_mode(PageMode::REDIRECT);
Expand Down

0 comments on commit a238724

Please sign in to comment.