I am seeing the following error when using page manager (admin/structure/pages)->node_view->contexts tab.

Notice: Undefined variable: plugins in field_collection_field_collection_from_field_get_children() (line 65 of /data/www/intranet/profiles/wetkit/modules/contrib/field_collection/ctools/relationships/field_collection_from_field.inc).
    Warning: array_merge(): Argument #1 is not an array in ctools_get_plugins() (line 281 of /data/www/intranet/profiles/wetkit/modules/contrib/ctools/includes/plugins.inc).

Due to this error the relationship dropdown is not showing, so I am unable to add any relationships to my panel page. In looking at the code it appears that the $plugins variable which is returned in function field_collection_field_collection_from_field_get_children is not initialized earlier in the function. Initializing the variable gets rid of the error message and the relationship dropdown then shows.

Screenshot attached, patch to follow.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joel_osc’s picture

Status: Active » Needs review
FileSize
662 bytes
rakesh.nimje84@gmail.com’s picture

The solution provided in #1 is working in my case. Thank You!!!

lmeurs’s picture

Status: Needs review » Reviewed & tested by the community

Can confirm the patch works, thanks!

jmuzz’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

I wasn't able to duplicate the error. I made a basic node type with a field collection that had some text fields and set up a variant with default settings for node view. The contexts tab has no error message and the relationships dropdown is working.

Can you provide more specific steps to reproduce the error?

lmeurs’s picture

@jmuzz: You probably do not need to add a field collection. The problem occurs in field_collection_field_collection_from_field_get_children() when field_info_instances() returns an array without a field_collection_item element. When you look at field_collection_field_collection_from_field_get_children() you'll see that the function then returns $plugins whithout initiating it first, which is done by the patch.

I just reproduced the 'bug' using simplytest.me with Field collection, Panels and Page manager. I enabled the Node template at admin/structure/pages, created a variant and visited the variant's Contexts page at admin/structure/pages/nojs/operation/node_view/handlers/node_view_panel_context/context.

jmuzz’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Can confirm these steps produce the error on simplytest.me . I will try to take another look at it soon and may be able to commit it.

subspaceeddy’s picture

I had this issue and can confirm the patch fixes it.

  • Commit eb28ebd on 7.x-1.x authored by joel_osc, committed by jmuzz:
    Issue #2159395 by joel_osc: Fixed panels relationship.
    
jmuzz’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.