Skip to content
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

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

Open
eSilverStrike opened this issue Dec 2, 2022 · 12 comments
Labels
Bug An issue describing unexpected or malicious behaviour. Important Improvement Code cleanup, Obsolete functions, or small changes to existing Features.
Milestone

Comments

@eSilverStrike
Copy link
Member

While researching this issue:

#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:

  • Need to fix the PHP 8 issues ourselves
  • Find a replacement library
  • Remove the File Manager from Geeklog
@eSilverStrike eSilverStrike added Bug An issue describing unexpected or malicious behaviour. Improvement Code cleanup, Obsolete functions, or small changes to existing Features. Important labels Dec 2, 2022
@eSilverStrike eSilverStrike added this to the 2.2.3 milestone Dec 2, 2022
@eSilverStrike
Copy link
Member Author

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

@mystralkk
Copy link
Member

@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
Copy link
Member

Alternative file managers include:

@eSilverStrike
Copy link
Member Author

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
Copy link
Member Author

eSilverStrike commented Dec 4, 2022

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

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

  • Active Community... Actively being developed now
  • Framework Free
    Cons
  • PHP 7.2.5 required (though I am not against upping the Geeklog version to 7)

elFinder
Pros

  • Easy to integrate with web editors (elRTE, CKEditor, TinyMCE) (big plus here)
  • Lots of contributors
  • Supports PHP 5.2+
    Cons
  • Requires jQuery
  • Releases the last few years have slowed right down.

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An issue describing unexpected or malicious behaviour. Important Improvement Code cleanup, Obsolete functions, or small changes to existing Features.
Projects
None yet
Development

No branches or pull requests

2 participants