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

Problems with validation since Joomla 3.9 and Fabrik 3.9 update

Discussion in 'Community' started by shepplerd, Nov 27, 2018.

  1. shepplerd

    shepplerd New Member

    Level: Community
    I've inherited a Joomla site with an extensive portion built with Fabrik. For the most part it's been working just fine and I've been able to keep it updated, etc... However, since the Joomla & Fabrik 3.9 updates, we've had an issue adding new users via Fabrik form. In testing I've found that the form field validation doesn't seem to be working properly: some fields don't run validation at all, others fields fail validation when they shouldn't, etc... And if I try to submit/save the form, I get this error:

    0 - An error has occurred.
    syntax error, unexpected 'regexp' (T_STRING)
    Return to Control Panel

    So far I've brought up a test non-production version of the site and updated Fabrik from Github, just updated to Joomla 3.9.1, etc... So far no change.

    Has anyone else had any issues with regex and/or form field validation with Joomla 3.9.x and Fabrik 3.9? Or have any ideas on what I can check on?

    Thanks!
     
  2. sodes

    sodes New Member

    Level: Community
    I've had issues with a date php validation since upgrading to 3.9 (Fabrik and Joomla), even though 'Match' is selected for 'Match or Replace' and the validation returns a boolean value, the date is actually changed to an invalid (strange) value after the validation runs. Sorry, no resolution, I've had to turn it off
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    @shepplerd - what validations do you have enabled on that form? There's nowehere in our code we use 'regexp' in a PHP context ... do you have any custom code in your validations, either in the conditions or (say) a PHP validation?

    @sodes - what is the code in your validation? Also, make sure your code is in the PHP box, not the Condition box.
     
  4. sodes

    sodes New Member

    Level: Community
    see attached screen shot
    this field is used in a repeating group
     

    Attached Files:

  5. shepplerd

    shepplerd New Member

    Level: Community
    @cheesegrits - There are a number of elements on the form with multiple validations enabled. Some are just PHP, some are both php and regex, etc... I'll start off with just one of the validation items for now. As an example of one of the regex validations that fails even before attempting to save/submit the form is in the City field of the member address.

    The city field has two validations enabled - regex and php.
    For regex:
    Action: regex
    Status: Published
    In: Both
    Out: Both
    Validate Hidden: Yes
    Must Validate: Yes
    Show validation icon: Yes
    Error message: This does not look like a valid city name.
    Condition: <empty>
    Regular Expression:
    Code (Text):
    /^[a-z\s,.'-]*$/i
    Match or replace: Match
    Tip text: City name may only include any of the following: upper and lower case Alphabet characters, periods(.), commas(,), dashes(-), apostrophes(') or spaces.

    The php validation has the following PHP code:
    Code (Text):
    return ucwords(strtolower($data));
    However, if I enter a regular city name (e.g. Chicago) - it fails and pops up the Tip text in a box.
     

    Attached Files:

  6. shepplerd

    shepplerd New Member

    Level: Community
    So, I learned a little bit more today. I restored a backup of the site running Joomla 3.8.12 to my test server and found that the issue exists there, too. So, my apologies, the issue didn't occur after the Joomla and Fabrik 3.9 updates, but happened earlier and wasn't found/reported. When I have time, I'm going to restore back to an even older version and step it forward to see if I can identify when the issues start. I'll update this thread with what I discover. Thanks!
     
    cheesegrits likes this.
  7. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    @shepplerd - I can't replicate this. I just set up an element with those exact validations, with Toggle Submit and AJAX validation on the form, and they run as expected.

    I doubt it's related, but what PHP version are you running?

    -- hugh
     
  8. shepplerd

    shepplerd New Member

    Level: Community
    @cheesegrits - I did find that it wasn't just the 3.9 (Fabrik & Joomla) updates that caused this .. it was an issue before the 3.9 updates that just wasn't noticed/reported. I do have an old backup of the site and I'm going to restore that to my test environment and verify that it's working there. From there I'll step through some of the Joomla and Fabrik updates to see if I can find where it starts having issues.

    To answer your question re: PHP version, the production site is on PHP 7.0.31. Will hopefully be changing that to a newer version as soon as the webhost updates the server.

    The test environment is on PHP 7.2.

    Behavior is the same on both.
     
  9. shepplerd

    shepplerd New Member

    Level: Community
    @cheesegrits - Ok, new info - I restored an old version of the site to my test environment. It's running Joomla 3.7.12 and Fabrik 3.6. It failed differently, but did every validation (regex and/or php) and form submission failed (same "syntax error, unexpected 'regexp' (T_STRING)" as above).

    However, when I changed the PHP version from 7.2 to 5.6, everything started working on my test site. Form field validation and form submission were successful.
     
  10. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Set error reporting to max, and it should show you what line of code is failing.

    Usually that error means you've got some quoting on a string wrong in your custom code. Either you've not quoted something, or you've tried to embed quotes.

    -- hugh
     
  11. shepplerd

    shepplerd New Member

    Level: Community
    Ok, I'll give that a shot. As I mentioned, I inherited doing the maintenance on this site after someone else built it. I'll work on going through and checking all of that and see if I can get it figured out. Thanks for the help so far, your question on PHP version is what prompted me to try changing that back to PHP 5.6.
     

Share This Page