Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
25 stars 19 forks source link

Geeklog File Manager doesn't support PHP 8 and the library seems to be Abandoned #1141

Open eSilverStrike opened 1 year ago

eSilverStrike commented 1 year ago

While researching this issue:

https://github.com/Geeklog-Core/geeklog/issues/1140

I notice that the RichFileManager we use for the Geeklog File Manager

https://github.com/psolom/RichFilemanager

hasn't been updated for 4 years and there is zero activity in the issues.

So, it looks like it has been abandoned by the developers.

This means we must do one of the following:

eSilverStrike commented 1 year ago

@mystralkk Do you have any possible options to use as a new File Manger?

mystralkk commented 1 year ago

@eSilverStrike I fixed issue #1140 just now, and are there other PHP 8 related issues with File Manager? I can use File Manager on Windows 11, Apache 2.4.54 and PHP 8.1.10.

mystralkk commented 1 year ago

Alternative file managers include:

eSilverStrike commented 1 year ago

On the surface Tiny File Manager looks promising. Been around for a while and lots of contributors.

Same with FileGator but not quite as popular.

I'll poke around a bit to see if I can find any other possible File Manager candidates.

At some point we will have to do some research to see what would be a good fit for Geeklog, feature and simplicity of integration wise.

eSilverStrike commented 1 year ago

PHP 8 related issues with File Manager? I can use File Manager on Windows 11, Apache 2.4.54 and PHP 8.1.10.

File Manager worked fine for me on PHP 7.4 but

on PHP 8.0 it failed to upload an image. No PHP error just the File Manager reporting:

Some files are failed during upload. Hover your mouse over a file in the queue to view detailed information.

and on PHP 8.1 I couldn't even load the file manager (Geeklog error reporting was set to -1, if not then it does load but uploads will fail). This was on Windows 10 (not sure the Apache version I will have to check). Looking more closely at the error log maybe it is a library that the File Manager depends on causing the issue...

Server error.
A PHP error has occurred:
This is being displayed as "Root Debugging" is enabled in your Geeklog configuration.
If this is a production website you must disable this option once you have resolved any issues you are investigating.

E_DEPRECATED(8192) - Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice @ C:\wamp64\www\geeklogdev\system\vendor\illuminate\container\Container.php line 1159

Call Stack
#   Function    File    Line
1   include C:\wamp64\www\geeklogdev\system\vendor\composer\ClassLoader.php 571
2   Composer\Autoload\includeFile   C:\wamp64\www\geeklogdev\system\vendor\composer\ClassLoader.php 428
3   loadClass   C:\wamp64\www\geeklogdev\system\vendor\servocoder\richfilemanager-php\src\helpers.php   17
4   RFM\container   C:\wamp64\www\geeklogdev\system\vendor\servocoder\richfilemanager-php\src\Application.php   191
5   registerRFM C:\wamp64\www\geeklogdev\system\vendor\servocoder\richfilemanager-php\src\Application.php   72
6   __construct C:\wamp64\www\geeklogdev\public_html\filemanager\connectors\php\filemanager.php 190

