Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295562

TypeError: Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::save(): Return value must be of type int, null returned

$
0
0

Problem/Motivation

The following error is triggered when trying to create a field using the drush field:create command:

[error]  TypeError: Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay::save(): Return value must be of type int, null returned in Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->save() (line 172 of /Users/dieterholvoet/Projects/sites-personal/whathappens/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php) #0 /Users/dieterholvoet/Projects/sites-personal/whathappens/vendor/drush/drush/src/Commands/field/FieldCreateCommands.php(494): Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->save()
#1 /Users/dieterholvoet/Projects/sites-personal/whathappens/vendor/drush/drush/src/Commands/field/FieldCreateCommands.php(200): Drush\Commands\field\FieldCreateCommands->createFieldDisplay('view')
#2 [internal function]: Drush\Commands\field\FieldCreateCommands->fieldCreate('node', 'social_post', Array)

The problem is that LayoutBuilderEntityViewDisplay::save() assumes that EntityInterface::save() always returns an int, but in practice it can return NULL as well.

Proposed resolution

Remove the return type.


Viewing all articles
Browse latest Browse all 295562


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>