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
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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';
      }

+2 −2
Original line number Diff line number Diff line
@@ -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>',
    ];
+1 −1
Original line number Diff line number Diff line
@@ -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',
      ],
    ];