Skip to content

Fix: use itemtype in values lookups - #1312

Open
marifex wants to merge 3 commits into
pluginsGLPI:11.0/bugfixesfrom
marifex:fix/values-lookup-itemtype
Open

marifex wants to merge 3 commits into
pluginsGLPI:11.0/bugfixesfrom
marifex:fix/values-lookup-itemtype

Conversation

@marifex

@marifex marifex commented Oct 21, 2026

Copy link
Copy Markdown

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.

Description

  • It fixes Value lookups by items_id do not use the itemtype index and scan the whole values table #1310
  • Values lookups on the container tables filter only on items_id (and plugin_fields_containers_id), so they cannot use the itemtype_item_container unique index, which starts with itemtype, and do a full scan of the table. On large tables this slows down the display and the save of every item with additional fields. The lookups and the delete on purge now also filter on itemtype.

@marifex
marifex force-pushed the fix/values-lookup-itemtype branch from e4f33bf to 2a3b62e Compare October 21, 2026 15:22
@marifex
marifex changed the base branch from main to 11.0/bugfixes October 21, 2026 15:22
Comment thread CHANGELOG.md Outdated
- Fix `Yes/No` field values returned as strings instead of integers in search results
- Fix ticket observers being able to edit and save additional fields they are not allowed to modify
- Fix mandatory fields blocking ticket creation from a GLPI form.
- Fix slow display and save of items with additional fields when the values tables are large

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.

1.24.7 is already released and this PR now conflicts with 11.0/bugfixes: can you rebase and move this entry to a new ## [Unreleased] section?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Rebased on 11.0/bugfixes and moved the entry to a new Unreleased section.

@marifex
marifex force-pushed the fix/values-lookup-itemtype branch from 2a3b62e to b6b185b Compare October 29, 2026 10:53
@marifex
marifex requested a review from Rom1-B October 29, 2026 10:55
@Rom1-B
Rom1-B requested review from MyvTsv and RomainLvr October 29, 2026 11:09

@Rom1-B Rom1-B 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.

LGTM.
A regression test would still be welcome: a values row with the same items_id but another itemtype, checking that stored values are read and purged only for the right itemtype.

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.

Value lookups by items_id do not use the itemtype index and scan the whole values table

4 participants