Redirect On New

boyjah

Member
I have a form set to redirect to a specific page In Frontend On New and another page In Frontend On Edit. But it always simply returns to On Edit page, even if it is a first time submission. How does Fabrik determine what is New versus what is Edit, for the purpose of a redirect?
 
In the plugin settings you have the "On" select with options "Both", "New" and "Edit". Do "New" or "Edit" not work for you?
 
If I set it to "New", redirect is ignored. If I set it to "Edit" or "Both", then it works. But this then ignores my second redirect option. I have one redirect for "New" submissions and the other redirect for "Edit" submissions. But the Redirect plugin seems to treat New submissions as if they are edits, not new.
 
Hmm, haven't tried it, but the order of the plugins may matter. Whatever the order right now in your site, swap them around and try again?
 
I will try it, but sadly Fabrik makes that extremely difficult! I wish we could just move them around to change the order. Instead, we must rewrite them all in the different order. It seems, though, that perhaps I can solve this by placing a php condition in each redirect, but I can't find a good example of how to do it. My redirect would be based on a field coming from a non-Fabrik table (table = #__comprofiler field = cb_usertype). The typical Fabrik placeholder approach does not seem to work if I use the condition:

$value = '{#__comprofiler___cb_usertype_raw}';
if($value == 'hp'){
return true;
}
else{
return false;
}

I think if I could find the correct php condition syntax, I could apply it to both redirects and fix the problem?
 
I can't replicate.
Redirect "on new" is run "on new", "on edit" run "on edit", the order doesn't matter.
What you can't have is "on both" with some other: after running the first matchig redirect it's finished.

php code:
You can only use placeholders which are defined in your Fabrik form (so your form elements and the general ones like {$my->id})
Check what you get with e.g. var_dump or the jdump extension.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top