Failsafe conversion of block_classes_stored

Created on 11 August 2024, 8 months ago

Problem/Motivation

In ✨ Storing block_classes_stored as a string value leads to poor developer experience Fixed , an update script was introduced that converts the block_classes_stored setting from a JSON string to an array.
The problem is that it does not check whether that setting has already been converted*, resulting in a JSON error because json_decode expects a string, not an array.
The update script will fail forever.

*Cases where this can happen: we're running the update script in a development environment, export the config changes to the filesystem, sync these files to the production environment, and import them. When running drush updb afterwards, the conversion has already taken place, and the update fails.

Proposed resolution

Do a simple is_string() check before converting the data.

Remaining tasks

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany mrshowerman Munich

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024