Skip to content

Fix: return Yes/No field values as integers in search (GLPI 12) - #1303

Merged
Rom1-B merged 2 commits into
mainfrom
support_46929_12
Oct 20, 2026
Merged

Rom1-B merged 2 commits into
mainfrom
support_46929_12

Conversation

@Rom1-B

@Rom1-B Rom1-B commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

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 !46929
  • Since 1.24.6, Yes/No field values returned by the search engine (including the REST API search endpoint) are strings "0"/"1" instead of integers 0/1.
  • Scripts relying on a truthy check now treat "0" as true, which breaks integrations that worked with 1.24.5.
  • The default value applied in search results for Yes/No fields is now an integer, restoring the previous value type.
  • forward-port: Fix: return Yes/No field values as integers in search (GLPI 11) #1302

Screenshots (if appropriate):

@Rom1-B
Rom1-B requested review from Herafia, Mary-Clb and MyvTsv October 14, 2026 12:16

@Herafia Herafia 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 existing test dataset (provideFieldTypesForSearchDefaultValue) only tests “yesno” with the default value “1.” It might be useful to add “0”; this would also verify that a false value returns an integer 0 when the item does not yet have a row ?

@Rom1-B
Rom1-B requested a review from Herafia October 20, 2026 06:37
@Rom1-B
Rom1-B merged commit 0e64112 into main Oct 20, 2026
7 checks passed
@Rom1-B
Rom1-B deleted the support_46929_12 branch October 20, 2026 07:55
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.

3 participants