In fieldable_panels_panes_preprocess_panels_pane() it's loading the fieldable_panels_pane entity in question from the database again, even though it's already be present on the $vars.
In the normal case, this is wasteful, since you already have perfectly fine object already loaded up.
But changing this will also allow Panopoly to simplify it's preview generating code for FPPs. In the past, Panopoly would actually save FPPs to the database just so that they get rendered correctly. But then we're saving something before the user has even pressed save!
Instead, we'd like to just render an unsaved FPP entity, and this function is causing trouble by loading the FPP from the database.
I'll post a patch in a moment.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | fieldable_panels_pane-avoid-reload-2415427-7.patch | 709 bytes | dsnopek |
Comments
Comment #1
dsnopekPatch is attached! Please let me know what you think.
Comment #2
damienmckennaGood find, thanks!
Comment #3
dsnopekActually, sorry, I think that configuration key might only be set on Panopoly. :-/ Here is a better patch that should work anywhere! Again, sorry for not testing more widely...
Comment #4
dsnopekAnd how about for safety we check if that key exists first...
Comment #5
damienmckennaI'd forgotten to upload recent commits, can you please reroll that? Thanks.
Comment #7
dsnopekSure!
Comment #8
damienmckennaCommitted.