From ae4e4a5615829d5e6993a30eb0f384ef8ab8eeee Mon Sep 17 00:00:00 2001 From: Martin Price Date: Fri, 30 Jan 2026 20:38:17 +0000 Subject: [PATCH 1/2] Issue #473: Add defensive coding to enable_bee_callback --- CHANGELOG.md | 2 ++ commands/projects.bee.inc | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f9be56..bb022cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ database or client does not support it. - The ability to download specified releases or branches of modules, themes, layout templates or Backdrop itself. - Command to convert database to UTF8MB4. +- Defensive coding to prevent warnings if a module or theme exists in the +`system` table but not in the file system. ### Fixed - Unhandled errors and warnings if commands run outside Backdrop root and/or diff --git a/commands/projects.bee.inc b/commands/projects.bee.inc index 487185e..03cfc96 100644 --- a/commands/projects.bee.inc +++ b/commands/projects.bee.inc @@ -214,7 +214,13 @@ function enable_bee_callback($arguments, $options) { switch ($type) { case 'module': // Get module info. - $module = $modules[$project]; + $module = $modules[$project] ?? FALSE; + if (!$module) { + bee_message(bt("Project '!name' could not be found.", array( + '!name' => $project, + )), 'error'); + continue 2; + } $name = $module->info['name']; // Check if already enabled. @@ -260,7 +266,13 @@ function enable_bee_callback($arguments, $options) { break; case 'theme': // Get theme info. - $theme = $themes[$project]; + $theme = $themes[$project] ?? FALSE; + if (!$theme) { + bee_message(bt("Project '!name' could not be found.", array( + '!name' => $project, + )), 'error'); + continue 2; + } $name = $theme->info['name']; // Check if already enabled. From 180001e147a960eee7af22e0fa87db209fe709c1 Mon Sep 17 00:00:00 2001 From: Martin Price <20357797+yorkshire-pudding@users.noreply.github.com> Date: Wed, 18 Feb 2026 12:59:00 +0000 Subject: [PATCH 2/2] Update unreleased date in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb022cf..f55b820 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project follows the which is based on the major version of Backdrop CMS with a semantic version system for each contributed module, theme and layout. -## [Unreleased] - 2026-01-30 +## [Unreleased] - 2026-02-18 ### Added - An option for the `db-import` command to allow import from newer MariaDB