pluginsGLPI / escalade

GLPI Plugin escalade
http://www.teclib-edition.com
GNU General Public License v2.0
17 stars 30 forks source link

2.9.7 - Problems escalating #218

Closed andrepetinga closed 1 day ago

andrepetinga commented 1 month ago

Hello.

  1. When If I make several escalations, the history is not showned correctly.

For example: Created a ticket and the Group assigned was "CONTACT CENTER DSI"

image

Then escalate (using escalate button) to UARS and the visual history doesn't show any previous group:

image

Then escalate (using escalate button) to UAS and it only shows the previous group:

image

LOGS:

[2024-07-15 11:13:47] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "assign" in .../glpi/marketplace/escalade/inc/ticket.class.php at line 108 Backtrace : marketplace/escalade/hook.php:433 PluginEscaladeTicket::pre_item_update() src/Plugin.php:1680 plugin_escalade_pre_item_update() src/CommonDBTM.php:1610 Plugin::doHook() src/Ticket.php:2440 CommonDBTM->update() src/CommonITILActor.php:434 Ticket->updateDateMod() src/Group_Ticket.php:66 CommonITILActor->post_addItem() src/CommonDBTM.php:1343 Group_Ticket->post_addItem() src/CommonITILObject.php:8757 CommonDBTM->add() src/CommonITILObject.php:2868 CommonITILObject->updateActors() src/Ticket.php:2225 CommonITILObject->post_addItem() src/CommonDBTM.php:1343 Ticket->post_addItem() front/ticket.form.php:80 CommonDBTM->add() public/index.php:82 require()

[2024-07-15 11:13:47] glpiphplog.WARNING: *** PHP Warning (2): foreach() argument must be of type array|object, null given in .../glpi/marketplace/escalade/inc/ticket.class.php at line 108 Backtrace : marketplace/escalade/hook.php:433 PluginEscaladeTicket::pre_item_update() src/Plugin.php:1680 plugin_escalade_pre_item_update() src/CommonDBTM.php:1610 Plugin::doHook() src/Ticket.php:2440 CommonDBTM->update() src/CommonITILActor.php:434 Ticket->updateDateMod() src/Group_Ticket.php:66 CommonITILActor->post_addItem() src/CommonDBTM.php:1343 Group_Ticket->post_addItem() src/CommonITILObject.php:8757 CommonDBTM->add() src/CommonITILObject.php:2868 CommonITILObject->updateActors() src/Ticket.php:2225 CommonITILObject->post_addItem() src/CommonDBTM.php:1343 Ticket->post_addItem() front/ticket.form.php:80 CommonDBTM->add() public/index.php:82 require()

  1. Another problem, is when we use the arrow icon to escalate.

image

It only shows a blank page and checking the LOG:

[2024-07-15 11:20:22] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "ticket_details" in .../glpi/marketplace/escalade/inc/ticket.class.php at line 519 Backtrace : marketplace/escalade/front/climb_group.php:42 PluginEscaladeTicket::climb_group() public/index.php:82 require()

[2024-07-15 11:20:22] glpiphplog.CRITICAL: *** Uncaught Exception TypeError: Unsupported operand types: null + array in .../glpi/marketplace/escalade/inc/ticket.class.php at line 524 Backtrace : marketplace/escalade/front/climb_group.php:42 PluginEscaladeTicket::climb_group() public/index.php:82 require()

  1. Another thing: If I escalate writing the group name, the "yellow task box" is not showned on the ticket history:

image

Only shows history text, not the "yellow task box":

image

stonebuzz commented 1 month ago

this should fix this issue (i hope)

https://github.com/pluginsGLPI/escalade/pull/212

andrepetinga commented 1 month ago

Hello. @stonebuzz. That fix only corrected the issue nr. 2. But issues 1 and 3 are still present and is still writting on the LOGS:

