-
Notifications
You must be signed in to change notification settings - Fork 40
Open
backdrop/backdrop
#5108Description
Description of the bug
I'm seeing the following error when running update.php:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: https://backdrop.ddev.site/core/update.php?op=selection&token=5rNtFIz6xZokmlD&action=update&id=18&op=do_nojs&op=do StatusText: error ResponseText: TypeError: array_merge(): Argument #1 must be of type array, null given in array_merge() (line 1264 of backdrop/core/modules/file/file.install).
Line 1264 is the last one shown below:
$config = config('file.type.document');
$mimetypes = $config->get('mimetypes');
$mimetypes = array_merge($mimetypes, array(
Here we are assuming that $config->get(
returns an array, but if mimetypes
has not been set this value is actually FALSE
.
We either need this update to have a dependency on the update where these were set, or we neeed to set this to an empty array.
Setting it to an empty array results in the following errors, but it does complete the update:
Warning: Undefined array key "module" in _file_types_build() (line 2452 of backdrop/core/modules/file/file.module).
Warning: Undefined array key "name" in _file_types_build() (line 2463 of backdrop/core/modules/file/file.module).
Warning: Undefined property: stdClass::$type in file_entity_info() (line 469 of backdrop/core/modules/file/file.module).
Warning: Undefined property: stdClass::$name in file_entity_info() (line 470 of backdrop/core/modules/file/file.module).
Warning: Undefined property: stdClass::$type in file_entity_info() (line 473 of backdrop/core/modules/file/file.module).
Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in file_entity_info() (line 473 of backdrop/core/modules/file/file.module).
Steps To Reproduce
To reproduce the behavior:
- Install Backdrop 1.22.2
- Add a bunch of files with type
image/jpeg
orimage/png
into thefield_image
on Posts. - ??? (checking on any other necessary configs...)
- Update to 1.31.1
- Run
core/update.php
Actual behavior
Fatal error, see above.
Expected behavior
Successful update.
Additional information
Add any other information that could help, such as:
- Backdrop CMS version: 1.22.2 to 1.31.1