I recently upgraded a local sandbox to Drupal core 9.2.4. While testing things out, I got an error when trying to add a new article content from /node/add/article.
The log shows the following message.
Drupal\Core\Entity\EntityStorageException: Missing bundle for entity type node in Drupal\Core\Entity\ContentEntityStorageBase->doCreate() (line 97 of /var/www/drupal9sandbox/docroot/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php).
The only change I made prior to this is that in the article.routing.yml file. I had to use _entity_form: 'node.default'
in lieu of Drupal\node\Controller\NodeController::add()
as that is deprecated in Drupal 9, as reported in NodeController::add() method is deprecated.
This is the complete content of the articles.routing.yml file.
Apart from the small change to _entity_form: 'node.default'
, I did not touch anything else.
custom_articles.add_content:
path: '/node/add/article'
defaults:
_entity_form: 'node.default'
_title_callback: '\Drupal\node\Controller\NodeController::addPageTitle'
node_type: 'article'
requirements:
_node_add_access: 'node:article'
options:
_node_operation_route: TRUE
parameters:
node_type:
with_config_overrides: TRUE
I am not sure where the bundle type would be defined, but this content type was working well on Drupal 8.9.16.