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 index: centers in ctools_terms_from_node_context() (line 38 of sites/all/modules/contrib/ctools/plugins/relationships/terms_from_node.inc).
I am receiving the following error with vocabularies added to a node after I created page manager page variant with a "multiple terms from node" relationship context with a few vocabularies checked. Since the conf for this context doesn't get updated with new vocabularies, when comparing fields for those new vocabularies to the old list, some indexes don't exist, hence the PHP Notice.
Comment | File | Size | Author |
---|---|---|---|
#1 | multiple_terms_node_relationship-1954794-2.patch | 926 bytes | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedThe supplied patch adds a !empty() check and will stop the notice.
Comment #2
Taz CreditAttribution: Taz commentedI too am getting this. The patch solved my problem, but i feel though it may just be a temporary fix.
I have a panel variant on node_page, one for each content type. The particular variant this error is coming from is NOT the variant the page ends up matching (Simple match by content type), but because the #weight is before the one that does match, it processes it anyway. The variant this error comes from has the 'multiple terms from node' context, which is passed through as an argument to a view.
I think some optimisations should be done here, as I did a backtrace to find where this was coming from - perhaps in another ticket, and maybe in Panels? If a selection rule is not using a context, then we should not process that particular context during the load. It seems like a massive overhead to be doing this when it's not required.
Comment #3
AndreyMaximov CreditAttribution: AndreyMaximov commentedThe simple fix. RTBC
Comment #4
japerryTested, fixed, and committed:
http://drupalcode.org/project/ctools.git/commit/c2e25670284e64e3509f8a65...