Skip to content

[Fix]: unclear and false positive warnings + an issue with additional informations targetting same field name over differents items (Glpi 11) - #695

Merged
jdurand-teclib merged 2 commits into
11.0/bugfixesfrom
fix/47354/error-during-injection
Nov 10, 2026
Merged

jdurand-teclib merged 2 commits into
11.0/bugfixesfrom
fix/47354/error-during-injection

Conversation

@jdurand-teclib

@jdurand-teclib jdurand-teclib commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR also exists for Glpi 12. #701

  • 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 !47354
  • Here is a brief description of what this PR does
    • Change unclear and generic warning messages in the logs into more explicit ones (especially for mapping issues)
    • Added a warning message when attempting to connect an item to a network port results in finding 0 or several ports
    • Fix a false positive warning when creating a network port without requesting it to be attached to a switch (considered as failed and triggered a warning)
    • Fix 2 issues regarding additional informations sharing a field name accross multiple itemtypes
      • they were overwritting eachother (i.e a Memory name overwritting a Processor name, or both having the same name...)
      • The data data injection form was only displaying the names of the fields, and not their itemtype (c.f screenshots)
        Unit tests to cover changes and ensure no regression

Screenshots (if appropriate):

Before solving the field names display issue:
image

After:
image

…e with several complementary informatinons targetting the same field on different objetcts
@jdurand-teclib jdurand-teclib self-assigned this Nov 3, 2026
@jdurand-teclib
jdurand-teclib requested review from a team, Lainow, MyvTsv and RomainLvr and removed request for a team November 3, 2026 15:26

@Lainow Lainow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The ERROR_NAME_NOT_MAPPED message is misleading. The check (inc/commoninjectionlib.class.php:2344) also triggers when the “Description” column is properly mapped but empty in that row. The user then sees “a mapping is needed” and goes looking for a mapping that already exists.

@Lainow

Lainow commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Once it's fixed, you can open the same PR for version 12 of the GLPI plugin(if you can reproduce the issue there as well), please.

@jdurand-teclib

Copy link
Copy Markdown
Contributor Author

Once it's fixed, you can open the same PR for version 12 of the GLPI plugin(if you can reproduce the issue there as well), please.

Thanks for the warning, i'll do it once this one is validated to get the good version

@jdurand-teclib

Copy link
Copy Markdown
Contributor Author

The ERROR_NAME_NOT_MAPPED message is misleading. The check (inc/commoninjectionlib.class.php:2344) also triggers when the “Description” column is properly mapped but empty in that row. The user then sees “a mapping is needed” and goes looking for a mapping that already exists.

Since the context doesn't allow to tell a missing mapping from an empty value apart, I updated the message to cover both possibilities, so the user can check both.

@jdurand-teclib
jdurand-teclib requested a review from Lainow November 5, 2026 15:39
@jdurand-teclib jdurand-teclib changed the title [Fix]: unclear and false positive warnings + an issue with additional informations targetting same field name over differents items [Fix]: unclear and false positive warnings + an issue with additional informations targetting same field name over differents items (Glpi 11) Nov 6, 2026
@jdurand-teclib
jdurand-teclib merged commit 499e38f into 11.0/bugfixes Nov 10, 2026
7 checks passed
@jdurand-teclib
jdurand-teclib deleted the fix/47354/error-during-injection branch November 10, 2026 08:03
jdurand-teclib added a commit that referenced this pull request Nov 10, 2026
… informations targetting same field name over differents items (Glpi 12) (#701)

> [!NOTE]
> This PR is the Glpi 12 version of #695 

- [x] I have performed a self-review of my code.
- [x] I have added tests (when available) that prove my fix is effective
or that my feature works.
- [x] 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 !47354
- Here is a brief description of what this PR does
- Change unclear and generic warning messages in the logs into more
explicit ones (especially for mapping issues)
- Added a warning message when attempting to connect an item to a
network port results in finding 0 or several ports
- Fix a false positive warning when creating a network port without
requesting it to be attached to a switch (considered as failed and
triggered a warning)
- Fix 2 issues regarding additional informations sharing a field name
accross multiple itemtypes
- they were overwritting eachother (i.e a Memory name overwritting a
Processor name, or both having the same name...)
- The data data injection form was only displaying the names of the
fields, and not their itemtype (c.f screenshots)
  Unit tests to cover changes and ensure no regression

## Screenshots (if appropriate):
Before solving the field names display issue:
<img width="1835" height="872" alt="image"
src="https://github.com/user-attachments/assets/698feabc-6c52-41d7-a813-01b1bd9587b5"
/>


After:
<img width="1835" height="872" alt="image"
src="https://github.com/user-attachments/assets/f44ca16e-e9f7-4b6b-b34f-e60283e9f9b8"
/>

---------

Co-authored-by: Julien Durand <300495670+jdurand-teclib@users.noreply.github.com>
@glpi-project

glpi-project Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Backport-action backported this pull request in workflow run 42779664969.

Target Status
main ⚠️ Drafted with conflicts #704

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants