Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JvE’s picture

Status: Active » Needs review
FileSize
1.68 KB

A simple patch.

Status: Needs review » Needs work

The last submitted patch, block-rehash-1851530-1.patch, failed testing.

JvE’s picture

Status: Needs work » Needs review
FileSize
1.71 KB

Hm, patch corrupt? Let's try again.

afidegnum’s picture

#3: block-rehash-1851530-3.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, block-rehash-1851530-3.patch, failed testing.

jcovington’s picture

Version: 8.x-dev » 7.x-dev
FileSize
915 bytes

This is a patch for block.module, to avoid an error against checking for $block['status']. I made the fix in 7.x. Should it also be made for 8.x?

jcovington’s picture

Status: Needs work » Needs review

Marking this issue for review per the patch submitted.

JvE’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Needs work
+++ b/modules/block/block.module
@@ -432,7 +432,7 @@ function _block_rehash($theme = NULL) {
-      if (!empty($block['region']) && $block['region'] != BLOCK_REGION_NONE && !isset($regions[$block['region']]) && $block['status'] == 1) {
+      if (!empty($block['region']) && $block['region'] != BLOCK_REGION_NONE && !isset($regions[$block['region']]) && 1 == $block['status']) {

I do not see how this would solve anything.
Also yes, issues should be fixed in 8.x first.

jcovington’s picture

@JvE, as I understand it, the error being thrown was due to trying to check for the value of $block['status'] in cases where $block['status'] is undefined. One quick solution is to reverse the equality check so that $block['status'] can be undefined without throwing any errors.

JvE’s picture

One quick solution is to reverse the equality check so that $block['status'] can be undefined without throwing any errors.

I'm sorry but you are mistaken. Where did you get that idea?

jcovington’s picture

Hm. When I made the change, I didn't see any errors printed to the admin page when enabling the devel module (which is how I came to be aware of this issue). But I see now when I monitor my logs that a notice is still shown. Sorry for the misinformation and I'll keep looking at this.

JvE’s picture

I wish I had time to help out :(
I think the patch from #3 can easily be made to apply to D7.

alexpott’s picture

Version: 8.x-dev » 7.x-dev
Issue summary: View changes

I don't think this is an issue for 8.x anymore

    $status = $block->status();
    // Disable blocks in invalid regions.
    if (!empty($region) && $region != BlockInterface::BLOCK_REGION_NONE && !isset($regions[$region]) && $status) {

New status() method on the ConfigEntity and the status property is guaranteed to exist.

JvE’s picture

Status: Needs work » Needs review
FileSize
1.65 KB
Kebz’s picture

The two patches above worked for me. Thanks!

Daluxz’s picture

Rerolled patch so it applies to the 7.x-1.0 version.

Status: Needs review » Needs work

The last submitted patch, 16: block-rehash-1851530-16.patch, failed testing.

tatarbj’s picture

The posted patch is not on block.module but on a contrib.
I'm attaching a rerolled one on the current 7.54.
Please review.
Cheers,
Balazs.

JvE’s picture

Status: Needs review » Reviewed & tested by the community
David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x - thanks!

I guess it's not really worth trying to write a test for this.

  • David_Rothstein committed de9aa2b on 7.x
    Issue #1851530 by JvE, jcovington, tatarbj: Notice: Undefined index:...

Status: Fixed » Closed (fixed)

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