All Questions

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

Webform 5.3 to 6.1.0 , Error : Call to undefined method Drupal\webform\Routing\WebformUncacheableResponse::addCacheableDependency() [closed]

I updated the webform module from 5.3.0 to the latest version (6.1.0) and then when I click submit on one of my forms, I receive this ERROR: Error: Call to undefined method Drupal\webform\Routing\...
0
votes
0answers
23 views

Configuration inspector is reporting errors erroneously

I have a Drupal 8.9.19 I'/m trying to migrate to Drupal 9. I just did a status report, and have some configuration errors I'm trying to fix first. For example, this is from a view: display.page_2....
0
votes
1answer
33 views

Similar content with contextual filter by url [duplicate]

There are two types of content (as an example): fruits vegetables They share the same vocabulary and similar terms. Catalog structure: -Fruits --juices ---for children ---for men ---for women -...
1
vote
1answer
31 views

Get raw node id value in views template without errors

I need to get the raw node id value in a views template, but the debug comments are interfering. Based on this issue I am using the following: {{ row.columns.nid |render|striptags|trim }} Which ...
0
votes
0answers
44 views

Split taxonomy terms in two facet filters

English is not my first language, so please be patient. I'd like to ask for assistance to split my taxonomy terms in two facet filters. Context: Drupal Core v9.2.6 Acquia Search v3.0.5 Acquia ...
0
votes
0answers
15 views

webforms Submission limit in event registration when it's possible to registrate more than 1 person by form [duplicate]

I use "Webform Demo: Event Registration System", to manage event registration, and everything works perfectly if only one person can subscribe in a Form. For example I want to stop the ...
-1
votes
0answers
19 views

Redirect to install.php "Drupal is already installed" [duplicate]

I try to import an existing Drupal 8 website on my Wampserver, but when I want to access to the backoffice (from /user page) with my id and password, I click on Validate and then I have a page with ...
2
votes
0answers
17 views

How use subqueues of entityqueue module?

I'm on D9 and already using entityqueue module to let the content editors orders some views via "simple" queues Now, I've been requested to make possible to order the nodes appearing on the ...
0
votes
1answer
29 views

Experiencing problems filtering view programmatically

I'm using a views block in my website, the content of this view is filtered programmatically. I now get messages from users who see the wrong information. The filter is based on the currently logged ...
0
votes
1answer
18 views

Create a block with related content selected from "page" content type

I've two content-types: 'Page' and 'Bike' From the page, I use a Entity reference field 'field_kies_je_leasefiets', where I link to several bikes. I want to create a block, placed on the full node ...
0
votes
0answers
9 views

WYSIWYG images in AMP Module

I have a Drupal 7 website, the site has AMP module installed. When I insert a image in WYSIWYG editor the site is not converted to AMP mobile version (in image fields there is no problem).How can I ...
-1
votes
1answer
25 views

How to add CSS for a sub theme?

I have a sub theme I created this way: globalrs/globalrs.info.yml name: globalrs type: theme core_version_requirement: ^8 || ^9 description: globalrs base theme: tara libraries: - globalrs/global-...
1
vote
1answer
33 views

How do I install a working demo?

I have been struggling with this for quite some time. I am trying to install a demo of the Commerce module as provided by Centarro, but every time the install finishes, I only get an empty site with ...
-3
votes
1answer
33 views

How to pass an argument to a hook without creating a custom module?

I need to attach a theme-agnostic ("global") CSS file to the preprocess_hook() function so that any theme I use, would include that CSS. I want to do that without creating a custom module ...
1
vote
1answer
38 views

How get webform translations programmatically?

I'm on Drupal 9. I need to load the options labels of a Webform's option programmatically. So far, I've managed to load the labels: $element = $webform_submission->getWebform() ->...
0
votes
0answers
18 views

Caption for colorbox gallery

I added a little gallery via colorbox to a content type. I just added an image field with no limitation and as formatter colorbox. Now I'm struggling, because I would like to have an image description ...
0
votes
2answers
25 views

Migrate accessing source fields by name instead of by selector?

