RenderArray not found in inline entity form render

Created on 29 September 2023, over 1 year ago

Problem/Motivation

Getting error in Inline Entity form render

Steps to reproduce

1. Installed fresh Drupal 10.1.2

2. Click on Structure -> Content types -> Basic page

3. Click on the Manage Fields tab

4. Add a new field with reference->content

5. Manage form display - set the field "Inline entity form - simple"

6. Save settings

7. Add content - Basic page

8. Error: Class "Drupal\rat\v1\RenderArray" not found in Drupal\inline_entity_form\Form\EntityInlineForm->entityForm()

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India shalini_jha

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

Comments & Activities

  • Issue created by @shalini_jha
  • Assigned to Shreya_98
  • 🇮🇳India viren18febs

    HI @shalini_jha

    You can try this as well!
    composer require drupal/rat (RenderArrayTool (RAT))

  • @shreya_th opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Shreya_98

    Hi @bojanz
    I have solved this issue and also created MR for RenderArray not found in inline entity form render.
    Kindly review the changes .

    Thank you.

  • 🇮🇹Italy smurfxx

    composer require drupal/rat solves the issue but is it possible to add this dependency via ludwig?

  • 🇭🇷Croatia devad

    Re: #6

    Ludwig is not a proper place to add dependencies to other drupal modules. The .info file is a proper place for that.
    See the related issue.

  • First commit to issue fork.
  • Status changed to Needs work 10 months ago
  • 🇺🇸United States froboy Chicago, IL

    @podarok I'm not sure the new class you're trying to import exists:

    Error: Class "Drupal\Core\Render\RenderArray" not found in Drupal\inline_entity_form\Form\EntityInlineForm->entityForm() (line 216 of /var/www/docroot/modules/contrib/inline_entity_form/src/Form/EntityInlineForm.php).

    I couldn't find anything similar anywhere. Tested on Drupal 10.0.x.

  • 🇺🇸United States froboy Chicago, IL

    It turns out RAT was installed (it lives at vendor/drupal/rat), but I needed to regenerate the composer autoloader:

    composer dump-autoload

    That fixed it all up.

  • We had this issue after a drupal/rat update that introduced a git repo inside its directory that was rejected downstream (eg. Pantheon), so the vendor/drupal/rat directory remained empty downstream due to no changes being detected in composer.json on subsequent pushes.

    We resolved it by removing and re-adding the directory to git:

    git rm --cached vendor/drupal/rat
    git add vendor/drupal/rat
    git commit ...
    git push ...
    
  • 🇲🇦Morocco lakhal

    Hi

    I'm sorry for reopening this discussion,

    Is there any way to get the module working without using composer, as I'm using a shared hosting and have no access to CLI

    I d'ont find rat in vender/drupal

    drupal version: 10.4.0

    Thank you

  • 🇧🇷Brazil gerson.analista

    I created a patch to add a ludwig.json file to the module.
    For it to work, you must enable the ludwig ( https://www.drupal.org/project/ludwig ) module and access its settings.
    The ludwig module will automatically download the library and execute it.

  • 🇲🇦Morocco lakhal

    Thank you @gerson.analista, it's working now :)

    However, I replaced "^1.0.0" by just by "1.0.0"

  • 🇧🇪Belgium flyke

    The MR applies on D11.1.4 but then my site throws error:
    Class "Drupal\Core\Render\RenderArray" not found

    The patch from #13 fixes the issue, so for now use that instead of the MR

Production build 0.71.5 2024