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.
Check if block.module is enabled before calling block_load.
Comment | File | Size | Author |
---|---|---|---|
#5 | webform-fatal_error_call_to-2386979-5.patch | 1012 bytes | DanChadwick |
#3 | webform-check-block-module-2386979-3.patch | 1013 bytes | shadcn |
#1 | webform-check-block-module-2386979-1.patch | 2.79 KB | shadcn |
Comments
Comment #1
shadcn CreditAttribution: shadcn commentedComment #2
DanChadwick CreditAttribution: DanChadwick commentedGood catch.
Probably function_exists('block_load') would be faster and just as clear. Also there is no reason not to include this in the existing if, rather than creating a nested if block. The && operator is guaranteed to be short-circuit in PHP.
Marking as Normal because this affects only a small portion of sites, and they can temporarily enable block as a work-around. If you tweak up the patch, I'll get it committed a little sooner.
Comment #3
shadcn CreditAttribution: shadcn commentedUpdated.
Comment #4
DanChadwick CreditAttribution: DanChadwick commentedI will flip the order of execution to but the cheap, most likely negative on first. Thx for your work on this.
Comment #5
DanChadwick CreditAttribution: DanChadwick commentedI re-ordered for efficiency:
Committed to 7.x-4.x and 8.x. Thanks!
Comment #8
DanChadwick CreditAttribution: DanChadwick commented