Drupal 8.8.0-dev fresh install
Installed the module, run the code analysis, then when I access add module ( /admin/config/development/module_builder/add ) I get:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 1 passed to Drupal\Component\Utility\NestedArray::getValue() must be of the type array, null given, called in drupal\modules\contrib\module_builder\src\Form\ComponentSectionForm.php on line 221 in Drupal\Component\Utility\NestedArray::getValue() (line 69 of core\lib\Drupal\Component\Utility\NestedArray.php).

This is happening because: $this->moduleEntityData = $module->get('data') ?? []; is using the magic __set method from Drupal\Core\Entity\EntityForm that is not actually setting anything. This might be an issue in EntityForm

The fix will be to declare the property $moduleEntityData inside the class to be sure it is initialized without the __set method.

Comments

aalin created an issue. See original summary.

aalin’s picture

Status: Needs work » Needs review
StatusFileSize
new459 bytes

patch added

aalin’s picture

StatusFileSize
new452 bytes

please ignore the previous patch

  • joachim committed df5d311 on 8.x-3.x authored by aalin
    Issue #3093329 by aalin: Fixed $moduleEntityData crash in...
joachim’s picture

Status: Needs review » Fixed

Wow, thank you so much for figuring that out! The thing with the magic methods looks like something that could have taken me ages to get to the bottom of!

Committed the patch with a docs formatting tweak.

joachim’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.