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.
Problem/Motivation
Using the module with PHP 7.4 generates errors:
Notice: Trying to access array offset on value of type null in taxonomy_menu_trails_init() (line 102 of /var/www/profiles/ecitizen/modules/contrib/taxonomy_menu_trails/taxonomy_menu_trails.module).
Proposed resolution
Update code syntax.
Comment | File | Size | Author |
---|---|---|---|
#3 | errors_when_using_php_74-3206470-3.patch | 1.54 KB | wylbur |
Comments
Comment #2
wylbur CreditAttribution: wylbur at Electric Citizen commentedComment #3
wylbur CreditAttribution: wylbur at Electric Citizen commentedHere's a patch that resolved the errors for us. This patch is based on the DEV branch.
Comment #4
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedAre we sure that the
isset
is the correct way instead of!empty
check? If the value (somehow) would be 0, it will also pass that condition. So this patch could be potentially changing the logic (though not intentionally). See the another approach here: #3206489: array offset notice.Comment #5
poker10 CreditAttribution: poker10 at ActivIT s.r.o. commentedThe correct status here should be Needs review.