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:
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).
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).