Questions tagged [9]

Version tags should be used only for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
2
votes
1answer
32 views

Drupal 9 Add custom twig extension

I need to output a JSON variable in my theme, data is saved in a node field. I can easily use hook_preprocess_node to decode the data and save it in axillary variable and then render it using a custom ...
-1
votes
0answers
18 views

Importing prices from CSV during Feeds Import

I have a list of towns with associated prices in a CSV file that I would like to import with Drupal Feeds. The CSV looks something like this. Names Towns Max Price 1 Anthony Price ...
-3
votes
0answers
26 views

How to create a block for related products based on their taxonomy term?

I want to create a block for related products.. all the solutions I found are not working on drupal 8/9 with commerce 2 , for a content you can just specify a contextual filter for (has taxonomy term) ...
1
vote
0answers
18 views

Parent contextual filter

I'm using drupal 9 for a project with a large taxonomy structure. On the parent page I want to show the child terms of the node. Multiple guides i've found have suggested using the contextual filter ...
0
votes
0answers
35 views

Use Injected CacheBackedInterface to invalidate certain bin

I've got a content type called SERVICE (I write it all capitalized to prevent mixture with drupal service) which admin can introduce different SERVICE using this type, it is expected that these ...
0
votes
1answer
16 views

Get taxonomy field value in forum-list.html.twig

I am customizing the appearance of the forums. I added all my forums and container. Additionally, I added a custom taxonomy field I need to show for each forum category. How can I show the custom ...
-3
votes
1answer
21 views

Integrate webform submissions with Google sheet

How do I integrate webform submissions with google sheet in Drupal 9? I've found a way using Zapier but that allows only a limited number of submissions per month. Is there any way I can achieve it ...
0
votes
0answers
42 views

How to replace IPE with Layout Builder? [closed]

I am trying to set up a D9 site that will allow site Editors layout flexibility. I have read a ton of articles on how awesome Layout Builder is and how it finally does what Panels couldn't do... hmm.. ...
0
votes
0answers
36 views

Setting visibility by content type while adding block to region from code

I created block from code. Now I want to add it to specific region ('sidebar_first') also from code. I'm doing it like this: function event_block_preprocess_page(&$vars) { if (\Drupal\block\...
0
votes
1answer
39 views

The service “redirect.request subscriber” has a dependency on a non-existent service “path.alias_manager”

While upgrading D8.9 to D9.1 got the below issue. Tired all solution nothing works. Because on this issue site is down and unable to process anything. [php7:notice] [pid 26850] Symfony\Component\...
0
votes
0answers
39 views

Show latest content date from group content type

I've a group type vendor with following groups: V1 V2 V3 Each group is associated with content type notes as shown below: Notes (Content Type) with nodes associated with groups: N1 (Group: V1) N2 (...
0
votes
0answers
8 views

Option to set comments to Hidden on an individual piece of content (node), even when it has no comments

Drupal 8 and Drupal 9 comment fields provide three settings for the default, as configured at for example /admin/structure/types/manage/article/fields/node.article.comment: The default value for this ...
0
votes
2answers
40 views

How do I get the title of a referenced node from a field?

I am trying to build a View that lists People's Profiles which are referenced to a Team via a Paragraph (within that Profile) to print out the Name of the Person and other data from the Profile. The ...
0
votes
0answers
24 views

How do I get the path or url to commerce product for views-view-fields.html.twig

I use the commerce module and VIEWS to build a product list. For this product list I like to have an output like this: <ul> <li> <...
0
votes
1answer
27 views

How can I create a Link to an URL containing a fragment identifier?

Is it possible to create a Link to a node with a hash in url (for opening a special Tab). I use: Link::createFromRoute('Title', 'entity.node.canonical', ['node' => 77]); And I want to link to: &...
0
votes
2answers
29 views

How many child pages can be added under a book parent item?

When using the Book module, is there any limit on the number of child items that can be added to a book parent node?
0
votes
1answer
35 views

Body text special characters are escaped

I have this code which I am using to get the body text from a node rewrite it with a regular expression and replace it, (I am replacing all you tube video links with embed codes) function ...
-3
votes
0answers
22 views

