layout template switching to system default (not one specified in form layout) when error occurs.

skyrun

Active Member
we have a multi-page form using a custom template selected in layout.

but recently (after a fabrik update perhaps), when we use this code in a plugin to throw an error, the form displays, but displays with the default template for fabrik vs. the one we have specified. i am 99% sure that this same code has worked in the past (like approx a few weeks back).

here's what i THINK is happening. the form is also specified in a hidden menu item that points to the form (testlocation.skyrun.com/reservation). That menu item has the fabrik form defined and in the 'fabrik form options' tab, the template is '- use default -'. that used to mean use the form setting. now it seems to have changed to mean use the default template instead of what is defined in the form ONLY when an error is returned. so i set that menu item to the template i wanted to use and it started working correctly.

here is the code we use to set the error in case that matters:
Code:
 if ($result->error) {
        $formModel->errors['srms_reservation_form___reservation_pricing'][] = " ";  // This is just a formality, there should be at least one element with error.
        $formModel->getForm()->error = $result->message; // set form error message
        return false;
    }

so i have a solution that i will implement by changing 25 menu items, but wanted to let you know that i think the behavior has changed and probably is non-intuitive now (using a different template when displaying an error vs. not).
 
yes, it appears to be.
perhaps that user can try setting the template in his menu item and that works around the issue.

i think the behaviour of a menu item has changed wrt validation failures.
 
I still can't replicate this. I tired adding a hidden menu linking to my test form, no change in my various test cases.

Can you provide a simple test case, with step by step instructions to set it up, that provokes this issue?

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top