


How do I sign in a user based on custom HTTP headers?
I would like to sign-in a user based on some custom headers in the HTTP request. Let’s say I have an administrator account whose username is admin. If I send a request to Drupal with a custom header (X-USER-NAME: admin), I would like to be logged in with this... read more
How do I add a revisions tab to a custom content entity to list revisions?
I’ve just created/generated a custom content entity module using Drush. I’ve checked I would like to use revisions, but I cannot see its tab. How can I add the revisions tab to this custom content entity and list revisions for that entity instances? read more
How do I set the value of a date and time field with Behat?
I am trying to test my site with Behat. On my entity edit form, I have a Datetime field that uses the Date and time widget. I want to use the Date and time widget because I need to set the time in increments of seconds, which I cannot do with the Select list widget. I... read more
How can I ensure migration YAML files execute in specified dependency order?
EDIT: To Answer my own question… I ended up making multiple migration files like this: Node Type A Part 1 (most fields migrated except the ones that need to reference Node Type B) Node Type B Node Type A Part 2 (now you can add the field referencing Node Type B)... read more
sad news and looking for the code
Greets Folks about 14 years and 5 months ago or so, we released a Drupal module called p2p-aid, it was announced here https://www.drupal.org/forum/general/show-off-your-drupal-site/2006-02-23/p2paidorg-now-live It worked very well and was used by at least two... read more
How to get the entity ID in a twig template
I have a custom entity, with the template my-custom-entity–my-entity.html.twig. How do I access the ID in the template? I can do this by implementing hook_preprocess_entity, but am wondering if the ID is already available in the template. read more
how to print a form in twig where a variable number of form elements have been printed already?
I am using a Twig template to render a form that has a variable number of elements. Each element’s key in the form is sequential integer. So in my template, I can do this: {% for item in form|children %} {{ item }} {% endfor %} However, then I have a broken... read more