[2024-07-15 14:36:42] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "assign" in .../glpi/marketplace/escalade/inc/ticket.class.php at line 108 Backtrace : marketplace/escalade/hook.php:433 PluginEscaladeTicket::pre_item_update() src/Plugin.php:1680 plugin_escalade_pre_item_update() src/CommonDBTM.php:1610 Plugin::doHook() src/Ticket.php:2440 CommonDBTM->update() src/CommonITILActor.php:434 Ticket->updateDateMod() src/Group_Ticket.php:66 CommonITILActor->post_addItem() src/CommonDBTM.php:1343 Group_Ticket->post_addItem() src/CommonITILObject.php:8757 CommonDBTM->add() src/CommonITILObject.php:2868 CommonITILObject->updateActors() src/Ticket.php:2225 CommonITILObject->post_addItem() src/CommonDBTM.php:1343 Ticket->post_addItem() front/ticket.form.php:80 CommonDBTM->add() public/index.php:82 require()

[2024-07-15 14:36:42] glpiphplog.WARNING: *** PHP Warning (2): foreach() argument must be of type array|object, null given in .../glpi/marketplace/escalade/inc/ticket.class.php at line 108 Backtrace : marketplace/escalade/hook.php:433 PluginEscaladeTicket::pre_item_update() src/Plugin.php:1680 plugin_escalade_pre_item_update() src/CommonDBTM.php:1610 Plugin::doHook() src/Ticket.php:2440 CommonDBTM->update() src/CommonITILActor.php:434 Ticket->updateDateMod() src/Group_Ticket.php:66 CommonITILActor->post_addItem() src/CommonDBTM.php:1343 Group_Ticket->post_addItem() src/CommonITILObject.php:8757 CommonDBTM->add() src/CommonITILObject.php:2868 CommonITILObject->updateActors() src/Ticket.php:2225 CommonITILObject->post_addItem() src/CommonDBTM.php:1343 Ticket->post_addItem() front/ticket.form.php:80 CommonDBTM->add() public/index.php:82 require()

andrepetinga commented 1 month ago

Hello again @stonebuzz. Made new tests today:

Regarding my first post:

Problem 1 is confirmed - Escalation history is not working properly. For example, it only shows up when we escalate using Escalate button. If we search for the group, the previous is not added to history.

Problem 3 is confirmed - The yellow private task mentioning the escalade option it's only being created when we escalate using Escalate button. Not using the search textbox or using "up arrow" (escalade history).

Found the errors mentioned on the first post when: ticket is created (we have a rule to assign a group), making a solution, rejecting a solution, using the "associate myself" button.

Errors are:

[2024-07-15 11:13:47] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "assign" in .../glpi/marketplace/escalade/inc/ticket.class.php at line 108
Backtrace :
marketplace/escalade/hook.php:433 PluginEscaladeTicket::pre_item_update()
src/Plugin.php:1680 plugin_escalade_pre_item_update()
src/CommonDBTM.php:1610 Plugin::doHook()
src/Ticket.php:2440 CommonDBTM->update()
src/CommonITILActor.php:434 Ticket->updateDateMod()
src/Group_Ticket.php:66 CommonITILActor->post_addItem()
src/CommonDBTM.php:1343 Group_Ticket->post_addItem()
src/CommonITILObject.php:8757 CommonDBTM->add()
src/CommonITILObject.php:2868 CommonITILObject->updateActors()
src/Ticket.php:2225 CommonITILObject->post_addItem()
src/CommonDBTM.php:1343 Ticket->post_addItem()
front/ticket.form.php:80 CommonDBTM->add()
public/index.php:82 require()

[2024-07-15 11:13:47] glpiphplog.WARNING: *** PHP Warning (2): foreach() argument must be of type array|object, null given in .../glpi/marketplace/escalade/inc/ticket.class.php at line 108
Backtrace :
marketplace/escalade/hook.php:433 PluginEscaladeTicket::pre_item_update()
src/Plugin.php:1680 plugin_escalade_pre_item_update()
src/CommonDBTM.php:1610 Plugin::doHook()
src/Ticket.php:2440 CommonDBTM->update()
src/CommonITILActor.php:434 Ticket->updateDateMod()
src/Group_Ticket.php:66 CommonITILActor->post_addItem()
src/CommonDBTM.php:1343 Group_Ticket->post_addItem()
src/CommonITILObject.php:8757 CommonDBTM->add()
src/CommonITILObject.php:2868 CommonITILObject->updateActors()
src/Ticket.php:2225 CommonITILObject->post_addItem()
src/CommonDBTM.php:1343 Ticket->post_addItem()
front/ticket.form.php:80 CommonDBTM->add()
public/index.php:82 require()

