Problem/Motivation

Steps to reproduce

  • Create a role "foo"
  • Create a block with a visibility condition on role "foo"
  • Delete role "foo">
 ! ) Fatal error: Call to undefined method Drupal\system\Plugin\Block\SystemMenuBlock::setVisibilityConfig() in core/modules/block/block.module on line 248

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

webflo created an issue. See original summary.

joshi.rohit100’s picture

Status: Active » Needs review
StatusFileSize
new631 bytes

Should be this ?

webflo’s picture

Issue tags: +Needs tests
+++ b/core/modules/block/block.module
@@ -245,7 +245,7 @@ function block_user_role_delete($role) {
+      $block->getPlugin()->setConfigurationValue('user_role', $visibility['user_role']);

I think $block->setVisibilityConfig is correct.

webflo’s picture

Issue tags: -Needs tests
StatusFileSize
new2.11 KB
webflo’s picture

Filled a similar/related issue for the node_type condition in #2549087: Block module should remove entity_bundle visibility conditions

webflo’s picture

StatusFileSize
new1.51 KB

Status: Needs review » Needs work

The last submitted patch, 6: 2548617-4-test-only.patch, failed testing.

webflo’s picture

Status: Needs work » Needs review

#6 failed as expected

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Nice find!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 207985a and pushed to 8.0.x. Thanks!

Btw. In future, having the last patch as a failing patch doesn't make much sense as the rtbc queue is retested.

  • alexpott committed 207985a on 8.0.x
    Issue #2548617 by webflo, joshi.rohit100: Fatal error in...

Status: Fixed » Closed (fixed)

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