I'm working on the MongoDB source plugin and I'm able to do the migration, but I have to make strange compromises. When defining the source fields, I have to set name the same as selector, like this. ...
-1
votes
1answer
47 views

Options for pml command with Drush 10

I just install a Drupal 9.2 site and Drush 10 to manage it. Usually I use Drush 9 and Drupal 8.9. It appear option for pml command seem not to work in Drush 10 as it do in Drush 9. Example: drush @...
0
votes
0answers
27 views

Adding custom field generated by drush to available fields on node

I have an existing custom module on my D9 website and I need to make some changes inside it. I want to add a field (boolean) into any content type page edit without doing it manually. So I need my ...
-1
votes
1answer
47 views

Change CSS without changing the website's filetree

I need to change the CSS of my current theme a bit (say, up to 100 lines). I don't want to create a sub-theme and I don't want to directly edit my theme's files (even though it's premium theme which ...
0
votes
2answers
22 views

Problem updating to Drupal 9 because of unmigrated module (video)

I am trying to migrate a Drupal 8 site to Drupal 9 (a bit late, I know, but just got the green light after asking for many weeks). I haven't done the site myself and though most of my migrations have ...
-1
votes
1answer
39 views

How do I access the protected value of node entity?

I have a view node and I use the below code to Kint out the node objects: $node = \Drupal::entityTypeManager() ->getStorage('node') ->loadMultiple(); dpm($node); returns the below ...
1
vote
1answer
12 views

Custom field formatter fails in create()

PHPStorm, PHP 7.4 IDE highlights $container->get('date.formatter'), with "Expected parameter of type '\Drupal\Core\Datetime\DateFormatterInterface', 'object' provided" This function is ...
0
votes
1answer
16 views

Hook for field not triggered when using delta in template

I tried to hook my Link type field with machine name "field_link". This field is rendered in template using delta index to extract some values, e.g.: {{ content.field_link[0]['#title'] }} I ...
1
vote
1answer
24 views

Is there a way to pull the 'description' metadata from Media's Remote Videos?

We have a Drupal 9 site that is using Media's Remote Video for YouTube videos. We need to pull the YouTube video's description but I do not see any way to accomplish this. The end result will be to ...
1
vote
1answer
27 views

Output JSON string into PHPTemplate file

I want to output a JSON string as part of a data attribute on an HTML tag for a template in Drupal 7. For the life of me, I cannot figure out why it does not work (works perfectly in 8+). I need to ...
0
votes
0answers
46 views

Alter route path within event_subscriber with GET parameters

