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.

342 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
41 views

What is the difference between Translation language, Translation source, and Original language?

Would anyone be able to explain to me what the difference is between "Original language", "Translation language", and "Translation source"? I think I have a pretty good ...
4
votes
1answer
88 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 ...
3
votes
1answer
76 views

Is there an event related to the creation of a session cookie for anonymous users?

I need to set an additional cookie whenever an anonymous user received a session cookie. This happens when selecting a facet in Search API for example. The specific use case is that I need an extra ...
3
votes
0answers
19 views

QuickEditIntegration can't process components for Quick Edit

I have a content type that is displayed with Layout Builder. When I view it in default mode, the Quick Edit option does not appear in the contextual menu. This is because none of the fields have the ...
3
votes
1answer
38 views

How to get all search results of search api index?

I want to get all the search results from the search API index and then perform a custom sort on it and then display them accordingly. I used the hook_search_api_results_alter and also the search ...
3
votes
0answers
65 views

Menu link tree only loads enabled elements in subtree regardless of parameters

When loading a menu tree without any custom parameters: $tree = \Drupal::menuTree()->load('my-menu-name', new MenuTreeParameters()); The returned tree \Drupal\Core\Menu\MenuLinkTreeElement[] ...
3
votes
0answers
102 views

How can you require users to change their passwords on first login after migration?

We are planning to migrate users from another CMS to Drupal. We can migrate usernames, but not passwords as the encryption is different. So we shall have to assign passwords to them. Earlier versions ...
3
votes
0answers
568 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\...
2
votes
0answers
41 views

How to add Rabbit Hole to a custom content entity

We use the module Rabbit Hole for nodes and terms. Now we would like to use it also for our custom content entities. I have tried to find some information, how to add the Rabbit Hole to a custom ...
2
votes
0answers
18 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 ...
2
votes
1answer
30 views

Migrate order billing profile

I'm trying to migrate order data from an existing site using CSV files and I can't get the billing profile to relate. In trying to troubleshoot this, I have it set just to insert a default value of a ...
2
votes
0answers
34 views

S3FS IMCE File upload issue for old files in Upgraded site

I have a question on IMCE File upload. Hope someone might have come across the similar issue. Installed modules: https://www.drupal.org/project/s3fs https://www.drupal.org/project/imce We have added ...
2
votes
0answers
171 views

Missing bundle for entity type node after upgrading

I recently upgraded a local sandbox to Drupal core 9.2.4. While testing things out, I got an error when trying to add a new article content from /node/add/article. The log shows the following message. ...
2
votes
0answers
32 views

Add an image to a vocabulary

I need to add an image to a vocabulary, not the taxonomy terms. Essentially, I need to add a field to the "Edit Vocabulary" page. Is there a way to do this?
2
votes
2answers
99 views

Basic kernel test fails with Type of Drupal\KernelTests\Core\Entity\EntityKernelTestBase::$modules must be array

Trying to port a Drupal 7 module to 9 with accompanying test and getting this error immediately when running it: PHP Fatal error: Type of Drupal\KernelTests\Core\Entity\EntityKernelTestBase::$modules ...
2
votes
0answers
44 views

How to add conditional on Gutenberg's color theme-support?

I've added the Gutenberg theme-support on my custom theme. I want to add conditional based on text color and background color. For example, selecting the black color background will reset the default ...
1
vote
0answers
32 views

Search API + Facets: Overwrite facet output and conditionally alter query condition based on active filter

I have a date field on hundreds of nodes indexed. I created a facet for the date field but it displays all dates available (ew). Instead, we'd like a filter for "Available Now" nodes and &...
1
vote
0answers
25 views

Can't save value of custom datetime field

I'm reaching out because I just can't find out why my custom datetime field isn't saving its value after I submit. Context: I've created a field containing two datetime fields. I will use it to add or ...
1
vote
0answers
27 views

How do I get the selected image style from a referenced media field?

I created a custom block with an entity reference to a media field (field_background_image). In the display settings I have chosen 'Thumbnail' as format and selected a custom image style 'background'. ...
1
vote
0answers
28 views

Webform handler to manage number of places available

I want to manage a webform to automatically close it if number of people reached, or to invalid submission if not enough places are available. I have use this : Close a webform when total seats reach ...
1
vote
0answers
56 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
vote
0answers
33 views

Files migration from local dev site

I'm migrating from Drupal 7 to Drupal 9 and am having an issue with my source files getting found with the upgrade_d7_file migration. My public files directory for my source site is not 'sites/default/...
1
vote
0answers
23 views

Auto add content to specific entity queue dependant on chosen taxonomy term

I have a People content type, which has an Expertise field which is a taxonomy term reference field. There will then be an EntityQueue set up for each Expertise term. What I'd like to do is ...
1
vote
0answers
93 views

Why is Drupal not sending mail?

When submitting a contact form there is no mail sent, eventhough there is a confirmation message. Or when trying to send a password reset link, everything goes well, Drupal says "If MYMAIL@...
1
vote
1answer
70 views

Why custom condition is not containing parent entity?

