Form Redirect Plugin - Before Data Save?

Status
Not open for further replies.

bonghetti

Member
Hi, I'm experiencing an anomaly, so I don't know if it's a bug or a different behavior from what I expected and therefore needed. I set the redirect plugin so that based on the outcome set in the form when saving it redirects me to an external link but which requires placeholders. Apparently it works correctly, but in reality I noticed that it works by taking data from the database before modifying the data through the form. So if the link was to be opened with id 3 this works not when I set 3 in the form, but when this is previously saved on that record. I hope I was able to explain well. Thank you in advance
 
I don't understand your setup.
The redirect plugin is the last plugin, running onAfter (i.e. after the data is stored into DB).
So form data and DB data are the same.
 
I have done several tests and basically I have a practical outcome field that I am going to change and I would like to use the redirect plugin so that if the outcome is "Call back" or "Appointment scheduled" then that link should have started me. I found that it only worked if those outcomes were previously selected and not when I changed them, so I assumed that the plugin read the data from the database before saving
 
As @toester has said, the redirect plugin is running after everything else so should have the most recent data. Looking at the code it appears to be doing that. If it is not then there must be something odd going on.

Is it possible to get an akeeba backup with instructions so I can try it with the debugger? If so post details by pm.
 
Still not clear what you are trying to do.
The redirect plugin is the last plugin run on form save.
What is "outcome" , an element? Which type? "that I am going to change" Where/how?
What is your jump url in the redirect plugin, what are the other settings in the redirect plugin?...
 
Hi, first of all many thanks for your interest in solving the problem. Unfortunately it is not easy for me to provide any Akeeba backup in the short term because I would have to empty the customer's sensitive data (but I reserve the right to do so) - Here is the link for the redirect
https://calendar.google.com/calendar/u/0/r /eventedit?sf=true&output=xml&text={a_nominativi_ccm___parent_id}+({a_esita_ccm___user_id})&location={a_nominativi_ccm___indirizzi_alt}&details=Appuntamento&tmpl=component&format=partial
and here is the code for the condition:
$esitoRaw = (int) '{a_nominativi_ccm___esito_ult_raw}';
if ($esitoRaw === 3 || $esitoRaw === 4) {
return true;
} else {
return false;
}
As I wrote to you, the link opens for me not when I enter one of the two results indicated but when this was previously set. Anyway, I'll do some more tests soon. Also because you gave me confirmation, as I had already read in the wiki, that the redirect plugin occurs last.

PS: In the form the "esito_ult" field is a databasejoin
 
hi,
I humbly apologize. I found my mistake. I had taken another field that detected the previous result and I carried out the verification in the condition on the wrong field. I renew my thanks to you for the wonderful work you do and for your availability
 
The good news is you got it fixed. Maybe you can help others on the forum from time to time. Bandwidth is in short supply around here.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top