1. We suggest you do NOT update to Joomla 3.8.10 until we can resolve an issue it causes with caching in Fabrik. If you do install it, you'll need to disable Joomla's "System Cache" in the global System settings.
  2. Apologies for the recent server outage, a planned migration by our host provider to a new location turned into a bit of a nightmare.

Undefined property in fileupload.php

Discussion in 'Community' started by Slater, Jun 18, 2018.

  1. Slater

    Slater New Member

    Level: Community
    I've just updated from 3.7 to 3.81

    Since the update I am getting an error similar to one previously reported here..
    http://fabrikar.com/forums/index.php?threads/error-fileupload-element-when-upload-image-1mb.47472/


    When uploading images from a mobile phone using the image capture I get the following errors on form submission

    NOTICE: Undefined property: stdClass::$shop___id_raw in /home/svr/public_html/plugins/fabrik_element/fileupload/fileupload.php on line 1684

    followed by

    Fatal error: Class Fabrik\Helpers\Image\StringHelper' not found in /home/svr/public_html/libraries/fabrik/fabrik/Helpers/Image/Imagegd.php on line 101

    I've had to restore the backup to get the site working again..

    The error is not present when using desktop browsers, only on the mobile devices - requesting a desktop site from the mobile has made no difference.
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    Why are you using the GD image lib rather than GD2? What version of PHP are you running?

    GD (v1) is an ancient version of the PHP image processing library, which was deprecated and support removed in 2010, in favor of GD2:

    https://wiki.php.net/rfc/removal-of-deprecated-features

    Check your file upload settings, under Display, Image Lib, see if you have a version of GD which says something like "GD: bundled (2.x.x compatible)", and if so, select that.

    If not, then you really need to update your PHP.

    -- hugh
     
  3. Slater

    Slater New Member

    Level: Community
    Thanks Hugh

    PHP version is 5.6.36.

    Hunting for the file upload settings now...
     
  4. Slater

    Slater New Member

    Level: Community
    Seems I'm already using GD Bundled (2.1.0 compatible) - its the only option available in the Display,Image Lib

    Any other ideas ?
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    Ah HAH!

    I see the problem, and why it would be specific to mobile phones, with EXIF data in the image. If you have "WIP" (work in progress) enabled, we check the embedded EXIF data in the uploaded image, and attempt to rotate the image if necessary. Which winds up calling a (broken) function from the GD lib, rather than the GD2 lib.

    Try editing:

    ./libraries/fabrik/fabrik/Helpers/Image/Imagegd.php

    ... and at line 14, add this:

    Code (Text):

    use \Fabrik\Helpers\StringHelper;
     
    I think that'll fix it. Let me know. If it does, I'll commit the change to github.

    -- hugh
     
  6. teamwork

    teamwork Member

    Level: Community
    Hello! We had the same issue - this fixes it! Wanted to let you guys know.
     
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
  8. Slater

    Slater New Member

    Level: Community
    Thanks for the update...

    I'll need to plan an update on our site, but just a note - I did not have work in progress turned on.
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    Let me know if it doesn't fix the problem.

    -- hugh
     
  10. Borox

    Borox Member

    Level: Professional
    Hi,

    I had the same issue, but add "use \Fabrik\Helpers\StringHelper;" wasn't enough in my case.

    Fileupload was working on Android (6.0.1) and on a desktop, but on an iphone (tested with iPhone 4 / 6) I had a 'Class 'Fabrik\Helpers\Image\StringHelper' not found', with no indication of the file where the problem was.

    I added the line "use \Fabrik\Helpers\StringHelper;" in ./libraries/fabrik/fabrik/Helpers/Image/Imagegd.php

    After that I've had a new error: Class 'Fabrik\Helpers\Image\JFile' not found

    So I added: use JFile;

    After that I've had a new error: Class 'Fabrik\Helpers\Image\JFactory' not found

    So I added: use JFactory;

    And now it works again on iPhone

    Weird :) why iPhone only? someone else experiment the same problem?
     
  11. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    I really have no clue, and unfortunately I don't have an iPhone (or iAnything) to test with.

    -- hugh
     
  12. Borox

    Borox Member

    Level: Professional
    Hi Hugh,

    Previously it was working well with both android an iphone, I don't know when the problem began with iphone.
    With the 2 'use' I add it works again but could you put it in the next version?
     
  13. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Professional
    I've committed some changes to imagegd.php which should fix it.

    I'm still puzzled as to why Android doesn't trigger this, unless you have your Android phone configured not to include EXIF data in the uploads.

    -- hugh
     
  14. Borox

    Borox Member

    Level: Professional
    OK, I'll test the last github update and I'll let you know

    Nicolas
     

Share This Page