1. "Fabrik 4" helpers needed!

    You are invited to join other community members active in coding, maintaining and improving Fabrik. Please visit https://fabrik.help for more information!
    Dismiss Notice

Error 0 strtotime(): argument php8.1 Fabrik3

Discussion in 'Community' started by ontarget, Dec 6, 2022.

  1. ontarget

    ontarget Active Member

    Level: Community
    Hi users are occasionally getting the following error when completing a fabrik (multigroup) form
    Code (Text):
    strtotime(): argument #1 ($datetime) must be of type string array given
    I have a few standard date plugin elements changed to d-m-Y format with no advanced stuff.
    I also have a read only field element grabbing a date value which I believe is the culprit
    $myapp = JFactory::getApplication();

    $myparam = $myapp->input->getString('aaa_participant_claim___course_start_date');

    /*return $myparam;*/

    return date ('d-m-Y', strtotime($myparam));
    The difficulty is I havent been able to replicate the error myself so it's difficult to determine.
    would you suggest any improvement to the code above, is it php8.1 compatible?
    Thanks for any suggestions
  2. achartier

    achartier Super Moderator Staff Member

    Level: Community
    I suggest you put a check in such as:

    if (is_array($myparam)) var_dump($myparam); die;

    And see what is output. Perhaps that will give you some clues.

Share This Page