Fix #20348: ErrorHandler::convertExceptionToError() Passing E_USER_ERROR to trigger_error() is deprecated since PHP 8.4

This commit is contained in:
Wilmer Arambula
2025-06-25 08:07:46 -04:00
committed by GitHub
parent 4c5a6c5035
commit f3eefee572
7 changed files with 169 additions and 9 deletions

View File

@ -174,12 +174,14 @@ class ActiveField extends Component
// use trigger_error to bypass this limitation
try {
return $this->render();
} catch (\Exception $e) {
ErrorHandler::convertExceptionToError($e);
return '';
} catch (\Throwable $e) {
ErrorHandler::convertExceptionToError($e);
return '';
if (PHP_VERSION_ID < 70400) {
trigger_error(ErrorHandler::convertExceptionToString($e), E_USER_ERROR);
return '';
}
throw $e;
}
}