💬 | Drupal core | PHP Fatal error: Uncaught Error: Call to a member function getLinkTemplates() on array in \core\lib\Drupal\Core\Entity\EntityTypeManager.php:105
🇮🇳India ashwani737
Hi @dpi #dpi
As per this documentation Entity type definitions are arrays, not objects.
\web\core\lib\Drupal\Core\Entity\entity.api.php
function hook_entity_type_build(array &$entity_types) {
/** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
// Add a form for a custom node form without overriding the default
// node form. To override the default node form, use hook_entity_type_alter().
$entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm');
}
💬 | Drupal core | PHP Fatal error: Uncaught Error: Call to a member function getLinkTemplates() on array in \core\lib\Drupal\Core\Entity\EntityTypeManager.php:105
🇮🇳India ashwani737
Hi @dpi
As per this documentation Entity type definitions are arrays, not objects.
\core\lib\Drupal\Core\Entity\entity.api.php
function hook_entity_type_build(array &$entity_types) {
/** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
// Add a form for a custom node form without overriding the default
// node form. To override the default node form, use hook_entity_type_alter().
$entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm');
}
💬 | Drupal core | PHP Fatal error: Uncaught Error: Call to a member function getLinkTemplates() on array in \core\lib\Drupal\Core\Entity\EntityTypeManager.php:105
🇮🇳India ashwani737
hi @dpi
as per this documentation its an array not an object.
\core\lib\Drupal\Core\Entity\entity.api.php
function hook_entity_type_build(array &$entity_types) {
/** @var \Drupal\Core\Entity\EntityTypeInterface[] $entity_types */
// Add a form for a custom node form without overriding the default
// node form. To override the default node form, use hook_entity_type_alter().
$entity_types['node']->setFormClass('mymodule_foo', 'Drupal\mymodule\NodeFooForm');
}