diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f9be56..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 @@ -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.