Skip to content
Snippets Groups Projects
Verified Commit 11426693 authored by Dave Long's avatar Dave Long
Browse files

Issue #3394197 by lauriii, phenaproxima, Wim Leers, longwave, smustgrave,...

Issue #3394197 by lauriii, phenaproxima, Wim Leers, longwave, smustgrave, moshe weitzman: [regression] The new property \Drupal\Core\Form\ConfigFormBase::$typedConfigManager conflicts with some contrib modules

(cherry picked from commit a9865eb3)
parent 2131d249
No related branches found
No related tags found
20 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words,!6848Issue #3417553 by longwave: Remove withConsecutive() in CacheCollectorTest,!6720Revert "Issue #3358581 by pfrenssen, _tarik_, a.dmitriiev, smustgrave:...,!6560Update ClaroPreRender.php, confirming classes provided are in array format,!6528Issue #3414261 by catch: Add authenticated user umami performance tests,!6501Issue #3263668 by omkar-pd, Wim Leers, hooroomoo: Re-enable inline form errors...,!6354Draft: Issue #3380392 by phma: Updating language weight from the overview reverts label if translated,!6324Issue #3416723 by Ludo.R: Provide a "node type" views default argument,!6119Issue #3405704 by Spokje, longwave: symfony/psr-http-message-bridge major version bump,!5950Issue #3403653 by alexpott, longwave: Incorporate improvements to how contrib runs PHPStan to core,!5858Issue #3401971 by fjgarlin: Test-only job shouldn't require constant rebases...,!5716Draft: Issue #3401102 by Spokje, longwave, smustgrave: Nightwatch artifacts on GitLab not retained,!5674Transaction autocommit during shutdown relies on unreliable object destruction order,!5644Issue #3395563 by nireneko, marvil07, lauriii, borisson_, smustgrave, Wim...
Pipeline #56892 passed
Pipeline: drupal

#56893

    ......@@ -40,12 +40,13 @@ abstract class ConfigFormBase extends FormBase {
    */
    public function __construct(
    ConfigFactoryInterface $config_factory,
    protected ?TypedConfigManagerInterface $typedConfigManager = NULL,
    protected $typedConfigManager = NULL,
    ) {
    $this->setConfigFactory($config_factory);
    if ($this->typedConfigManager === NULL) {
    @trigger_error('Calling ConfigFormBase::__construct() without the $typedConfigManager argument is deprecated in drupal:10.2.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3373502', E_USER_DEPRECATED);
    $this->typedConfigManager = \Drupal::service('config.typed');
    if (!$typedConfigManager instanceof TypedConfigManagerInterface) {
    $type = get_debug_type($typedConfigManager);
    @trigger_error("Passing $type to the \$typedConfigManager parameter of ConfigFormBase::__construct() is deprecated in drupal:10.2.0 and must be an instance of \Drupal\Core\Config\TypedConfigManagerInterface in drupal:11.0.0. See https://www.drupal.org/node/3404140", E_USER_DEPRECATED);
    }
    }
    ......@@ -59,6 +60,19 @@ public static function create(ContainerInterface $container) {
    );
    }
    /**
    * Returns the typed config manager service.
    *
    * @return \Drupal\Core\Config\TypedConfigManagerInterface
    * The typed config manager service.
    */
    protected function typedConfigManager(): TypedConfigManagerInterface {
    if ($this->typedConfigManager instanceof TypedConfigManagerInterface) {
    return $this->typedConfigManager;
    }
    return \Drupal::service('config.typed');
    }
    /**
    * {@inheritdoc}
    */
    ......@@ -158,13 +172,11 @@ public function storeConfigKeyToFormElementMap(array $element, FormStateInterfac
    * {@inheritdoc}
    */
    public function validateForm(array &$form, FormStateInterface $form_state) {
    assert($this->typedConfigManager instanceof TypedConfigManagerInterface);
    $map = $form_state->get(static::CONFIG_KEY_TO_FORM_ELEMENT_MAP) ?? [];
    foreach (array_keys($map) as $config_name) {
    $config = $this->configFactory()->getEditable($config_name);
    static::copyFormValuesToConfig($config, $form_state, $form);
    $typed_config = $this->typedConfigManager->createFromNameAndData($config_name, $config->getRawData());
    $typed_config = $this->typedConfigManager()->createFromNameAndData($config_name, $config->getRawData());
    $violations = $typed_config->validate();
    // Rather than immediately applying all violation messages to the
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment