tomolimo / processmaker

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

Problem with GLPI_DATA #167

Closed jorge-madrigal closed 1 year ago

jorge-madrigal commented 1 year ago

Hello Tomolimo:

Your plugin is fantastic. we have used version 3.6 and we are migrating the entire system.

I have migrated the plugin and processmaker to the latest version.

I have a problem with GLPI_DATA. When I go to finish the first task of the Processmaker process, I click the btnGLPISendRequestbutton. I have the next mistake:

Uncaught ReferenceError: GLPI_DATA is not defined at case_onload (VM773 glpi.js:357:21)

image

image

Any ideas?

In the first form of the process task, I have a warning that I don't know if it can influence postmessage

image Thank you

tomolimo commented 1 year ago

Hello @jorge-madrigal Could you post a screenshot of the plugin configuration form? It's in Setup > General > ProcessMaker Could you post a screenshot of GLPI configuration? It's in Setup > General > General Setup Thank you, Regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo

Here you have my configuration:

image

image

image

image

Thank you

tomolimo commented 1 year ago

Hello @jorge-madrigal,

I think the root cause of the issue is that GLPI defined URL and GLPI used URL are not the same: The GLPI defined URL is image And you are really using image You MUST use the GLPI defined URL (or you MUST change the GLPI URL), but both MUST be identical.

Thank you, Regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo

The first warning regarding pm_glpi has disappeared. I change GLPI_Ul. But the GLPI_DATA error keeps appearing.

image

Thank you Jorge

tomolimo commented 1 year ago

Hello @jorge-madrigal Could you post a screen copy of the previous dynaform from the dynaform editor? Like this one? image Thank you, Regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo :

This is de form: image

The process was working fine with version 3.6 of the plugin and processmaker.

I have been looking for the definition of GLPI_DATA in the code of the processmaker plugin and the processmaker server, and I cannot find it.

Where is the variable defined?

Thanks

jorge-madrigal commented 1 year ago

Hello @tomolino:

For more information: Another thing is that the first task of the process has more than one form.

The first task has 3 forms. There are 3 steps. The last form has the submit btnGLPISendRequest

jorge-madrigal commented 1 year ago

Hello @tomolimo:

I think I know where the problem is.

As I said, the task has 3 steps. The first is a data form. In that first step there is data in GLPI_DATA. Look at the image:

image

I Resume debugger->

image

I resume debugger and I enter the data in the form and press next step

In this moment, GLPI_DATA is empty or undefined.

I think GLPI_DATA data is lost when there are multiple steps in the same task.

Thank you

tomolimo commented 1 year ago

Hello @jorge-madrigal I made tests with processes in which there are several steps in one task... I'll need your process to debug that... Could you post the pmx file on my Discord account (it's Tomolimo), so that it'll remain private? Thank you, Regards, Tomlimo

jorge-madrigal commented 1 year ago

Hello @tomolimo: I would like to send you my process, but it is complicated. Additionally, it uses external databases that you do not have.

I am going to review the steps and try to simplify the task to verify that the error is not from the task itself.

I also use a digital signature script, I am going to check that this script is not the problem.

Give me a day or 2 to research my own task.

Thank you. Jorge,

tomolimo commented 1 year ago

Hello @jorge-madrigal Thank you, Regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo

I think the problem is with the initial task of the process itself.

To check this I have created a process with only one task. This task has 2 steps. When I press the btnGLPISendRequest button it does nothing. I have reviewed the code and it remains in (cases.js file): myform.requestSubmit(button.length ? button[0] : undefined);

The button finds it but does not validate the form.

A window appears indicating loading...

Do you know any reason why this could happen?

Look: image image image image

When did you accept the form? Where are you going? tracking.injector.php?

Thank you, Regards, Jorge Madrigal

tomolimo commented 1 year ago

Hello @jorge-madrigal In order to be able to help you, I need to have your pmx and the configuration of the process itself in GLPI. Thank you, Regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo: I have simplified everything to the maximum.

GLPI, version 10.0.10 (Only glpi, only processmaker plugin) Processmaker plugin 5.0.1 GLPI Server: Windows with xampp Server processmaker version 3.3.0 RE 2.0 Linux

Process= Tutorial.

Everything works until submit. At that moment Loading... appears and does not end.

The process is created in processmaker, but the first task does not finish.

Tutorial.json

If I show the submit button, a spinner appears inside it.

