I'm overriding a node type with a panelizer layout. If I attempt to add comment: field: comment body, it pops up with an ajax 500 error. See the attached image for the full error

Entitymalformedexception: missing bundle property on entity of type: comment in entity_extract_ids() (line 7575 of ... includes/common.inc)

I got this with a different field also, but I can't remember which off the top of my head.

CommentFileSizeAuthor
#6 1829406-500-be-gone.patch2.49 KBbeeradb
7575.jpg61.37 KBesmerel

Comments

merlinofchaos’s picture

Project: Panelizer (obsolete) » Panopoly Magic
Version: 7.x-3.x-dev » 7.x-1.x-dev

This appears to be a bug in Panopoly.

When I stick a print_r() in the exception in entity_extract_ids(), I discover that panopoly_magic.module is calling fape_field_edit_field_form() on line 650. However, the $entity is not valid, and fape has no provisions for that being called with an invalid entity. (This may be a validation bug in fape, from that perspective).

populist’s picture

Project: Panopoly Magic » Panopoly

Moved back to main queue

populist’s picture

Assigned: Unassigned » beeradb

Assinging to beeradb sine he loves UUID and FAPE

merlinofchaos’s picture

The base issue is that when editing a pane that uses an entity context, you cannot assume the entity is already known. If it comes from arguments then the entity is merely a placeholder when using the back end. I put a hack in our panopoly magic to check for the entity before adding the FAPE call (and submit handler), and it seemed to do the trick, but I have no idea if that's correct.

populist’s picture

Mind posting the code you have from #4? Panopoly Magic is making a lot of conditional judgements and adding a logical check there sounds fine.

beeradb’s picture

StatusFileSize
new2.49 KB

Here's a patch which prevents the issue from occurring.

Long term it would be nice to refactor the code around determine the entity type, field name, and entity ID. This refactoring would need to occur outside of Panopoly, as the primary issue is that the data isn't available in form_state values, so we're forced to use a combination of url args, form state values, and finger crossing to hope we can determine the correct entity. In cases like this (where this is no entity), we don't have much of a recourse currently but to do some defensive coding around the possibility.

beeradb’s picture

Status: Active » Needs review
populist’s picture

Status: Needs review » Fixed

Great. Reviewed + Pushed.

Status: Fixed » Closed (fixed)

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