Right now if you enable panels everywhere without taxonomy module I get a couple of notices:
Notice: Undefined index: entity:taxonomy_term in ctools_context_entity_get_child() (line 32 of .../ctools/plugins/contexts/entity.inc).
Strict warning: Creating default object from empty value in panels_everywhere_site_template_add_context() (line 125 of ../panels_everywhere/plugins/tasks/site_template.inc).
Strict warning: Creating default object from empty value in panels_everywhere_site_template_add_context() (line 125 of .../panels_everywhere/plugins/tasks/site_template.inc).
I found code in the panels_everywhere_site_template_get_base_contexts function that depends on the node and the user module also.
My two solution suggestions are:
- Wrap the code requiring the modules in modul_exists checks
- Add the modules as dependencies in the info file
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | panels_everywhere-n2349583-12.patch | 4.45 KB | damienmckenna |
| #8 | panels_everywhere-n2349583-8.patch | 4.89 KB | damienmckenna |
Comments
Comment #1
emattias commentedI think that we should ultimately implement suggestion #1 but in the mean time, here's a patch that implements #2, for the modules that I found code requiring them.
Comment #2
damienmckennaFirst off, thanks for the patch.
I believe this is the wrong approach - it shouldn't require more modules, it should instead just have logic that verifies the modules exist before trying to do something; while the user and node modules are required by core, the Taxonomy module is not thus it should not be required by Panels Everywhere either.
(PS, please set issues to "needs review" when you upload a patch.)
Comment #3
slv_ commentedComment #4
slv_ commentedRight, so the issue is that panels_everywhere_site_template_add_context() is called by panels_everywhere_site_template_get_base_contexts() even in cases where some of the contexts it's being called with don't make sense (e.g: User being viewed context in a simple static page like "my-page").
As such, in some cases the $context argument passed to panels_everywhere_site_template_add_context() is a NULL, and therefore that warning appears in environments where E_STRICT is enabled for error logging, since the function tries to add some properties to it.
I've attached a simple patch (certainly might not be the most correct), to at least check whether the context is an object, and if it's not, create it as stdClass().
Comment #5
damienmckennaI've confirmed the problem, but the patch doesn't solve it.
Comment #6
damienmckennaComment #7
damienmckennaTwo errors show:
After enabling the default PE site template and going to admin/structure/pages/site_template, the following shows:
Notice: Undefined index: entity:taxonomy_term in ctools_context_entity_get_child() (line 32 of ctools/plugins/contexts/entity.inc).Once either the "Selection rules", "Context" or "Content" pages for the site template display results in the following:
Fatal error: Call to undefined method stdClass::is_type() in ctools/includes/context.inc on line 148Comment #8
damienmckennaThis should do it. All that was necessary was to confirm that the Taxonomy module was enabled before loading & creating the contexts.
Comment #9
damienmckennaCommitted. Thank you both!
Comment #11
damienmckennaNeeds to be backported to D6.
Comment #12
damienmckennaPorted to D6.
Comment #13
damienmckennaCommitted to D6 too.