Steps to reproduce:

1. Download and enable the UUID and References modules.
2. Add a node reference field to fieldable panel pane entities.
3. Create a fieldable panel pane, and add a reference to a node.
4. Place the fieldable panel pane inside a panel.

When you look at the panel, the referenced node will not be displayed.

(The same thing would happen with Entity Reference module also, by the way, except there's currently another bug in the UUID module's integration with Entity Reference which cancels this one out.)

The cause of the bug is that Fieldable Panels Panes is using entity_uuid_load() to load entities by UUID, but that's the wrong function. What that function does is load an entity in which all local IDs have been replaced by UUIDs. But when Drupal goes to render a node reference field, it won't know what to do with the UUIDs, so it's not able to find the referenced node.

A patch is coming up.

Comments

Status:Active» Needs review
StatusFileSize
new739 bytes

Here's the patch.

Altering and adding ers support if need be by loading the published entity.

Status:Needs review» Postponed (maintainer needs more info)

Can you provide a link to the entity references module for the UUID bug you mentioned? Given that references is basically depreciated in favor of entity references it doesn't make sense to commit this unless it fixes any potential issues with entity references.

Status:Postponed (maintainer needs more info)» Needs review

Hm, I actually am able to reproduce this bug with a fresh copy of Entity Reference now; no other bug seems to cancel it out anymore.

(I think the issue I had been thinking about was #1545278: Dependencies are not added for entityreference fields (Symptom: "Undefined index: target_type") but that only comes into play if you additionally have the Entity Dependency API module enabled also.)

So, this bug now seems to occur for both Entity Reference and References.

Either way, I wouldn't suggest holding off based on that, since:

  1. The References module has 45,000 sites using it so it's not going away anytime soon :)
  2. These bugs with references are really just symptoms; the fundamental bug is that fieldable_panels_panes_load_entity() is sometimes returning an "entity" that has the wrong data in it.

I don't think the ers support should be in this patch. It's two separate problems.

Additionally, ers contains its own support for fpp, not the reverse. This is intentional: I wanted to make sure it was possible for ers to add itself to entities *without* the entity having to be modified to support it. So this is an important distinction. Beyond that, I don't even understand what the ers support is doing here, so that's a problem on its own.

I'm also concerned about the use of current() -- what happens if the pane doesn't exist? I believe that will lead to a crash because current() fails on an empty array?

Status:Needs review» Needs work