Skip to content

Commit 0a2d0ce

Browse files
Merge branch '1.x-1.x' into issue-111-update-command
2 parents 0e97dd9 + f976f24 commit 0a2d0ce

12 files changed

Lines changed: 75 additions & 21 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Get PHP syntax highlighting for these file extensions.
2+
3+
*.inc linguist-language=php

.github/workflows/phpcs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@v3
2020
with:
2121
repository: backdrop-ops/phpcs
22-
ref: 1.0.0
22+
ref: 1.1.0
2323
path: phpcs
2424
- name: Move standard outside current dir
2525
run: mv phpcs ..

.lando.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@ name: bee
22
recipe: backdrop
33
keys: false
44
config:
5-
php: 8.3
5+
php: 8.4
66
webroot: backdrop
7-
database: mysql
7+
database: mysql:8.0
88
# Set Xdebug off by default. We use the tooling below to turn it on as needed.
99
xdebug: false
1010
# Need to disable bee so can use the version in the repo.
1111
bee: false
1212
services:
1313
appserver:
14+
# Allow scanner to fail faster; http paths often fail locally.
15+
scanner:
16+
retry: 5
1417
config:
1518
php: .lando/php.ini
1619
build_as_root:
@@ -42,8 +45,12 @@ services:
4245
database:
4346
healthcheck: mysql --defaults-extra-file=/app/.lando/mysql.cnf --silent --execute "SHOW DATABASES;"
4447
multisite:
45-
type: php:8.3
48+
type: php:8.4
4649
webroot: multisite
50+
ssl: true
51+
# Allow scanner to fail faster; http paths often fail locally.
52+
scanner:
53+
retry: 5
4754
events:
4855
pre-rebuild:
4956
# Run clean-up tasks.

