- Issue created by @mugesh.s
- 🇮🇳India mugesh.s Tamil Nadu
Note: Using configuration file /builds/issue/signature_field-3533081/web/modules/custom/signature_field-3533081/phpstan.neon.
Line src/Plugin/Field/Element/Signature.php
13 Class Drupal\signature_field\Element\Signature extends deprecated
class Drupal\Core\Render\Element\FormElement:
in drupal:10.3.0 and is removed from drupal:12.0.0. use
\Drupal\Core\Render\Element\FormElementBase instead.
55 Call to deprecated method renderPlain() of class
Drupal\Core\Render\Renderer:
in drupal:10.3.0 and is removed from drupal:12.0.0. Use
\Drupal\Core\Render\RendererInterface::renderInIsolation() instead.Line src/Plugin/Field/FieldWidget/SignatureWidget.php
254 Call to deprecated method renderPlain() of interface
Drupal\Core\Render\RendererInterface:
in drupal:10.3.0 and is removed from drupal:12.0.0. Use
\Drupal\Core\Render\RendererInterface::renderInIsolation() instead.
259 Call to deprecated method renderPlain() of interface
Drupal\Core\Render\RendererInterface:
in drupal:10.3.0 and is removed from drupal:12.0.0. Use
\Drupal\Core\Render\RendererInterface::renderInIsolation() instead.1. Class Inheritance Deprecation
File:Signature.php
Line:13Problem:
Your class extends `FormElement`, which is deprecated.
Solution:
Change the parent class from `FormElement` to `FormElementBase`.How to fix:
// ...existing code... use Drupal\Core\Render\Element\FormElementBase; // ...existing code... class Signature extends FormElementBase { // ...existing code... ```` ---
2. Deprecated Method: `
renderPlain()
`Files:
- Signature.php (Line 55)
- SignatureWidget.php (Lines 254, 259)Problem:
`renderPlain()` is deprecated.
Solution:
Use `renderInIsolation()` instead.How to fix:
// ...existing code... // $output = $renderer->renderPlain($build); $output = $renderer->renderInIsolation($build); // ...existing code... ```` // ...existing code... // $output = $this->renderer->renderPlain($build); $output = $this->renderer->renderInIsolation($build); // ...existing code... ````
Summary:
- Change `FormElement` to `FormElementBase`.
- Replace all `renderPlain()` calls with `renderInIsolation()`.