image

Do you have an example that works so I can test it? Thank you

Jorge Madrigal

tomolimo commented 1 year ago

Hello @jorge-madrigal The json file is the export of the dynaform, not the export of the process which is a PMX file... Sorry all the examples I have can't be published, only the card sample is public. But I can try to do a card sample with several steps per tasks. thank you regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo

Sorry, this is the file:

Prueba.zip

Thank you

tomolimo commented 1 year ago

Hello @jorge-madrigal The bpmn file is the export of the map of the project, not the export of the process which is a PMX file... Thank you, Regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo:

I'm sorry. I haven't come today but it seems my brain isn't right. I hope I get it right this time.

Prueba-1.zip

Thank you

Jorge

tomolimo commented 1 year ago

Hello @jorge-madrigal I've successfully imported the process, and I'm going to test it, and I'll keep you informed thank you, Regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo:

Sorry.

To have more clues. I am using GLPI10.0.10 .I don't know if that influences. I have tried the example process: Credit Card. I have loaded it into processmaker successfully. I have tried and the same thing happens, the first task does not finish and the loading icon appears...

First I select the category ( The configured category is CARD CREDIT): image

The first form appears. I fill it out and press submit image

When I press submit, appears this..

image

The dynaform disappears (as expected), but in processmaker it does not jump to the second task and the GLPI does not create the ticket image

Thank you very much for your patience Jorge Madrigal

tomolimo commented 1 year ago

Hello @jorge-madrigal I've not yet test your process, but I've 2 ideas/questions:

  1. Which browser are you using? Which version?
  2. Could it be possible for you to do a test using a GLPI with direct URL (I mean without any path in URL)? I can see that GLPI is relocated under a directory (= https://helpdesk.diputaciondevalladolid.es/glpi/public). Could you change your config to be able to use https://helpdesk.diputaciondevalladolid.es/glpi/public? Thank you, Regards, Tomolimo
jorge-madrigal commented 1 year ago

Hello @tomolimo:

1.- I do the tests with Chrome (version 119.0.6045.159), to see the debugger interruptions. I have tried in Edge (version 119.0.2151.58), with Firefox (119.0.1) and it also fails in all of them.

2.- I'm doing it as you say. For the latest tests, I have used a local GLPI (10.0.10). The url is unique, it has no added paths. The url is jorge.diputaciondevalladolid.es. Just that route. And the failures remain.

image

image


Other thing:

This issue was created because GLPI DATA being lost. I know the reason. In my original process, first task has 3 steps. First, a form, second an output file is generated, third the document is viewed in a PDF viewer.

If the second step is other form, the GLPI_DATa isn't lost.

When the step is a document generated, GLPI_DATA is lost.

I attach pmx with a very simple example. In the second step GLPI_DATA is lost. Prueba2-2.zip

Thank you Regards Jorge Madrigal

tomolimo commented 1 year ago

Hello @jorge-madrigal I think you found the root cause to this issue: the "output document" generation: I didn't test this use case. I'll keep you informed Thank you, Regards, Tomolimo

jorge-madrigal commented 1 year ago

Hello @tomolimo:

I think there are 2 issues: 1.- The output document step causes GLPI_DATA to be lost (The process I have used is inPrueba2-2.zip). I admit that finding this issue was luck.

2.- The process Prueba-1.zip. The task is not completed and the ticket is not created.

I can help you with all the tests you want. We use the processmaker plugin and we want to promote it more in our organization. Therefore, I am the first one interested in helping you.

Thank you, Regards Jorge Madrigal

tomolimo commented 1 year ago

Hello @jorge-madrigal,

Second issue is fixed: see in the attached pmx file Prueba-1 (2).zip The issue root cause is that you've used a button instead of a submit button on the second task. A button will not trigger the save dynaform mechanism and therefore the process cannot evoluate. Firt issue. I'm going to check it right now.

Thank you, Regards, Tomolimo

tomolimo commented 1 year ago

Hello again @jorge-madrigal,

Here is a small video to show you that the issue is now fixed (at least on my dev workstation). https://github.com/tomolimo/processmaker/assets/7569958/6af4eab7-5692-4bb7-8e93-8f377949bf5a Give me one hour to provide a new release for the PM server 😃

Thank you Regards, Tomolimo

tomolimo commented 1 year ago

Fixed by https://github.com/tomolimo/processmaker-server/releases/tag/RE-2.1