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

0 Cannot access empty property since update

Discussion in 'Community' started by Intelartifice, Jan 14, 2019.

  1. Intelartifice

    Intelartifice Member

    Level: Community
    Hi,
    I've several form on my site and all are good except one since update to Fabrik 3.9
    If I disable the email and redirect form plugin it's Ok
    But if enable one of these plugin I get 0 Cannot access empty property.
    Only on one form :( !!! And of course it's an important form...

    If some one an idea ?

    Joomla 3.9.1
    Fabrik 3.9 + lib 3.9
    PHP 7.0

    Regards,
    Jean-Marc
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    What are the settings of these plugins?
    Do you have custom code (e.g. email to, condition, attachement...)?
     
  3. Intelartifice

    Intelartifice Member

    Level: Community
    Hi Troester,
    NO there is no condition, no attachement, no template article ....
    Only text with placeholder

    The error occurs even with a simple redirect to homepage ....
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Can you set error reporting in Joomla to maximum and enable debug mode, and see if you get a more informative error message including the file name and line number.

    -- hugh
     
  5. Intelartifice

    Intelartifice Member

    Level: Community
    Ok
    so, in list view :
    Warning: Division by zero in my path site root /form/plugins/fabrik_element/calc/calc.php(313) : eval()'d code on line 1

    in form/detail/add view :
    Warning: Division by zero in my path site root /form/plugins/fabrik_element/calc/calc.php(104) : eval()'d code on line 1

    Then on debug mode at the and of the page there is :
    SELECT b.id

    FROM l7w43_user_usergroup_map AS map

    LEFT JOIN l7w43_usergroups AS a
    ON a.id = map.group_id

    LEFT JOIN l7w43_usergroups AS b
    ON b.lft <= a.lft
    AND b.rgt >= a.rgt

    WHERE map.user_id = 524
    Explication
    id select_type table type possible_keys key key_len ref rows filtered Extra
    1 SIMPLE map ref PRIMARY PRIMARY 4 const 2 100.00 Using index
    1 SIMPLE a eq_ref PRIMARY PRIMARY 4 avis2sante_telemedicine_joomform.map.group_id 1 100.00 NULL
    1 SIMPLE b ALL idx_usergroup_nested_set_lookup INDEX N'A PU ÊTRE UTILISÉ NULL NULL 15 100.00 Range checked for each record (index map: 0x10)

    Thanks for helping
    Regards
    Jean-Marc
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Well ...

    ... means you have an error in your code in a calc element, so first step is to fix that. You need to make sure whatever you are dividing by has a value. So, say you are using a placeholder to get the value of an element you will be dividing by ...

    Code (Text):

    $myValue = (int)'{yourtable___yourelement}';
    if ($myValue !== 0) {
      return $something / $myValue;
    }
    else {
      return 0;
    }
     
    -- hugh
     
  7. Intelartifice

    Intelartifice Member

    Level: Community
    Hi Cheese,
    Ahah! you're right, but strangely before update I didn't get this error !!!
    As, I don't have this on my second server !
    I take a look about that, I think there is something else

    Thanks
    And I have another question, so : new thread...
     
  8. Intelartifice

    Intelartifice Member

    Level: Community
    Hi,
    I've set the division by zero :)) dummie forgot) but the error is still here
    Call stack :

    0 Cannot access empty property
    /home/....../preprod/web/form/libraries/fabrik/fabrik/Helpers/ArrayHelper.php:157
    Call stack
    #
    Function Location
    1 () JROOT/libraries/fabrik/fabrik/Helpers/ArrayHelper.php:157
    2 Fabrik\Helpers\ArrayHelper::toObject() JROOT/plugins/fabrik_element/databasejoin/databasejoin.php:2052
    3 PlgFabrik_ElementDatabasejoin->getEmailValue() JROOT/components/com_fabrik/models/plugin-form.php:419
    4 PlgFabrik_Form->getEmailData() JROOT/components/com_fabrik/models/plugin-form.php:221
    5 PlgFabrik_Form->getProcessData() JROOT/plugins/fabrik_form/email/email.php:87
    6 PlgFabrik_FormEmail->onAfterProcess() JROOT/components/com_fabrik/models/pluginmanager.php:676
    7 FabrikFEModelPluginmanager->runPlugins() JROOT/components/com_fabrik/models/form.php:1303
    8 FabrikFEModelForm->process() JROOT/components/com_fabrik/controllers/form.php:313
    9 FabrikControllerForm->process() JROOT/libraries/src/MVC/Controller/BaseController.php:710
    10 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/components/com_fabrik/fabrik.php:181
    11 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402
    12 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377
    13 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:194
    14 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:233
    15 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:196
    16 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49

    I repeat the form plugins work great in other forms, just this one. As I add a form plugin (redirect, mail, ....) I get this error
    For sending mail I use :
    One default field with : $user =& JFactory::getUser(); return $user->get('email');
    And a calc field with :
    $expertId = '{a2s_dossier_expertise___nom_expert_raw}';
    $myDb = JFactory::getDbo();
    $myQuery = $myDb->getQuery(true);
    $myQuery->select('e_mail')->from('a2s_users')->where->where('id = ' . $myDb->quote($expertId));
    $myDb->setQuery($myQuery);
    return $myDb->loadResult();

    {a2s_dossier_expertise___nom_expert_raw}'; :
    Databasejoin (a2s_users) with concat label : nom,' - ',pro_firstname,', ',specialite_list

    the data are well set in the list.
    but the worst is that even with a simple redirect formplugin it doesn't work.

    Regards,
    Jean-Marc
     
    Last edited: Jan 28, 2019

Share This Page