Include odataPhp sdk

If someone can help me and explain me how to do it. I would like to use an very old external PHP library like https://github.com/hansfn/odataphp but, Drupal does not find the classes after an ...
0
votes
1answer
24 views

How do I get the order_id and order_number on the checkout completed page?

I'm trying to get the order information inside the mymodule_preprocess_page hook. On the normal page I can get it via the $cart. But the $cart is not available on the checkout page anymore. How do I ...
0
votes
0answers
31 views

Can not install modules

I am on a fresh Drupal 9.1.7 setup (tried PHP 7.4 and PHP 8.0). When trying to install modules I get the following error: Uncaught PHP Exception Drupal\Core\File\Exception\NotRegularDirectoryException:...
1
vote
2answers
47 views

Translate tab missing

I am working on my first multilingual Drupal 9 website, and I face a challenge. I can't seem to get my contact webform elements translated. I am using Webform Version: 6.0.2. I have enabled ...
0
votes
0answers
23 views

Load page content with AJAX after being gated

I need to gate a page's content with a form so that the content isn't loaded until a form on the frontend is filled out. I can hook into this form's onSuccess method (all via JavaScript) but I'm a bit ...
0
votes
0answers
16 views

Custom JSON API route not listed

I installed JSON API Resources module to implement a custom route and I followed the examples provided by the documentation. Therefore I declared a route in my test_module.routing.yml like this: ...
2
votes
2answers
45 views

How to create a new parent section on the Configuration page?

When one navigates to Manage » Configuration, the page is divided into sections which (in the "Seven" theme at least) shows up in individual boxes. These sections have headings like "...
-2
votes
1answer
66 views

How to add and associate Paragraphs to Media Library Images Programmatically

Good day everyone, Our client wants to have this feature where he can upload/reuse multiple images for an article content type. This can be achieved using a Media Library, where I find it tricky is ...
0
votes
0answers
16 views

Fetch Book field values on child level only once

I'm working on a project where I use the core Book functionality to create my sites structure. I have three content types: Reader Issue Article Where Issue is a child of Reader, and Article is a ...
1
vote
1answer
39 views

Programmatically enable the entity view display

I would like to programmatically enable the Layout Builder module. I followed the instructions given on Layout Builder — building Drupal 8 layouts, but they don't seem to work. They might be outdated ...
0
votes
0answers
21 views

How to add filter criteria by current date in views

I am using Drupal 9 and have a content type with a field "Publish until" (datetime). I want to add a filter in views that it will compare the date in this field with current date. I found a ...
0
votes
0answers
67 views

The “twig” service or alias has been removed or inlined when the container was compiled. Upgrade Drupal 8.9.13 to 9.0.11

I'm trying to upgrade Drupal 8.9.13 to 9.0.11 in my local setup (Windows & xampp). I have upgraded all the contributed modules which supports for Drupal 9. When I try to upgrade core, got below ...
0
votes
1answer
31 views

How can I add CSS variables to the HTML head?

For my site I want to be able to set custom css variables to the sites head. I don't want to add css files just inline css code. In the end I want users to be able to set colors using a color picker. ...
0
votes
0answers
25 views

Menu link Converting full URL to local

