2

I'm building a Bet website a long test of Drupal 8.

Thanks to drupal console I managed to create a lot of custom entity types.

Now I want to expose my entity to views but I get this message;

The handler for this item is broken or missing. The following details are available:

One of the only customization I've done from my game entity type was to change the table name : from game to mespronos_game, by editing the annotation from :

base_table = "game"

to

base_table = "mespronos__game"

This is working, I'm able to create game entities but I can't figure how to tell views the table he should look in.

Here's all the annotation for my game entity :

/**
 * Defines the Game entity.
 *
 * @ingroup mespronos
 *
 * @ContentEntityType(
 *   id = "game",
 *   label = @Translation("Game entity"),
 *   handlers = {
 *     "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
 *     "list_builder" = "Drupal\mespronos\Entity\Controller\GameListController",
 *     "views_data" = "Drupal\mespronos\Entity\GameViewsData",
 *
 *     "form" = {
 *       "default" = "Drupal\mespronos\Entity\Form\GameForm",
 *       "add" = "Drupal\mespronos\Entity\Form\GameForm",
 *       "edit" = "Drupal\mespronos\Entity\Form\GameForm",
 *       "delete" = "Drupal\mespronos\Entity\Form\GameDeleteForm",
 *     },
 *     "access" = "Drupal\mespronos\GameAccessControlHandler",
 *   },
 *   base_table = "mespronos__game",
 *   admin_permission = "administer Game entity",
 *   entity_keys = {
 *     "id" = "id",
 *     "uuid" = "uuid"
 *   },
 *   links = {
 *     "canonical" = "/admin/game/{game}",
 *     "edit-form" = "/admin/game/{game}/edit",
 *     "delete-form" = "/admin/game/{game}/delete"
 *   },
 *   field_ui_base_route = "game.settings"
 * )
 */

All my sources files are available on github : https://github.com/kgaut/mespronos

Thanks in advance.

  • Clear cache and run update.php so the schema can get updated. – user21641 Jul 23 '15 at 18:21
  • Why did you rename the base table? If you want a prefix, Drupal supports that globally in settings.php – benjy Oct 11 '15 at 23:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.