.lando/setup.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ set_up() {
2222
cd /app
2323

2424
# Create databases.
25-
mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS backdrop; GRANT ALL PRIVILEGES ON backdrop.* TO 'backdrop'@'%' IDENTIFIED by 'backdrop';"
26-
mysql -h database -u root -e "CREATE DATABASE multi_one; GRANT ALL PRIVILEGES ON multi_one.* TO 'backdrop'@'%' IDENTIFIED by 'backdrop';"
27-
mysql -h database -u root -e "CREATE DATABASE multi_two; GRANT ALL PRIVILEGES ON multi_two.* TO 'backdrop'@'%' IDENTIFIED by 'backdrop';"
28-
mysql -h database -u root -e "CREATE DATABASE install_test; GRANT ALL PRIVILEGES ON install_test.* TO 'backdrop'@'%' IDENTIFIED by 'backdrop';"
25+
mysql -h database -u root -e "CREATE USER IF NOT EXISTS 'backdrop'@'%' IDENTIFIED BY 'backdrop';"
26+
mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS backdrop; GRANT ALL PRIVILEGES ON backdrop.* TO 'backdrop'@'%';"
27+
mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS multi_one; GRANT ALL PRIVILEGES ON multi_one.* TO 'backdrop'@'%';"
28+
mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS multi_two; GRANT ALL PRIVILEGES ON multi_two.* TO 'backdrop'@'%';"
29+
mysql -h database -u root -e "CREATE DATABASE IF NOT EXISTS install_test; GRANT ALL PRIVILEGES ON install_test.* TO 'backdrop'@'%';"
2930
mysql -h database -u root -e "FLUSH PRIVILEGES;"
3031

3132
# Configure Backdrop installation.

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ and this project follows the
88
which is based on the major version of Backdrop CMS with a semantic version
99
system for each contributed module, theme and layout.
1010

11-
## [Unreleased] - 2025-07-08
11+
## [Unreleased] - 2026-02-23
1212

1313
### Added
1414
- An option for the `db-import` command to allow import from newer MariaDB
@@ -18,18 +18,24 @@ database or client does not support it.
1818
- The ability to download specified releases or branches of modules, themes,
1919
layout templates or Backdrop itself.
2020
- Command to convert database to UTF8MB4.
21+
- Support for PHP 8.4
22+
- Defensive coding to prevent warnings if a module or theme exists in the
23+
`system` table but not in the file system.
2124

2225
### Fixed
2326
- Unhandled errors and warnings if commands run outside Backdrop root and/or
2427
before installing Backdrop.
2528
- Error if importing config to database config storage.
29+
- Deprecations within error handling for PHP 8.4.
2630

2731
### Changed
2832
- Bee will now notify the user of additional modules that will be enabled or disabled
2933
based on module dependencies when using the enable and disable commands.
3034
- The functions within the download command have been made more flexible and
3135
better able to support the coming 'update' command.
3236
- Provide default terminal width if `tput cols` fails to get the value.
37+
- The `config-import` command will now import `system.extensions` config updates first
38+
if there are any.
3339

3440
## [1.x-1.1.0] - 2024-09-07
3541

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ database operations (i.e. `db-export`, `db-import`, `db-drop`, `sql` but NOT
3131

3232
### PHP
3333
![Static Badge](https://img.shields.io/badge/php%20compatibility-555555?logo=php&logoColor=white&style=flat-square)
34+
![Static Badge](https://img.shields.io/badge/8.4-blue?style=flat-square)
3435
![Static Badge](https://img.shields.io/badge/8.3-blue?style=flat-square)
3536
![Static Badge](https://img.shields.io/badge/8.2-blue?style=flat-square)
3637
![Static Badge](https://img.shields.io/badge/8.1-blue?style=flat-square)
3738
![Static Badge](https://img.shields.io/badge/8.0-blue?style=flat-square)
3839
![Static Badge](https://img.shields.io/badge/7.4-blue?style=flat-square)
3940

40-
- Bee is tested and works from `7.4` up to `8.3`.
41+
- Bee is tested and works from `7.4` up to `8.4`.
4142

4243
## Installation
4344

bee.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@
4646
* The file that the error came from.
4747
* @param int $line
4848
* The line number the error came from.
49-
* @param array $context
49+
* @param array|null $context
5050
* An array of all variables from where the error was triggered.
5151
*
5252
* @see https://www.php.net/manual/en/function.set-error-handler.php
5353
* @see _backdrop_error_handler()
5454
*/
55-
function bee_error_handler($error_level, $message, $filename, $line, array $context = NULL) {
55+
function bee_error_handler($error_level, $message, $filename, $line, ?array $context = NULL) {
5656
require_once __DIR__ . '/includes/errors.inc';
57-
_bee_error_handler_real($error_level, $message, $filename, $line, $context);
57+
_bee_error_handler_real($error_level, $message, $filename, $line);
5858
}
5959

6060
/**

commands/config.bee.inc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,25 @@ function config_import_bee_callback($arguments, $options) {
299299
return;
300300
}
301301

302+
// As of Backdrop 1.32.0, modules and themes may be enabled via config import.
303+
// Import the special system.extensions config file first if it exists.
304+
if (isset($statuses['system.extensions']) && $statuses['system.extensions'] == 'update') {
305+
config_sync_file('system.extensions', 'update');
306+
307+
// Revalidate the configuration after new modules have been enabled.
308+
// Hooks such as hook_config_import_validate() in the newly enabled modules
309+
// will be included as module_enable() clears the module_implements() cache.
310+
try {
311+
foreach ($rows as $row) {
312+
config_sync_validate_file($row[0]['value'], $row[1]['value'], $statuses);
313+
}
314+
}
315+
catch (ConfigValidateException $e) {
316+
bee_message($e->getMessage(), 'error');
317+
return;
318+
}
319+
}
320+
302321
// Import config.
303322
foreach ($rows as $row) {
304323
config_sync_file($row[0]['value'], $row[1]['value']);

commands/db.bee.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ function db_bee_mysql_options(array $db_info, $include_db = TRUE) {
422422

423423
// Create an array for the connection string and filename.
424424
$options = array();
425-
$options['connection'] = "--defaults-file=$temp_filename ";
425+
$options['connection'] = "--defaults-extra-file=$temp_filename ";
426426
$options['connection'] .= ($include_db) ? rawurldecode($db_info['database']) : '';
427427
$options['filename'] = $temp_filename;
428428

commands/projects.bee.inc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ function enable_bee_callback($arguments, $options) {
214214
switch ($type) {
215215
case 'module':
216216
// Get module info.
217-
$module = $modules[$project];
217+
$module = $modules[$project] ?? FALSE;
218+
if (!$module) {
219+
bee_message(bt("Project '!name' could not be found.", array(
220+
'!name' => $project,
221+
)), 'error');
222+
continue 2;
223+
}
218224
$name = $module->info['name'];
219225

220226
// Check if already enabled.
@@ -260,7 +266,13 @@ function enable_bee_callback($arguments, $options) {
260266
break;
261267
case 'theme':
262268
// Get theme info.
263-
$theme = $themes[$project];
269+
$theme = $themes[$project] ?? FALSE;
270+
if (!$theme) {
271+
bee_message(bt("Project '!name' could not be found.", array(
272+
'!name' => $project,
273+
)), 'error');
274+
continue 2;
275+
}
264276
$name = $theme->info['name'];
265277

266278
// Check if already enabled.

0 commit comments

Comments
 (0)