- Issue created by @phenaproxima
- @phenaproxima opened merge request.
- π¦πΊAustralia pameeela
@phenaproxima can we update it from
b2b_saas
, tosaas_product
? - First commit to issue fork.
- π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Poked at this after chatting with Adam
There were two issues:
1) missing component versions - I fixed this and pushed
2) the recipe runner installs modules before themesI put a debugger on the
drupal_flush_all_caches
call inexperience_builder_install
and stepped into\Drupal\experience_builder\Plugin\ComponentPluginManager::setCachedDefinitions
At that point the
mercury
theme doesn't exist - so no component config entities get created for the SDCBut when we get to the theme install step, on 11.2 that yields a cache clear of the plugin definitions _but_ we're in a ::isSyncing TRUE state, and hence the logic in
\Drupal\experience_builder\Plugin\ComponentPluginManager::setCachedDefinitions
is skippedI think that means we might need to ship default component config entities, which is the opposite of what I told Adam in a call earlier.
But then I tried adding them, and the issue is that the plugins don't exist at that point, because the clearing of the cache in the theme installer doesn't do discovery, it just clears the cache.
So I then added this to experience_builder.install
function experience_builder_themes_install(): void { \Drupal::service(ComponentPluginManager::class)->getDefinitions(); }
But that didn't seem to help either.
I've pushed up the config, hopefully this helps Adam pinpoint where the issue lies.
- πΊπΈUnited States phenaproxima Massachusetts
It might have just been the hook being wrong. It's
hook_themes_installed
, nothook_themes_install
. - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Discussed with Adam and we agreed getting XB to listen to default content pre import event and making sure it has generated components feels like a good approach to make sure this race condition doesn't happen
- πΊπΈUnited States phenaproxima Massachusetts
Discussed this with @larowlan a bit more and I think we have our solution.
First of all, having the recipe ship the Component config entities is, we agreed, the worst of all possible worlds. It's basically having to maintain the components in two places (Mercury, and the recipe). The coupling is a nightmare. Mediacurrent also feels that this is very much the wrong path.
So the fix probably lies in Experience Builder supporting recipes in some way. Lee suggested a config action that creates the components. That would work, but would be awkward because config actions generally need to target some existing config object. So I had an idea that we both liked better - how about if Experience Builder subscribes to the DefaultContent system's
PreImportEvent
, and unconditionally creates the components before importing content? That should vault us past this hurdle.I think we may still want to have a config action as well, to ensure that specific components are created when needed, but that can be a separate feature request in XB and would not be a blocker to building this site template.
- πΊπΈUnited States Lanny Heidbreder
phenaproxima β credited lanny heidbreder β .
- πΊπΈUnited States phenaproxima Massachusetts
XB follow-ups needed here, which will allow us to remove nearly all the patches I'm adding here:
- Fix XB's broken service decoration (already exists)
- Subscribe to recipe events to ensure that you have all component entities properly generated for you once the recipe is applied, and before content is imported
- Call processDefaultValue() on field items when generating component entities, since that is necessary to actually be conformant with field schema
-
phenaproxima β
committed 318f64b7 on 2.x
Issue #3530376 by phenaproxima, larowlan, pameeela, lanny heidbreder,...
-
phenaproxima β
committed 318f64b7 on 2.x
- πΊπΈUnited States phenaproxima Massachusetts
Whew. That was quite a slog, but with much help, we made it. Obviously the template is not usable in the wild, but at least we've got something we can iterate on! Merged into 2.x.