Closed (fixed)
Project:
Fieldable Panels Panes (FPP)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Dec 2015 at 16:22 UTC
Updated:
27 Sep 2016 at 02:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joelstein commentedComment #3
joelstein commentedComment #5
joelstein commentedUgh, working too fast and missed a semicolon.
Comment #7
joelstein commentedActually, the patch above breaks stuff, probably because the bundle property is used for other purposes in FPP.
However, it just occurred to me that the only reason that the bundle property is available is because the FPP entity was loaded, which means it's already available in the request cache. If anyone stumbles on this, you can simply load the entity with
fieldable_panels_panes_load_from_subtype_force($subtype['entity_id']);.Slightly related, it would be worth considering if we can load the reusable entities in a lighter way, in case hundreds (or more) of them need to be loaded...
Comment #10
chris burge commentedI'm also needing the FPP entity bundles while using hook_ctools_content_subtype_alter(). Returning $info['bundle'] does break things (i.e. none of my FPP entities print in panels). If the 'bundle' namespace is already being used, then let's use something else like 'fpp_bundle'.
Comment #11
chris burge commentedI think the underlying issue is in fieldable_panels_panes_load_from_subtype():
When we set $info['bundle'], fieldable_panels_panes_load_from_subtype() thinks this is a new entity. Instead, let's check if $subtype_info['entity_id'] is set. If it's not set, then we're dealing with a new entity.
With this change, we'll never get to "Finally, try this" because either $subtype_info['entity_id'] is set or it isn't set. One of the IFs will return true before getting to "Finally, try this". I'm not sure about the consequences of this. When would neither $subtype_info['bundle'] nor $subtype_info['entity_id'] be set?
Comment #12
chris burge commentedComment #14
damienmckennaCommitted. Thank you both!
Comment #15
damienmckenna