Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When creating an entity module from the model module by replacing model and Model, it appears that
if the name choosen to replace model is alphabetically before "comment", the entity does work correctly.
That is to say in the content tab (admin/content/) a new entity instance cannot be created.
For example :
the entity name "col" does not work and the enity name "con" works
Any idea ?
Thanks a lot
Comments
Comment #2
marcver CreditAttribution: marcver commentedSolved.
The problem comes from the fact that the entity view may be or may be not created at the install time of the MODULENAME module.
This is due to a bug in the model module : according to the documentation, the hook hook_views_default_views should be placed in a file named MODULENAME.views_default.inc
see https://api.drupal.org/api/views/views.api.php/function/hook_views_defau...
But in the model module, this file is named MODULENAME.views.inc
As a consequence, the view may or may not randomly be created.
As far as I can see, renaming MODULENAME.views.inc in MODULENAME.views_default.inc solved my problem.
Comment #3
marcver CreditAttribution: marcver commented