Skip to content

Conversation

cconard96
Copy link
Contributor

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.

Description

Fixes #21162
Fix condition for dropdown custom field search option joins when multiple selection are allowed.
Fix usage of glpi_assets_assets table instead of REFTABLE in join conditions.
Add dropdown custom fields (single and multiple) to test dataset for automatic search tests to take them into account.

@cedric-anne cedric-anne added this to the 11.0.0 milestone Sep 30, 2025
cedric-anne
cedric-anne previously approved these changes Sep 30, 2025
@cedric-anne cedric-anne dismissed their stale review September 30, 2025 08:07

tests are failing

@trasher
Copy link
Contributor

trasher commented Sep 30, 2025

Tests are failing

@cconard96
Copy link
Contributor Author

You cannot use CAST with JSON datatype. JSON is only a valid datatype in MySQL.

@cedric-anne
Copy link
Member

You cannot use CAST with JSON datatype. JSON is only a valid datatype in MySQL.

Indeed, there is something missing to make this code compatible with both MySQL and MariaDB.

@cconard96
Copy link
Contributor Author

You cannot use CAST with JSON datatype. JSON is only a valid datatype in MySQL.

Indeed, there is something missing to make this code compatible with both MySQL and MariaDB.

The point of the QueryFunction class refactoring was to allow better compatibility between DBMS. Maybe calls to cast with JSON type should be transformed to a JSON_EXTRACT function when MariaDB is detected, if there is a way currently to detect that.

I don't know how useful I am going to be today. I haven't had much sleep.

@cedric-anne cedric-anne force-pushed the fix/custom_fields_multi_dropdown branch from a76a0fd to 8d1f578 Compare September 30, 2025 16:21
@cedric-anne cedric-anne force-pushed the fix/custom_fields_multi_dropdown branch 2 times, most recently from 6e34449 to 5fbcdb2 Compare October 1, 2025 07:00
@cedric-anne cedric-anne force-pushed the fix/custom_fields_multi_dropdown branch from 5fbcdb2 to b05f497 Compare October 1, 2025 07:01
@cedric-anne cedric-anne merged commit 7f9e866 into glpi-project:11.0/bugfixes Oct 1, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GLPI 11 - Error after creating asset definition view
4 participants