[openmairie-framework-Commits] r5491 - openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core

0 views
Skip to first unread message

ldo...@users.adullact.net

unread,
Feb 25, 2026, 10:38:47 AM (8 days ago) Feb 25
to openmairie...@googlegroups.com
Author: ldorner
Date: 2026-02-25 16:38:44 +0100 (Wed, 25 Feb 2026)
New Revision: 5491

Modified:
openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core/om_application_pdo.trait.php
Log:
fix: value === '' et build_query_columns_metadata_map fixe

Modified: openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core/om_application_pdo.trait.php
===================================================================
--- openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core/om_application_pdo.trait.php 2026-02-25 13:33:24 UTC (rev 5490)
+++ openmairie_exemple/branches/4.11.0-compatibilite-php8.1_WIP3/core/om_application_pdo.trait.php 2026-02-25 15:38:44 UTC (rev 5491)
@@ -518,6 +518,12 @@
*/
}

+ /**
+ * Construit une map des métadonnées des colonnes d'une requête.
+ *
+ * @param string $query Requête SQL
+ * @return array Map des métadonnées des colonnes
+ */
protected function build_query_columns_metadata_map($query) {
$map = array();
if (preg_match_all('/(?:FROM|JOIN)\s+(?:[\w]+\.)?(\w+)/i', $query, $matches)) {
@@ -531,13 +537,15 @@
$map[strtolower($col_name)] = $col_info;
}
}
- $inst = $this->get_inst__om_dbform(array(
- 'obj' => $table_name,
- 'idx' => 0,
- ));
- if ($inst !== null && method_exists($inst, 'get_additional_columns')) {
- foreach ($inst->get_additional_columns() as $col_name => $col_info) {
- $map[strtolower($col_name)] = $col_info;
+ if (isset($GLOBALS['f'])) {
+ $inst = $this->get_inst__om_dbform(array(
+ 'obj' => $table_name,
+ 'idx' => 0,
+ ));
+ if ($inst !== null && method_exists($inst, 'get_additional_columns')) {
+ foreach ($inst->get_additional_columns() as $col_name => $col_info) {
+ $map[strtolower($col_name)] = $col_info;
+ }
}
}
}
@@ -1478,7 +1486,7 @@

if (!$get_columns_name && ($value === true || $value === false)) {
$boolean_columns[$key] = true;
- } else if (!$get_columns_name && ($value === 1 || $value === "1" || $value === "t" || $value === 0 || $value === "0" || $value === "f" || $value == "")) {
+ } else if (!$get_columns_name && ($value === 1 || $value === "1" || $value === "t" || $value === 0 || $value === "0" || $value === "f" || $value === "")) {
// Construire la map des métadonnées une seule fois
// à partir des tables de la requête (get_columns_metadata
// + get_additional_columns), évite getColumnMeta()

Reply all
Reply to author
Forward
0 new messages