


Cannot format date for date field in a Views_Database_Connector view
I am using the Views Database Connector module in drupal 8 to display the data from an external mssql database. I am running into issues with the date field. When I am asked to configure this field in the view, I am asked to choose a format for the date. However, when... read more
Get text_long field value with EntityMetadataWrapper
I am trying to get data from a text_long type field using EntityMetadataWrapper, and from what I’m seeing on the interwebs, I should be using something like this: $wrapper->{$field}->value(); or $wrapper->{$field}->value->value(); However, if I... read more
BrowserTest on a multisite gives an error
My sites directory looks like this: default, site1, site2, site3. The default directory is empty. I want to run tests against my site1 database. So I have put its details in phpunit.xml Here is my phpunit.xml set up. <php> <!– Set error reporting to... read more
Default user image in user account menu!
I am trying to add a default image to render in the user account menu when the user does not have an image. CODE: function nestle_preprocess_menu(&$variables) { if($variables[‘menu_name’] == “account”) { $user =... read more
Replace pages with static HTML pages
I have a drupal 7 driven website. I need to replace a handful of pages on that website using static HTML without impacting the URLs of those pages. For example I have a page accessible at: example.com/services/ That page is a proper drupal driven page. I want that... read more
Disabling Twig cache does not prevent Drupal from caching
I have the following content in menu.html.twig template. <ul> <li><a href=”/”>Blog</a></li> <li><a href=”/photos”>Bilder</a></li> <li><a... read more
How do I set a field value?
I am using the following code, but it doesn’t set the field value as I would expect. use DrupalCoreEntityEntityInterface; /** * Implements hook_ENTITY_TYPE_update(). */ function mymodule_node_update(EntityInterface $entity) { if ($entity->getType() ==... read more
Should I ignore the "vendor" directory?
I’m finally trying to get on board with using Drupal 8 and want to know if I should ignore the vendor directory in git with .gitignore. I would assume not, but I’ve seen a few example .gitignore files that do. Thanks! read more
How do I enable a REST resource for a custom content type?
I’ve created a bunch of custom content types like “Car Makes” and “Car Models”, but I can’t seem to figure out how to enable a REST resource for them. In my REST settings page, I see the default content, content type, user, user... read more
Creating paragraph entities and adding to a node
I am using the Paragraph module in and I need to programmatically create paragraph entities and attach them to nodes. Using the following code in a for-loop: $paragraph = new ParagraphsItemEntity(array(‘field_name’ => ‘field_page_body’,... read more
How can I filter an index view using REST?
I have a custom content type called ‘Regions’, which simply has a title field. Example values are: Asia, North America, Ocenia, etc. I’ve set up a view for this list and a REST export for it, so /regions gives me a simple list:... read more
security kit module settings are blocking own site jQuery calls
I am using Security kit module to enhance security for my website. In that I have enabled Enable JavaScript + CSS + Noscript protection option. This setting is blocking one of Jquery call that is .load functionality. The description of this option is here: Enable... read more
Concatenate two fieds in an EntityQuery condition
I’m trying to query some nodes by a given string checking if the string is either in the node title OR if the string is an exact match of concatenating the value of two strings. I know this should be possible in normal mysql but not sure it can be translated in... read more
Stemmer processor not working
I have configured Search api module in my Drupal 8 search. This is the first time I am configuring search api. I am using database search and not solr. My problem is stemmer processor is not working properly. I am not getting intended result for keywords due to... read more
User can’t access own private files via Views
I’ve set up a private directory sites/default/files/private and use it for a file field. As an admin, everything works as expected when uploading and viewing a private file. As a user who uploads a private file, I can only download own private files with the... read more
Print image with alt text
In the node template, I print an image gallery. I need to add the alt text. <div class=”field–name-field_gallery”> {{ content.field_gallery }} {{ content.field_gallery.alt_field }} </div> There are many images, which are printed, but the... read more
Migrate multiselect taxonomy values from node with csv
I want to import companies with csv into Drupal 8 with migrate_source_csv module. CSV: company_name,company_categories,company_size “Dummy Name”,”Category 1″;”Category 2″,”2 people” How to accomplish? Do I need an other... read more
How do I use the Password Policy module?
I just installed and configured the Password Policy module, but the constraints like password length should be minimum 8 characters is not reflecting when an administrator user adds a new user and creates an one time login password. The constraints/plugins provided in... read more