0

Initially I wanted a list of Authors in an exposed filter (as a checkbox) but after looking into BEF (better exposed filters) it seems this isn't possible.

Instead I am trying to create a taxonomy term for each user created but have found regardless of what entity I am trying to create, the hook for insertion is never called.

I am using xdebug and was expecting at least a single breakpoint inside one of the functions to work but it never triggers, I have cleared my cache and other preprocessing functions inside this file (bare.theme).

A few examples of functions I have tried (my theme is called "bare"):

function bare_entity_insert(Drupal\Core\Entity\EntityInterface $entity){}

function bare_user_insert(\Drupal\user\UserInterface $user) {}

function bare_entity_create(Drupal\Core\Entity\EntityInterface $entity){}

function bare_user_create(\Drupal\user\Plugin\Core\Entity\User $user){

I feel I have missed something very crucial, perhaps I can't call these functions inside a .theme file?

3

Yes if you're trying that in a theme then it won't work and will need to be done in a module (Obviously changing the "bare" to whatever your module name is)

  • Thank you, this has caused more anguish than its worth. – Malii Jun 7 '18 at 14:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.