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.
725
questions with no upvoted or accepted answers
6
votes
0
answers
44
views
How to override the typehint for entityTypeManager with a more specific one?
I'm often frustrated by entityTypeManager because when I load entities, the typehint for the return value of the load methods is EntityInterface, but I want it to be a more specific interface (which I ...
5
votes
1
answer
193
views
How does the Geolocation content of a page filter is a Views block?
I have a website with Drupal 9 and the Geolocation module :
https://www.drupal.org/project/geolocation
I created a content type with a Geolocation field that contains coordinates.
My website uses the ...
4
votes
0
answers
134
views
How can I dynamically switch between two databases for ALL queries?
I need to copy some entities from one Drupal 9 database to different Drupal 9 database. I have searched and looked high and low, but none of the examples I have found work anywhere. I found no help on ...
4
votes
0
answers
258
views
How to deal with config sync changing the order of lines in files causing spurious changes in source control?
I am really enjoying Drupal 8/9's built-in config sync mechanism which allows you to export config to a directory. This makes it possible to store config in a git repo and easily deploy from dev to ...
4
votes
0
answers
2k
views
Schema information for module is missing - how to fix?
I tried to install the Scheduler module but it did not install properly because we somehow did not have code for another custom module that the database thinks was installed. I got the code for the ...
4
votes
0
answers
457
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 ...
4
votes
1
answer
260
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 ...
4
votes
1
answer
128
views
How do I set the display suite default region for newly created fields?
What needs to be done:
Newly created fields in any content type should go to the hidden region of the DS Layout.
Short background:
In our project we use the Display Suite module, and we have the ...
3
votes
0
answers
40
views
Can I use pseudofields in anything other than source?
If I use pseudofields in the source property for my custom plugin, they are correctly substituted with the computed values. If I use them in another configuration (as per the example), they are ...
3
votes
0
answers
138
views
File can not be copied during migration of media entity
I'm migrating pictures into Drupal (9) media entities (image). System is using AWS S3 for local storage. I have 2 migrations:
First migrates external images into drupal's files. It copies files from ...
3
votes
0
answers
80
views
Enable a module with sample config that depends on a theme
I have a submodule that provides some prepared configuration via config/install. The goal is to have devs enable that module to get a preconfigured set of content types complete with preconfigured ...
3
votes
0
answers
63
views
Array type hints conflict between Drupal and Symfony
In an event subscriber, I have:
/**
* Registers the methods in this class that should be listeners.
*
* @return array
* An array of event listener definitions.
*/
public static ...
3
votes
0
answers
175
views
How to properly extend Entity Query class?
I am working on some complex aggregate reporting that pulls from several sources (node type) and generates a report in a table display. There are about 10ish line items (could be more later) and ...
3
votes
0
answers
300
views
JSON:API FieldEnhancers - removing a resource object from a JSON:API response
I need to remove a resource object (in this case a paragraph) from a JSON:API response when it matches a specific condition. I do not want to delete it, I just want to exclude the object from the ...
3
votes
0
answers
127
views
How to filter book pages by book with Views? ( how to integrate book with views)
At the moment on Drupal 9.3 there is very poor integration between views and Book Module.
how to create a view to show all the book pages with functionality to filter ( an exposed filter) them by ...
3
votes
1
answer
527
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
0
answers
21
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
1
answer
287
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
0
answers
465
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
0
answers
220
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
1
answer
1k
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
0
answers
18
views
Field formatter migration: How do I setup the related yml files?
I've custom formatters in Drupal 7. In Drupal 9 I've a custom module to provide the same formatters. How do I have to setup the migration yml-File, if the names of the formatters in D7 are the same as ...
2
votes
0
answers
30
views
Display images in a Webform options (that displays a likert scale)
I'm looking for a way to display images in Webform options that I have created. The Webform options display a Likert scale with 4 options.
The machine name of the Webform option is '...
2
votes
0
answers
124
views
Need help understanding caching issue on Pantheon and Redis
On a Drupal 9.5 site on Pantehon that uses Redis, we have Drupal cache and the BigPipe module enabled.
The problem is that the cache is only being "hit" (?) if the same user visits a page ...
2
votes
1
answer
244
views
How can I properly create separate storage for a base field?
What is the correct and supported way to create a separate table storage for a base field on a custom entity? I tried the answer here, using setCustomStorage(TRUE), but it didn't work, and I don't ...
2
votes
0
answers
59
views
Convert an existing entity type to revisionable
I am trying to make an existing entity type (knowledge), from the Knowledge Project, revisionable. I followed these instructions Converting a content entity type to be revisionable. A new table, ...
2
votes
0
answers
120
views
How to duplicate/clone a field in a content type
I have a custom content type with an image field. I want to convert this image field into media type. There are already thousands of nodes created with this content type.
One of the ways I've ...
2
votes
0
answers
216
views
How do I cancel an order?
I am looking for a way to change the status of some orders. I need to be able to cancel orders even if the payment has been validated. In fact, I'm currently using the Commerce Payplug module which ...
2
votes
0
answers
522
views
Allow users to upload heic images and auto-convert to jpg
It seems that heic images are increasingly popular way to store images (the default image format since ios 11, but browsers do not support them. Site visitors may attempt to upload an heic image from ...
2
votes
0
answers
325
views
Refresh a form with Ajax after closing a Dialog
So I have a custom form in which I display a list of entities.
Below that list, I added an “Add More” link which opens a Dialog.
When I close (or submit) the Dialog, I want the list of entities to be ...
2
votes
0
answers
43
views
Changes in email template are saved, but not used (cache?)
I'm usually trying to find an answer/clue on my own, and usually it works, but at this time search is fruitless.
So I'm trying to edit a welcome email text, using /admin/config/people/accounts section....
2
votes
0
answers
80
views
Get Drupal core search results via jsonapi
I am using the jsonapi module to get node content for specific bundles for a mobile app and i am familiar with the filter, include and sorting concepts of the jsonapi.
Now i want to get search results ...
2
votes
0
answers
153
views
Edit webform submission secure token url
I would like to change url for secure token.
Now it /webform/MYFORM/submissions/sid?token
But i would like to change it to /submissions/sid?token
I use these instructions https://www.drupal.org/...
2
votes
0
answers
70
views
Variations created with a queue worker sluggishly slow
The site my team is currently building is meant to import a list of all available trips for a travel booking agency.
The method we settled for (for now) can be summarized as such :
A daily cron job ...
2
votes
0
answers
376
views
How can I extend Serializer to handle a custom field type?
I'm trying to extend Serialization to get the JSON Field module to return a JSON object instead of stringified JSON.
Goal: When I access an entity that contains a JSON field using JSON:API, I want a ...
2
votes
1
answer
245
views
Drush can't write to /tmp
Drush does not seem to be able to move files to the tmp folder on my local machine. Changing the tmp folder location to for instance "sites/default/files" works, but I would like to know why ...
2
votes
0
answers
154
views
Problem with same webform added multiple time in a page
Problem
I have an Article node with layout builder enabled for content author.
I have webform Subscribe newsletter with ajax enabled.
I add webform Subscribe newsletter to the node twice. So there are ...
2
votes
1
answer
344
views
Why isn't an image from the local domain shown with the explanation that, for security reasons, only images from the local domain are allowed?
I'm running Drupal Core 9.3.7, with basically the default set up. The Basic HTML editor is CKEditor. If I include an image in a page, that image is not shown when I view the page; on inspection, it is ...
2
votes
0
answers
408
views
I cannot access PDF files uploaded in the private directory
PDF files uploaded to the private directory cannot be viewed and returns a 404 error.
This also happens to the user with the Administrator role.
Other file types can be viewed with no issue.
This ...
2
votes
0
answers
125
views
Drush 10 pass alias to remote
Our remote environments are currently fronted by a Linux instance acting as the gatekeeper between the developers and the actual environments (apache and mysql instances running Drupal). This was done ...
2
votes
0
answers
927
views
"A non-existent config entity name returned by FieldStorageConfigInterface::getBundles()" errors in watchdog
After migrating from 7 to 9, I'm getting a lot of these errors in watchdog, from views.
A non-existent config entity name returned by FieldStorageConfigInterface::getBundles(): entity type: paragraph,...
2
votes
1
answer
496
views
Migration fails with "missing migrations" errors
I am trying to migrate a Drupal 7 site to Drupal 9 using the Migrate module user interface. I have read through and followed the corresponding tutorials on drupal.org, but the migration still fails.
...
2
votes
0
answers
192
views
How can I change the format used for <pubDate>?
I'm using Drupal 9 to display a RSS feed with the Aggregator module. For the imported items, the date for <pubDate>Wed, 24 Nov 2021 20:05:46 +0000</pubDate> is showed as 2 months 3 weeks ...
2
votes
0
answers
149
views
Add a custom Access callback to the profile module to hide the menu tab for certain users
We are using the Profile module and I'm trying to hide the menu tab on the user's account for certain users based on a value of a field on the user.
I have the alterRoute set.
namespace Drupal\...
2
votes
0
answers
32
views
Page with multiple displays on the same path does not respect the different access rights
With Drupal 7, it was possible to define in Views a page with several displays, having all the same URL. By ordering the displays in descending order of access level (Administrator first, Anonymous ...
2
votes
1
answer
153
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
0
answers
36
views
How can I retain the destination parameter when a user registers a new account with email verification?
This is for a Drupal 9 website.
How can we retain the destination after a user registers a new account that requires email verification?
Example workflow:
User clicks to create a new node but does not ...
2
votes
0
answers
342
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
1
answer
78
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
0
answers
137
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 ...