Qual: Ensure type is string.

This commit is contained in:
MDW 2025-01-05 16:27:32 +01:00
parent ba32606084
commit f322aad97b
No known key found for this signature in database

View File

@ -1,4 +1,6 @@
<?php
/* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*/
'@phan-var-force DolibarrModules $this';
// $keyforselect = name of main table
@ -51,7 +53,7 @@ if ($resql) { // This can fail when class is used on old database (during mig
$tmpparam = jsonOrUnserialize($obj->param); // $tmp may be array 'options' => array 'c_currencies:code_iso:code_iso' => null
if (is_array($tmpparam) && array_key_exists('options', $tmpparam) && $tmpparam['options'] && is_array($tmpparam['options'])) {
$tmpkeys = array_keys($tmpparam['options']);
$tmp = array_shift($tmpkeys);
$tmp = (string) array_shift($tmpkeys);
}
if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) {
$typeFilter = "List:".$tmp;