Redirect not working in Safari

kebmsmith

Member
More cross-browser issues...

I'm attaching my redirect instructions that I'm using to send the customer to a "thank you" message after hitting Submit. It works fine in Firefox, but not in Safari.

In Safari, when you click "Submit", it seems to redirect to a page of empty content. I.e., my message doesn't get displayed.

Note it's a conditional redirect (only redirects if method of payment is "check" vs "paypal" or "credit"). As an experiment, I made it unconditional and it did not help.

Screen%20Shot%202013-02-28%20at%204.17.25%20PM.png
 
Is this in Safari on a Mac or Windows box?

BTW, one tiny note .. be careful about relying on a return value from require_once(). Probably not relevant in this case, as it's unlikely you'd be requiring the same file elsewhere. But the point of require_once() is .. well, as the name suggests, it only includes the file once. So the second time you require_once on a file, it's always going to return true (well, 1, I think) to tell you the file has already been loaded. It won't actually run the file again.

So if you need the return value, to be on the safe side, use plain require. Of course, then if you have any function definitions, that'll barf if you require it a second time 'cos you are trying to define the same function twice. So you'd have to return your value from inside a function, and do ...

require_once '/path/to/my_func.php';
return myFunc();

Anyway ... let me know what OS. I don't have a Mac, or even easy access to one (my friends are all way to poor to buy Macs, LOL!), but I don't mind installing Safari on Windows if that'll show me the problem.

Well, to be honest, I do mind installing Safari, but I'll do it 'cos I'm a nice guy. ;)

-- hugh
 
My Safari is on a Mac, because I'm fabulously wealthy :) But maybe it would exhibit the same behavior on a PC.

I'm not sure I understand your point about require_once. I didn't think I was relying on the return value of "require" at all. Whaddya mean exactly?
--
K
 
My Safari is on a Mac, because I'm fabulously wealthy :)

LMAO!

I didn't think I was relying on the return value of "require" at all.

Oh, sorry, I'm blind. I saw your Condition code with a line starting with require_once(), didn't notice it was run on with a line that calls the func and returns the response form that.

So ignore everything I said. Nothing to see here. Move along.

Installing Safari now. ::sigh::

I used to be a Mac developer way back when. Actually, I was the first ever "certified Apple developer" in the UK when they started the dev program in the UK. My first one was a Mac Plus in (I'll plead the 5th ont he year), I think the last one I owned was a Mac 2ci, circa 1984. At which point they basically priced themselves out of my life. I still love 'em, but as I'm not a graphic designer or have any sense of "style", Winders does what I need, for about half the price.

Maybe I'll own another one, one day.

Oh, and my other claim to Mac fame was that a Mac SE30 (basically a Plus on steroids) I owned got featured in a UK Apple TV ad campaign. I got in a wreck with it in the back of my car, serious enough to spin me half a dozen times, pop the tailgate, and the SE went tumbling down the road and ended up over 200 yards from the remains of my car. Half the case was gone, and it was well mangled. Just out of interest, I tried plugging it in about a week later, and it fired right up. I called Apple just to thank them for making such a rock solid product, and maybe pretty please could I have a replacement case, and next thing I know their marketing department shows up at my door with a film crew ... and a brand spanking new SE30, in exchange for my beat up one.

-- hugh
 
Hmmm, I can't get it to misbehave on Safari on Windows.

Can you temporary disable the other two plugins (set Publish to No), so ONLY the redirect is running, see if that helps?

Oh, and set "Use as search data" to No. That's not relevant if you aren't actually using it as a "search form" (a special use of redirects, which allows you to build a custom form for searching a list with, and would only make sense if you were redirecting to a Fabrik List page) and could potentially complicate things.

-- hugh
 
Safari

Thanks for investigating. I'll be up in it in the morning. Will make the changes you suggest and ping you back.
 
Sorry for the delay - got sidetracked with other projects.

I tried your suggestion of disabling all but the redirect, and it behaves the same way. Blank content area comes up when I submit a reservation.

If you have time to dig into this, I have a mirror of the website that exhibits the same problem, and that our customers don't know about, so we can edit and fool with it without affecting the real database.

It's at haiea.org, and if you create a username I'll make you an admin.

A couple other experiments I tried:
- Set condition to simply: return 1;
- Set the content of the message to simply: "Thanks!"
- Changed the content redirect to "Popup", "New page", and "Same page"

None of those had *any* effect. Surprisingly, this last one (popup/new page/same page) didn't make any difference in Firefox either...

I'll install Safari in my Windows VM and see if I can see it succeed like you did. Also, I can save off a "page source" view from both versions of Safari and see if it's a difference in the code produced, or in the browser itself (I'm guessing it's the latter, but I don't know how the browser difference affects what Joomla/Fabrik serve).

========= UPDATE ============

I ran it in Windows XP Safari (latest version - 5.1.7) and it failed in the same way (redirect screen = blank content area) with Redirect Target set to "Same Page"
If I change the redirect target to "New page" it does *not* open up a new browser tab upon submission (like I thought it would), but it *does* show the desired content! Huh???
Then I tried "Popup" and it worked also.
Then I switched *back* to "Same Page" and... it's working.

I also went back to Safari on the Mac, and the problem is gone there as well.

Not sure what changed, but I guess something must've.

Now I'm going to focus on the IE problem. Will report - thanks for your help.

--
Keb'm
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top