New problem found: If we have a requester or observer with an email (external user), the observer email will be deleted if escalade using the Escalate button or the "up arrow" (escalade history). The observer will stay if we escalade searching for the group. And we can see this on the LOGS:

[2024-07-16 16:35:53] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "alternative_email" in .../glpi/src/CommonITILObject.php at line 9943
  Backtrace :
  src/Ticket.php:1041                                CommonITILObject->transformActorsInput()
  src/CommonDBTM.php:1612                            Ticket->prepareInputForUpdate()
  marketplace/escalade/inc/ticket.class.php:520      CommonDBTM->update()
  marketplace/escalade/front/climb_group.php:40      PluginEscaladeTicket::climb_group()
  public/index.php:82                                require()
andrepetinga commented 1 month ago

Hello @stonebuzz. Today I updated to 2.9.8 version, and then apllied 2 fixes: #219 and #212. Made new tests today and regarding my last post:

SAME RESULT ->Problem 1 is confirmed - Escalation history is not working properly. For example, it only shows up when we escalate using Escalate button. If we search for the group, the previous is not added to history.

SAME RESULT -> Problem 3 is confirmed - The yellow private task mentioning the escalade option it's only being created when we escalate using Escalate button. Not using the search textbox or using "up arrow" (escalade history).

NEW RESULT -> No errors found when: ticket is created (we have a rule to assign a group), making a solution, rejecting a solution, using the "associate myself" button no longer writes those errors on the logs.

But using the "associate myself" button is writting a new error, since I applied the #219 patch.

SAME RESULT -> New problem found: If we have a requester or observer with an email (external user), the observer email will be deleted if escalade using the Escalate button or the "up arrow" (escalade history). The observer will stay if we escalade searching for the group. And we can see this on the LOGS:

2024-07-22 12:07:37] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "alternative_email" in .../glpi/src/CommonITILObject.php at line 9884
Backtrace :
src/Ticket.php:1041                                CommonITILObject->transformActorsInput()
src/CommonDBTM.php:1618                            Ticket->prepareInputForUpdate()
marketplace/escalade/front/ticket.form.php:70      CommonDBTM->update()
public/index.php:82                                require()
ftoledo commented 2 weeks ago

Hi @andrepetinga What version of glpi are you using?

andrepetinga commented 1 week ago

Hi @andrepetinga What version of glpi are you using?

10.0.16

stonebuzz commented 1 week ago

Hi @andrepetinga

SAME RESULT -> Problem 3 is confirmed - The yellow private task mentioning the escalade option it's only being created when we escalate using Escalate button. Not using the search textbox or using "up arrow" (escalade history).

Should be fixed by https://github.com/pluginsGLPI/escalade/pull/230

stonebuzz commented 1 week ago

Hi @andrepetinga

NEW RESULT -> No errors found when: ticket is created (we have a rule to assign a group), making a solution, rejecting a solution, using the "associate myself" button no longer writes those errors on the logs.

Should be fixed by https://github.com/pluginsGLPI/escalade/pull/231

stonebuzz commented 4 days ago

Hi @andrepetinga @ftoledo

can you retry by using "main" branch ?

after testing, the recent PR corrected the problem

andrepetinga commented 3 days ago

Hi @andrepetinga

SAME RESULT -> Problem 3 is confirmed - The yellow private task mentioning the escalade option it's only being created when we escalate using Escalate button. Not using the search textbox or using "up arrow" (escalade history).

Should be fixed by #230

Hi @stonebuzz. Sorry for the delay...

Just picked up my installed 2.9.8 version and only applied the #230. What I did was to manually change the "'_plugin_escalade_no_history' => true" to "'_plugin_escalade_no_history' => false"

Testing:

When using the Escalade Button -> Still OK When using the Arrow from the History -> Now it's OK When searching the a group -> Still NOT OK!

image

As you can see in the print, the Group "UGSI" was added at 14:43, and no Private task

stonebuzz commented 3 days ago

Hi @andrepetinga

can you retry with main branch (not 2.9.8 + one patch)

andrepetinga commented 3 days ago

Hi @andrepetinga

NEW RESULT -> No errors found when: ticket is created (we have a rule to assign a group), making a solution, rejecting a solution, using the "associate myself" button no longer writes those errors on the logs.

Should be fixed by #231

Hi @stonebuzz.

