Closed (fixed)
Project:
Block Class
Version:
4.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Mar 2025 at 08:53 UTC
Updated:
21 May 2026 at 23:50 UTC
Jump to comment: Most recent
Updating db results in
> [notice] Update started: block_class_update_20004
> [error] json_decode(): Argument #1 ($json) must be of type string, array given
> [error] Update failed: block_class_update_20004

Drupal 11.3.8
Block class 4.0.2
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
merlin06 commentedWe have a similar problem but the hook is block_class_update_20017()
We have an additional issue where we run feature:import before database updates.
The feature:import adds additional classes in via:
We end up with block_classes.settings in the database that looks like:
This is my solution that can convert our situation into a proper array of block classes for block_class.settings.yml:
Comment #5
dydave commentedApparently this issue is still occuring as it was recently reported by a user in duplicate issue #3586652: Updating problem.
Changes suggested by @umac_de at #2:
Replacing
with
Let's trying putting this change and the one above from #3 into a merge request (?!)
Also related to: #3493849: Argument #1 ($array) must be of type array, string given block_class/src/Service/BlockClassHelperService.php.
Comment #9
dydave commentedQuick follow-up on this issue:
Created MR !75 at #7 and since all the required jobs and tests were still passing 🟢, I went ahead and merged the changes at #8. 🥳
As for the issue encountered at #3 with database update
block_class_update_20017:After second thought, it should probably be the object of a separate ticket, more specifically describing the problem, errors and steps to reproduce.
No additional documentation or tests are necessary for this change, therefore, marking issue as Fixed, for now.
Feel free to let us know if you encounter more issues with db update
block_class_update_20004or any other updates of the module, we would surely be glad to help.Thanks in advance!