Resolve #3399927 "Link to config"
Closes #3399927
Merge request reports
Activity
added 1 commit
added 27 commits
-
45651ba4...8f087227 - 21 commits from branch
project:11.x
- 32ba7455 - Add link to config single export from configuration synchronization page
- 9dacd0bf - Issue #3399927: Add test coverage for Export this config link
- 076d289d - Issue #3399927: Fix phpstan issue
- 012e5bf8 - Code refactor
- cd0d1d35 - Issue #3399927: Fix config type entity not exist issue after code refactoring
- 222f06c6 - Issue #3399927: Fix merge conflict, fix phpcs issue regarding unused use...
Toggle commit list-
45651ba4...8f087227 - 21 commits from branch
320 * Handles switching the import textarea. 321 */ 322 public function updateImport($form, FormStateInterface $form_state) { 323 // Determine the full config name for the selected config entity. 324 if ($form_state->getValue('config_type') !== 'system.simple') { 325 $definition = $this->entityTypeManager->getDefinition($form_state->getValue('config_type')); 326 $name = $definition->getConfigPrefix() . '.' . $form_state->getValue('config_name'); 327 } 328 // The config name is used directly for simple configuration. 329 else { 330 $name = $form_state->getValue('config_name'); 331 } 332 /** 333 * @var Drupal\Core\Config\FileStorage 334 */ 335 $config_storage_sync_service = \Drupal::service('config.storage.sync'); changed this line in version 7 of the diff
323 // Determine the full config name for the selected config entity. 324 if ($form_state->getValue('config_type') !== 'system.simple') { 325 $definition = $this->entityTypeManager->getDefinition($form_state->getValue('config_type')); 326 $name = $definition->getConfigPrefix() . '.' . $form_state->getValue('config_name'); 327 } 328 // The config name is used directly for simple configuration. 329 else { 330 $name = $form_state->getValue('config_name'); 331 } 332 /** 333 * @var Drupal\Core\Config\FileStorage 334 */ 335 $config_storage_sync_service = \Drupal::service('config.storage.sync'); 336 // Check if config exists. 337 $exists = $config_storage_sync_service->exists($name); 338 $form['import']['#value'] = !$exists ? NULL : Yaml::encode($config_storage_sync_service->read($name)); changed this line in version 7 of the diff
324 if ($form_state->getValue('config_type') !== 'system.simple') { 325 $definition = $this->entityTypeManager->getDefinition($form_state->getValue('config_type')); 326 $name = $definition->getConfigPrefix() . '.' . $form_state->getValue('config_name'); 327 } 328 // The config name is used directly for simple configuration. 329 else { 330 $name = $form_state->getValue('config_name'); 331 } 332 /** 333 * @var Drupal\Core\Config\FileStorage 334 */ 335 $config_storage_sync_service = \Drupal::service('config.storage.sync'); 336 // Check if config exists. 337 $exists = $config_storage_sync_service->exists($name); 338 $form['import']['#value'] = !$exists ? NULL : Yaml::encode($config_storage_sync_service->read($name)); 339 return $form['import']; changed this line in version 7 of the diff
288 291 '#rows' => 24, 289 292 '#required' => TRUE, 290 293 ]; 294 if ($config_type && $config_name) { 295 $fake_form_state = (new FormState())->setValues([ changed this line in version 7 of the diff
344 356 ]), 345 357 ], 346 358 ]; 359 // Get config type from config name. 360 $config_type = $this->configManager->getEntityTypeIdByName($config_name) ?? 'system.simple'; 361 // Set config name URL parameter. 362 $config_name_url_param = $config_name; 363 364 // If config type is not empty and is not 'system.simple', 365 // Remove config prefix from config name. 366 if (!empty($config_type) && $config_type != 'system.simple') { changed this line in version 7 of the diff
added 1 commit
added 1 commit
161 170 * @param \Drupal\Core\Extension\ThemeExtensionList $extension_list_theme 162 171 * The theme extension list. 163 172 */ 164 public function __construct(EntityTypeManagerInterface $entity_type_manager, StorageInterface $config_storage, RendererInterface $renderer, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, LockBackendInterface $lock, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ThemeHandlerInterface $theme_handler, ModuleExtensionList $extension_list_module, ThemeExtensionList $extension_list_theme = NULL) { 173 public function __construct(EntityTypeManagerInterface $entity_type_manager, StorageInterface $config_storage, RendererInterface $renderer, StorageInterface $sync_storage, EventDispatcherInterface $event_dispatcher, ConfigManagerInterface $config_manager, LockBackendInterface $lock, TypedConfigManagerInterface $typed_config, ModuleHandlerInterface $module_handler, ModuleInstallerInterface $module_installer, ThemeHandlerInterface $theme_handler, ModuleExtensionList $extension_list_module, ThemeExtensionList $extension_list_theme = NULL) { changed this line in version 11 of the diff
added 1 commit
added 1 commit
added 1 commit
133 134 */ 134 135 protected $data = []; 135 136 137 /** 138 * The sync configuration storage. 139 * 140 * @var \Drupal\Core\Config\StorageInterface 141 */ 142 protected $syncStorage; changed this line in version 14 of the diff
306 323 return $form; 307 324 } 308 325 326 /** 327 * Handles switching the import textarea. 328 */ 329 public function updateImport($config_type, $config_name) { changed this line in version 14 of the diff
Please register or sign in to reply