You need to sign in to do that
Don't have an account?
Page redirects break in Summer09
Some of our page redirects are breaking with summer09. Here is simple example to reproduce.
<apex:page controller="redirect"> <apex:form > <apex:commandButton value="Go back!" action="{!back}"/> </apex:form> </apex:page> public class redirect { public PageReference back() { PageReference returnpage = new PageReference('/' + System.currentPageReference().getParameters().get('retURL')); returnPage.setRedirect(true); return returnPage; } }
Use a URL like this: https://cs1.salesforce.com/apex/redirect?retURL=someId.
In Spring 09 the page would return you to https://cs1.salesforce.com/someId.
In Summer 09 it returns https://someId.
The domain is being left out.
Thanks,
Jason
Workaround: remove the extra slash when creating the PageReference for retURL:
All Answers
Has something to do with the retURL parameter. It doesn't like it.
If I use something else it works fine.
<apex:page controller="redirect">
<apex:form >
<apex:commandButton value="Go back! URL" action="{!back}"/>
<apex:commandButton value="Go back! ID" action="{!back1}"/>
</apex:form>
</apex:page>
public class redirect {
public PageReference back() {
PageReference returnpage = new PageReference('/' + ApexPages.currentPage().getParameters().get('retURL'));
returnPage.setRedirect(true);
return returnPage;
}
public PageReference back1() {
PageReference returnpage = new PageReference('/' + ApexPages.currentPage().getParameters().get('id'));
returnPage.setRedirect(true);
return returnPage;
}
}
Still frustrating as I must scramble to patch this :smileyindifferent:
Workaround: remove the extra slash when creating the PageReference for retURL: