Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Form module error

edited March 2 in Modules
I am trying the Forms module for the 1st time, and having located the 'parser_allowed_functions' config array in MY_Fuel.php (incidentally, the module docs refer to editing the parser config file instead of this) and adding the 'form' function, I can render a form OK via the WYSIWYG, but with a lot of
A PHP Error was encountered Severity: Notice Message: Array to string conversion Filename: libraries/Fuel_forms.php Line Number: 1771 ...
errors. I'm using Fuel v1.4, under PHP 7.

Comments

  • edited 5:19AM
    What does line 1771 look like for you in Fuel_forms.php? Do you have the latest version of it by chance?
  • edited March 6
    Line 1771 is
    return is_true_val($this->$found[1]);

    It's the master branch from Github, from last week.
  • edited March 6
    What seems to be happening is that some $found[1] values, whilst strings, do not evaluate as string properties of Fuel_forms class? eg one value that trips the error is 'javascript_submit'. Could the value $this->javascript_submit itself be an array? I'm not sure if that is a dynamically created property?
  • edited March 7
    That line should be:
    return !empty($this->{$found[1]});
    It's in the develop branch. I've merged it into the master.
  • edited 5:19AM
    That works for me, thanks!
  • edited March 10
    Could the module documentation be updated to refer to the proper config file? I ran into this same problem (creating and editing the wrong config file) today.
  • edited 5:19AM
    Sure thing... I've updated it.
  • edited June 1

    I had this working back in March, but now I've come back to it there are issues! When I submit a form (which renders OK) all I get now is a page with nothing but a script tag

    /fuel/modules/fuel/assets/js/jquery/plugins/jquery-migrate-1.1.1.js?c=-62169984000
    

    and in the console, "jQuery is not defined" from the script above. The page never seems to complete, and there is nothing seemingly of interest in the log. That seems to think the page has completed.

    This is using the either the master or dev versions of the Forms module.

  • So I still have this problem with CMS defined forms when using 'javascript submit' = 'yes'.

    Clicking Submit shows an 'undefined' message (jQuery undefined) in the 'messages' element, before rendering nothing but the jquery migrate tag (whilst submitting to the same page as the origin form). The page never completes.

    Not setting the 'javascript submit' option in the module admin doesn't cause an issue, and using the 'validate' option is OK too.

    All the scripts are loading (validate, additional-methods, jquery.forms, forms).

    The call to ajaxSubmit() occurs (so maybe the fault is in jquery.forms.js), but I haven't had time to investigate further.

  • Does this error happen if you are not logged into the CMS?

  • I hadn't tried that, and I just now have.

    Logged out of the admin, the messages element shows 'Undefined' briefly, but the form does submit and return, with the expected "After submit text" message.

    Presumably the "undefined" text should have the "javascript waiting message" instead? That is defined in the admin, but doesn't ever appear.

  • Are you able to capture what line number and file the Undefined is coming from?

Sign In or Register to comment.