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.
It's causing a race condition on cache clear.
Warning: Invalid argument supplied for foreach() in /var/www/d7/code/sites/all/modules/redirect/redirect.module on line 1444
Notice: Undefined index: bundles in /var/www/d7/code/sites/all/modules/redirect/redirect.module on line 1444
See #1416558: hook_entity_info(), hook_schema(), and the field system are strongly bound to each other for the core issue.
Comment | File | Size | Author |
---|---|---|---|
#9 | 1441488-bundle-empty-check.patch | 1.6 KB | tomsegarra |
|
Comments
Comment #1
Dave ReidI'm not sure how this could be worked around? I haven't ever experienced this error in local testing so maybe it's another module added in the picture that is causing the actual cache conflict?
Comment #2
Dave ReidComment #3
tim.plunkettI really have no more insight into this, except Damien's issue seemed to pretty clearly explain the behavior I was seeing.
Also using File Entity, Media 2.x, Entity, Entity Reference on the site.
Comment #4
Dave ReidHrm. This is frustrating.
Comment #5
geek-merlinhuh, this is a major PITA as it is quite natural to list call entity_get_info() from inside hook_field_extra_fields() to get a list of entities.
tried this with a module today and kadong, the site is in WSOD state and i found NO way to revive it: disabling the module and "drush cc all" does not help
(beware: my experiment is no 100% smoking-gun proof as there are some other modules on the site, but only well proven ones)
i don't want to take the power out of solving this major issue radically, but some people may be thankful for
* a way to revive a site that broke due to this
* a way to get an entity listing without entity_get_info()
EDIT: don't trust the above too much. good chance entityrefrence broke my site.
Comment #6
geek-merlinwould be nice to review the above idea.
for a mid-term tool approach see #1450612: Dataflow browser for hooks system
Comment #7
Dave ReidNothing to review.
Comment #8
Dave ReidComment #9
tomsegarra CreditAttribution: tomsegarra as a volunteer commentedThe only major difference between this implementation of hook_field_extra_fields() and the one in the Metatag module is that Metatag checks whether $entity_info['bundles'] is empty. Since the error message in the original issue report complains about "Undefined index: bundles", it seems appropriate to add a similar check here.
Given that there's really only one reliable report of this problem, that Metatag has almost the same code ostensibly working fine in a full release, and that this issue has been helping prevent a stable release of Redirect for three years now, I propose that adding this variable check is sufficient mitigation until further reports arise.
Comment #10
Chris Matthews CreditAttribution: Chris Matthews commented...and that this issue has been helping prevent a stable release of Redirect for three years now, I propose that adding this variable check is sufficient mitigation until further reports arise.
+1 to ^
The patch in #9 applied cleanly to redirect.module 7.x-1.x-dev and looks like a clean fix, but it would be good to get at least 1 other review/test before changing the status to RTBC.
Comment #11
Chris Matthews CreditAttribution: Chris Matthews as a volunteer and at City of Oaks Design commentedThis issue is a child of #2514248: Plan for Redirect v7.x-1.0 release. Should it continue to be blocker for a full 7.x-1.0 release of redirect?
Comment #12
euk CreditAttribution: euk commentedHello!
I applied patch in #9 and all seems to be working fine. Cache clear works without issues. Is there anything else to test?
Considering it's been about a year since the latest patch was uploaded - I believe the fix is good to go.
Comment #13
tomsegarra CreditAttribution: tomsegarra as a volunteer commentedWe've got two independent reviews here, and for an issue of this size I think that qualifies as RTBC.
Comment #14
pifagorComment #17
pifagor