Error cart checkout with Safari

When I use Cart with Safari, I get the following error after entering the contact details and hitting the “Complete the order” button:
Safari can’t open the page:

https://domainname/backlight/cart/cart/invoiced_finalCheckout/” The error is: “cannot parse response” (INSURLErrorDomain:-1017)

It works however very well with Chrome and Edge.
This error appears both with Safari on my Mac and Safari on my iphone.
Thanks for your advise!
Erik

I’m unable to duplicate this on my iOS devices.
Can you check that Backlight and all your modules are up to date?

Thanks for your reply, all modules are on the latest version, this instance was only installed about 3 weeks ago.

Wonder if it has anything to do with the version of Safari.
Can you post a link to a cart enabled album? I only have Safari on my iPhone and iPad, but others might be able to check things on their Macs.
(you might get some test orders)

Here you go: F1-Barcelona test 2022 - image-ine photography

I’m seeing the same error on your site when trying on my iPhone. It doesn’t happen on my own site.
@Ben will probably need to look into it.
Your cart also works in Firefox.

Also, it looks like you were hit by the recent bug that affected layouts.
For example, looking at that album on my iPhone, there’s so much left and right padding that the image thumbnails are squeezed into little tiny things. This is what it looks like:

First go to your Backlight Modules page and click on Reinstall All.
Then edit your album template and under Thumbnail Grid, check the Gutters setting. Chances are that it’s set to 125px. This is what’s squeezing out the thumbails.

You may find other issues in other templates. If you do, look for excessively large numbers in padding and border settings. Border radius settings were affected too.

You are right on the gutter settings, makes a big difference!

I get the checkout error as well on your page using Safari on my Mac.

It looks like Safari is being very finicky with the request and that we’re not necessarily doing anything wrong with our code.
I’ll see whether I can replicate this, and if so, alter the way it works so that it hopefully doesn’t trigger whatever condition it is that causes this to fail.

Hi Ben,
FYI, I also have a Backlight2 instance on another website.
This one works fine using Safari from the same Mac on the same network.
Is there anything you could recommend me check between the 2 installs?
Thanks,
Erik

Hi Erik, I’ve had a look at this and haven’t been able to work out what’s going wrong.

This issue doesn’t occur for me on my own server in Safari.
It also affects Safari Technology Preview 139

Looking at the Safari inspector, there is no log of the submission to the server. When you click submit, the very next items in the network inspector are the loading of Safari’s error page and associated stylesheet. I received notification emails, so it does look like the request is going through. This missing network logging means that I can’t see what your server is returning in Safari.

Copying-and-pasting a redirect URL from a successful checkout in Chrome, then trying the same redirect in a standalone PHP page in Safari succeeded without issue.

Your server is using Nginx and has been configured with extra security settings. Applying these to my test page also didn’t cause the issue.

The ‘final checkout’ function does try to send the response to the browser before sending out the emails, so that the user isn’t waiting for the response. Applying this to the test page also doesn’t cause the issue for me.

Is this your own server or hosted on a shared hosting service? Would you be able to provide me with FTP access so that I can try to modify the cart checkout? This is in case the way it responds before sending emails is somehow combining with your Nginx settings to return a payload that upsets Safari.

Hi Ben,

This is a hosted server.
I will send you the credentials through PM

Thanks,

Erik

Hi @ErikJunius, thanks for the access. I’ve found what looks to be the problem and fixed it.

The underlying issue seemed to be that Backlight was producing an error message due to a minor bug with checking digital downloads, and that the output from the error message was conflicting with the server telling the browser to redirect to the ‘thank you’ URL. (A page should either have output or redirect but not both).

I’m not sure why this only affected Safari on your site, as I wasn’t able to replicate the original error.

I’ve fixed this by modifying the file backlight/modules/module-cart/application/models/ShoppingCart.php on your server. This change has been added to our codebase, so will carry through to any future updates.

Sorry for all of the spam Orders created in this process.

Indeed it works as it should, greta job Ben! I wil not invoice all the pictures you bought :wink: :wink:

1 Like