Problem/Motivation

Clicking "Save Block" causes Drupal website error

Steps to reproduce

  1. Configure Block
  2. Click on "Save Block;" - can make changes or not - doesn't matter
  3. Following error message:
The website encountered an unexpected error. Please try again later.
Error: Call to undefined method Drupal::entityManager() in _block_styles_form_submit() (line 132 of modules/block_styles/block_styles.module)

Proposed resolution

None

Remaining tasks

User interface changes

API changes

Data model changes

Comments

dmaclachlan created an issue. See original summary.

alex_optim’s picture

Status: Active » Needs review

I checked this problem for Drupal 8.9.14 and this module working as expected.
Could you please provide more information for reproduce issue?

dmaclachlan’s picture

Hi! Thanks for responding. What information can I provide for you?

Whenever I go in to modify a block and hit "Submit," I get the error message I posted.

Thanks!

p.s. Installed on Drupal 9.1.7
p.p.s. Error Log Message:

Notice: Trying to access array offset on value of type null in block_styles_form_block_form_alter() (line 81 of /home/cumberla/public_html/test.cumberlandcountylibraries.org/drupal9/modules/block_styles/block_styles.module)

Notice: Trying to access array offset on value of type null in block_styles_form_block_form_alter() (line 98 of /home/cumberla/public_html/test.cumberlandcountylibraries.org/drupal9/modules/block_styles/block_styles.module)

Notice: Trying to access array offset on value of type null in block_styles_form_block_form_alter() (line 109 of /home/cumberla/public_html/test.cumberlandcountylibraries.org/drupal9/modules/block_styles/block_styles.module)

Notice: Trying to access array offset on value of type null in block_styles_form_block_form_alter() (line 81 of /home/cumberla/public_html/test.cumberlandcountylibraries.org/drupal9/modules/block_styles/block_styles.module)

Notice: Trying to access array offset on value of type null in block_styles_form_block_form_alter() (line 98 of /home/cumberla/public_html/test.cumberlandcountylibraries.org/drupal9/modules/block_styles/block_styles.module)

Notice: Trying to access array offset on value of type null in block_styles_form_block_form_alter() (line 109 of /home/cumberla/public_html/test.cumberlandcountylibraries.org/drupal9/modules/block_styles/block_styles.module)

Error: Call to undefined method Drupal::entityManager() in _block_styles_form_submit() (line 132 of /home/cumberla/public_html/test.cumberlandcountylibraries.org/drupal9/modules/block_styles/block_styles.module)

dmaclachlan’s picture

Hi! Checking in to see if you might have some insights into why this module isn't cooperating with my Drupal installation. Thanks!

dmaclachlan’s picture

Hello - checking in to see what, if any, additional information I can provide. Still experiencing the same error message as soon as I hit "Submit" when making any kind of change to a block. Thanks!

dmaclachlan’s picture

Hi - Checking in to see if there's any other information I can send to you to help you. Thanks!

digitalfrontiersmedia’s picture

dmaclachlan, your error message indicates that the problem is actually with a different module--https://www.drupal.org/project/block_styles

digitalfrontiersmedia’s picture

Project: Block Background Style » Block Styles
Version: 1.0.2 » 2.0.2
digitalfrontiersmedia’s picture

Status: Needs review » Active
hatuhay’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.