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

Small error after upgrading to PHP 7.1: Use of undefined constant params

Discussion in 'Community' started by Mustafa_s, Dec 3, 2018.

  1. Mustafa_s

    Mustafa_s Member

    Level: Community
    Hello Fabrik team,

    I upgraded to PHP 7.1, Joomla 3.9.1 and Fabrik 3.9, however, ever since the upgrade I'm getting the following error message on a CALC element: Use of undefined constant params - assumed 'params'.

    This is the screenshot of the frontend error message (with MAX error reporting and Debug on): https://i.imgur.com/HyHZtqd.png

    This is the screenshot of the backend of the CALC element: https://i.imgur.com/yWQYpJi.png

    Anyone can guide me in the right direction? What am I doing wrong here?

    Thanks!
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    As in the error message: Use of undefined constant params...
    $search = params;
    What should params be, the string 'params'?
    I don't think this is a php7.1 effect, maybe before you had set error reporting to a lower level.
     
  3. Mustafa_s

    Mustafa_s Member

    Level: Community
    This is so long ago I don't even remember what I was trying to do :-/ Seems like On Save I'm trying to get the filename of the fileupload element called premfacesall___file.

    $image_file = '{premfacesall___file_raw}' . ".png";
    $image_path = "images/site/faces/";
    $url = JURI::base() . $image_path . $image_file;


    $path = "{premfacesall___file_raw}";
    $path2 = basename($path) ."<br/>";

    $subject = "$path2";
    $search = params;
    $trimmed = str_replace($search, '', $subject);
    $filename = strstr($trimmed, '.png', true);

    return $filename;

    This was certainly working before (agreed then maybe way before the change to PHP 7.1), not sure why it's now now. Don't know what Parms should be now.
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Even if it was supposed to be $params, there is no $params in a calc element, so I'm really not sure what you were trying to do.

    -- hugh
     
  5. Mustafa_s

    Mustafa_s Member

    Level: Community
    Hey cheesegrits & troester,

    I finally found time to take a closer look into what was going on, it's basically looking for the string 'params', so that was an easy fixed.

    Thank you for the assistance, I appreciate it.
     

Share This Page