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.
Notice: Undefined variable: base_tables in entity_views_plugins() (line 324 of /home/pavella/d7/sites/all/modules/entity/views/entity.views.inc).
This started happening after I created a feature that included some views, now I get this notice on any/all pages that make use of a view. I'm not sure what other information might be relevant. I was working out of a blank site for the sole purpose of creating a new feature.
Thanks for any insights.
Comment | File | Size | Author |
---|---|---|---|
#7 | undefined-variable-base-table-fix-1630578-7.patch | 455 bytes | cpliakas |
Comments
Comment #1
Yanivs CreditAttribution: Yanivs commentedHad the same error message right after enabling 7.x-1.0-rc3.
Switched to 7.x-1.0-rc2 and the error message is not appearing anymore.
Cheers,
Y
Comment #2
patrickavella CreditAttribution: patrickavella commentedThanks Yanivs.
The notice doesn't seem to be breaking anything, hopefully it's there's a fix in the next release.
Comment #3
josefg CreditAttribution: josefg commentedI have the same issue.
It seems to me that the problem lies in the new function entity_views_table_definition(), which replaces the function of EntityDefaultViewsController.views_data() - (as far as I can tell the latter no longer gets called). However, in doing so, entity_views_table_definition() forgets to populate the ['base'] sub-array of its return value. Here is my suggestion for an amendment:
entity/views/entity.views.inc:
Comment #4
splig CreditAttribution: splig commentedThere's another issue whereby the base_tables array is not being set before it is used.
Another suggested patch:
entity/views/entity.views.inc:
Comment #5
fubhy CreditAttribution: fubhy commentedThanks guys!
However, please provide an actual .patch file before setting an issue to "needs review".
Other than that (without actually looking into this): The suggested solution from #4 seems to be the right approach. I understand that the loop might not yield any results in some cases which would cause this error message.
You can learn how to create a patch right here: http://drupal.org/project/entity/git-instructions
Comment #6
fubhy CreditAttribution: fubhy commentedOh and by looking at the current dev tree the code is still the same there so the bug report should be filed against the dev branch instead of the release candidate.
Comment #7
cpliakas CreditAttribution: cpliakas commentedConverted #1630578-4: Notice: Undefined variable: base_tables in entity_views_plugins() (line 324 to a patch because I need this fix immediately. Sorry for commandeering someone else's work, but if this does get into the module please give splig credit for the patch.
Thanks!
Chris
Comment #8
fubhy CreditAttribution: fubhy commentedComment #9
fagothanks, committed.
Comment #10
rexgonzaga23 CreditAttribution: rexgonzaga23 commentedThanks its fixed.