Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Due to #1172560: The block X was assigned to the invalid region Y and has been disabled. it is possible that $block['status'] is used in _block_rehash() before it is ensured to exist.
Comment | File | Size | Author |
---|---|---|---|
#18 | block-rehash-1851530-18.patch | 1.69 KB | tatarbj |
Comments
Comment #1
JvE CreditAttribution: JvE commentedA simple patch.
Comment #3
JvE CreditAttribution: JvE commentedHm, patch corrupt? Let's try again.
Comment #4
afidegnum CreditAttribution: afidegnum commented#3: block-rehash-1851530-3.patch queued for re-testing.
Comment #6
jcovington CreditAttribution: jcovington commentedThis 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?
Comment #7
jcovington CreditAttribution: jcovington commentedMarking this issue for review per the patch submitted.
Comment #8
JvE CreditAttribution: JvE commentedI do not see how this would solve anything.
Also yes, issues should be fixed in 8.x first.
Comment #9
jcovington CreditAttribution: jcovington commented@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.
Comment #10
JvE CreditAttribution: JvE commentedI'm sorry but you are mistaken. Where did you get that idea?
Comment #11
jcovington CreditAttribution: jcovington commentedHm. 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.
Comment #12
JvE CreditAttribution: JvE commentedI wish I had time to help out :(
I think the patch from #3 can easily be made to apply to D7.
Comment #13
alexpottI don't think this is an issue for 8.x anymore
New status() method on the ConfigEntity and the status property is guaranteed to exist.
Comment #14
JvE CreditAttribution: JvE commentedComment #15
Kebz CreditAttribution: Kebz commentedThe two patches above worked for me. Thanks!
Comment #16
Daluxz CreditAttribution: Daluxz at One Shoe commentedRerolled patch so it applies to the 7.x-1.0 version.
Comment #18
tatarbjThe 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.
Comment #19
JvE CreditAttribution: JvE as a volunteer commentedComment #20
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedCommitted to 7.x - thanks!
I guess it's not really worth trying to write a test for this.