datainjection icon indicating copy to clipboard operation
datainjection copied to clipboard

Fix injection of not null fields

Open Mary-Clb opened this issue 3 months ago • 0 comments

Checklist before requesting a review

  • [x] 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.

Description

  • It fixes #539 & !40013
  • When trying to inject data into the glpi_users table, fields with empty values that are defined as NOT NULL in the database do not take their assigned default values. The fix simply fills the isNullable() function in the corresponding class with the fields that can be null, allowing the plugin to distinguish NOT NULL fields and ensure they comply with their database constraints.

As discussed before with @lainow:

@stonebuzz @Rom1-B would it be better to fix that in all classes in the PR ? I need a fix for the client but the problem will probably happen again with another class.

Mary-Clb avatar Oct 31 '25 14:10 Mary-Clb