- Issue created by @mxr576
- Merge request !12253Set config synching true before importing bundled configs β (Open) created by mxr576
- ππΊHungary mxr576 Hungary
Okay, so it seems the proposed change breaks the
RecipeQuickStartTest
with a similar error that I have reported, although the proposed fix fixes the problem that I reported.In DiscoveryTrait.php line 53:\n \n The "entity:shortcut:default" plugin does not exist. Valid plugin IDs for Drupal\Core\TypedData\TypedDataManager are: filter_format, entity_reference, entity, entity:block, entity:block_co \n ntent_type, entity:block_content, entity:field_config, entity:field_storage_config, entity:filter_format, entity:path_alias, entity:shortcut_set, entity:shortcut, entity:menu, entity:actio \n n, entity:user_role, entity:user, entity:view, entity:date_format, entity:entity_view_mode, entity:entity_view_display, entity:entity_form_mode, entity:entity_form_display, entity:base_fie \n ld_override, field_item:link, field_item:text, field_item:text_with_summary, field_item:text_long, field_item:float, field_item:integer, field_item:decimal, field_item:string_long, field_i \n tem:created, field_item:entity_reference, field_item:string, field_item:changed, field_item:map, field_item:password, field_item:timestamp, field_item:uuid, field_item:language, field_item \n :uri, field_item:email, field_item:boolean, float, decimal, boolean, email, uri, list, language, map, string, duration_iso8601, timespan, timestamp, any, binary, datetime_iso8601, integer, \n language_reference
- ππΊHungary mxr576 Hungary
and the exception originates from
\Drupal\Core\Recipe\RecipeRunner::installContent()
... so maybe I bumped into another issue and the proposed fix is not completely a bad idea (open for comments, please!) - ππΊHungary mxr576 Hungary
Okay, at this point, I am unsure where to catch this bug and which layers are impacted... of course setting is synching on the config installer is not a god idea since it triggers #3 by design (from
\Drupal\Core\Config\ConfigInstaller::createConfiguration()
:// If we are syncing do not create configuration entities. Pluggable // configuration entities can have dependencies on modules that are // not yet enabled. This approach means that any code that expects // default configuration entities to exist will be unstable after the // module has been enabled and before the config entity has been // imported. if ($this->isSyncing()) { continue; }
setting the isSynching() on the config entity was an idea to bypass the dependency calculation in
\Drupal\Core\Config\Entity\ConfigEntityBase::preSave()
:if (!$this->isSyncing()) { // Ensure the correct dependencies are present. If the configuration is // being written during a configuration synchronization then there is no // need to recalculate the dependencies. $this->calculateDependencies(); // If the data is trusted we need to ensure that the dependencies are // sorted as per their schema. If the save is not trusted then the // configuration will be sorted by StorableConfigBase. if ($this->trustedData) {}
...but this changes Drupal core behavior globally, there is a way to scope it to recipes only, but still, would that be the approach? Unsure, especially even with this change other parts of the Recipe install fails when it tries to fetch the "datasource_foo" entity for different reasons (like because entity insert hooks are triggered).
- ππΊHungary mxr576 Hungary
mxr576 β changed the visibility of the branch 3526781-set-config-synching to hidden.
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
You don't post your recipe, so just guessing, but FYI recipes don't install dependent config _entities_ unless explicitly said.
You need
config: import: your_module: - node.type.foo
- ππΊHungary mxr576 Hungary
And the answer was in front of my eyes after my new RCA... Gotta go to the corner to cry.
Thanks for saving me from another hours of debugging and sorry for the noise.