tomolimo / processmaker

GLPI plugin that provides an interface with ProcessMaker (http://www.processmaker.com/)
30 stars 11 forks source link

CORS issue #121

Closed duckwc closed 3 years ago

duckwc commented 3 years ago

Describe the bug Some of the iframe features are not working correctly in GLPI: I noticed

To Reproduce Steps to reproduce the behavior:

  1. assign a new process to a ticket
  2. Dynaform iframe is empty (only showing the headers)

Expected behavior Dynaform should display the form and resize the iframe to the size of that form

**Workaround I workaround that issue by editing /processmaker/workflow/engine/js/cases/core/pmDynaform.js and /processmaker/workflow/engine/methods/cases/cases_Step.php and avoiding calls to parent DOM like parent.showCaseNavigatorPanel

Screenshots

2021-06-09 17_22_38-GLPI - Setup — Mozilla Firefox

Desktop (please complete the following information):

**Server:

*Additional context Add any other context about the problem here.

tomolimo commented 3 years ago

Hello @duckwc Usually this trouble comes from the the fact that GLPI and ProcessMaker server do not share the same domain root. Good exp: GLPI url: http://glpi.acme.com and PM url: http://pm.acme.com, in this case the shared domain is acme.com Could you check that? Thank you, Regards, Tomolimo

duckwc commented 3 years ago

Hello @tomolimo ,

Sorry I didn't mention it in the issue, but yes they do, both in https: one is https://glpi.mydomain.com and the other https:// pmaker.mydomain.com

2021-06-09 17_41_15-GLPI - Setup — Mozilla Firefox

Thank you, Cyril

tomolimo commented 3 years ago

Hello @duckwc Ok, thank you, Another question: what URL is currently used for GLPI by your browser? Thank you Regards, Tomolimo

duckwc commented 3 years ago

Hello @tomolimo

The URL is https://glpi.mydomain.com

2021-06-11 16_44_02-GLPI - Setup — Mozilla Firefox 2021-06-11 16_46_01-GLPI - Setup — Mozilla Firefox

Regards, Cyril

tomolimo commented 3 years ago

Hello @duckwc

Then we should go to debug in the javascript console in your Browser to get the real error messages.

Could you press F12 (or activate the development tools), tand try to replay the issue?

Then you should have some errors in the javascript console.

Thank you Regards,

Tomolimo

duckwc commented 3 years ago

Hello @tomolimo

The errors I have are the form

Uncaught DOMException: Permission denied to access property "xxx" on cross-origin object

xxx vary from one page to the other. In the dynaforms page, its showCaseNavigatorPanel. JS file involved is js/cases/core/pmDynaform.js

My workaround for this file is to edit the js file and replace line 22 if (pm_run_outside_main_app === 'true') { with if (0 && pm_run_outside_main_app === 'true') { This does skip the tests to parent DOM and avoids the script to exit on error, and the workflow is displayed...

Thank you, Regards, Cyril

tomolimo commented 3 years ago

Hello @duckwc Could we continue to discuss with discord? Regards, Tomolimo

duckwc commented 3 years ago

sure @tomolimo here is my account id : duckwc#7400

tomolimo commented 3 years ago

and mine is: Tomolimo#1077

tomolimo commented 3 years ago

Hello @duckwc Could you check if the PM server URL is correctly rewritten like explained here: https://github.com/tomolimo/processmaker-server/wiki/Inbound-rewrite-rules Thank you, Regards, Tomolimo

tomolimo commented 3 years ago

Solved after applying https://github.com/tomolimo/processmaker/issues/121#issuecomment-861400044