- Issue created by @alexpott
- π¬π§United Kingdom alexpott πͺπΊπ
This is happening because wse_config and workspaces are being installed at the same time. The wse_config module depends on workspaces (via the wse module), so workspaces is installed first. This means that when we loop round do entity updates we try and create a reference field on the wse_config entity type before the entity type actually exists. Because we process the workspaces in this loop before wse_config.
I think this is a core bug. I think we should process entity type creations before we do any field adding.
- π¬π§United Kingdom alexpott πͺπΊπ
Yeah this is a core bug. We should only be processing field storage updates if the provider of the entity type is not in the module list.
- Merge request !10573Only install field storage definitions if the entity type provider has been... β (Open) created by alexpott
- π¬π§United Kingdom alexpott πͺπΊπ
This is a critical bug because it prevent correct installation of modules that provide fields for entity types they do not provide themselves.
- π¬π§United Kingdom alexpott πͺπΊπ
Another way to recreate this problem with only core modules is to make taxonomy dependent on workspaces... and then install minimal and then taxonomy... kaboom! Works fine on 11.1.x.
- π¬π§United Kingdom catch
#6 seems like a possible test coverage shortcut - could be done with hook_system_info_alter() in a test module.
- First commit to issue fork.
Added a test to the MR per #6/#7. The tricky part was that the entity storage exception actually is caught by the module installer and logged. Then the workspace field ends up getting created correctly later anyway. Had to create a logger that would re-throw the exception.
Tweaked the service definition YML a bit and rebased. Not sure whether the log recorder should have more of an API with an interface defining methods, instead of expecting to work directly with state, but leaving as is for now.
- πΊπΈUnited States nicxvan
That's a tricky test.
Coverage looks good and fix looks good.
I'm running test only just to be sure. - πΊπΈUnited States nicxvan
Took a couple of reads to see how it was working, but I'll keep it in mind if I ever need this.