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

with latest github update, return $_REQUEST['anything']; in an element causes error

Discussion in 'Professional Support' started by skyrun, Dec 31, 2019.

  1. skyrun

    skyrun Active Member

    Level: Community
    when my element has the evaled default of
    return $_REQUEST['anything'], it causes this error.
    An error has occurred with a eval'd field - please inform the web-site owner.
    Debug: Caught exception on eval of reservation_id: syntax error, unexpected '(' in [myroot]/language/en-GB/en-GB.com_fabrik.ini on line 3

    there is no ( on the file referenced on line 3... line 3 is a comment.

    if i turn off 'eval', on the element reservation_id, then the error goes away (but doesn't resolve correctly of course).

    doesn't do it on an older version of fabrik, came in when i updated (i haven't updated for a few months... so could be any time in last few months).

    seems weird that it calls out the language ini file... maybe that rings a bell for someone.

    happens whether ?anything=something is set or not.
     
  2. skyrun

    skyrun Active Member

    Level: Community
    some updates. first, if i set allow fabrikdebug to NO or YES, then these errors go away. only when i set it to 'debug js' does the issue show.

    second, if i erase the language ini file, the error changes to:

    Error
    An error has occurred with a eval'd field - please inform the web-site owner.
    Debug: Caught exception on eval of reservation_id: Undefined property: stdClass::$title

    which is probably a more accurate error message. (reservation_id is the element with the eval default on it). i am getting this on lots of elements and they all boil down to Undefined property: stdClass::$title

    also weird is that i copied the components/com_fabrik and administrator/components/com_fabrik and plugins/fabrik_form (and fabrik_list and fabrik_elements) files from an older joomla that isn't showthis error message (even with debug js set in options) but this joomla still gets that error... so assuming i did the copy correctly, i am doubting my assumption that this is caused by the fabrik update.
     
  3. troester

    troester Well-Known Member Staff Member

    Level: Community
    Did you try to use Joomla's
    $myapp = JFactory::getApplication();
    $xy = $myapp->input->get('anything','default');

    and/or
    return (string)$xy;
    to get a defined, valid value

    And not sure what you mean with "copied ... files"? Did you mix files from different Fabrik versions?
     

Share This Page