Fatal Error: During inheritance of SplFileInfo

My specifications are:

  • Linux Mint
  • LinuxValet.plus as web server
  • GroceryCrudEnterprise 2.9.4
  • CodeIgniter 4

I set the upload folder to public/uploads, then I do:

$uploadValidations = [
      'maxUploadSize' => '20M', // 20 Mega Bytes
      'minUploadSize' => '1K', // 1 Kilo Byte
      'allowedFileTypes' => [
        'gif', 'jpeg', 'jpg', 'png', 'tiff'
      ]
    ];
    $crud->setFieldUpload('thumbnail', 'uploads', base_url() . '/uploads', $uploadValidations);

The error I get:

<b>Fatal error</b>:  During inheritance of SplFileInfo: Uncaught ErrorException: Return type of Upload\File::getExtension() should either be compatible with SplFileInfo::getExtension(): string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /paud/app/Libraries/GroceryCrudEnterprise/codeguy/upload/src/Upload/File.php: 187

Hello @xyz,

This is an issue with PHP 8.1 and upload files for Grocery CRUD Enterprise. I am working on a fix and soon I will have an update. I will let you know once this will be available.

Regards
Johnny

Hello @xyz ,

The issue is now fixed at the latest version of Grocery CRUD Enterprise (2.9.5). Please let me know if the latest version fixed the issue that you had. You can download the latest version from here: User's Page Login

Regards
Johnny

Thank you, @johnny .

I’ll try.