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.
The following functions incorrectly assumes that menu_get_item()
always returns an array, but this is not true: For 404 pages, for example, it returns FALSE
. With PHP 7.4, these functions cause a notice.
With PHP 7.4, block_page_build()
doesn't shown any block on 404 pages.
Comment | File | Size | Author |
---|---|---|---|
#10 | 3085088-10.patch | 1.54 KB | mcdruid |
#10 | interdiff-3085088-7-10.txt | 565 bytes | mcdruid |
#4 | drupal-menu_get_item_false-3085088-4.patch | 8.84 KB | Taran2L |
Comments
Comment #2
Taran2LComment #3
Taran2LComment #4
Taran2LComment #5
apadernoComment #6
MustangGB CreditAttribution: MustangGB commentedI guess this is what was meant.
Comment #7
mcdruidWondering whether we can get away with a couple of very minimal changes which simply bail out if
menu_get_item()
returnsFALSE
.Let's see what the tests say...
Couple of notes:
Comment #8
mcdruidOops, the interdiff's obviously not meant to be a patch... bit distracted atm :)
Comment #10
mcdruidI'm actually surprised more tests didn't fail with that patch; I hadn't read the logic properly.
Here's a tweak to the change in
block_page_build()
which I've checked fixes at least one of the test fails.Comment #11
mcdruidTests look okay, I think.
Noting that I am sneaking in the removal of what looks like an unnecessary, duplicated call to
menu_get_item()
fromblock_page_build()
. I don't see taking this out "while we're here" causing any harm, but we could leave it and file a followup if we want to keep this patch 100% about PHP 7.4Hopefully this approach is easier to review than #4 which is a significantly bigger patch largely because of indentation changes.
AFAICS this is ready for final review.
Comment #12
MustangGB CreditAttribution: MustangGB commentedDid wonder what that was in there for, thanks for mentioning why.
Comment #13
mcdruidConfirmation that #10 resolves the PHP 7.4 exceptions from the two files we're changing (compared against the most recent baseline test in #3081386-60: [META] Fully support PHP 7.4 in Drupal 7 ):
Comment #14
Fabianx CreditAttribution: Fabianx at Tag1 Consulting commentedApproved, let's get this in.
Comment #16
mcdruidThanks all; one more step closer!