The website encountered an unexpected error

Created on 15 November 2024, about 1 month ago

Problem/Motivation

Iam using D9 (5.11) and I tried to install this module but crash - it seems I need to do a rollback.

The website encountered an unexpected error. Please try again later.
Error: Class "Drupal\Core\Render\Element\FormElementBase" not found in include() (line 20 of modules/contrib/ultimate_table_field/src/Element/UltimateTable.php).
πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @coaston
  • πŸ‡ΈπŸ‡°Slovakia coaston

    Based on β†’

    Description:
    \Drupal\Core\Render\Element\RenderElement and \Drupal\Core\Render\Element\FormElement are deprecated and will be removed in Drupal 12. Instead, use \Drupal\Core\Render\Element\RenderElementBase and \Drupal\Core\Render\Element\FormElementBase respectively. This includes all the static methods on both classes.

    So when I replaced
    use Drupal\Core\Render\Element\FormElementBase;
    with
    use Drupal\Core\Render\Element\FormElement;

    and
    class UltimateTable extends FormElementBase implements ContainerFactoryPluginInterface {
    with
    class UltimateTable extends FormElement implements ContainerFactoryPluginInterface {
    I was able at least enable module so no rollback is needed.

    However there are 2 options now. Remove D9 compatibility ,or create additional D9 version with method.

  • πŸ‡²πŸ‡¦Morocco b.khouy πŸ‡²πŸ‡¦ Morocco

    The Drupal\Core\Render\Element\FormElementBase class is not available in your current Drupal version. However, the alternative class, Drupal\Core\Render\Element\FormElement, is deprecated in Drupal 10.3 and is scheduled for removal in Drupal 12. To address this, we will continue using the deprecated FormElement class for now, with plans for a Drupal 12-compatible release in the future.

    In the meantime, here is a patch to resolve the issue until the next release containing the fix.

  • πŸ‡²πŸ‡¦Morocco b.khouy πŸ‡²πŸ‡¦ Morocco
  • πŸ‡²πŸ‡¦Morocco b.khouy πŸ‡²πŸ‡¦ Morocco

    I rewrite the path in #3 to also fix Undefined array key "default_formatter" warning.

  • πŸ‡²πŸ‡¦Morocco b.khouy πŸ‡²πŸ‡¦ Morocco
  • Merge request !4fix Drupal 9 compatibility warnings β†’ (Merged) created by b.khouy
  • πŸ‡²πŸ‡¦Morocco b.khouy πŸ‡²πŸ‡¦ Morocco
  • πŸ‡²πŸ‡¦Morocco b.khouy πŸ‡²πŸ‡¦ Morocco
  • πŸ‡²πŸ‡¦Morocco b.khouy πŸ‡²πŸ‡¦ Morocco
Production build 0.71.5 2024