I know I can alter route path with event_subscriber class AdminRouteModifier extends RouteSubscriberBase { protected function alterRoutes(RouteCollection $collection) { if ($route = $collection-...
0
votes
0answers
18 views

Read reverse-relationship from a view programatically

Alright, this is taking so much time than expected. I'm having a comment type "Default comment". The comments under this comment type is published and created as nodes under "level3&...
0
votes
1answer
72 views

Database Error after updating from Webform 6.0.5 -> 6.1.0 in Drupal 9.2.7 (PHP 7.4.14)

After updating to Webform 6.1.0 the following error occurs: webform module 8626 - Issue #3240399: Move form #method, #action, and #attributes from properties to settings #8626 Fehlgeschlagen: Drupal\...
2
votes
2answers
84 views

add field to user in hook_update_n

The latest release of our existing module needs to define MANY new fields that are attached to the drupal user. For each field, in {module}/config/optional there is a field config and a field storage ...
0
votes
1answer
17 views

Read entity reference node field

I have a referenced entity named - field_cp_level2_ref_level3. This field belongs to level3 content type. when I dump the $entity, I see the field as below: entity:node:level3::...
0
votes
0answers
24 views

Is it possible to convert a text field to an email type field that has exiting data in Drupal 9?

We have a Drupal 9 site that has a plain text field with existing data that was used for email data. We'd like to convert this field type to email. Is this possible?
1
vote
1answer
28 views

How to display an SVG code in a Views?

​ I added the following code for a "Global: Custom Text" field of a Views : <div class="messages-list__item messages messages--warning" data-drupal-selector="messages" ...
0
votes
1answer
19 views

alter image style attribute

i am trying to develop a CKEDITOR plugin to add padding/margin to images, after looking in the documentations i have written this code : const style = new CKEDITOR.style( { element: 'img', attributes: ...
1
vote
1answer
16 views

Machine-translate a node by menu link

I have an "About us" main-navigation menu link. I want to create several other main-navigation menu links, in languages other than English, which will link to that very webpage, for example: ...
1
vote
1answer
64 views

How do I mock \Drupal::httpClient()?

I'm unit testing a utility library (of our own making) that makes calls to an external REST API with \Drupal::httpClient() So, I have a library class with static functions: class myUtils { public ...
-3
votes
0answers
25 views

Theme is already present

I have a custom theme, and updated it sometimes in production, just uploading my_theme.zip in appearance->add new theme. Everything was fine, updates were being installed. But today I tried to do ...
0
votes
0answers
28 views

Unable to log in using Chrome browser

I having an issue with my Drupal site (8.9.19) Using Firefox browser, there is no problem login for all users However, when using Chrome - users are unable to access. This is what I received in the ...
1
vote
1answer
24 views

How do I render a commerce promotion coupon code on the order details?

I want to show a coupon code used on an order details page, but cannot seem to render it on a templates. Here are some things I have tried so far... {% for coupon in order_entity.coupons %} {{ ...
0
votes
1answer
24 views

How to change the condition to AND in accessing content by role in a view-block?

I have a view-block 'Expo', I want to display this block only if current user has two specific user roles i.e., 'Actor' and 'Singer'. When I checked the both 'Actor' and 'Singer' , The block is ...
-2
votes
0answers
28 views

How can I get the value of field_tckn field?

I'm trying to get a field value on form save but I can't do it for the life of me. dpm($form_state->getValue('field_tckn')) gave me null and so did $form_state->getValues()). dpm($form_state) ...
1
vote
1answer
47 views

Calling a twig template depending on the number of field items

I need to call different twig templates of an image field depending on the number of items of this field. If there is only 1 image item, I'd like to use template1.html.twig. If there are > 1 image ...
0
votes
0answers
44 views

Save textarea word count programmatically

I'm trying to keep a word count tally on a set of long text fields. As far as I can see, there are several options: Create a view and add php to a custom template that produces the word count. Most ...
0
votes
1answer
119 views

How can I debug a Twig error that occurs after migrating from Drupal 8.9 to Drupal 9+

I am trying migrate my Drupal 8.9 site to Drupal 9+ and I am stuck with an error its cause I am not able to hunt down. On almost every page I get the following PHP exception: Twig\Error\RuntimeError: ...
0
votes
0answers
7 views

Use Views Rules to loop over a user's view

I have a contextual view that lists the last expired Course Session of a teacher. I use a contextual filter like this: User: Uid whereby: WHEN THE FILTER VALUE IS NOT AVAILABLE Provide default value ...
0
votes
1answer
35 views

Use ajax to save modal / dialog form instead of page reload

I'm looking for a way to save modal & dialog forms through ajax instead of redirecting the user after the form submit. Ajax is quite unknown territory to me. I've found several interesting topics ...
0
votes
1answer
32 views

Is it possible to set up Amazon advertising with the Media module?

I have a Drupal 9 site with the Media module enabled. I have subscribed to the Amazon partner program. Is there a solution to display Amazon iframe in Drupal? I am thinking of the Media module. Many ...
1
vote
1answer
13 views

How to add link to translated content in text field

I need some help on a multilingual D9 site, trying to add links to translated node in text field. In German version should be a link to the English and French version of this node, as part of the node ...
0
votes
1answer
33 views

Anonymous user redirected to core/install.php while admin does not

As an admin I've built a large table on Drupal 8 (php, mysql). It runs without issues for Admin, but trying as Anonymous user it redirects me to core/install.php Since it's ONLY affecting Anonymous ...
1
vote
1answer
42 views

How to use entityQuery with custom field type?

I am working on building a query for nodes that have a few custom fields (field types). The fields are custom build in a custom module with a custom schema. When I execute the query: $query = \Drupal:...

15 30 50 per page
1
3 4
5
6 7
1705