Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix static group criteria #439

Merged
merged 7 commits into from
Nov 14, 2023

Conversation

stonebuzz
Copy link
Collaborator

Try to fix #430

Search from static group is a litlle bit different than "Computer" search (Glpiinventory plugin use it's own derived class PluginGlpiinventoryComputer)

PluginGlpiinventoryComputer is mainly used to override standard massiveaction and get only one "Add to static group or "Remove from static group".

First commit allow saerch engine to correctly compute SQL query based on Computer

Second commit backup and restore $_SESSION['glpisearch']['Computer'] to prevent the search carried out in the static group from overwriting the last search carried out on the Computer.

@stonebuzz
Copy link
Collaborator Author

Last commit use Search::manageParams with $usesession = false

instead of backup / restore $_SESSION

inc/deploygroup_staticdata.class.php Outdated Show resolved Hide resolved
inc/deploygroup_staticdata.class.php Outdated Show resolved Hide resolved
stonebuzz and others added 2 commits November 13, 2023 09:52
Co-authored-by: Johan Cwiklinski <[email protected]>
Co-authored-by: Johan Cwiklinski <[email protected]>
inc/deploygroup_staticdata.class.php Outdated Show resolved Hide resolved
inc/deploygroup_staticdata.class.php Outdated Show resolved Hide resolved
@kintaro1981
Copy link

kintaro1981 commented Nov 13, 2023

Try to fix #430

Search from static group is a litlle bit different than "Computer" search (Glpiinventory plugin use it's own derived class PluginGlpiinventoryComputer)

PluginGlpiinventoryComputer is mainly used to override standard massiveaction and get only one "Add to static group or "Remove from static group".

First commit allow saerch engine to correctly compute SQL query based on Computer

Second commit backup and restore $_SESSION['glpisearch']['Computer'] to prevent the search carried out in the static group from overwriting the last search carried out on the Computer.

is it possibile that with this commit now the dynamic and static group search (criteria) get resetted?
assigned computer are collected but the search get resetted and you have to rewrite it every time. making the search refine process really difficult

@stonebuzz
Copy link
Collaborator Author

is it possibile that with this commit now the dynamic and static group search (criteria) get resetted? assigned computer are collected but the search get resetted and you have to rewrite it every time. making the search refine process really difficult

I've adapted the PR to keep the same search behavior on dynamic groups, as the search is saved in the database.

It won't be possible to do the same for static groups.
as the search is not saved in the database.

@kintaro1981
Copy link

is it possibile that with this commit now the dynamic and static group search (criteria) get resetted? assigned computer are collected but the search get resetted and you have to rewrite it every time. making the search refine process really difficult

I've adapted the PR to keep the same search behavior on dynamic groups, as the search is saved in the database.

It won't be possible to do the same for static groups. as the search is not saved in the database.

I think that can be fair... as to add computer to static groups we can use the "regular search" and then add selected to specific static group. tomorrow morning I'm going to test it. thank you

@kintaro1981
Copy link

kintaro1981 commented Nov 14, 2023

tomorrow morning I'm going to test it. thank you

I confirm it is working as expected now

@cedric-anne cedric-anne merged commit e272d84 into glpi-project:master Nov 14, 2023
12 checks passed
@cedric-anne cedric-anne added this to the 1.3.4 milestone Nov 14, 2023
@cedric-anne cedric-anne added the bug Something isn't working label Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unknown column 'glpi_ipaddresses_3714572b4d6732a91ac0d68a00a3c328.name' in 'where clause'
4 participants