- Issue created by @godotislate
- Merge request !7195Issue #3431452: Deprecated RenderElement and FormElement and change to... β (Closed) created by godotislate
- Status changed to Needs review
8 months ago 10:01pm 26 March 2024 Created CR: https://www.drupal.org/node/3436275 β
MR with updated test for deprecation: https://git.drupalcode.org/project/drupal/-/merge_requests/7195- Status changed to Needs work
8 months ago 4:11pm 27 March 2024 - πΊπΈUnited States smustgrave
This actually seems like a large change, probably safer to deprecated for removal in D12
- Status changed to Needs review
8 months ago 5:00pm 27 March 2024 - Status changed to Needs work
8 months ago 2:07pm 28 March 2024 - πΊπΈUnited States smustgrave
Thanks appears to need manual rebasing though.
- Status changed to Needs review
8 months ago 2:40pm 28 March 2024 - Status changed to RTBC
8 months ago 2:57pm 28 March 2024 Thanks for reviewing.
Separately, I wish that there were a similar way to deal with validation Constraint plugins, since my guess is that there are a lot more contrib and custom validation plugins being written than render element plugins, but since Constraint is a Symfony class, not sure there's a solution.
- Status changed to Needs work
8 months ago 11:35am 29 March 2024 - π¬π§United Kingdom alexpott πͺπΊπ
As things are called statically on the class we need to issue deprecations from there too because this will avoid the constructor.
So for example we need to add things like
\Drupal\Core\Render\Element\FormElement::processPattern()
with the code:/** * {@inheritdoc} */ public static function processPattern(&$element, FormStateInterface $form_state, &$complete_form) { @trigger_error('\Drupal\Core\Render\Element\FormElement::processPattern() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Render\Element\FormElementBase::processPattern() instead. See https://www.drupal.org/node/3436275', E_USER_DEPRECATED); return parent::processPattern($element, $form_state, $complete_form); }
Not pretty but the best we can do.
- Status changed to Needs review
8 months ago 3:49pm 29 March 2024 Added deprecation warnings to all the static methods with corresponding tests.
- Status changed to RTBC
8 months ago 3:22pm 30 March 2024 - πΊπΈUnited States smustgrave
Will remember that about static methods going forward
Deprecations look good though.
- π¬π§United Kingdom alexpott πͺπΊπ
@godotislate thanks for getting this done. It's great to have this complete before people start to covert to attributes as it was pretty icky.
Committed and pushed 8d1ff20647 to 11.x and b89ad7f9c8 to 10.3.x. Thanks!
-
alexpott β
committed b89ad7f9 on 10.3.x
Issue #3431452 by godotislate, smustgrave, alexpott: Rename...
-
alexpott β
committed b89ad7f9 on 10.3.x
- Status changed to Fixed
8 months ago 5:27pm 30 March 2024 -
alexpott β
committed 8d1ff206 on 11.x
Issue #3431452 by godotislate, smustgrave, alexpott: Rename...
-
alexpott β
committed 8d1ff206 on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.
- π¬π§United Kingdom scott_euser
I guess it's not possible to backport empty RenderElementBase and FormElementBase classes to 10.2 that extend the old ones to allow contrib to fix depreciations now vs having to wait until end of 10.2 security coverage on December 9th? Happy to do the legwork there if it is an option but I guess it's not as no further non-security releases to 10.2 right?