- Issue created by @maursilveira
- Merge request !20Issue 3451146: Use replaceWith instead of replace in #ajax form settings β (Merged) created by maursilveira
- last update
8 months ago 9 pass - Status changed to Needs review
8 months ago 4:05pm 30 May 2024 - π¨π¦Canada maursilveira Windsor, ON
I've created a merge request with the adjustment.
- Status changed to RTBC
8 months ago 2:55am 31 May 2024 - πΊπΈUnited States benjifisher Boston area
I reviewed the MR, and it does just what the change record says. (Thanks for adding a link to the change record in the issue summary.) I also searched for other uses of
'method' => 'replace',
, and I did not find any.The hard part is testing. From the issue description:
Both methods work identically before Drupal 10.3.0, but starting in this version, only
replaceWith
is supported.Not quite. Starting with Drupal 10.3.0,
replace
generates a deprecation notice, which is not easy to test. I did it by hacking the line@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);
in
Drupal\Core\Render\Element\RenderElementBase::preRenderAjaxForm()
, removing the@
so that the error is not suppressed. After that change, I see a deprecation notice (debug level) in the logs each time I load the page at/admin/config/system/shield
.When I make the change in the MR, I do not see any log messages when loading that page.
- First commit to issue fork.
-
japerry β
committed cd96ff24 on 8.x-1.x authored by
maursilveira β
Issue #3451146: Use replaceWith, not replace, in #ajax form settings
-
japerry β
committed cd96ff24 on 8.x-1.x authored by
maursilveira β
- Status changed to Fixed
7 months ago 6:08pm 2 July 2024 - πΊπΈUnited States japerry KVUO
Verified that the deprecation notice and BC shim 'replaceWith' exists all the way back in Drupal 8, with the notice only being added in Drupal 10.3. Fixed.
Automatically closed - issue fixed for 2 weeks with no activity.