diff --git a/core/misc/ajax.es6.js b/core/misc/ajax.es6.js index a746ac70f4..942a526c0b 100644 --- a/core/misc/ajax.es6.js +++ b/core/misc/ajax.es6.js @@ -403,18 +403,18 @@ function loadAjaxBehavior(base) { this.instanceIndex = false; // @todo Remove support for 'wrapper' and solely use 'wrapper_selector'. - if (this.wrapper) { + if (this.wrapper && !this.wrapper_selector) { + /** + * @type {string} + */ + this.wrapper_selector = `#${this.wrapper}`; + /** * @deprecated Use this.wrapper_selector. * * @type {string} */ - this.wrapper = null; - - /** - * @type {string} - */ - this.wrapper_selector = `#${this.wrapper}`; + this.wrapper = this.wrapper_selector; } /** diff --git a/core/misc/ajax.js b/core/misc/ajax.js index b6f4395420..29cb346b50 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -172,10 +172,10 @@ function loadAjaxBehavior(base) { this.instanceIndex = false; - if (this.wrapper) { - this.wrapper = null; - + if (this.wrapper && !this.wrapper_selector) { this.wrapper_selector = '#' + this.wrapper; + + this.wrapper = this.wrapper_selector; } this.element = element; diff --git a/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php b/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php index 118fe56cd0..95bc711954 100644 --- a/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php +++ b/core/tests/Drupal/Tests/Core/Render/Element/RenderElementTest.php @@ -45,6 +45,8 @@ protected function setUp() { /** * @covers ::preRenderAjaxForm * @dataProvider providerTestPreRenderAjaxForm + * + * @legacy */ public function testPreRenderAjaxForm($element, $expected, $url) { $request = Request::create('/test');