Problem/Motivation
While starting building a display, it is not possible to save the first step, we can do stuff, save all later steps, but if we come back to the first step, we still can't save it.
It may be because we do things like that:
- In InstanceStorage::createFromImplementation(), we get the sources without the tree node Ids.
- We create an
HistoryStep, calculating the hash without the tree node ids - We create the entity, saving the source tree and this hash as the first step
Instance::postCreate()is adding the Node Ids with::buildIndexFromSlot(), changing the hash of the present step but not the saved state which still have no tree node Ids.- Then we do a setSave() but it is not related to the issue (and must be kept)
Proposed resolution
Just a proposal, the root cause is not certain yet: Execute buildIndexFromSlot() in a preCreate() instead of postCreate(). Not an easy task because preCreate() is a static method.
Issue fork display_builder-3549867
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
pdureau commentedComment #3
pdureau commentedComment #4
pdureau commentedComment #5
smovs commentedComment #7
mogtofu33 commentedChecking what I can do for the tests.
Comment #8
mogtofu33 commentedComment #9
pdureau commentedComment #11
mogtofu33 commentedComment #14
mogtofu33 commented