I'm using: Drupal 9.1.7 Commerce 2.24 I'm trying to create my custom condition (based on https://docs.drupalcommerce.org/commerce2/developer-guide/core/conditions). However parent entity is always ...
1
vote
0answers
31 views

How do I migrate product fields?

I'm migrating Drupal 7 commerce products to Drupal 9 and I'm using: Drush (10.5.0) migrate_plus migrate_tools commerce_migrate_commerce commerce_migrate I have successfully migrated nodes, but I ...
1
vote
0answers
19 views

How do I use a hook to modify CiviCRM payment processor details in Webform?

I am trying to use hook_form_alter() to change the details of the CiviCRM Payment Processor for specific users (to change from live mode to test mode). On Drupal 7 it's in $form['submitted'] when Page ...
1
vote
0answers
37 views

entityQuery returns wrong result: too many joins?

I built an entityQuery for a custom entity type "vote". I only want to get those votes for a specific poll and those by deputies who are members of a specific fraction. The fraction ...
1
vote
0answers
37 views

Edit a node in the settings tray?

I am looking at this page in the Drupal docs for the Settings Tray and wondering if this can be used to edit the current node you are looking at, similar to this image: Is there a way to edit all of ...
1
vote
0answers
16 views

Adding a relative date range facet to a Search API view using the "last updated" field

I would like to add a facet to a search_api view filtering on the content "changed" field. I would like to use friendly naming like "This week", "This month" etc. There ...
1
vote
0answers
165 views

Add additional taxonomy term fields to an exposed filter form

Brief: How to add a custom field from a taxonomy term into a View's exposed filter form? Specific: I have an image field added to taxonomy terms that I want to add to the exposed filter form along ...
1
vote
1answer
68 views

Get third party settings in paragraph node edition

I'm adding a third party settings in my .module file, in the mymodule_form_alter function. I did this is order to add an image to my paragraph. function my_module_form_alter(&$form, ...
1
vote
0answers
14 views

addField() does not properly ensure table?

When I create a view with a table display, I configure the table columns to be sortable and set Dinstinct to avoid duplicates. I get the following SQL error. General error: 3065 Expression #1 of ...
1
vote
0answers
60 views

Drush can't find commands inside vagrant VM

I have a new install of Drupal 9.1.8, with drush 10.5 installed through composer inside a Vagrant VM. But drush list gives: Available commands: help Displays help for a command list Lists ...
1
vote
0answers
17 views

Excluding other parent taxonomy terms when one is selected in "Filter criteria"

I have a table in a content views with a list of four content fields: City 1, City 2, City 3, and Tourist. Because the cities were all taxonomy references in this particular content type, I created a ...
1
vote
0answers
34 views

What is The Best Practice for Custom Plugin Files Placement

I'm going to create a custom plugin type, so I need to create a plugin manager, plugin base, plugin Interface and a plugin annotation, the annotations goes to ModuleRoot/src/Annotation but for the ...
1
vote
0answers
87 views

Can I cast a generic type reference (EntityInterface) of an object, to a more specific, AccountInterface, if I know the object is a user?

Here is my code // implements hook_node_presave function mymodule_entity_presave(Drupal\Core\Entity\EntityInterface $entity) { if ( $entity->getEntityTypeId() === 'user' ) { so now I know the $...
1
vote
0answers
132 views

Programmatically add a node

Some years ago I made a Drupal 7 site. I want to remake the site with Drupal 9. In Drupal 7 I added nodes programmatically with this PHP code. define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT ...
1
vote
0answers
44 views

Code coverage with Functional JS Tests

So I am trying to get the code coverage report to work with my functional JS tests. I have been looking everywhere and trying everything, but I just can not seem to get the report to work, even ...
1
vote
0answers
85 views

How do I fetch all users in a comment thread?

I want to send notifications to users that have posted in a comment thread. I need to get the user IDs in an event subscriber that will be triggered when comments are created/edited, so performance ...
1
vote
0answers
116 views

Enable language selector for Paragraphs Library

I am using paragraphs on a multilingual Drupal 9 page. Everything is working fine, I can translate basic pages with paragraphs to get a multilingual node. I have now enabled the Paragraphs Library sub ...
1
vote
0answers
53 views

Flag commerce product variation breaks page

I am building a shop on Drupal 9 ,Commerce 2, and want to implement a "my favorite products"-bookmark, so that a user can bookmark products and save them for later. So, I installed flag ...
1
vote
0answers
44 views

Unable to fix my site after Commerce Promotion was enabled (no Commerce Cart enabled)

I installed the sub module Commerce Promotion and my Drupal 9 site crashed with the following message, plus debugging code: The website encountered an unexpected error. Please try again later. Error: ...
1
vote
0answers
53 views

How to work with translations on a date?

I am trying to render a translated date coming from an API and I am wondering what's the best way to do it. The value coming from the API is formatted as "February 13, 2007" I would love to ...
1
vote
2answers
40 views

How do I get node revisions to use my custom template?

I have a custom node template for my content type of Listing, node--listing.html.twig. It is quite heavily customised for the client. However when we go to view a revision (e.g. /node/144/revisions/...
1
vote
1answer
452 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 ...
1
vote
0answers
99 views

What is the design pattern for plugins (and their managers) called?

I am trying to figure out how to design (and subsequently implement) as plugin-like solution in Symfony. I found this article https://drupalize.me/tutorial/what-are-plugins?p=2766 that says: Plugins ...
1
vote
0answers
94 views

Patch gets not applied to Drupal locally in DDEV built with Composer from the Drupal Git repo

I try to build a local workflow to be able to review patches for core. I am using DDEV for the local environment. Steps I have taken: git clone https://git.drupalcode.org/project/drupal.git . ddev ...
1
vote
1answer
59 views

How to alter routes defined in route_callbacks?

Usually I alter static routes in routes subscriber: protected function alterRoutes(RouteCollection $collection) { $route = $collection->get('gutenberg.media.load_media'); if ($route) { ...
1
vote
1answer
216 views

Use entity reference to target revisions of an an entity

I'm building a custom entity document which supports revisions. Revisions are seen as versions of the document (v1.1, v1.2, ...), the title field is revisionable as well. Then there is a custom entity ...

1
2 3 4 5
7