Skip to content
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Fixed

- Fix an issue where data are not formatted when coming from a field plugin's custom field.

## [2.15.10] - 2026-08-07

### Fixed
Expand Down
10 changes: 9 additions & 1 deletion inc/commoninjectionlib.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,14 @@ private function reformatThirdPass()
//Get search option associated with the field
$option = self::findSearchOption($searchOptions, $field);

if ($option && !isset($option['checktype'])) {
// In some cases, float datatype is wrongly detected as string, decimal or number, so we check that first.
//Regex matches all decimal formats accepted by glpi
$option['checktype'] = (preg_match('/^(?:(?:\d{1,3}(?: \d{3})+|\d+)[.,]|\d{1,3}(?:,\d{3})+\.)\d+$/', $value) !== 0)
? "float"
: $option['datatype'];
}

// Check some types
switch ($option['checktype'] ?? 'text') {
case "date":
Expand Down Expand Up @@ -1397,7 +1405,7 @@ private function checkType($injectionClass, $option, $field_name, $data, $mandat
{

if (!empty($option)) {
$field_type = ($option['checktype'] ?? 'text');
$field_type = ($option['checktype'] ?? $option['datatype'] ?? 'text');

//If no data provided AND this mapping is not mandatory
if (
Expand Down