Closed (fixed)
Project:
Fieldable Panels Panes (FPP)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Aug 2012 at 08:59 UTC
Updated:
8 Feb 2013 at 19:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
nils.destoop commentedPatch attached to change all the view functions to fieldable_panel_pane_view
Comment #2
nils.destoop commentedComment #3
nils.destoop commentedMaybe the other functions (load functions, fieldable_panels_panes_create, fieldable_panels_panes_access, fieldable_panels_panes_save) should also be renamed?
Comment #4
merlinofchaos commentedI'm sorry, what fatal error do you refer to? Are you making a change because the metadata module is hardcoding what the names of our view callbacks should be? I'm very confused by this change.
Comment #5
swentel commentedSo here's the irony: The Entity API module has Field API formatters which allows you to select a formatter to render an entity through a view mode. The callback for that is entity_metadata_view_single(), however, it looks at the entity_type name - see below. In case of the fieldable panels panes module, the entity key is 'fieldable_panels_pane', but the callback to view it is 'fieldable_panels_panes_view', that's why the undefined function error pops up.
I haven't tested whether it's possible to change the view callback in the entity info to fieldable_panels_pane_view, but I hope this info makes it a bit clearer?
(note, it probably happens in other occasions as well outside field api formatters, but not sure)
Comment #6
merlinofchaos commentedYes it should be possible to change this in the entity info somewhere. I'd start by trying 'view callback'?
Comment #7
nils.destoop commentedI tried changing the view callback first. But then following fatal error occures: ': Trying to get property of non-object in PanelsPaneController->view()'
When dsm'ing, the value of $entity is an array with entities, instead of an entity on it's own.
Comment #8
theunraveler commentedzuuperman is correct: it looks like the view callback is given an array with one entity. I've adjusted the
fieldable_panels_panes_view()function to react accordingly if the argument is an array. I'm not sure if this is the best way to deal with this.Comment #9
dave reidThis change looks acceptable and allows compatibility with entity API, so committing to #8 to 7.x-1.x. http://drupalcode.org/project/fieldable_panels_panes.git/commit/4031576
Comment #11
dave reidCommitting #8 made fieldable panel panes incompatible with the 'Rendered entity' row plugin in Views.
Comment #12
dave reidFixed for real with http://drupalcode.org/project/fieldable_panels_panes.git/commit/cd4949f