Skip to content

Commit

Permalink
FIX Reset time limit back to original value
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Feb 20, 2025
1 parent a4227a9 commit 25c7019
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Forms/GridField/GridFieldPrintButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,26 @@ public function getURLHandlers($gridField)
*/
public function handlePrint($gridField, $request = null)
{
$orig = ini_get('max_execution_time');
set_time_limit(60);
Requirements::clear();

$data = $this->generatePrintData($gridField);

$this->extend('updatePrintData', $data);

$ret = null;
if ($data) {
return $data->renderWith([
$ret = $data->renderWith([
get_class($gridField) . '_print',
GridField::class . '_print',
]);
}
// Reset the time limit, this is done mainly to prevent the 60 second time limit from
// making unrelated unit-tests run out of execution time when running a testsuite.
set_time_limit($orig);

return null;
return $ret;
}

/**
Expand Down

0 comments on commit 25c7019

Please sign in to comment.