Continued with my installed 2.9.8 version (now also with #230 correction) and only applied the #231. What I did was to manually change the "$tickets_id = $item->input['id'];" to "$tickets_id = $item->input['id'] ?? $item->fields['id'];"

Testing:

No error on the logs when using the "associate myself" button.

andrepetinga commented 3 days ago

Hi @andrepetinga

can you retry with main branch (not 2.9.8 + one patch)

Yes, that was my plan :)

And yes, using the main branch:

When using the Escalade Button -> OK! When using the Arrow from the History -> OK! When searching the a group -> OK!

andrepetinga commented 3 days ago

Hello @stonebuzz. Today I updated to 2.9.8 version, and then apllied 2 fixes: #219 and #212. Made new tests today and regarding my last post:

SAME RESULT ->Problem 1 is confirmed - Escalation history is not working properly. For example, it only shows up when we escalate using Escalate button. If we search for the group, the previous is not added to history.

SAME RESULT -> Problem 3 is confirmed - The yellow private task mentioning the escalade option it's only being created when we escalate using Escalate button. Not using the search textbox or using "up arrow" (escalade history).

NEW RESULT -> No errors found when: ticket is created (we have a rule to assign a group), making a solution, rejecting a solution, using the "associate myself" button no longer writes those errors on the logs.

But using the "associate myself" button is writting a new error, since I applied the #219 patch.

SAME RESULT -> New problem found: If we have a requester or observer with an email (external user), the observer email will be deleted if escalade using the Escalate button or the "up arrow" (escalade history). The observer will stay if we escalade searching for the group. And we can see this on the LOGS:

2024-07-22 12:07:37] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "alternative_email" in .../glpi/src/CommonITILObject.php at line 9884
Backtrace :
src/Ticket.php:1041                                CommonITILObject->transformActorsInput()
src/CommonDBTM.php:1618                            Ticket->prepareInputForUpdate()
marketplace/escalade/front/ticket.form.php:70      CommonDBTM->update()
public/index.php:82                                require()

Hello @stonebuzz.

So, after installing the main branch of 2.9.8 (no patches added), I repeated all my tests and:

NEW RESULT ->Problem 1 no longer exists - Escalation history is now working properly.

NEW RESULT -> Problem 3 no longer exists - The yellow private task mentioning the escalade option it's being created.

NEW RESULT -> Now, using the "associate myself" button no longer raises an error on the log.

SAME RESULT -> New problem found: If we have a requester or observer with an email (external user), the observer email will be deleted if escalade using the Escalate button or the "up arrow" (escalade history). The observer will stay if we escalade searching for the group.

And we can see this on the LOGS:

Using the "up arrow" (escalade history):

[2024-09-04 15:24:03] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "alternative_email" in …/glpi/src/CommonITILObject.php at line 9884
  Backtrace :
  src/Ticket.php:1041                                CommonITILObject->transformActorsInput()
  src/CommonDBTM.php:1618                            Ticket->prepareInputForUpdate()
  marketplace/escalade/inc/ticket.class.php:509      CommonDBTM->update()
  marketplace/escalade/front/climb_group.php:40      PluginEscaladeTicket::climb_group()
  public/index.php:82                                require()

Using the Escalate button:

[2024-09-04 15:18:30] glpiphplog.WARNING:   *** PHP Warning (2): Undefined array key "alternative_email" in …/glpi/src/CommonITILObject.php at line 9884
  Backtrace :
  src/Ticket.php:1041                                CommonITILObject->transformActorsInput()
  src/CommonDBTM.php:1618                            Ticket->prepareInputForUpdate()
  marketplace/escalade/front/ticket.form.php:70      CommonDBTM->update()
  public/index.php:82                                require()

Almost there!!! :)

stonebuzz commented 3 days ago

Can you (please) open a new issue ?

stonebuzz commented 3 days ago

I'll consider this one ‘finished’ (I was waiting for your feedback as well as the others).

andrepetinga commented 3 days ago

Just created the new issue #241

ftoledo commented 2 days ago

Hi @andrepetinga @ftoledo

can you retry by using "main" branch ?

after testing, the recent PR corrected the problem

hi @stonebuzz i can confirm that main branch has solved the issue. thanks!

stonebuzz commented 1 day ago

in view of the recent progress and feedback from the community, I'm closing this issue.

release coming soon