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
0
votes
1answer
23 views

How do I spawn additional instances with the same configuration?

I have the following scenario: I will develop an application based on Drupal. Everything will be developed on a local instance. Composer files, configuration and so on will be kept in a git repository....
0
votes
0answers
31 views

Getting error while exporting configuration [closed]

Trying to export config using Drupal console command. drupal ce Error Call to undefined function Drupal\Console\Command\Config\config_get_config_directory() in Drupal\Console\Command\Config\...
0
votes
1answer
42 views

How do I access profile fields? [duplicate]

I have installed the Profile module. I am trying to programmatically load profiles. The code works, but I am not able to access any field value. class IdCardController extends ControllerBase { /** ...
-1
votes
1answer
16 views

How do I add a leaflet provider to the list of geocoder providers?

I want configure the Leaflet geocoder provider, but I don't know how. I have enabled the Geolocation - Leaflet sub-module of the Geolocation Field module, but visiting /admin/config/system/geocoder/...
0
votes
0answers
24 views

Share option is missing

I'm trying to share a webform, but I cannot find the option to do so. I disabled the experimental module, re-enabled it, and flushed the cache, but still is not showing up. I'm running Drupal 9.0.8 ...
-2
votes
0answers
21 views

Call to undefined function devel_set_handler

When I tried to install the Devel module on a Drupal 9 site, I got this error. Error: Call to undefined function Drupal\devel\EventSubscriber\devel_set_handler() How can I fix it?
3
votes
1answer
66 views

Disable caching for a front page path processor

I’m working on a project where users can create a book (core functionality). In a simple text field they can connect a domain to this book. This way the book is only accessible via this domain. For ...
0
votes
0answers
23 views

Modify form (add select option) by another form in Modal

I wonder if Drupal can add an additional segment of data in a form on the fly using another form via Modal. I have this form in a table. City | Description | Active New york | ...
4
votes
1answer
66 views

Force a single value base field to be in a separate table?

I have a custom entity type (eg: myentitytype), and I would like to add a new base field to it via hook_entity_base_field_info(). As I understand it, single value fields (with a cardinality of 1) will ...
3
votes
0answers
36 views

How can I have Behat create content with an address field properly filled?

I'm writting a Behat test, where I'm triying to create a content that uses a field address, generated by Address Module. I'm using Drupal 9.0.7, Address Module 1.9.0 and behat 3.8.1. My goal is to ...
0
votes
1answer
36 views

Add JS to all webform

I have a Drupal 9 custom theme and would like to attach a JS file on the webform. Adding JS file in themename.libraries.yml does not work. webform: js: theme: js/webform.min.js: {} What ...
0
votes
0answers
32 views

Render a field of a “node_view” array in a block template file

I want to render a field_address field (text field) in a block template file. The node is loaded in a preprocess function. I know I can print the field value with {{ front_nodeObj.field_address.entity....
0
votes
0answers
32 views

Referencing images in files directory from twig template

In a newly installed Drupal 9 site, I have images in the sites/default/files/ directory which I am trying to use in my custom theme. In my theme, I'm implementing a custom entity-print--node--deal....
0
votes
1answer
72 views

Hide path on frontpage redirect

In a custom module i'm using an EventSubscriber to redirect different people to different frontpages. Below is the simplified code I'm using. //GET PATH $nid = 1; $domain_url = \Drupal::service('...
0
votes
1answer
22 views

phpwkhtmltopdf engine pdf printing configuration issues

The screenshot below shows my Entity Print configurations for created styled PDFs from node content. As shown in the screenshot I am using the phpwkhtmltopdf engine and the mikehaertl/phpwkhtmltopdf ...
0
votes
0answers
27 views

Entity Print PDF stying issues

How can I apply CSS styling to a PDF generated from node content? Using the Entity Print module I am able to create PDFs from my node content. My problem is the PDF output do not reflect the styling I ...
0
votes
1answer
36 views

Displaying a single result out of three results

I have a view block that is set up to produce three product titles sorted from a taxonomy term (flowers). I have a view whose machine name is latest_products. In a preprocess function I use the ...
1
vote
1answer
40 views

Post content via JSON API: CURL works, PHP not?

I've got those modules enabled: HAL HTTP Basic Authentication JSON:API REST UI RESTful Web Services Serialization When I run this command, the content is created. curl \ --user demo:9aqW72MUbFQR4EYh ...
2
votes
2answers
95 views

Can I create non-default EntityReferenceSelection?

I have the following EntityReferenceSelection plugin: /** * Provides an entity reference selection for my_entity. * * @EntityReferenceSelection( * id = "extra:my_entity", * label = &...
2
votes
1answer
51 views

Reverse entity reference lookup

I have a data structure where content type research has an entity reference field scientists. The content type scientists does not have any research reference entity field though. I can get all ...
3
votes
1answer
44 views

Mocking Settings (settings.php) within Unit tests

Drupal's Settings class is marked final and has no interface, meaning traditional PHPUnit mocking techniques will not work out of the box. Is it necessary to install third-party tools to be able to ...
0
votes
1answer
49 views

“The service 'serializer' has a dependency on a non-existent service 'entity.manager'”

I have a multidomain site and recently I update from D8 to D9. In my multidomain site I have 2 websites, sharing core and modules, but with different DB. One of them after update works correctly but ...
0
votes
0answers
27 views

How do I use a core class from an external script? [duplicate]

I am trying to access a node programmatically and getting errors though using (AFAIK) the recommended way. My code (so far) is really simple. use Drupal\node\Entity\Node; $nid=1805; $node = Node::...
1
vote
1answer
41 views

Submissions using JSON:API POST method

I would like post submissions in webform using core's JSON:API. I've created a webform, then added the fields I need. I've installed JSON:API Extras to be able customize some API properties per ...
0
votes
0answers
19 views

How can I wrap each row of a HTML list field view in an a-tag

I'm wondering how I can wrap an <a> tag around the <li>s rendered by the HTML list in Views. Unfortunately I only find the option to wrap each field in a custom tag, but not the entire row....
0
votes
0answers
21 views

Parent terms aren't recognized

I have a term migration with an SQL source (WordPress) but the parent term is not properly set when imported into Drupal. Config: id: wp_terms_my_terms label: WordPress Terms: My Terms migration_group:...
-4
votes
1answer
23 views

Multiple Gutenberg blocks in a module [closed]

I've created a custom Gutenberg block and would like to know how to add more within the same module. Some suggested to add JS in MY_CustomModule.libraries.yml, but it does not work. My custom H2 ...
0
votes
1answer
77 views

Problem upgrading via Composer

I am currently trying to upgrade my site from drupal 8.9 to drupal 9. I ran these commands to give permissions: $ chmod 777 web/sites/default $ find web/sites/default -name "*settings.php" -...
0
votes
0answers
12 views

Add row after amount of blocks

I'm trying to archieve something that looks very easy for me, but I can't find the solution. I'm using drupal 9, bootstrap 3 subtheme. I have a region (region-buttons) that has multiple blocks. {% ...
2
votes
2answers
97 views

Managing backward compatibility

It seems (correct me if I'm wrong) that there are some classes or services that must be used in relevant cases in Drupal 9 that are not present in Drupal 8. For example, New in Symfony 4.3: Simpler ...
0
votes
0answers
33 views

Changes not saved when using paragraph in paragraph

The project is in Drupal 9.0.2 Recovery steps: I created a content type, Inside it there is an entity reference field of paragraph. Inside this paragraph there is an entity reference field which is ...
0
votes
1answer
37 views

How do I ensure new dependencies added to the info.yml of an existing enabled module are picked up?

I've added dependencies: - core/jquery - core/drupal to mymodule.info.yml (where mymodule is my module name). How do I ensure Drupal "sees" these new dependencies? For example, can I ...
0
votes
0answers
26 views

How to install drupal 9 with PostgreSQL using Docksal?

I use docksal for developing on Drupal. Recently I decided to install Drupal 9 with PostgreSQL as a database using Docksal. Firstly, I cloned this git-repository. https://github.com/docksal/...
1
vote
1answer
62 views

How to properly manage field types for a content type created by a module?

I'm a bit confused about two different errors I get, which seem to contradict each other. I guess I didn't register my field types properly. The first one appears when I try to uninstall my module. ...
0
votes
1answer
20 views

How do I run a BrowserTestBase functional test with blocks?

I have a module that defines a custom block and places it using a block.block.block_name.yml file that I generated by exporting the placement of the block on a dev site. I've unit-tested the block ...
4
votes
2answers
38 views

Alter comment pager to jump to comment section right away?

I set up a content type and a specific comment type for this content. I set the comment pager to display 10 comments per page. When I now use the pager, I get redirected from the node URL itself www....
3
votes
1answer
59 views

Add webform field programmatically

In older versions of Webform (Drupal 7), the function webform_component_insert() can be used to add fields to a webform, for example inside a hook_node_insert() implementation, so they are added when ...
0
votes
0answers
88 views

Issues with Drush 10.3.5 version in Ubuntu 20.04

I installed Drush 10.3.5 version via composer in Drupal 9.0.7 but I am getting a website error as follows after I ran command drush cache-rebuild. I can not access the admin page as well. The website ...
1
vote
1answer
50 views

Missing updates for Media

After much package dependency finagling via composer, updating PHP, updating MariaDb, etc.. (not as bad as D7 => D8 but still harder than I'd hoped) I managed to update from 8.9 => 9.0.7. I was ...
2
votes
1answer
66 views

Why can html.twig files be placed outside the templates folder?

In Drupal theme folder structure, there is written: Templates provide HTML markup and some presentation logic. Contrary to Drupal 7, in Drupal 8 template files (*.html.twig files) must be stored in ...
-1
votes
1answer
35 views

Alter Submit button of specific form [closed]

I am new to Drupal and want to alter a submit button of a node-edit form. So I wrote a basic module to do so. And it also alters the form button of my form with the id=node_hotel_edit_form. But also ...
1
vote
1answer
35 views

What does the “Views: Filter by an entity reference view” reference method do?

I was just creating a reference type and noticed that there is a reference method called Views: Filter by an entity reference view. What does this do, and how does it differ from the Default method? I ...
0
votes
0answers
47 views

Standard way of filling webform fields with session or cookie values

Is there a standard way of filling Webform (hidden) fields with session variables and cookies? In previous versions of Webform (4.x?), I've read that some placeholders could be used for setting the ...
2
votes
0answers
55 views

Site errors out when trying to create a subtheme based on Classy

I'm creating a custom theme in Drupal 9 and am trying to use classy as my subtheme but get the following error: The website encountered an unexpected error. Please try again later. Drupal\Core\Theme\...
0
votes
1answer
66 views

Authentication required (git.drupalcode.org)

On Drupal 9, I want to install the Taxonomy menu module using Composer, but I get the following error. Using version ^3.4 for drupal/taxonomy_menu ./composer.json has been updated Loading composer ...
2
votes
1answer
136 views

Date Field Type - Text Field Widget is Gone?

I am noticing that the Date field type only has the availability of three widgets: Select list Date and time Select list, no time Can someone tell me why the "Text Field" widget is gone? ...
1
vote
1answer
47 views

Block in node view showing but does not show up when rendering node in Views

I have a node type that I have a specific block added to. I have some AJAX going on in the block. When you view the full node the block shows up. When I go to Views and render the full node content ...
0
votes
0answers
30 views

Trigger login / send login credentials from different subdomain

I have my Drupal 9 living on a subdomain like e. g. drupal.xyz.com. Then I have some marketing-related landingpage stuff at subdomain.xyz.com, which is not Drupal, but another system. Now I would like ...
0
votes
0answers
48 views

Fatal error memory limit (always) while installing a module

I am asking for help in solving an extremely annoying problem. I have a simple website based on Drupal 9. Due to its simplicity, the installation of all modules was based on the Drupal UI. I also have ...
0
votes
0answers
35 views

How can I show/hide node field values the same way items are shown/hidden in /admin/modules?

When viewing a node of a specific type, how can I show/hide the values like in /admin/modules? I want to be able to click on the field title and show or hide the value. Is there a module that can help ...