Skip to content
Snippets Groups Projects
Verified Commit 55339845 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3303557 by Binoli Lalani, quietone, catch, Tom Konda, smustgrave:...

Issue #3303557 by Binoli Lalani, quietone, catch, Tom Konda, smustgrave: Deprecate and remove the AJAX replace method
parent 09748605
No related branches found
No related tags found
No related merge requests found
......@@ -374,6 +374,7 @@ public static function preRenderAjaxForm($element) {
// @todo Legacy support. Remove in Drupal 8.
if (isset($settings['method']) && $settings['method'] == 'replace') {
@trigger_error('Using "replace" as the method in #ajax property is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. Use "replaceWith" instead. See https://www.drupal.org/project/drupal/issues/3303557', E_USER_DEPRECATED);
$settings['method'] = 'replaceWith';
}
......
......@@ -31,7 +31,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#ajax' => [
'callback' => 'ajax_forms_test_validation_form_callback',
'wrapper' => 'message_area',
'method' => 'replace',
'method' => 'replaceWith',
],
'#suffix' => '<div id="message_area"></div>',
];
......@@ -44,7 +44,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#ajax' => [
'callback' => 'ajax_forms_test_validation_number_form_callback',
'wrapper' => 'message_area_number',
'method' => 'replace',
'method' => 'replaceWith',
],
'#suffix' => '<div id="message_area_number"></div>',
];
......
......@@ -77,7 +77,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#ajax' => [
'callback' => '::buildAjaxSnackConfigureForm',
'wrapper' => 'snack-config-form',
'method' => 'replace',
'method' => 'replaceWith',
'effect' => 'fade',
],
];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment