Problem/Motivation

error message
A clean install generates the error above.

Steps to reproduce

Do a ddev drush site:install --existing-config on drupal 10.3

Proposed resolution

Add an if statement in case the value is a string and not an array.

Command icon Show commands

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

bernardm28 created an issue. See original summary.

bernardm28’s picture

Issue summary: View changes
bernardm28’s picture

Status: Active » Needs review
ericpoir’s picture

StatusFileSize
new945 bytes

I created a patch based on the work done in the following MR:

https://git.drupalcode.org/project/block_class/-/merge_requests/58

After applying these changes, it works for my on 4.0.0.

npcoder’s picture

StatusFileSize
new731 bytes

I encountered the same error and have created a patch that could be helpful.

rajab natshah’s picture

Status: Needs review » Reviewed & tested by the community

Facing the same issue.
Patch #6 is working
Thank you :)

rajab natshah’s picture

Priority: Major » Critical
renatog’s picture

Parent issue: » #3520864: Plan for 4.0.2

Thanks everyone!

Adding this on plan for the next release

johncionci’s picture

Patch installed and working for me!

dydave made their first commit to this issue’s fork.

dydave’s picture

Priority: Critical » Normal
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Thank you very much for raising this issue.

Sorry for this late reply, but unfortunately I was unable to reproduce this with current version of Drupal Core, tested with:

  • core: 11.2.5
  • block_class: 4.0.x
  • php: 8.3

Is this still issue still happening with more recent versions of the module and Drupal Core?

From what I have seen, the config variable 'block_classes_stored' is properly declared as a sequence of string and initialized as an empty array, so I can't seem to think of any reason the variable $block_classes_stored could be a string...🤔

In short: I am unable to reproduce this issue and from the look at the code think the problem should not occur again.

Could anyone please provide clear testing steps to follow, to reproduce the issue, if possible with more context, versions of module/core, etc... ?

Any additional information that could help us reproduce the problem would be greatly appreciated.

Additionally, since there has not been any comments on the issue for half a year, we could also perhaps assume the problem initially reported might have been resolved with some other changes (from other tickets) (?).

Lowering ticket priority back to Normal and switching status to Postponed (maintainer needs more info), for now, until the work expected in this ticket could be clarified.

Feel free to let us know if you would have any questions or concerns on any aspects of this comment or the module in general, we would surely be glad to help.
Thanks in advance!

alae.akalay’s picture

Facing the same issue with TB Megamenu blocks (https://www.drupal.org/project/tb_megamenu) - after some debug I've found that the conversion is not straigthforward, so I added a check to decode the JSON string into an associative array.

ckhalilo made their first commit to this issue’s fork.

ckhalilo’s picture

Status: Postponed (maintainer needs more info) » Needs review

Hi
I have added a new MR handle Json and check if empty block_classes_stored.

Best Regards
Khalil

ckhalilo’s picture

StatusFileSize
new1.04 KB

You can find the patch here

rajab natshah’s picture

Status: Needs review » Reviewed & tested by the community