Skip to content

Conversation

@CorentinS6
Copy link

@CorentinS6 CorentinS6 commented Oct 21, 2025

….php

fix PHP Warning (2): Undefined array key "bypass_filter_assign_group" in /var/www/glpi/plugins/escalade/inc/ticket.class.php at line 1270

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes # (issue number, if applicable)
  • Here is a brief description of what this PR does

Screenshots (if appropriate):

….php

fix  PHP Warning (2): Undefined array key "bypass_filter_assign_group" in /var/www/glpi/plugins/escalade/inc/ticket.class.php at line 1270
'is_assign' => 1,
];
if ($config->fields['use_filter_assign_group'] && !$user_config->fields['bypass_filter_assign_group']) {
if ($config->fields['use_filter_assign_group'] && isset($user_config->fields['bypass_filter_assign_group']) && !$user_config->fields['bypass_filter_assign_group']) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ($config->fields['use_filter_assign_group'] && isset($user_config->fields['bypass_filter_assign_group']) && !$user_config->fields['bypass_filter_assign_group']) {
if ($config->fields['use_filter_assign_group'] && (!isset($user_config->fields['bypass_filter_assign_group']) || !$user_config->fields['bypass_filter_assign_group'])) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ($config->fields['use_filter_assign_group'] && isset($user_config->fields['bypass_filter_assign_group']) && !$user_config->fields['bypass_filter_assign_group']) {
if ($config->fields['use_filter_assign_group'] ?? false && !($user_config->fields['bypass_filter_assign_group'] ?? false)) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use / test the second proposal and let me know if it works for you.

@FrancisTicgal
Copy link

FrancisTicgal commented Dec 16, 2025

Hello,
Can we put something like this? The problem I see is when the user does not exist in the escalade_users table.

if (
     $config->fields['use_filter_assign_group']
    && isset($user_config->fields['bypass_filter_assign_group'])
    && !$user_config->fields['bypass_filter_assign_group']
) {
    $condition['id'] = $groups_id_filtered;
}

-- edit
I hadn't seen Corentin's commit, but I agree with him.
If the configuration field were missing, the problem would be different in my opinion, but the existence of the user configuration is not checked, so new users might not have it.

@FrancisTicgal
Copy link

I add screenshots for context
image
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants