- Issue created by @lobsterr
- last update
over 1 year ago 60 pass - @lobsterr opened merge request.
- Issue was unassigned.
- Status changed to Needs review
over 1 year ago 10:09am 6 September 2023 - π§πͺBelgium lobsterr
I have tried to find a way to detect, if config is actually translation, but there is no methods for it.
The only way we can check it by storage collection. Or maybe there is another way to do it.
Anyway, I think in this case we just simply can check source and it would be enough - πΊπΈUnited States Chris Burge
@LOBsTerr - I'm having trouble reproducing this issue.
Set up steps:
- Install a vanilla Drupal 10.1.x site
- Install oEmbed Providers module
- Install Configuration Translation
- Install Dutch language
- Create a 'Test Media Type' media type
- Add translation for media type configuration
- Export entire site config to ../config/sync
If I drop the DB and re-install from existing config, I'm not seeing the warning.
I also tried setting a breakpoint in
ConfigEventsSubscriber::configSave()
. If I alter the translated ../config/sync/language/nl/media.type.test_media_type.yml file and import, the breakpoint doesn't hit. If alter ../config/sync/media.type.test_media_type.yml file and import, the breakpoint does hit.So far as I can tell,
ConfigEventsSubscriber::configSave()
doesn't fire went translated config is imported. - π§πͺBelgium lobsterr
I will double check it on clean installation and will come to you
- π§πͺBelgium lobsterr
I have followed almost exactly your steps, the only difference, I translated Image media type, instead of creating a custom one:
and this what I see during the installationroot@f91e89afa23e:/home/lob/www/clean-drupal# ./vendor/bin/drush 'site:install' minimal --root=/home/lob/www/clean-drupal/web/ --site-name='Clean Drupal website' --site-mail=info@example.org --locale=en --account-mail=admin@example.org --account-name=admin --account-pass=admin --sites-subdir=default --existing-config -y You are about to: * DROP all tables in your 'drupal' database. // Do you want to continue?: yes. [notice] Starting Drupal installation. This takes a while. [notice] Performed install task: install_select_language [notice] Performed install task: install_select_profile [notice] Performed install task: install_load_profile [notice] Performed install task: install_verify_requirements [notice] Performed install task: install_verify_database_ready [notice] Performed install task: install_base_system [notice] Performed install task: install_bootstrap_full [warning] Undefined array key "source" ConfigEventsSubscriber.php:68 [warning] Undefined array key "source" ConfigEventsSubscriber.php:68 [warning] Undefined array key "source" ConfigEventsSubscriber.php:68
If you want I can share my configuration. I also set breakpoints to discover it in the first place and I just did it again. The same result as reported, Are you sure your debugger setup to work with CLI ?
- πΊπΈUnited States Chris Burge
I'm able to reproduce the behavior when installing the site with Drush; however, it doesn't happen when the site is installed via UI. When installing with Drush, the breakpoint does hit, and I do see that 'source' is missing.
Additional info:
When runningdrush config:import
to import either the media type or its translated config,ConfigEventsSubscriber::configSave()
does not fire.Diving deeper:
When installing via UI:
InConfigImporter::ImportConfig()
, the following line returns an overrider:
$overrider = $this->configManager->getConfigCollectionInfo()->getOverrideService($collection);
The config object loaded isDrupal\language\Config\LanguageCongigOverride
, which has its own->save()
method, which dispatches aLanguageConfigOverrideCrudEvent
event. The oEmbed Providers'ConfigEventsSubscriber
subscriber is not triggered.When installing via Drush:
InConfigImporter::ImportConfig()
, the following line does NOT return an overrider:
$overrider = $this->configManager->getConfigCollectionInfo()->getOverrideService($collection);
The config object loaded isDrupal\Core\Config\Config
. When its->save()
is called, it dispatches aConfigCrudEvent
event, which triggers the oEmbed Providers'ConfigEventsSubscriber
subscriber. - πΊπΈUnited States Chris Burge
In
ConfigImporter::ImportConfig()
, when installing via UI,$this->configManager->getConfigCollectionInfo()
returns two collections:language.en
andlangauge.nl
. When installing via Drush, it returns onlylanguage.en
.I spent some time digging into this, and it really gets into the weeds of the Drupal installer and how Drush invokes it. This is being caused by either a bug in core or in Drush.
- Status changed to Closed: works as designed
about 1 year ago 1:51am 1 December 2023 - πΊπΈUnited States Chris Burge
This module extends the provider-side of core's oEmbed functionality. If an issue does exist, it's a core issue. Please feel free to open an issue against Drupal core.