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
0answers
3 views

How to build core test database?

Fifteen years writing Drupal code and yet I have never written unit tests. I have recently posted a couple core patches which require tests to be written for them - so good time to learn how to write ...
0
votes
1answer
6 views

Using root source property within migrate sub_process plugin

I'm performing migration from Drupal 9 into another Drupal 9 project. Let's say "content features" migration. In a node migration I'm trying to create stubs for media items. The media source ...
0
votes
0answers
16 views

What did I write incorrectly in the node.js service configurations required for the Bootstrap 4 - Barrio SASS subtheme? [closed]

I raise a Drupal site on docker, namely - docker4drupal (a set of already created images: php, nginx, mariadb, etc.) https://github.com/wodby/docker4drupal I need to create a subtheme based on ...
0
votes
1answer
20 views

How to use patch request with parameters in custom rest resource?

I am creating a custom rest resource. /** * Provides a resource to update nodes. * * @RestResource( * id = "my_custom_resource", * label = @Translation("Custom rest resource&...
-1
votes
1answer
18 views

anchor menu description under each menu in menu.html.twig

I am currently displaying the Menu "description" underneath each link using menu.html.twig. by doing this: {% if item.original_link.getDescription %} <span class="navigation__link-...
-2
votes
1answer
11 views

Search and pagination in media popup don't work properly [closed]

In the /admin/content/media page, I have more than one button for the pagination. The search is working properly. When I edit a media on some node, in the popup, I only have one button in the ...
0
votes
0answers
13 views

Custom validation multi value paragraphs : how to get weight value

I am validating a multi value paragraph field using constraints. /** * Implements hook_entity_bundle_field_info_alter(). */ function cnfpt_internet_entity_bundle_field_info_alter(&$fields, \...
0
votes
0answers
11 views

Custom validation multi value paragraphs: highlighting missing field

I am using constraint for the validation my multi value paragraph field. I can correctly implement the different validation rules but I haven't found out how to highlight only the erroneous field(s). ...
0
votes
0answers
15 views

How to debug ccs and js aggregation problem

I'm working on a D9 website. On my local server I have all caching and performance settings like js and css aggregation turned off. Now when I copy my site to me remote server these settings are on. ...
0
votes
0answers
20 views

Post Data to D7 from D9

How do I post data from Drupal 9 when a content is created, post data to Drupal 7 hosted in a different server to create node content. In Drupal7, I have enabled services module and created a resource ...
0
votes
1answer
11 views

Meta Tags Module: Set of available meta tags is different for certain node types

I have a behaviour, which I don't understand: using Meta Tags and a couple of sub modules (like twitter cards, schema.org: JobPosting, etc.) On /admin/config/search/metatag/add I see them for certain ...
0
votes
1answer
28 views

Build custom form with entity form field

I have a feature to migrate from Drupal 7 to Drupal 9. This allows me to build a custom form made up of static fields, which I define in the code of my module, and fields dynamically retrieved from an ...
0
votes
1answer
35 views

Can't migrate files that contain spaces and underscore

I'm migrating my D7 site to D9 and I'm getting 2K+ fail migrations for my files directory. It's failing because the file names contain Spaces and Underscores. Does anyone know what I need to do to ...
-1
votes
0answers
17 views

You are not authorized to access this page after 8 to 9 upgrade

I'm not able to log into drupal 9 after doing an upgrade from 8 to 9. Nothing shows in the logs as I'm not able to see what's the real issue. I get a 403 error when I check in chrome console.
0
votes
1answer
35 views

How can I access the parent entity values inside a custom paragraph formElement?

I created a select custom field that must be inserted inside a paragraph and the options values are dynamically inserted based on another reference field present in the paragraph itself. How can I ...
0
votes
0answers
22 views

Set ['#default_value'] of taxonomy term reference field via hook_form_alter()?

Here's a different question with the same taxonomy term reference field I mentioned in my previous question. Users with Administrator and Coach roles are granted permission to register Student users ...
0
votes
3answers
46 views

ConstraintValidator fails to validate constraint on Taxonomy Term reference field

Client has a simple and consistent hierarchical taxonomy. Cities at the top level and Schools at the second level. . ├── City1 │   ├── School1 │   ├── School2 │   └── School5 └── City2 ├── School3 ...
0
votes
1answer
35 views

Why doesn't the Status Report page show any information?

I've just done an upgrade of my site from Drupal 8.9.16 to Drupal 9.2.6. Everything looks fine but when I go to /admin/reports/status there is no information as per the screenshot. I've never come ...
0
votes
1answer
41 views

Where to define custom entity caching rules of detail pages

When you have a larger project you probably have both internal page cache as internal dynamic page cache module enabled. In my case I do. But I have a section on my website containing custom entities (...
-2
votes
1answer
15 views

How to add anti csrf token to the forms (No Anti-CSRF tokens were found in a HTML submission form.)

When i was testing my drupal 9 website for security i got the error as "No Anti-CSRF tokens were found in a HTML submission form." solution is given as "use anti-CSRF packages such as ...
-1
votes
0answers
26 views

How do i modify or add custom information into a REST API response?

I am not able to modify or add custom info in REST API response For that I tried How to Modify the Response of Drupal 8 User Login API Endpoint, but I am not able to find the controller for entity....
0
votes
0answers
25 views

Using dynamic templates in custom module

I have created a custom Drupal 9 module, and I would like for this module to use different template files basing on a variable. I have looked at hook_theme() and I think the pattern return value might ...
0
votes
1answer
33 views

entity_form how to programmatically add references and update the form visually (entity_browser)

I´m having an fieldable entity with a reference field to paragraphs field_paragraphs and a paragraph_type with a reference field to content_type event field_events. What i am trying in the entity form ...
1
vote
1answer
21 views

How to add inline CSS style in Custom Text of Views?

I have already setup fields for user to input color code (e.g. "#123000") to a content type. Now I need to modify the inline style color / background-color with the given value. I tried to ...
0
votes
0answers
23 views

Unable to create temporary file while installing site

When trying to install Drupal 9 I get this error This problem comes up when I try to install drupal in Spanish Warning: curl_setopt_array (): Unable to create temporary file. in GuzzleHttp \ Handler \...
-2
votes
0answers
24 views

How can one user assign certain portions of permissions to other users, while the rest of the permissions are invisible to him [closed]

I'm using Drupal 9. I want to create an account for the website, which has the permission to create roles and accounts, but I hope that the permission list he can see when assigning role permissions ...
2
votes
1answer
50 views

How to prevent a node from being deleted while performing a delete operation?

I want to prevent a node from being deleted while a delete operation is performed on it. For example in administration panel if user clicks "Delete" on the node, the node shouldn't be ...
-2
votes
0answers
25 views

Why do I get such errors when adding a module via ftp?

I am using Ubuntu 20.04. I have installed a Drupal 9 site and raised the site with Docker4Drupal. Configured in docker-compose.yml that containers are used: web server - nginx container, database - ...
0
votes
0answers
21 views

ReflectionException: Class does not exist in ReflectionMethod when creating page in module [closed]

Im trying to create a basic page through a module like here I have created a landing_page.info.yml name: Landing Page type: module description: 'Landing Page' core_version_requirement: ^8.7.7 || ^9 ...
0
votes
0answers
36 views

How to manually deploy on a shared hosting?

In my shared hosting: no git, no composer, no root folder settings. Only the folder "public_html". And my Drupal files: vendor, web, composer.json, composer.lock. How should I put it all in ...
0
votes
0answers
20 views

Multiple custom views templates with hook_theme()?

Module file /** * Implements hook_theme(). */ function mymod_theme($existing, $type, $theme, $path) { return [ 'views-view-fields--myview' => [ 'variables' => [ '...
0
votes
0answers
29 views

Create default content in Module? [closed]

I am creating my own module, which creates a content type. But I am also trying to create demo content for that content type from my module. I have created .info and .module files. then at config/...
0
votes
0answers
8 views

Alter value in email before sending [closed]

I have a Drupal 9 web form which contains a social security number. I only want the first 6 digits to be displayed in the email that is sent as a receipt, but I wish all digits to be saved. Is there a ...
0
votes
1answer
17 views

Why does ThemeInitialization.php have fatal error: allowed memory exhausted? [closed]

In the process of upgrading a Drupal site from Drupal 8 to Drupal 9 I caused a problem where infinite memory is consumed by ThemeInitialization.php, no matter how much is allocated by php.ini. After ...
1
vote
1answer
37 views

Render responsive image inside form fields programmatically

I am trying to figure out how to render a responsive image programmatically inside a form field. I am doing maintenance in a code on my current job, and sometimes there are form fields using the '#...
1
vote
1answer
77 views

How to make a custom entity fieldable?

This has been asked here before; but question is closed and the few replies do not provide sufficient information. I am trying to use a contrib module (sitewide_alert) which provides its own custom ...
-3
votes
0answers
31 views

Upgrading a shop

I planning to upgrade a Drupal 7 commerce shop, containing 4.5 mill unique products. In this installation, there is a single product type with around 30 fields and about 5 taxonomies. Daily, there are ...
0
votes
0answers
29 views

During migration, the method getRevisionId() is called! [closed]

The migration works with XML files. This means that data was exported from the old system, this data was prepared as XML files and these XML files are to be imported back into Drupal. There are two ...
0
votes
1answer
13 views

Perform an action after each step in a multi-step Webform

I'm trying to figure out how to grab data from the previous step of a multi-step webform after a user progresses and I'm coming up blank. Is there a particular hook that gets fired whenever a users ...
0
votes
1answer
69 views

REST API calls are always cached

In Drupal 9.2.6 I have a caching issue. The code I am using is the following. $returnValues = [ 'value' => 'test', 'time' => time(), ]; $response = new ResourceResponse($returnValues, 200, [...
0
votes
1answer
32 views

Accessing menu protected data

How can the protected data of a menu object, pictured below, be accessed ? using $menu->id() works and returns the menu ID. But neighter $menu->values nor $menu->get('values') work.
0
votes
1answer
39 views

How can I filter the path aliases by node id?

On this page admin/config/search/path, we can only filter the results by URL alias. I want to filter the results by node id as well? How can I do that? It is not possible with form alter. As the ...
1
vote
1answer
17 views

Add custom font to mpdf while using PDF using mPDF module

I made a custom module to create a PDF from a views page. This module depends on PDF using mPDF. I'm now trying to add a custom Google font. This should be the default font when generating a pdf. But ...
0
votes
1answer
65 views

Throw error for required field in hook_form_alter?

I have a node type that can be created by authenticated users. In the node create form, I added a terms-of-service checkbox via a form hook like so: function themename_form_alter(&$form, &$...
2
votes
1answer
115 views

How do I create multilingual user path aliases?

I'm setting up a multilingual site, and I need the user path aliases to be multilingual. Users are set up as translatable: Language Detection: URL (path prefix) English: /en Japanese: No prefix ...
0
votes
0answers
33 views

How to create similar multiple forms using a button?

I am using Drupal 9. I am creating a module that has a form with a button that will re-create another form similar to the first one. These is my code. public function buildForm(array $form, ...
0
votes
1answer
36 views

List all the nodes with the same menu parent ID

I have the following menu in my system. The parent menu-link connects to a node whose ID is 58. All the sub menu-links have a parent ID equal to 58. I need to find the main and the sub-menus using 58,...
0
votes
1answer
20 views

How get the info of a element in webform email twig?

I'm on D9, theming a webform email. I'm currently overriding the twig file, instead of using the configuration of the body in the email hanlder, because there are various conditional logic I've to ...
0
votes
1answer
43 views

A theme in a custom distribution isn't found

For our Drupal sites we develop our own distribution. In the distribution are two themes (administration theme and custom base theme). The administration theme works, but the custom base theme cannot ...
1
vote
0answers
40 views

How do I fix the base URL issue while using load balancer

Since base URL is deprecated, and our Drupal 9 Site is using a load balancer, we are facing issues when setting up the base URL. Instead of the base URL, it displays the load balancer IP. Any help ...

1
2 3 4 5
12