[SOLVED] Image upload: "Class '\Fabrik\Helpers\Image\Imagegd2' not found" and PHP errors

lousyfool

Well-Known Member
Staff member
Hi again,

Since updates J! 3.8.x -> 3.9 and Fabrik 3.8.1 -> 3.9, image uploads with the 'fileupload' element don't work anymore but throw errors, in frontend, backend and PHP error log, and both in PHP 7.2 and 7.1.

Frontend/backend error:
Code:
Class '\Fabrik\Helpers\Image\Imagegd2' not found

PHP error log:
Code:
Undefined index: j_bc_content___img_main in /blablabla/plugins/fabrik_element/fileupload/fileupload.php on line 2254
Undefined variable: myFileDir in /blablabla/plugins/fabrik_element/fileupload/fileupload.php on line 2260

I'm not using AJAX upload but standard.
Needless to say, since updating no other relevant settings have been modified, and GD support is still enabled on the server.

Many thanks for another quick intervention!
 
I can confirm this issue.

It worked fine on the latest Fabrik 3.8.

But as soon as I upgraded to Fabrik 3.9 this problem occured.

Unfortunately this is critical, as I have too many sites to revert back to an older version.

Hugh, or someone who knows where the issue might be, is it possible you can have a look at this please?

Thanks,
 
Last edited:
Can you check if there's a file
your-site\libraries\fabrik\fabrik\Helpers\Image\Imagegd2.php

I can't replicate but I'm running a GitHub update.
 
Last edited:
Hi Troester, yes there is.

Size is 4370 bytes

However, looking deeper at the error message "0 Class '\Fabrik\Helpers\Image\Imagegd2' not found"

I see it is looking for Fabrik with capital F, yet on my install, the folder is lowercase

0:/public_html/libraries/fabrik/fabrik/Helpers/Image/

Could this be an issue?
 
Last edited:
The case of the class and file paths aren't related.

@p38 - can you find me on Skype, and get me logged on to your site.

-- hugh
 
Sorry, been away the last two days, but can now confirm that after applying the Github fix, image uploads are working fine again!
Brilliant - many thanks for the prompt and effective solution, also to @p38 for joining in!

I'm still getting the same two lines in the PHP error log, though:
Code:
PHP Notice:  Undefined index: j_bc_content___img_main in /blablabla/plugins/fabrik_element/fileupload/fileupload.php on line 2254
PHP Notice:  Undefined variable: myFileDir in /blablabla/plugins/fabrik_element/fileupload/fileupload.php on line 2260

Anything that could/should be done about it?

Thank you so much again!

(P.S.: No kidding... am thinking to take out a support subscription as another way of "rewarding" your good work, but it seems to be not possible now. I'll keep an eye open for it and do the useful then.)
 
... it means your upload element doesn't exist in the submitted data.

I've added some code to stop the warnings, but there's probably another underlying issue.

Many thanks, Hugh,

Indeed, no more notices in the log.
Not sure if it helps, but from testing before applying the fix I can say that the notices were thrown only when a new or different file was uploaded on form submission, but not when the form was submitted without a file (the element is not "required") or when the file remained the same in edit mode.

Anyway, I'll mark this "solved" for now. Thanks again!
 
Last edited:
I'm experiencing this with a new list I'm working on. It's worth noting that I recently used the fabrik library to patch some buggies. Currently on fabrik 3.9
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top