


Send email to customers after particular period of time?
I am using the Drupal Commerce module and I have a product type service for license to be sold on site. I have different licences (products) like 1 year license, 2 year license, 6 months license and many more. I need to send an email to customers 1 month prior to... read more
How to alter node links
I have few existing node nodes which contains link <a href=”/some/link/here”>Click here</a>. Now I want to update all links to <a href=”/updated/some/link/here”>. Is there any way to do this in Drupal8 via code. read more
How to conditionally attach a stylesheet to a page, preventing anonymous users from getting a cached version?
I’d like to create a module capable of overriding some of the theme’s css (for any theme). Think of small things like hiding the image, changing font sizes and colors, etc. My initial thought was to toggle this using a session variable: /** * Implements... read more
How to display a Paragraph field with a condition
Hello here is my problem, I have a paragrah type with an illimited value image field in which I store image(s) to display them in 200*200 but also a single Json file with mapping data linked to the image(s) in the paragraph. But in the drupal conf I can not hide the... read more
absolute url of inline images in body using views and services
I am using services module in Drupal 8 to output node body in JSON format. The inline images are broken in android app which uses json to render node. Is there any code/method or module for D8 which can rewrite relative inline images path to absolute. My drupal... read more
Creating a duplicate button for multiple entry field collection field
I’m building a form for inputting people’s travel plans, and as part of that, I need to capture who will be in what country on what days (see diagram for relevant section of the form) Next to the Add Another Item button to allow me to add another top-level... read more
Creating a ticket system with core only. How to modify fields on full_content view without reloading?
I’m trying to create a ticketing system with Drupal 8 core. I know Drupal 8 has quick edit module, but that doesnt seem to be working in D8 core. Below is a very basic ticket I made as it just contains: ticket subject (title) ticket body assigned to status... read more
How do I remove JOIN in hook_views_query_alter()?
I have a view with two filters (A + B). Filter B should only be included in the query, if a specific value in filter A is set (like a “conditional filter”). So I tried to remove the where condition of filter B in hook_views_query_alter by unsetting it:... read more
Group date field by day for chart
I have a custom database table with a datetime column that I have made accessible to Views. I want to create a line charts of number of rows per day but I can’t get the View right. With aggregation on I have a COUNT on my ID field and I’m trying to group... read more
How to load field configurations in code
I have defined fields using the UI, and some more fields using YAML files in my custom module, e.g.: The field storage is defined in field.storage.node.my_heading: langcode: en status: true dependencies: enforced: module: – my_module id: node.my_heading... read more
Unknown engine type outputformat
Hello I’ve just updated Drupal (to version 7.53) and now in Drush when I try launch the commands: “drush @theflyingeye.org up” (to update my website) or “drush @theflyingeye.org cc” (to clean chache) or “drush @theflyingeye.org dl... read more
$form_state->setValue() doesn’t save value
I have an validate code: public function validateForm(array &$form, FormStateInterface $form_state) { parent::validateForm($form, $form_state); $form_state->setValue(‘my_variable’, $form_state->getValue(‘my_variable’) + 1);... read more
How can I list only modules which need an update?
Drush 8.1.9 & Drupal 7.53. What I’m looking for is a command like drush ups but without all the modules that are [OK] – so when used with an alias of several sites I don’t have to scroll through loads. So all I get is: aliasname Name Installed Version... read more
How can I add an unescaped script tag and contents to a page?
I would like to add to my pages the structured data in JSON-LD (https://developers.google.com/search/docs/guides/intro-structured-data) Basically, what I need to do is to add somewhere in the HTML for, let’s say a basic page, a snippet like the following:... read more
How do I inject services in a service?
How do I inject services in a service? I am using the following code, but it throws an error. class RoleNegotiator implements ThemeNegotiatorInterface { public static function create(ContainerInterface $interface) { return new static(... read more
How to expose filter for entity reference as dropdown in the Search API view?
In my Search API view, I’d like an Exposed filter > Entity reference to be a select box, not a text field. Details I have a view which I created like: Views > Add new view > Show: default node index So it uses the Search API index as a basis. In the... read more
TypeError on "drush config-export"
I’ve been receiving the following error message when trying to do a drush config-export command. However, I am able to successfully do the configuration export from the Drupal admin page (admin/config/development/configuration/full/export). TypeError: Argument 2... read more
Webform multiple files with descriptions
D7: I am looking at building a competition section on a site I’m working on. Originally I started looking at Webforms to do this, but there are requirements I have that Webform doesn’t solve (as far as I can tell). What I need is to allow entrants to... read more