1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

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

Discussion in 'Community' started by lousyfool, Nov 9, 2018.

  1. lousyfool

    lousyfool New Member

    Level: Community
    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 (Text):
    Class '\Fabrik\Helpers\Image\Imagegd2' not found
    PHP error log:
    Code (Text):

    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!
     
  2. p38

    p38 Member

    Level: Community
    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: Nov 13, 2018 at 10:25 AM
  3. troester

    troester Well-Known Member Staff Member

    Level: Community
    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: Nov 13, 2018 at 12:08 PM
  4. p38

    p38 Member

    Level: Community
    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: Nov 13, 2018 at 9:03 PM
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    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
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    lousyfool and p38 like this.
  7. p38

    p38 Member

    Level: Community
    Thanks a ton Hugh, much appreciated.
     
  8. lousyfool

    lousyfool New Member

    Level: Community
    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 (Text):

    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.)
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
  10. lousyfool

    lousyfool New Member

    Level: Community
    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: Nov 16, 2018 at 5:31 AM

Share This Page