You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2025-03-13 15:24:32

lordbat
Member
From: Spain
Registered: 2016-02-12
Posts: 191

Plugin Dev - Search::show() on Modal error in the 2nd call

Hi, i suppose this is for the glpi dev team. This is my situation.

Im developing a plugin and when i call in JS an ajax modal with the function glpi_ajax_dialog().

In the backend i have a switch and base on the param recieved can send the Search::show('NAME OF THE ITEMTYPE').
The first time i call this works fine but if i close de modal and excecute again but this time with another param the instance of the twig template is still in the cache, so the searching bar i have an error because is not generating a new instance with the relationship of the table.

But after the 2nd call with the error, when i call again but with the 1st correct param is returned ok without error, i think this is because the instance was loaded in the 1st call.

There is a way to control this instance to "clean" the instance when i call again the Search:show()?

Thanks.

Last edited by lordbat (2025-03-13 15:25:27)


You can mark this thread as [Solved] in the subject of your thread. (This is only available edit of the first post.) It is good for users who help others to quickly see which post is still open.
############################################################

Offline

#2 2025-03-13 16:35:25

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,237
Website

Re: Plugin Dev - Search::show() on Modal error in the 2nd call

Its very difficult to say anything without actually seeing the code, but you should be in Debug mode when developing to help avoid cache issues.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

Board footer

Powered by FluxBB