Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Default statblock overwrites morph instance #26

Open
eaton opened this issue Mar 3, 2017 · 2 comments
Open

Default statblock overwrites morph instance #26

eaton opened this issue Mar 3, 2017 · 2 comments

Comments

@eaton
Copy link
Member

eaton commented Mar 3, 2017

eldrich.module has a snippet of code to auto-populate a morph instance with the morph's defaults when it's saved without values. BUT. When saved via IEF, the entity instance doesn't seem to HAVE any values when hook_entity_presave fires. In particular, $field->isEmpty() always returns true, ensuring values are always overwritten.

It's a bad scene, man.

@eaton
Copy link
Member Author

eaton commented Mar 3, 2017

More accurately, the StatBlock field doesn't seem to preserve its data between Inline Entity Form updates — the overwriting was just a symptom if it always being empty after an (attempted) save. Other fields, including custom ones like SkillReference, don't have the problem. And StatBlocks don't have the problem when they're not inside of an Inline Entity Form.

eaton added a commit that referenced this issue Mar 4, 2017
…But less bad when dealing with this ECK Instance issue than IEF, apparently. Tentatively declaring #26 closed but we’ll see.
@eaton
Copy link
Member Author

eaton commented Mar 4, 2017

It definitely looks like an interaction between Inline Entity Form, StatBlock, and (potentially) Eck entities. Haven't had time to trace it all the way through the call stack and figure out where the ball is being dropped, but it happens with Muses as well.

In the short term, I've replaced Inline Entity Form for Statblock-Possessing Eck entities with EntityBrowser, which might actually be a little cleaner presentationally but is also ass on mobile, so we'll see how it goes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant