All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
68 views

How to redirect after node insert (not form redirect)?

I am trying to find out how to redirect after I insert a new node. All the answers I have been able to find discuss $form_state->setRedirectUrl(); but this is a form redirect; not a proper redirect ...
0
votes
0answers
17 views

How to upload image to media library? (No upload field)

I'm missing something in media_library. When I click "Add media" in the media library (/media/add/image) there's no browse/upload field. All of the other media types have an upload field. This ...
0
votes
0answers
34 views

What existing Drupal 8 module installs software required for running tests (PHPUnit, etc.)?

Running tests in Drupal 8 requires certain software to run, of course. However, I was surprised to not find a module, up-to-date set of instructions, or other turnkey method of identifying and ...
-1
votes
0answers
14 views

What drupal module allows me to integrate the google documents API with drupal, allowing viewing and editing? [closed]

I want to allow different users to edit the same Google document. I have tried with Google documents, but I have not managed the edition only to visualize a Google document. Is there any module that ...
2
votes
2answers
33 views

Which event should we subscribe to if we want code to be triggered when a new user registers?

I noticed that the following event is defined for when a user account is 'set const SET_USER = 'account.set'; I want to execute code by creating an event subscriber when a new user registers on the ...
0
votes
0answers
7 views

Render context is empty after IPN payment

I've developed an offsite payement gateway (Paybox card payment) using the IPN onNotify method. It was working fine on Commerce 2.13. Since I upgraded to Commerce 2.17, when the IPN request is ...
0
votes
1answer
14 views

Update failed on Metadata module, any easy fix?

I am very sorry to bring a rather nebulous question here but need any and all help I can get: for the first time, I've had a "White Screen of Death" issue when trying to update a module. I believe ...
0
votes
1answer
23 views

is it possible to populate subclass of FieldItemList from code?

The context first: I'm migrating a website from D7 to D8 and one of the modules has no update on D8. I found an alternate module with the same functionality. For the FieldType of the alternate ...
-2
votes
0answers
13 views

Show a list of tagged node based on entity reference field [duplicate]

Drupal 7 Taxonomy vocabulary = Company activity (Activity 1, Activity 2, Activity 3 ….). This vocabulary has an OG group field. Content type 1 = Company with an entity (terms) reference field ...
0
votes
0answers
13 views

Ajax webform: “submit” javascript event is not fired?

