New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.10][PHP8.1, Xampp] PHP Error on white page instead of redirection to Joomla's error page #37035
Comments
Can you try what happens when you replace this line: https://github.com/joomla/joomla-cms/blob/3.10-dev/libraries/legacy/exception/exception.php#L64 |
No change with |
I found that bug a while ago (but apparently forgot to open an issue about it). This has nothing to do with xampp nor windows, as this happened on PHP 8.1 on a linux server as well. The problem is, that of PHP 8.1 the Exception class has now type hints for all it's properties, which now cannot be overridden without specifying the exactly same type hint. But there is a catch - this changed line is now a compile error on all PHP versions lower that 8.1. See also:
|
As said above. It didn't in libraries/legacy/exception/exception.php#L64. |
There is an additional |
@ManuelHu Could you do a full PR against 3.10-dev so we can include the changes with our next release? |
@zero-24 I'm not sure this is a good way - adding the type hints would break all sites on php 7.x and 8.0... (See both example links in my first answer). |
Ah yes thats not a good thing :D
Does that work down to 5.3.10 too, as this is the minimum version of 3.10? |
5.3.10 also appears to have the properties set-up as protected, too (
This should work as expected, at least I don't see anything that would break. But I haven't worked with such ancient php versions for a long time... Removing the properties would also remove the deprecation tags and the joomla doc blocks... I could prepare a pull request tomorrow. |
Great!
Thanks once done I will take the PR and run it against a local 5.3.10 to be sure. |
PR has been created here: #37074 (comment) thanks @ManuelHu |
Steps to reproduce the issue
Fatal error: Type of JException::$file must be string (as in class Exception) in Z:\xampp810\htdocs\j3-php81\libraries\legacy\exception\exception.php on line 18
I have tested that with "more complete" J3 sites. Same behavior.
Maybe related: #37015
The text was updated successfully, but these errors were encountered: