From bd726deb08e62e15c0e2a38262beb09478722bb2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:01:56 +0000 Subject: [PATCH 1/9] Refactor Art bootstrap loading Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/admin/admin_header.php | 3 +-- src/header.php | 2 +- src/icms_version.php | 2 +- src/include/bootstrap.php | 27 +++++++++++++++++++++++++++ src/include/functions.ini.php | 13 ++++++++----- src/include/functions.php | 1 + 6 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/admin/admin_header.php b/src/admin/admin_header.php index 58cf354..e76b0d6 100644 --- a/src/admin/admin_header.php +++ b/src/admin/admin_header.php @@ -24,9 +24,8 @@ */ include "../../../include/cp_header.php"; +include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php"; -include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/class/art/functions.php"; -include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/class/art/functions.admin.php"; // include the default language file for the admin interface diff --git a/src/header.php b/src/header.php index b031931..9b5e9b4 100644 --- a/src/header.php +++ b/src/header.php @@ -24,9 +24,9 @@ */ include_once '../../mainfile.php'; +include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/functions.php"; -include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/class/art/functions.php"; $myts = icms_core_Textsanitizer::getInstance(); diff --git a/src/icms_version.php b/src/icms_version.php index f311013..b2e1de1 100644 --- a/src/icms_version.php +++ b/src/icms_version.php @@ -52,7 +52,7 @@ $modversion['submit_feature'] = "https://www.impresscms.org/modules/iforum/"; $modversion['submit_bug'] = "https://www.impresscms.org/modules/iforum/"; -include_once(ICMS_ROOT_PATH."/modules/".$modulename."/class/art/functions.ini.php"); +include_once(ICMS_ROOT_PATH."/modules/".$modulename."/include/bootstrap.php"); include_once(ICMS_ROOT_PATH."/modules/".$modulename."/include/functions.php"); // Is performing module install/update? $isModuleAction = icms_moduleAction($modversion['dirname']); diff --git a/src/include/bootstrap.php b/src/include/bootstrap.php index 0adf5bc..944eb53 100644 --- a/src/include/bootstrap.php +++ b/src/include/bootstrap.php @@ -66,3 +66,30 @@ function &iforum_get_handler($handlerName) return $handler; } + +function iforum_load_art_functions_ini() +{ + if (defined('FRAMEWORKS_ART_FUNCTIONS_INI')) { + return true; + } + + return (bool) include_once iforum_get_module_path('class/art/functions.ini.php'); +} + +function iforum_load_art_functions($group = '') +{ + iforum_load_art_functions_ini(); + + if ($group === '') { + return (bool) include_once iforum_get_module_path('class/art/functions.php'); + } + + return load_functions($group); +} + +function iforum_load_art_object() +{ + iforum_load_art_functions_ini(); + + return load_object(); +} diff --git a/src/include/functions.ini.php b/src/include/functions.ini.php index 6c792bf..4f5892a 100644 --- a/src/include/functions.ini.php +++ b/src/include/functions.ini.php @@ -27,15 +27,18 @@ { exit(); } + +include_once ICMS_ROOT_PATH.'/modules/'.basename(dirname(__FILE__, 2)).'/include/bootstrap.php'; if (defined("IFORUM_FUNCTIONS_INI")) return; - define("IFORUM_FUNCTIONS_INI", 1); - -include_once(ICMS_ROOT_PATH."/modules/".basename(dirname(__FILE__, 2))."/class/art/functions.php"); - +define("IFORUM_FUNCTIONS_INI", 1); + +/** +* @deprecated Use iforum_load_art_object() instead. +*/ function iforum_load_object() { - return load_object(); + return iforum_load_art_object(); } function iforum_message($message ) diff --git a/src/include/functions.php b/src/include/functions.php index 14bb6b7..42b754c 100644 --- a/src/include/functions.php +++ b/src/include/functions.php @@ -27,6 +27,7 @@ define("IFORUM_FUNCTIONS", true); include_once dirname(__FILE__)."/functions.ini.php"; +iforum_load_art_functions(); if (!defined("_GLOBAL_LEFT")) { define('_GLOBAL_LEFT', ((defined('_ADM_USE_RTL') && _ADM_USE_RTL )?"right":"left")); From 105315439f7bc89064dffdaa5c5c85ee3905364a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:03:05 +0000 Subject: [PATCH 2/9] Harden bootstrap wrappers Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/admin/admin_header.php | 5 +++-- src/include/bootstrap.php | 16 +++++++++++++--- src/include/functions.ini.php | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/admin/admin_header.php b/src/admin/admin_header.php index e76b0d6..b395e11 100644 --- a/src/admin/admin_header.php +++ b/src/admin/admin_header.php @@ -26,8 +26,9 @@ include "../../../include/cp_header.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php"; - - +iforum_load_art_functions('admin'); + + // include the default language file for the admin interface if (!@include_once(ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/language/" . $icmsConfig['language'] . "/main.php")) { diff --git a/src/include/bootstrap.php b/src/include/bootstrap.php index 944eb53..3e8286a 100644 --- a/src/include/bootstrap.php +++ b/src/include/bootstrap.php @@ -73,23 +73,33 @@ function iforum_load_art_functions_ini() return true; } - return (bool) include_once iforum_get_module_path('class/art/functions.ini.php'); + $loaded = include_once iforum_get_module_path('class/art/functions.ini.php'); + + return $loaded !== false || defined('FRAMEWORKS_ART_FUNCTIONS_INI'); } function iforum_load_art_functions($group = '') { - iforum_load_art_functions_ini(); + if (!iforum_load_art_functions_ini()) { + return false; + } if ($group === '') { return (bool) include_once iforum_get_module_path('class/art/functions.php'); } + if (!function_exists('load_functions')) { + return false; + } + return load_functions($group); } function iforum_load_art_object() { - iforum_load_art_functions_ini(); + if (!iforum_load_art_functions_ini() || !function_exists('load_object')) { + return false; + } return load_object(); } diff --git a/src/include/functions.ini.php b/src/include/functions.ini.php index 4f5892a..39e85b0 100644 --- a/src/include/functions.ini.php +++ b/src/include/functions.ini.php @@ -28,7 +28,7 @@ exit(); } -include_once ICMS_ROOT_PATH.'/modules/'.basename(dirname(__FILE__, 2)).'/include/bootstrap.php'; +include_once(ICMS_ROOT_PATH."/modules/".basename(dirname(__FILE__, 2))."/include/bootstrap.php"); if (defined("IFORUM_FUNCTIONS_INI")) return; define("IFORUM_FUNCTIONS_INI", 1); From 5fa77ce08106079a7675616f5d1f822dcde2b502 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:03:53 +0000 Subject: [PATCH 3/9] Handle bootstrap load failures Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/admin/admin_header.php | 4 +++- src/include/bootstrap.php | 4 +--- src/include/functions.php | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/admin/admin_header.php b/src/admin/admin_header.php index b395e11..78a3b7b 100644 --- a/src/admin/admin_header.php +++ b/src/admin/admin_header.php @@ -26,7 +26,9 @@ include "../../../include/cp_header.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php"; -iforum_load_art_functions('admin'); +if (!iforum_load_art_functions('admin')) { + return; +} // include the default language file for the admin interface diff --git a/src/include/bootstrap.php b/src/include/bootstrap.php index 3e8286a..1eaac0d 100644 --- a/src/include/bootstrap.php +++ b/src/include/bootstrap.php @@ -73,9 +73,7 @@ function iforum_load_art_functions_ini() return true; } - $loaded = include_once iforum_get_module_path('class/art/functions.ini.php'); - - return $loaded !== false || defined('FRAMEWORKS_ART_FUNCTIONS_INI'); + return include_once iforum_get_module_path('class/art/functions.ini.php') !== false; } function iforum_load_art_functions($group = '') diff --git a/src/include/functions.php b/src/include/functions.php index 42b754c..ce4c6ea 100644 --- a/src/include/functions.php +++ b/src/include/functions.php @@ -27,7 +27,9 @@ define("IFORUM_FUNCTIONS", true); include_once dirname(__FILE__)."/functions.ini.php"; -iforum_load_art_functions(); +if (!iforum_load_art_functions()) { + return; +} if (!defined("_GLOBAL_LEFT")) { define('_GLOBAL_LEFT', ((defined('_ADM_USE_RTL') && _ADM_USE_RTL )?"right":"left")); From 8abdd00f3f3fb5cf168083bb933e8c71313ddea8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:04:45 +0000 Subject: [PATCH 4/9] Report bootstrap load issues Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/admin/admin_header.php | 1 + src/include/bootstrap.php | 4 +++- src/include/functions.php | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/admin/admin_header.php b/src/admin/admin_header.php index 78a3b7b..42bf755 100644 --- a/src/admin/admin_header.php +++ b/src/admin/admin_header.php @@ -27,6 +27,7 @@ include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php"; if (!iforum_load_art_functions('admin')) { + trigger_error('Unable to load iForum admin Art functions.', E_USER_WARNING); return; } diff --git a/src/include/bootstrap.php b/src/include/bootstrap.php index 1eaac0d..499567a 100644 --- a/src/include/bootstrap.php +++ b/src/include/bootstrap.php @@ -73,7 +73,9 @@ function iforum_load_art_functions_ini() return true; } - return include_once iforum_get_module_path('class/art/functions.ini.php') !== false; + include_once iforum_get_module_path('class/art/functions.ini.php'); + + return defined('FRAMEWORKS_ART_FUNCTIONS_INI'); } function iforum_load_art_functions($group = '') diff --git a/src/include/functions.php b/src/include/functions.php index ce4c6ea..53bb4eb 100644 --- a/src/include/functions.php +++ b/src/include/functions.php @@ -28,6 +28,7 @@ include_once dirname(__FILE__)."/functions.ini.php"; if (!iforum_load_art_functions()) { + trigger_error('Unable to load iForum Art functions.', E_USER_WARNING); return; } if (!defined("_GLOBAL_LEFT")) From 8ea5c82f2b11163946d94a9e8082a0795964f5d1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:05:45 +0000 Subject: [PATCH 5/9] Clarify bootstrap diagnostics Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/admin/admin_header.php | 2 +- src/include/bootstrap.php | 4 +++- src/include/functions.ini.php | 2 +- src/include/functions.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/admin/admin_header.php b/src/admin/admin_header.php index 42bf755..df4f9a7 100644 --- a/src/admin/admin_header.php +++ b/src/admin/admin_header.php @@ -27,7 +27,7 @@ include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php"; if (!iforum_load_art_functions('admin')) { - trigger_error('Unable to load iForum admin Art functions.', E_USER_WARNING); + trigger_error('Unable to load iForum admin Art functions from '.iforum_get_module_path('class/art/functions.admin.php').'.', E_USER_WARNING); return; } diff --git a/src/include/bootstrap.php b/src/include/bootstrap.php index 499567a..60ec4b3 100644 --- a/src/include/bootstrap.php +++ b/src/include/bootstrap.php @@ -85,7 +85,9 @@ function iforum_load_art_functions($group = '') } if ($group === '') { - return (bool) include_once iforum_get_module_path('class/art/functions.php'); + include_once iforum_get_module_path('class/art/functions.php'); + + return defined('FRAMEWORKS_ART_FUNCTIONS'); } if (!function_exists('load_functions')) { diff --git a/src/include/functions.ini.php b/src/include/functions.ini.php index 39e85b0..a831c00 100644 --- a/src/include/functions.ini.php +++ b/src/include/functions.ini.php @@ -28,7 +28,7 @@ exit(); } -include_once(ICMS_ROOT_PATH."/modules/".basename(dirname(__FILE__, 2))."/include/bootstrap.php"); +include_once dirname(__DIR__).'/include/bootstrap.php'; if (defined("IFORUM_FUNCTIONS_INI")) return; define("IFORUM_FUNCTIONS_INI", 1); diff --git a/src/include/functions.php b/src/include/functions.php index 53bb4eb..2a29bc5 100644 --- a/src/include/functions.php +++ b/src/include/functions.php @@ -28,7 +28,7 @@ include_once dirname(__FILE__)."/functions.ini.php"; if (!iforum_load_art_functions()) { - trigger_error('Unable to load iForum Art functions.', E_USER_WARNING); + trigger_error('Unable to load iForum Art functions from '.iforum_get_module_path('class/art/functions.php').'.', E_USER_WARNING); return; } if (!defined("_GLOBAL_LEFT")) From f726fe92368520fcf9e1de2420c66c1dd76d5236 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:06:54 +0000 Subject: [PATCH 6/9] Standardize Art runtime checks Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/admin/admin_header.php | 2 +- src/include/bootstrap.php | 17 +++++++++++------ src/include/functions.php | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/admin/admin_header.php b/src/admin/admin_header.php index df4f9a7..bbee65e 100644 --- a/src/admin/admin_header.php +++ b/src/admin/admin_header.php @@ -27,7 +27,7 @@ include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/bootstrap.php"; include_once ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/include/vars.php"; if (!iforum_load_art_functions('admin')) { - trigger_error('Unable to load iForum admin Art functions from '.iforum_get_module_path('class/art/functions.admin.php').'.', E_USER_WARNING); + trigger_error('Unable to initialize the iForum Art admin runtime.', E_USER_WARNING); return; } diff --git a/src/include/bootstrap.php b/src/include/bootstrap.php index 60ec4b3..afe9ded 100644 --- a/src/include/bootstrap.php +++ b/src/include/bootstrap.php @@ -84,17 +84,22 @@ function iforum_load_art_functions($group = '') return false; } + $constant = 'FRAMEWORKS_ART_FUNCTIONS'; + if ($group !== '') { + $constant .= '_' . strtoupper($group); + } + if ($group === '') { include_once iforum_get_module_path('class/art/functions.php'); + } else { + if (!function_exists('load_functions')) { + return false; + } - return defined('FRAMEWORKS_ART_FUNCTIONS'); - } - - if (!function_exists('load_functions')) { - return false; + load_functions($group); } - return load_functions($group); + return defined($constant); } function iforum_load_art_object() diff --git a/src/include/functions.php b/src/include/functions.php index 2a29bc5..05ad10a 100644 --- a/src/include/functions.php +++ b/src/include/functions.php @@ -28,7 +28,7 @@ include_once dirname(__FILE__)."/functions.ini.php"; if (!iforum_load_art_functions()) { - trigger_error('Unable to load iForum Art functions from '.iforum_get_module_path('class/art/functions.php').'.', E_USER_WARNING); + trigger_error('Unable to initialize the iForum Art runtime for shared functions.', E_USER_WARNING); return; } if (!defined("_GLOBAL_LEFT")) From a64658cecc38678553388cbf097cc63a02361abb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:07:54 +0000 Subject: [PATCH 7/9] Polish Art runtime messages Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/admin/admin_header.php | 3 +-- src/include/functions.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/admin/admin_header.php b/src/admin/admin_header.php index bbee65e..4412997 100644 --- a/src/admin/admin_header.php +++ b/src/admin/admin_header.php @@ -30,8 +30,7 @@ trigger_error('Unable to initialize the iForum Art admin runtime.', E_USER_WARNING); return; } - - + // include the default language file for the admin interface if (!@include_once(ICMS_ROOT_PATH."/modules/".icms::$module->getVar("dirname")."/language/" . $icmsConfig['language'] . "/main.php")) { diff --git a/src/include/functions.php b/src/include/functions.php index 05ad10a..54d7c98 100644 --- a/src/include/functions.php +++ b/src/include/functions.php @@ -28,7 +28,7 @@ include_once dirname(__FILE__)."/functions.ini.php"; if (!iforum_load_art_functions()) { - trigger_error('Unable to initialize the iForum Art runtime for shared functions.', E_USER_WARNING); + trigger_error('Unable to initialize the iForum Art runtime.', E_USER_WARNING); return; } if (!defined("_GLOBAL_LEFT")) From c3601235224f78dfc62ad5312ba15c4aa1c4b10e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:08:54 +0000 Subject: [PATCH 8/9] Document deprecated Art wrapper Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/include/bootstrap.php | 1 + src/include/functions.ini.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/bootstrap.php b/src/include/bootstrap.php index afe9ded..6ce2333 100644 --- a/src/include/bootstrap.php +++ b/src/include/bootstrap.php @@ -93,6 +93,7 @@ function iforum_load_art_functions($group = '') include_once iforum_get_module_path('class/art/functions.php'); } else { if (!function_exists('load_functions')) { + trigger_error('Unable to initialize the iForum Art runtime.', E_USER_WARNING); return false; } diff --git a/src/include/functions.ini.php b/src/include/functions.ini.php index a831c00..7fe21ff 100644 --- a/src/include/functions.ini.php +++ b/src/include/functions.ini.php @@ -34,7 +34,7 @@ define("IFORUM_FUNCTIONS_INI", 1); /** -* @deprecated Use iforum_load_art_object() instead. +* @deprecated since 2.4.0, use iforum_load_art_object() instead; kept for compatibility and subject to future removal. */ function iforum_load_object() { From 484d2ff28b2b8608236247757397754c9acee583 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 09:09:47 +0000 Subject: [PATCH 9/9] Finalize Art deprecation notes Agent-Logs-Url: https://github.com/iForumModule/iforum/sessions/c63434c5-fdf3-4585-b817-d9e672a58240 Co-authored-by: fiammybe <3736946+fiammybe@users.noreply.github.com> --- src/include/bootstrap.php | 1 - src/include/functions.ini.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/include/bootstrap.php b/src/include/bootstrap.php index 6ce2333..afe9ded 100644 --- a/src/include/bootstrap.php +++ b/src/include/bootstrap.php @@ -93,7 +93,6 @@ function iforum_load_art_functions($group = '') include_once iforum_get_module_path('class/art/functions.php'); } else { if (!function_exists('load_functions')) { - trigger_error('Unable to initialize the iForum Art runtime.', E_USER_WARNING); return false; } diff --git a/src/include/functions.ini.php b/src/include/functions.ini.php index 7fe21ff..bdf0354 100644 --- a/src/include/functions.ini.php +++ b/src/include/functions.ini.php @@ -34,7 +34,7 @@ define("IFORUM_FUNCTIONS_INI", 1); /** -* @deprecated since 2.4.0, use iforum_load_art_object() instead; kept for compatibility and subject to future removal. +* @deprecated since 2.4.0, use iforum_load_art_object() instead; kept for compatibility and planned for removal in 3.0.0. */ function iforum_load_object() {