From d64d02758aaef7e432e12c3f26590217a01a5f6e Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 29 May 2026 04:13:38 -0400 Subject: [PATCH 1/2] 2.7.1 updates --- docs/lang_diff.txt | 9 ++++++--- htdocs/include/version.php | 2 +- htdocs/modules/debugbar/class/DebugbarLogger.php | 3 +++ htdocs/modules/system/admin/blocksadmin/main.php | 6 +++--- .../system/language/english/admin/blocksadmin.php | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/lang_diff.txt b/docs/lang_diff.txt index ca1872b32..a8cdef92c 100644 --- a/docs/lang_diff.txt +++ b/docs/lang_diff.txt @@ -3,6 +3,12 @@ LANGUAGE DIFFERENCES Below are language differences from a version to next version. +================================ +2026/05/17: Version 2.7.1-Betas +================================ +/htdocs/modules/system/language/english/admin/blocksadmin.php +- added define('_AM_SYSTEM_BLOCKS_INVALID_CLONE', 'Invalid block parameters.'); + ================================ 2025/03/30: Version 2.7.0-Betas (previously released as 2.5.12-Betas) ================================ @@ -10,9 +16,6 @@ Below are language differences from a version to next version. - added define('MISSING_REQUIRED_EXTENSIONS', 'Required PHP extensions are missing'); - added define('MISSING_REQUIRED_EXTENSIONS_MSG', 'XOOPS cannot be installed because the following mandatory PHP extension(s) are not available: %s. Enable them in your PHP configuration (php.ini) and restart your web server, then reload this page.'); -/htdocs/modules/system/language/english/admin/blocksadmin.php -- added define('_AM_SYSTEM_BLOCKS_INVALIDCLONE', 'Invalid block parameters.'); - /htdocs/modules/system/language/english/admin.php - added define('_AM_SYSTEM_MENUS', 'Menus'); - added define('_AM_SYSTEM_MENUS_DESC', 'Manage site navigation menus'); diff --git a/htdocs/include/version.php b/htdocs/include/version.php index 8bb4c4813..10b049264 100644 --- a/htdocs/include/version.php +++ b/htdocs/include/version.php @@ -32,4 +32,4 @@ /** * Define XOOPS version */ -define('XOOPS_VERSION', 'XOOPS 2.7.0'); +define('XOOPS_VERSION', 'XOOPS 2.7.1-Beta1'); diff --git a/htdocs/modules/debugbar/class/DebugbarLogger.php b/htdocs/modules/debugbar/class/DebugbarLogger.php index 6427547d2..59088a070 100644 --- a/htdocs/modules/debugbar/class/DebugbarLogger.php +++ b/htdocs/modules/debugbar/class/DebugbarLogger.php @@ -361,6 +361,9 @@ public function addSmarty() return; } + $helper = Helper::getInstance(); + $helper->loadLanguage('main'); + // Normalize values for display foreach ($data as $k => $v) { if ($v === '') { diff --git a/htdocs/modules/system/admin/blocksadmin/main.php b/htdocs/modules/system/admin/blocksadmin/main.php index 5276c8868..ed5e33391 100644 --- a/htdocs/modules/system/admin/blocksadmin/main.php +++ b/htdocs/modules/system/admin/blocksadmin/main.php @@ -315,7 +315,7 @@ || false !== strpos($clone_dirname, '\\') || false !== strpos($clone_dirname, '..') || false !== strpos($clone_dirname, "\0"))) { - redirect_header('admin.php?fct=blocksadmin', 3, _AM_SYSTEM_BLOCKS_INVALIDCLONE); + redirect_header('admin.php?fct=blocksadmin', 3, _AM_SYSTEM_BLOCKS_INVALID_CLONE); } // func_file is the block PHP file under modules//blocks/ // (a subdirectory is allowed - some modules nest block files); @@ -328,12 +328,12 @@ || false !== strpos($clone_path, '\\') || false !== strpos($clone_path, "\0") || str_starts_with($clone_path, '/'))) { - redirect_header('admin.php?fct=blocksadmin', 3, _AM_SYSTEM_BLOCKS_INVALIDCLONE); + redirect_header('admin.php?fct=blocksadmin', 3, _AM_SYSTEM_BLOCKS_INVALID_CLONE); } } foreach ([$clone_show_func, $clone_edit_func] as $clone_func) { if ($clone_func !== '' && !preg_match('/^[A-Za-z_]\w*$/', $clone_func)) { - redirect_header('admin.php?fct=blocksadmin', 3, _AM_SYSTEM_BLOCKS_INVALIDCLONE); + redirect_header('admin.php?fct=blocksadmin', 3, _AM_SYSTEM_BLOCKS_INVALID_CLONE); } } diff --git a/htdocs/modules/system/language/english/admin/blocksadmin.php b/htdocs/modules/system/language/english/admin/blocksadmin.php index 2337bb346..8637f7123 100644 --- a/htdocs/modules/system/language/english/admin/blocksadmin.php +++ b/htdocs/modules/system/language/english/admin/blocksadmin.php @@ -88,4 +88,4 @@ define('_AM_SYSTEM_BLOCKS_FOOTER_LEFT', 'Footer Left'); define('_AM_SYSTEM_BLOCKS_FOOTER_CENTER', 'Footer Center'); define('_AM_SYSTEM_BLOCKS_FOOTER_RIGHT', 'Footer Right'); -define('_AM_SYSTEM_BLOCKS_INVALIDCLONE', 'Invalid block parameters.'); +define('_AM_SYSTEM_BLOCKS_INVALID_CLONE', 'Invalid block parameters.'); From f8838e45afe3c8301e049c63cc4f7b9c134dd5d5 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Fri, 29 May 2026 20:12:44 -0400 Subject: [PATCH 2/2] fix(tests): source XOOPS_VERSION from version.php so VersionTest covers the real value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bootstrap.php hardcoded 'XOOPS 2.7.0-RC1', shadowing version.php's unconditional define(). VersionTest therefore validated the stale fixture instead of the file, leaving the 2.7.1-Beta1 bump untested (0% patch coverage on version.php). Load the real version.php in the bootstrap and relax the exact-version assertion to the 2.7. line so future patch and pre-release bumps within the line don't churn the test. Two optional follow-ups still open from the review, neither blocking: - docs/lang_diff.txt could record the constant change as a rename rather than a delete-from-2.7.0 + add-to-2.7.1 (cosmetic, since no 2.7.0 stable shipped). - The Debugbar 3 lines remain uncoverable by Codecov because htdocs/modules/debugbar isn't in the include in tests/phpunit.xml.dist — expected, not something this PR needs to fix. --- tests/bootstrap.php | 4 +++- tests/unit/htdocs/include/VersionTest.php | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f34e0173b..adbe5bfd1 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -387,8 +387,10 @@ } // XOOPS version + cache path (needed by Frameworks) +// Source the real version.php so VersionTest exercises the shipped value +// rather than a duplicated literal that silently drifts on each bump. if (!defined('XOOPS_VERSION')) { - define('XOOPS_VERSION', 'XOOPS 2.7.0-RC1'); + require_once XOOPS_ROOT_PATH . '/include/version.php'; } if (!defined('XOOPS_CACHE_PATH')) { define('XOOPS_CACHE_PATH', XOOPS_VAR_PATH . '/caches/xoops_cache'); diff --git a/tests/unit/htdocs/include/VersionTest.php b/tests/unit/htdocs/include/VersionTest.php index 5d345ec68..2b3c85e78 100644 --- a/tests/unit/htdocs/include/VersionTest.php +++ b/tests/unit/htdocs/include/VersionTest.php @@ -41,8 +41,9 @@ public function testXoopsVersionContainsVersionNumber() public function testXoopsVersionValue() { - // Verify the version starts with the expected major.minor.patch - $this->assertStringStartsWith('XOOPS 2.7.0', XOOPS_VERSION, 'Version should start with XOOPS 2.7.0'); + // Verify the version starts with the expected major.minor line + // (kept at 2.7. so patch/pre-release bumps within the line don't churn this test) + $this->assertStringStartsWith('XOOPS 2.7.', XOOPS_VERSION, 'Version should start with XOOPS 2.7.'); } public function testXoopsVersionContainsXoopsPrefix()