Hello,

After installing Drupal CMS ver 2, I got an error when trying to update page using Canvas page builder:

Error 500: Drupal\Core\Render\Element::isEmpty(): Argument #1 ($elements) must be of type array, null given, called in .../httpdocs/web/modules/contrib/canvas/src/Plugin/Canvas/ComponentSource/BlockComponent.php on line 245

I did small update in BlockComponent.php file:

//if (Element::isEmpty($build['content'])) {
//  return $build;
//}

This change let me work with Canvas.
Also, it looks like "UI Icons for Menu" module makes canvas to crash too.

Please check.

Thanks

Oren

Comments

orela created an issue. See original summary.

hyperlogos’s picture

I am also having exactly this error, and the same workaround works here., thank you Oren.

This was working for me from install until recently. Unfortunately I both recently did an update and also installed and removed the "radix" theme due to pretty much all of their dependencies carrying serious warnings, so I'm not sure what broke it. Radix depended on components module which I hoped might be the problem, but I uninstalled and removed components as well and the problem persists. So if it is the problem, it's some config change it made and not in the code.

wim leers’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs steps to reproduce
Related issues: +#3518722: Test coverage to prove that BlockPluginInterface cacheability is correct when rendered via XB

Thanks for reporting this!

Could you narrow down which block is hitting this problem? The code you commented out is necessary: just commenting it out is going to cause other problems. (Linking the issue that introduced that particular implementation).

Also, it looks like "UI Icons for Menu" module makes canvas to crash too.

How, exactly?

bdh676’s picture

Steps to produce

  • Installing a fresh Drupal CMS instance with the Mercury theme
  • enabling Webform access
  • edit main page and select to edit the header or open the library components menu shows error

An unexpected error has occurred while rendering the component's form.

Error 500: Drupal\Core\Render\Element::isEmpty(): Argument #1 ($elements) must be of type array, null given, called in /var/www/html/web/modules/contrib/canvas/src/Plugin/Canvas/ComponentSource/BlockComponent.php on line 245

hyperlogos’s picture

I uninstalled (but did not remove) Webform Access and uncommented that code again, and this has apparently solved the problem for me for now. Thanks bdh676.

bdh676’s picture

Status: Postponed (maintainer needs more info) » Needs work
Issue tags: -Needs steps to reproduce