Page 1 of 1

Access-Control-Allow-Origin Issue

Posted: Wed May 29, 2019 9:16 am
by jemiris
Hi,
I got the below error
access-control allow-origin-issue.png
access-control allow-origin-issue.png (83.64 KiB) Viewed 7912 times
please help
i have tried
Code: Select all
<?php
header('Access-Control-Allow-Origin: *');  
but not solved. please give an idea :?: :idea:

Re: Access-Control-Allow-Origin Issue

Posted: Wed May 29, 2019 9:13 pm
by amosbatto
You need to add that header to the <iframe>.

In your workflow/engine/methods/cases/casesStartPage.php, change the code from:
Code: Select all
        $oHeadPublisher->addExtJsScript('cases/casesDocuments', false); //adding a javascript file .js
        $oHeadPublisher->addContent('cases/casesDocuments'); //adding a html file  .html
        break;
To:
Code: Select all
 
       $oHeadPublisher->addExtJsScript('cases/casesDocuments', false); //adding a javascript file .js
        $oHeadPublisher->addContent('cases/casesDocuments'); //adding a html file  .html.
        header('Access-Control-Allow-Origin: *');
        break;
Does it work now?

Re: Access-Control-Allow-Origin Issue

Posted: Thu May 30, 2019 7:46 am
by jemiris
I was not in the correct file. Now i have changed. Thanks

Re: Access-Control-Allow-Origin Issue

Posted: Thu Aug 15, 2019 10:41 pm
by fiqihpunya
i still got error after entering header, please help...

Re: Access-Control-Allow-Origin Issue

Posted: Thu Aug 15, 2019 10:42 pm
by fiqihpunya
amosbatto wrote: Wed May 29, 2019 9:13 pm You need to add that header to the <iframe>.

In your workflow/engine/methods/cases/casesStartPage.php, change the code from:
Code: Select all
        $oHeadPublisher->addExtJsScript('cases/casesDocuments', false); //adding a javascript file .js
        $oHeadPublisher->addContent('cases/casesDocuments'); //adding a html file  .html
        break;
To:
Code: Select all
 
       $oHeadPublisher->addExtJsScript('cases/casesDocuments', false); //adding a javascript file .js
        $oHeadPublisher->addContent('cases/casesDocuments'); //adding a html file  .html.
        header('Access-Control-Allow-Origin: *');
        break;
Does it work now?
i still got error after add this header,

Re: Access-Control-Allow-Origin Issue

Posted: Fri Aug 16, 2019 9:18 pm
by amosbatto
fiqihpunya wrote: Thu Aug 15, 2019 10:42 pm i still got error after add this header,
This is only a solution for people who are creating plugins for pages under the Home menu. I can't help you without knowing the context. Please answer my questions at: viewtopic.php?f=44&t=710087#p826030