When I save a menu link pointing to a node (nid 5, alias /woohoo/magic/test, it's value in the database is: entity:node/5 I'm trying to convert fully formed user inputs such as "http://127.0.0.1:...
0
votes
0answers
11 views

Is there any way to set a flag field value on flag creation?

I have a Flag with a boolean field, Happy. I want to set the value of this field when I flag content programmatically. My question Is there a way to set the value of the flag field when creating the ...
0
votes
0answers
15 views

How to aggregate values from fields in Paragraphs based on value of another field in that same paragraph, and display in an aggregated Views table?

Hopefully my title makes sense... I am setting up a Drupal 9 website for internal use as a financial reporting engine and a CRM. I am making use of the following modules: Paragraphs Views Viewfield ...
0
votes
0answers
6 views

Book node entity to set child nodes access permissions

I'm working on a simple permissions module for books. This module should make a book with its child nodes private. The toplevel content type is called reader than I have a child content type edition ...
0
votes
0answers
41 views

Why does my custom block disappear after page reload?

I have created a custom block with a custom module (Example: https://www.webwash.net/programmatically-create-block-drupal-8/). The goal is to display some external content, which is working. The only ...
-3
votes
1answer
26 views

Set a default integer value with #ajax, according to a form state value in the same form

There is an integer field: "Number of pitches" Another integer field: "Maximum people allowed". These will usually be the same values. I am trying to set the value of the field ...
0
votes
1answer
26 views

Success with cookie, fails with JWT: RuntimeException: Failed to start the session because headers have already been sent

My Controller is working with cookie auth but failing with JWT. This Controller is supposed to flag an entity for the logged-in user. If I am using cookie auth, there are no errors and everything ...
1
vote
1answer
34 views

Is there any way to show a “computed field” value in edit mode?

I have a content type (Structure) to which I added a text computed field. In a module I added the following code. function computed_field_field_reference_compute($entity_type_manager, $node, $fields, $...
0
votes
2answers
135 views

OO way of adding base field definitions

Is there any object oriented Drupal way to add a base field definition to an existing entity? Of course I am familiar with hook_entity_base_field_info(), but I am trying to keep my .module file size ...
0
votes
0answers
39 views

“drush updatedb” failes with “The provided host name is not valid for this server”

I run my site with Drupal 9.1.6 on Strato Webhosting. The site is well accessible via Webbroser either under mydomain.tld or www.mydomain.tld. I can perform a database update running update.php, but ...
0
votes
1answer
24 views

Adding Count Up module to custom front page

My end goal is to put several Count Up numbers on my custom front page. But I'm having trouble getting it implemented. First, I installed the Count Up library (https://github.com/inorganik/CountUp.js) ...
0
votes
1answer
19 views

How to override version of drupal-library (JavaScript library) included with composer merge-plugin?

I'm using Webform with the composer-merge plugin to bring in its libraries: Relevant parts of my composer.json file: "extra": { "installer-paths": { "...
-3
votes
1answer
54 views

Undefined function 'entity_metadata_wrapper'

A custom module is using the following code. function sun_blogs_views_pre_render(&$view) { if ($view->name === 'blog_listing') { if ($view->current_display === 'page') { Drupal::...
0
votes
1answer
34 views

How to add custom attributes to description meta tag?

I need to add 'class' and 'data-type' attributes to meta tag containing description attribute. I was able to locate the core Metatag module, however I'm unable to find any documentation on how to ...
0
votes
1answer
52 views

ArgumentCountError: Too few arguments to function Drupal\hal\Normalizer\ContentEntityNormalizer::__construct(), 3 passed and exactly 5 expected

I've replaced the deprecated functions with non-deprecated functions using drupal-check and PHPStorm. The site builds on Drupal 8.9.13. I update composer.json to 9.1.5 and run composer update. drush ...
0
votes
0answers
43 views

How do I forward user to a specific page from the node create page when a role and nodes creation limit matched?

I am recreating my website from Drupal 7 to Drupal 9, and I am struggling with getting a rule that I had setup in D7 working on D9. Rules is still in Alpha, and the Rules Form module is non-existent ...
2
votes
2answers
104 views

How to expand NodeForm so new argument can passed to it

I have a content type called service request, which have some conditional fields that each might appear or disappear based on an other field value called service type. I have used conditional field ...
0
votes
0answers
17 views

Different behavior of URL response and service response

I am trying to pass csrf_token or session token without an additional request. I am able to get token using /session/token endpoint. I am observing a different behavior here. The response of routing ...
1
vote
2answers
95 views

Pass value into a view using block input

I have created a Drupal 9 site with articles that belongs to taxonomy terms. I want to give the ability to the administrator of the site to place a block with whatever taxonomy he wants. How would I ...
0
votes
0answers
18 views

Make Boolean filter FALSE accept null [duplicate]

Have content type Article. Content type Article has a field, called "Need Further Review", of boolean type. This field is not required, default value FALSE. The articles has value TRUE, ...

1
2 3 4 5 6