Support Forums

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

XMLHttpRequest blocked by CORS policy in SP Page Builder

Featured Lock Resolved Issue
Hi chaps - I really hope you can assist me with this because I've been all over the place to try and find a solution.

To cut a long story short, I am trying to embed a number of 3rd party booking calendars into a new site that I'm building.

The calendars work fine when embedded within an article. However, when I add it to SP Page Builder either as RAW HTML code or via a custom module I am getting the following error:

Access to XMLHttpRequest at 'https://westlakesadventure.anytimebooking.eu/category/listAllActive/1/NaN/?_=1552041970711' from origin 'http://www.tourismweb.co.uk' has been blocked by CORS policy: Request header field x-csrf-token is not allowed by Access-Control-Allow-Headers in preflight response.

Here is the broken calendar with Page Builder:
Titlehttp://www.tourismweb.co.uk/WLA/book-now


Here is the calendar working in an article in Joomla:
Titlehttp://www.tourismweb.co.uk/WLA/accommodation/group-accommodation

The problem is that I need to include the calendars within varying places within Page Builder pages so the article solution isn't going to work for me.

I've added the following to my .htaccess

<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>

I've been in touch with the hosts and also the booking calendar developers and they are telling me the preflight request is not a feature of their widget and the xcsrf token is not their token. They also said it looks as if your CMS is adding this to the request as well as appending a query (timestamp) to the end of the Url which again is not something in our making.

In terms of settings:
SP Page Builder Pro 3.4.4
Joomla 3.9.3
PHP 7.2

I really hope you will be able to find a workaround for me? I can happily PM access details to the administator and FTP.

Cheers,
Mike

7 Answers

mjandrew

More than a month ago #Permalink
Just a quick follow up from the booking calendar developers.

They said their apache2 vhosts already have Header set Access-Control-Allow-Origin set which accepts from any other domain elsewhere on the web using the verbs GET or POST.

The issue is the preflight being created which contains the options verb which they don't support.

I'm really hoping we can find a workaround for this preflight issue.

Tony

More than a month ago #Permalink
Do we have an answer to this issue yet? I have the same problem with a 3rd party form which does not work in any pagebuilder page but works fine on all the other pages of my website. I have the same error as above. Please respond.

swemmel

More than a month ago #Permalink
I have same problem also, for long time. Still not solved. You will not have the problem using SPPB (pro) 3.1.1. All the versions later then this will throw the problem. (in my case). So, until now I am stuck with SPPPBpro 3.1.1. on my clients website, which is not good. :(

Peter

swemmel

More than a month ago #Permalink
Any news on this very long lasting issue please?

Thank you.

Kind regards,
Peter

Tony

More than a month ago #Permalink
I am also waiting for a solution to this issue

swemmel

More than a month ago #Permalink
Do we have an answer to this issue yet? I have the same problem with a 3rd party form which does not work in any pagebuilder page but works fine on all the other pages of my website. I have the same error as above. Please respond.


The only work-around till now is to downgrade to SP Pagebuilder 3.1.1. (In my case).

Best regards,
Peter

swemmel

More than a month ago #Permalink
Hi Guys,

Solution is to comment out the code that cause the error. You should comment out the following lines in the following files:

/components/com_sppagebuilder/sppagebuilder.php: line 23
/components/com_sppagebuilder/controllers/page.php: line 24
/components/com_sppagebuilder/addons/ajax_contact/site.php: line 17
/components/com_sppagebuilder/addons/form_builder/site.php: line 18

This will stop the issue. Mark that with every update to a newer version you will have to do the same.

Best regards,
Peter


There are no replies made for this post yet.
Be one of the first to reply to this post!

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 119
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 110
Toufiq

Toufiq

Total Accepted Answers: 89
Kamruzzaman Alam

Kamruzzaman Alam

Total Accepted Answers: 4
FUTURECLIENT

FUTURECLIENT

Total Accepted Answers: 2

115

Templates

296174

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us