( ! ) Warning: Uncaught Error: Object of class UnwindExit could not be converted to string in C:\wamp64\www\geeklogdev\system\vendor\illuminate\container\Container.php:13 Stack trace: #0 C:\wamp64\www\geeklogdev\system\vendor\composer\ClassLoader.php(571): include() #1 C:\wamp64\www\geeklogdev\system\vendor\composer\ClassLoader.php(428): Composer\Autoload\includeFile('C:\\wamp64\\www\\g...') #2 C:\wamp64\www\geeklogdev\system\vendor\servocoder\richfilemanager-php\src\helpers.php(17): Composer\Autoload\ClassLoader->loadClass('Illuminate\\Cont...') #3 C:\wamp64\www\geeklogdev\system\vendor\servocoder\richfilemanager-php\src\Application.php(191): RFM\container() #4 C:\wamp64\www\geeklogdev\system\vendor\servocoder\richfilemanager-php\src\Application.php(72): RFM\Application->registerRFM() #5 C:\wamp64\www\geeklogdev\public_html\filemanager\connectors\php\filemanager.php(190): RFM\Application->__construct() #6 {main} thrown in C:\wamp64\www\geeklogdev\system\vendor\illuminate\container\Container.php on line 13
Call Stack
#   Time    Memory  Function    Location
1   0.0003  366560  {main}( )   ...\filemanager.php:0
2   0.7527  1327064 RFM\Application->__construct( $basePath = ??? ) ...\filemanager.php:190
3   0.7530  1327176 RFM\Application->registerRFM( ) ...\Application.php:72
4   0.7530  1327176 RFM\container( $make = ???, $parameters = ??? ) ...\Application.php:191
5   0.7530  1327176 Composer\Autoload\ClassLoader->loadClass( $class = 'Illuminate\\Container\\Container' ) ...\helpers.php:17
6   0.7533  1327288 Composer\Autoload\includeFile( $file = 'C:\\wamp64\\www\\geeklogdev\\system\\vendor\\composer/../illuminate/container\\Container.php' ) ...\ClassLoader.php:428
7   0.7534  1327552 include( 'C:\wamp64\www\geeklogdev\system\vendor\illuminate\container\Container.php )   ...\ClassLoader.php:571

( ! ) Fatal error: During inheritance of ArrayAccess: Uncaught in C:\wamp64\www\geeklogdev\system\vendor\illuminate\container\Container.php on line 13
Call Stack
#   Time    Memory  Function    Location
1   0.0003  366560  {main}( )   ...\filemanager.php:0
2   0.7527  1327064 RFM\Application->__construct( $basePath = ??? ) ...\filemanager.php:190
3   0.7530  1327176 RFM\Application->registerRFM( ) ...\Application.php:72
4   0.7530  1327176 RFM\container( $make = ???, $parameters = ??? ) ...\Application.php:191
5   0.7530  1327176 Composer\Autoload\ClassLoader->loadClass( $class = 'Illuminate\\Container\\Container' ) ...\helpers.php:17
6   0.7533  1327288 Composer\Autoload\includeFile( $file = 'C:\\wamp64\\www\\geeklogdev\\system\\vendor\\composer/../illuminate/container\\Container.php' ) ...\ClassLoader.php:428
7   0.7534  1327552 include( 'C:\wamp64\www\geeklogdev\system\vendor\illuminate\container\Container.php )   ...\ClassLoader.php:571
mystralkk commented 1 year ago

The illuminate/container library used by richfilemanager-php causes the error in the log. There is a forked version of richfilemanager-php, but this requires PHP 7. Forking and modifying the original richfilemanager-php to work with PHP 5.6.4 through PHP 8.1 would be too unrealistic, since we cannot upgrade the libraries it depends on, as you said. We will have to replace the current file manager with an alternative like Tiny File Manager or bump up the PHP version Geeklog will require to 7.x or newer.

mystralkk commented 1 year ago

Tiny File Manager is good, but it seems that it is NOT intended to be used with CKEditor or TinyMCE. How about elFinder, instead?

eSilverStrike commented 1 year ago

You mean when when a user uploads and image via the FCKEditor which then uses the File Manager for image selection? I had forgotten about that integration. So they are incompatible then... too bad (I did a quick google search and didn't see where)

On the surface FileGator has had a lot more activity but then they have less contributors that elFinder. Not sure if elFinder is just so feature complete that it is sort of at a maintenance stage...

FileGator Pros

elFinder Pros

I am not sure which way to go but then I haven't looked at the code or actually tried out FIleGator since they do not have a demo website running

mystralkk commented 1 year ago

There are far fewer free editors able to work with CKEditor or TinyMCE than several years ago. Such editors include Roxy Fileman (web site no longer exists), Responsive Filemanager (seems to be dead), FileManager (web site no longer exists), and KCFinder(inactive for 8 years), FileFator and elFinder, but all but the last two are not suitable to use now.

mystralkk commented 1 year ago

FileGator seems to assume that the "public" folder to be the document root, so other locations like "public_html/images/" are probably not allowed.

eSilverStrike commented 1 year ago

Just a thought....

Maybe it is worth to pick a better file manager even if it doesn't support CKEditor...

Maybe it is worth switching our editor to TinyMCE or some other option...

mystralkk commented 1 year ago

The Rich FileManager we are using is quite customizable, so it might be an option to fork its backend (RichFilemanager-PHP) and update it to work with PHP 8.x.