? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
8 Sep 2021

Pull Request for Issue #35487

Summary of Changes

Removal of a single error suppressor, in a file thats already deprecated without replacement, to ensure PHP 8 compatibility with the JoomlaTools framework when PHP8 and debug is used

... and "because its better"

Testing Instructions

Install Joomla 3 and set up caching with Cache Lite, on a PHP 8 server that runs XDebug and DocMan from https://www.joomlatools.com (I know a very specific and very niche set up)

Attempt to access site.

Actual result BEFORE applying this Pull Request

"500 error include_once(Cache/Lite.php): Failed to open stream: No such file or directory"

Enable error reporting/debug mode and then you get a JoomlaTools framework Exception:

KExceptionError | Warning [500]
include_once(Cache/Lite.php): Failed to open stream: No such file or directory
.../libraries/src/Cache/Storage/CacheliteStorage.php:347

Expected result AFTER applying this Pull Request

No errors on loading home page

Documentation Changes Required

joomla/coding-standards#274

avatar PhilETaylor PhilETaylor - open - 8 Sep 2021
avatar PhilETaylor PhilETaylor - change - 8 Sep 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Sep 2021
Category Libraries
avatar PhilETaylor PhilETaylor - change - 8 Sep 2021
Labels Added: ?
avatar wilsonge
wilsonge - comment - 8 Sep 2021

Presumably this would also have fixed #10862

avatar PhilETaylor
PhilETaylor - comment - 8 Sep 2021

I doubt it, #10862 is talking about "require_once" which creates a fatal error (even in PHP 8) whereas the code that is in Joomla 3.10.x today is an "include_once" which will never create a fatal error, only a warning, unless you have XDebug installed and JoomlaTools Framework installed (which is responsible for raising a warning into a KExceptionError Exception.

related noise: #35487

avatar skurvish
skurvish - comment - 8 Sep 2021

I have tested the code change on my system that exhibited this issue and it resolves the issue.

avatar alikon alikon - alter_testresult - 8 Sep 2021 - skurvish: Tested successfully
avatar richard67
richard67 - comment - 11 Sep 2021

@PhilETaylor Appveyor is failing for PHP versions 7.* with following message

Command executed with exception: PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; Cache_Lite has a deprecated constructor in C:\projects\joomla-cms\libraries\vendor\pear\cache_lite\Cache\Lite.php on line 29

e.g. here: https://ci.appveyor.com/project/release-joomla/joomla-cms/build/job/hqwu27rij3ckij0h

avatar PhilETaylor
PhilETaylor - comment - 11 Sep 2021

Awesome isn't it... when people dont listen to my expertise but demand something to be changed for their own sake, who propose a solution but dont test it...

The problem is that Cache_Lite is abandoned and unmaintained and has been for years. The last version was released on 2019-11-19.

I think the best solution is to abandon this PR.

As I said before

What is the point in fixing a single error suppression in a single feature that is hardly used by anyone (cache lite) and that is already deprecated and removed from Joomla 4, and that requires at least 4 specific things (PHP8, JoomlaTools, XDebug AND removal of cache_lite from previously working server) in order to trigger...

This is not really fixing anything except a very very very edge case. There are bigger issues to resolve.

avatar PhilETaylor PhilETaylor - change - 11 Sep 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-09-11 12:48:25
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 11 Sep 2021
avatar richard67
richard67 - comment - 11 Sep 2021

@PhilETaylor Does it need to re-open the issue #35487 ?

avatar PhilETaylor
PhilETaylor - comment - 11 Sep 2021

No just ignore it.. its such an edge case and removing this one error suppressor in the whole of the 700+ that Joomla uses is literally not important.

avatar PhilETaylor
PhilETaylor - comment - 11 Sep 2021

Of course thats just IMHO... Im not a maintainer...

avatar wilsonge
wilsonge - comment - 21 Sep 2021

I mean 2019 is only two years. I can't see the appveyor issue anymore. But the constructor thing basically means cache lite isn't ever working on PHP 8 right? If so then we can also add a prereq that ensures isSupported returns false for php 8 on top of this change (which looks good to me).

I mean I like the change anyhow just for removing the error supressor if nothing else.

avatar PhilETaylor
PhilETaylor - comment - 21 Sep 2021

forked to #35627 so it doesnt get lost as I dont have time this week.

Add a Comment

Login with GitHub to post a comment