We want to track the event "form submitted" via Matomo. It is working for forms which does not have AJAX activated: Drupal.behaviors.donationFormSent = { attach: function (context, settings) { $('...
0
votes
1answer
27 views

Unable to retrieve checkbox values from a template file

I have created a checkbox option for a field. Category One Two Three Four This is the code I am using. {% for key, item in content.field_room_category if key|first != '#' %} <li>...
0
votes
0answers
12 views

How can I get this breadcrumb setting toggle to work?

I have this bit in my theme where the header & breadcrumb positioned centered. I have a breadcrumb on/off toggle, but I am not able to get the toggle to turn on/off breadcrumb, its always stays on....
0
votes
0answers
4 views

Creating a Citation Field with Bibliography & Citation module

I started using the Bibliography & Citation module and it looks fab. However, I am trying to set a field in one of my content type to work as a citation (e.g. Brown 1999, 12-15) but I can manage ...
0
votes
0answers
10 views

How to migrate Contributed Module Configuration from one environment to another one?

I have 5 different Development servers and there is one configuration related to contributed module called External links, now I am trying to create feature for that config so that I can easily roll ...
-2
votes
0answers
10 views

expose complete menu tree and and its fields which created using menu item extra using rest api

I used menu tree api to get all menu information but im not able to get all fields ex:icon,class..etc. which was created by using menu-content-extra. So can you help me out to get complete menu tree ...
0
votes
0answers
13 views

How do I set granularity to an END date value used as sort criteria?

I have a Date field with start and end dates (mm-dd-yy). I need to build a View listing nodes grouped by end date year and sorted first by descending end date year and second by ascending title. ...
0
votes
0answers
12 views

Unsetting formatter's third party settings

We have this hook hook_field_formatter_third_party_settings_form that allows us to set third party settings in formatter settings form. But what would be the best way of unsetting them if we are ...
1
vote
1answer
34 views
+50

Custom node access control not working with access filter?

In some of mine content types I have checkbox field "Content protect". If checked that node should be visible only to registered user. If not checked - visible to everyone: function hook_node_access($...
-6
votes
0answers
22 views

Blurry pictures with text [closed]

I need to upload a lot of pictures with text, made in illustrator and Photo shop. However, the text and graphs looks very blurry on the published website. I have exported them to .jpg, and i cannot ...
0
votes
1answer
19 views

Programatically change exposed filter value based on another exposed filter

I have 2 exposed filters in my Drupal 8 view - both are select dropdowns. I want the value of the 2nd filter to change based on selection of first filter Here are the filters $filters = $view->...
-4
votes
0answers
27 views

Drupal 8 Recommended Database [closed]

What is the recommended database for Drupal 8 - is it MySQL or MariaDB? I don't have any particular preference and just needed a recommendation on what the best long term database for Drupal 8 is.
0
votes
0answers
29 views

Upgrade 8.4.8 to 8.5.11 error Inspector not found

I'm trying to upgrade from Drupal 8.4.8 to Drupal 8.5.11 but I'm stuck on the following error Drush command terminated abnormally due to an unrecoverable error. ...
0
votes
1answer
30 views

Programmatically creating a custom block

I followed the steps from https://www.webwash.net/programmatically-create-block-drupal-8/. I have a view already created and I want to render this view in this block. I can't find a good ...
0
votes
1answer
19 views

Custom Condition on Query [duplicate]

I'm trying to add a custom condition in a query: $today = new DrupalDateTime(); $today = $today->format("m-d"); $ids = Drupal::entityQuery('user') ->condition('status', 1) ->condition(...
0
votes
0answers
32 views

Sending email from custom module

I've created my first Drupal 8 module which is a form that emails its output to a staff person. Everything works except for the email portion which doesn't throw any errors, but just doesn't do ...
0
votes
0answers
15 views

Composer cannot delete .editorconfig

I'm trying to install a third-party library in Drupal 8 by doing 'composer update'. I get this: I have made it seemingly impossible for it not to be able to delete .editorconfig: But I still get the ...
0
votes
0answers
15 views

Variable in file-audio.html.twig

I created the following preprocess function to add a value. function mytheme_preprocess_node__audio(&$variables) { $node = $variables['node']; $media_field = $node->get('field_image')->...
0
votes
0answers
19 views

For “drupal/recommended-project”, Handling the Relocated Root without Override Document Root

I am in the process of switching my website over from extracting a tar.gz file to using composer. But now, I don't know how to handle the fact that the site is now located at public_html/web. In my ...
0
votes
0answers
25 views

How to test hooks for custom module in PHPUnit kernel tests

I have a custom module file that has one hook: mymodule.module: function mymodule_node_presave(Drupal\Core\Entity\EntityInterface $node) { if (isset($node->original)) { $orig_node = $node-&...
0
votes
0answers
6 views

AJAX altered Entityform edit form not rebuilt 2nd time

Background I have an Entityform (using module with 7.x-2.0-rc4) with two select dropdowns, and I'm trying to alter it such that the second dropdown filters based on the first using AJAX. Current ...
0
votes
0answers
9 views

Custom Block Config - Accepting array of objects

I have built a component following the docs but am wanting to add configure to allow the user to add a series of objects that each contain a 'title' (a text field) and a 'content' (a list of text ...
0
votes
1answer
21 views

How do I prevent the HTML markup in an item list from being escaped?

As you can see in the code below, I try various ways to prevent Drupal from escaping the HTML and passing the link tags to the output, including the use of '#allowed_tags' and the Markup class. None ...
0
votes
0answers
15 views

reformat webform radio button

Using Drupal 7 webform, the standard radio button output is as follows: <div class="form-item form-type-radio form-item-submitted-X"> <input type="radio" id="edit-submitted-X" name="...
0
votes
0answers
26 views

Deleting a Site Entirely

The requirements of the project I'm working on changed dramatically and it was easier to build a new Drupal sure than to try and reconfigure the old one. Now, I want to delete the old site to free up ...
0
votes
0answers
6 views

Show product title when creating orders manually

I want to create a couple of orders manually. Therefore, I need to select the correct products. I have a bunch of products with multiple variations. The variations are titled like 'paperback' (it's ...
-1
votes
0answers
21 views

How do I add translations to a site?

My site supports 10 languages and English. I am trying to translate the names of the USA states and the Canada provinces. On https://localize.drupal.org/, I can only find the translations for the ...
0
votes
0answers
5 views

Ajax submit comments by pressing enter

I am using the Ajax comments module and display suite. https://www.drupal.org/project/ajax_comments When pressing submit button the comment form gets submitted via ajax as it is supposed to. When I ...
-1
votes
0answers
23 views

How to load a JavaScript function during view load?

I have a view called 'Programs search'. I want to disable certain fields based on javascript function during the page load. I already have a custom.js script created. Not sure what should be the ...
-1
votes
0answers
14 views

Select several pdf anywhere on website to add to cart and download them all by providing email [closed]

I use drupal 8. I have been searching all over the internet for a solution, but I cannot find any. This is my last resort before quitting on drupal and trying another CMS. I have a website (not an e-...
0
votes
1answer
11 views

Hiding view filter option based on another filter selection

I have a view with search criteria and the search criteria looks like below: Age group(options: new born, toddler, pre-school) Classroom (options: NA, potty-trained, transition, not-trained) All ...
1
vote
0answers
44 views

How to setup 'headers' cache context by value?

I try to set a headers cache context (/core/lib/Drupal/Core/Cache/Context/HeadersCacheContext.php) by the value of a custom HTTP header. My web server sends a custom HTTP header X-My-Custom-Header. ...
0
votes
1answer
68 views

Create cookie after download file

I want to create a cookie after a file download. This is an extension on the existing module: https://www.drupal.org/project/file_utility Each time you click on a download, a popup opens. For me it ...
0
votes
0answers
24 views

How to override images in node's content? [closed]

Our site is having issues because of the high resolution images inside our articles. We already have thousands of articles so editing each of it is not optimal. I'm kinda new in drupal and I just need ...
-1
votes
0answers
13 views

Get counter or loop index value in paragraph.html.twig

I have a paragraph types called key benefits(key_benefits) and I want {% if paragraph.index==3 %}</div><div class="row">{% endif %} in my paragraph--key-benefits.html.twig but does not ...
0
votes
1answer
37 views

Get domain from a URL field

I have a link field in a content type, field_source. I created a computed field (field_source_domain) in the same content type, which should contain the domain for the link in field_source. I tried ...
1
vote
1answer
31 views

How do I execute code when a module is installed or uninstalled?

Currently, I manually have to add terms one by one every time a module gets installed, and that's not efficient. I'm writing a simple module that needs to automatically install 2 terms every time the ...
0
votes
1answer
13 views

How to map Address field module sub fields (City, State, etc.) to specific (individual) fields in Salesforce?

Address module: https://www.drupal.org/project/address Usually Salesforce mapping doesn't allow to add Address module subfields in the mapping.
1
vote
0answers
31 views

When I clear cache, my menu ordering seems to go out of order

When I clear cache, especially on high traffic times, my menu seems to go out of ordering. Usually I don't see any log messages except for one time: Message Drupal\Core\Database\...
0
votes
0answers
20 views

How to optimize the Glyphicons font with font-display: swap? [closed]

I want to optimize the loading of the Glyphicons font for the Google PageSpeed Insights tool. I need to apply the CSS code below : font-display: swap Here is the location of my font : https://...
0
votes
0answers
11 views

Remove the first subdomain

I am building a custom module with Domain Access. When a user creates a domain, for example using myname.host.com, it will create newname.myname.host.com. I need only to get myname.host.com. This is ...

15 30 50 per page