Redirect URL returning wrong value

rsearle 28 Oct, 2011
Here's a backup of a form I cannot get to work. Display the form SelectAnnualLeaveApplicant and choose the Employee option. Custom code sets the hidden field {leaveform} = 'ProxyAnnualLeaveApplication'. There are two test emails (change the email addresses to test it out) around the Redirect URL that prove the assignment has been done correctly. Yet the Redirect URL retieves the default value of 'AnnualLeaveApplication' from {leaveform}, and redirects to the wrong form. What have I missed?

Thanks,

Russell Searle
Principal Consultant | Psicom | Melbourne, Australia
+61 422 412 941 | [email]rsearle@psicom.com.au[/email] | http://psicom.com.au
GreyHead 28 Oct, 2011
Hi Russell,

Apologies for the little flood of emails.

It appears to be working OK here?

Please add a couple of Debugger actions - one after the Custom Code and one at the end of the On Submit event to see what is happening on your site.

Bob
rsearle 28 Oct, 2011
The debugger shows the same thing that I'm observing in testing through the "Frontend view": regardless of the chosen option, the redirect URL goes to the AnnualLeaveApplication form (i.e. the default value for the hidden field).

The redirect URL is simply not seeing the change to the {leaveform} variable. If I delete the hidden field I get no &chronoform= query clause. If I don't set the hidden field to a default, then I get &chronoform= (i.e. a blank form ID). Whatever I do with this, the redirect retrieves the unaltered default value of {leaveform}. This is doing my head in.

I'm running Joomla! 1.7.2. Could that be significant?

Thanks ...
rsearle 28 Oct, 2011
I found a workaround for my problem. It doesn't fix the problem that Redirect URL is not retrieving the correct value of {leaveform} after the assignment. But I changed the option values for the radio group on the form, so that the option values are the actual form names. Redirect URL does read the correct value of the chosen option, even if it doesn't read a value that has been changed by custom code. So I have met my requirement and I'm out of trouble.

Thanks very much ...
GreyHead 29 Oct, 2011
Hi Russell,

Glad to see you got it working. I don't know what the problem is and without the debug info there are no more clues here.

Here is what I see:

Data Array:
Array
(
[leaveform] => ProxyAnnualLeaveApplication
[applicant] => Employee
[submit] => Submit
[9d1f4210665ac83d9f8b9a49a741ef5d] => 1
[option] => com_chronoforms
[chronoform] => SelectAnnualLeaveApplicant
[event] => submit
[Itemid] =>
)

Debug Data

redirect_url
redirect_url_target_url: index.php
Redirect URL: index.php?option=com_chronoforms&chronoform=ProxyAnnualLeaveApplication
redirect_user
redirect_user_target_url: http://
Redirect URL (click to continue):
index.php?option=com_chronoforms&chronoform=ProxyAnnualLeaveApplication


Bob
rsearle 29 Oct, 2011
Thanks Bob,

My debug data for the same case shows both redirect_urls as:

index.php?option=com_chronoforms&chronoform=AnnualLeaveApplication

... when the test emails show {leaveform} = ProxyAnnualLeaveApplication.

For the life of me, I can't find what's wrong. However, the solution I have in the forms now is simpler, more efficient and more maintainable than the original. It doesn't even require custom code any more. So I'll just put this one on the spike for next time.

Thanks again ...
This topic is locked and no more replies can be posted.