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.
1,753
questions
0
votes
0
answers
53
views
Form States not working when compressed javascript is enabled
I have visible states setup for a 2 fields that correctly work when javascript aggregation is disabled. When I turn JS aggregation on both fields are visible no matter what option I select on the ...
1
vote
0
answers
32
views
How do I hide the label of disabled field groups?
In the Manage Display tab, I have disabled fields because they are rendered in the page.html.twig file inside of a region. I don't want the field to display the label.
I can set the label to hidden ...
0
votes
1
answer
315
views
Why is the Cache-Control always "no-cache" and "X-Drupal-Dynamic-Cache" UNCACHEABLE on this site?
I have a production website for quite a long time now.
By digging, we found that the Cache-Control was always to "no-cache" and "X-Drupal-Dynamic-Cache" is UNCACHEABLE
My settings....
0
votes
0
answers
21
views
Counting by rewritten element
In my view, I'd like to group my row by values.
The initial data look like this.
In the field configuration in the view, I rewrite each value like this {{ field__value |split('-')[2] }} to get only ...
1
vote
0
answers
61
views
Contrib module service overriding not working
I am using the ‘Path Redirect Import module along with the Redirect module.
I am trying to override its service ‘path_redirect_import.importer’
To do this, I have added a service provider and a custom ...
0
votes
1
answer
36
views
Can I set default access settings?
The Webform module defaults to allowing anonymous and authenticated users to submit a form.
The vast majority of the webforms we use are for internal staff that have a particular Drupal role.
Is there ...
0
votes
0
answers
20
views
Using Geofield, how do I create links that would center the map on required point?
This appears to me as a rather basic requirement, but surprisingly enough, I can find no information on how this can be done.
You know how when you search something on Google maps, apart from just a ...
0
votes
0
answers
22
views
How can I combine filter values?
I'm on D9.5.x.
I'm styling the default Glossary view. It works, but on the site some of the node titles start with a character that is not alphabetic, for example - My awesome title - or @ My Work. ...
0
votes
0
answers
31
views
How to add Rules "Context variables" based on node fields?
I am doing a Data comparison in rules condition. But while adding "Context variables -> Data Selectors", I am unable to add node fields like "node.ABC.value" or "node.ABC&...
0
votes
2
answers
89
views
How to know how many nodes my website has?
In /admin/content no specific number of nodes is available.
How to know how many nodes my website has, preferably without installing a module?
I want to know how many nodes I have in general, not of a ...
0
votes
1
answer
58
views
Solr autocomplete does not work for Product Variations
I am trying to create a sitewide search using Solr. For this, I indexed Product Variations and Content entities as Rendered HTML Output. When I try to search for a content entity, the autocomplete ...
0
votes
1
answer
130
views
How can I change the label of the title field "Name" of my taxonomy?
I want to customize the title label of my taxonomy, the name field. By default, its value is "Name".
I know I can use the mymodule_form_alter hook and do as followed:
$form['title']['widget']...
0
votes
2
answers
58
views
Creating user programmatically fails with Postgres
Anyone know what's wrong here? After the D8->D9 upgrade, a stupidly simple piece of code is not working, has there been a change? It worked before.
$params = [
'name' => $username,
'pass' =&...
0
votes
0
answers
16
views
How to expose a filter of an list (text) field to your site visitors in a REST Export View
How can I filter based on selections of a list (text) field and share that with users? For text fields this works out of the box, but for list fields you can only select the specified values:
I would ...
1
vote
2
answers
54
views
functional test: Schema errors but Schema is correct
I have a settings form in my custom module and functional test of this form.
I added new field to form
$form['unblockable_roles'] = [
'#type' => 'checkboxes',
'#title' => $this->t('Users ...
-2
votes
1
answer
62
views
How do I make an activation link on registration expire in 15 minutes?
I have user registration and forgot password mails sent to the user.
I want 5 minute expiration for forgot password and user registration. Now the forgot password will expire after 5 minutes but new ...
0
votes
1
answer
87
views
Theming image.html.twig for one paragraph type with custom template suggestion
I have a custom module that when installed, creates a paragraph type called "Gallery". Gallery has one field called "field_gallery_images", which is a media reference.
I am trying ...
0
votes
1
answer
80
views
How to conclude from Upgrade Status module if my website is ready to be upgraded from 9 to 10 in command line?
How to conclude from Upgrade Status module if my website is ready to be upgraded from 9 to 10 in command line?
From the documentation I understand that I should run either of these commands:
vendor/...
0
votes
1
answer
237
views
How to get path/URL without language prefix (for multilingual site)
I have written a code to get the parameters (node_id, taxonomy_id) from the URL using the following code.
Sample URL: /foo/bar/[nid]\/[tid]
$path = \Drupal::request()->getpathInfo();
$arg = explode(...
0
votes
1
answer
81
views
Is there any danger in uninstalling Redirect module?
Drupal 9.5.3 with no core customizations and very few contrib modules:
Redirect
Asset Injector
Token
All nodes in this website have alternative aliases such as example.com/my-first-node instead of ...
0
votes
1
answer
51
views
Attach JavaScript to page with Commerce Events
I'm using hook_page_attachments_alter in Drupal 9 to add some JavaScript dataLayer calls to certain routes, but I also need to add some to certain cart events (i.e. add item to cart).
I've written a ...
0
votes
0
answers
19
views
How to show/hide a webform block on nodes of specific content type based on node field value?
I have a webform with machine name "podcast". I am displaying this webform as a block in the nodes of content type with the machine name 'podcast'.
There is a file field with the machine ...
0
votes
0
answers
38
views
How can I show the "content" menu without the "Access the Content overview page" permission?
On a site, I installed the Media and Microcontent modules. I need to set up two user roles, one which should access only the "Media content overview" page and the other one which should ...
0
votes
0
answers
48
views
Load webform handler to change to_mail
I have a contact form with three handlers, on to send mail to admin, second to sales team and the last one to the one who have filled out the form.
I would like to change the to_mail address ...
0
votes
1
answer
338
views
How do I disable ONLY_FULL_GROUP_BY in MySQL 8?
Is it possible to disable ONLY_FULL_GROUP_BY in MySQL 8?
I saw suggestions on how to do this on the MySQL server directly, as well as hacking up Drupal core, but none of them have been successful so ...
0
votes
1
answer
157
views
How to get a menu link UUID from a menu tree item?
I'm trying to create a select box like the one that allows the selection of a menu parent on the node form. I might be barking up the wrong tree in my approach. I figured if I can get an array of menu ...
0
votes
1
answer
42
views
"Most popular" tags of the day
How can I create a list of the most popular tags of the day, based on the actual date, using view?
The most voted answer for Most popular tags in a list as a block helped me to set a list of the "...
0
votes
0
answers
91
views
How can you update a single configuration entity using drush?
Every now and then, if I try to import partial configs using drush, like
drush config:import --partial --source=stuff/is/here
drush seems to understand that some of these config entities exist in the ...
1
vote
1
answer
106
views
Returning long-running api response as a "download"
I'm working on a REST api endpoint which takes in an array of IDs, loads all of the entities associated with those IDs, does some processing on them, then returns them in a chosen format (csv, xls etc....
0
votes
1
answer
69
views
Computed multiplication
I have a webform where I am using the Twig Computed module to calculate an amount. It is simple and straight forward: I have a field that captures the amount and I'm using Twig to multiply it to find ...
0
votes
2
answers
139
views
Config Export changes to different folder
Is it possible to export only the changed configuration files to a specified folder?
When you run drush cex to see the change list of files like this
+------------+----------------------+-----------+
|...
0
votes
1
answer
104
views
How can I check if an element has a CSS class that matches a value in an array?
In Drupal 9, I'm trying to check if an element has a certain css class using hasClass().
<p{{ attributes }}>Does this element have my css class?</p>
{% if attributes.hasClass('my-css-...
0
votes
1
answer
110
views
How can I programmatically save node components?
There is a site with number of nodes including layout canvas and site studio components available in a node.
When there will be changes in one of the components (new field added with default value), ...
0
votes
1
answer
74
views
Why is <br> changed to <br />?
After I edit a block in Full HTML form CKEditor on Source mode and save, Drupal changes <br> to <br />.
Drupal also seems to me to unify some HTML tags into one line.
This
<p>
<!--...
0
votes
2
answers
116
views
How to set media library widget so that allows only certain dimension images for each field?
I'm trying to find a way to set some image dimension limit for the media library widget.
That will allow me to restrict on which image sizes can be selected based on the fields they are using them.
I ...
0
votes
0
answers
28
views
Why does Drush:migrate not generate config entities for separate content types?
When using Drupal 9 with modules migrate, migrate_drupal, migrate_upgrade and migrate_plus, and calling drush:migrate --configure-only with a Drupal 7 source database
I see migrations at drush ...
0
votes
0
answers
58
views
Check referenced child entity update in Inline Entity Form and change author in parent entity
Can anybody help me how I can check upon entity update (with hook_entity_update or with something else) whether one of the fields of child referenced entity is update and make changes on parent entity?...
0
votes
1
answer
84
views
Creating twig template for rows in a specific view
Hi I have a view with the machine name news_filter. In the html every content type it's fields are inside a .views-row div. I want to create a template for those specific rows and maybe later also for ...
0
votes
0
answers
28
views
How can I get multiple results from the same filter with the REST API?
I am using the Drupal REST API UI module to create filters I can search. I have one for a page type called Category. If I want to search for category 52 I can use api/resources/?category_id=52.
I have ...
1
vote
2
answers
223
views
Custom plugin definition not loading
I'm trying to create my own plugin type in Drupal 9 but it's not finding my test definition and I can't figure out why.
Here's my services.yaml:
services:
plugin.manager.reaction:
class: Drupal\...
0
votes
1
answer
41
views
User error : "2" is an invalid render array key dans Drupal\Core\Render\Element::children()
I face off this message on certains pages, somtimes relate to twig template part, sometimes to other things.
In watchdog:
User error : "2" is an invalid render array key dans Drupal\Core\...
0
votes
1
answer
129
views
Entity print broken when updating to PHP8.1
I've updated my drupal environment php 7.4 to php 8.1.18. i've enable some extensions, but I have this error when i try to download a PDF
Error : Typed property DOMDocument::$documentElement must not ...
0
votes
0
answers
12
views
Field design problem for approval level + assigned user entity reference
Say I have an approval system that needs to assign to users by levels with a limit of 5 levels
(say choose limit as 2 levels, then level 1 => uid 3, level 2 => uid4, that makes it a two level ...
0
votes
1
answer
226
views
Disabling (or overriding) a css file from contrib module's library
I am using admin_toolbar module and I would like to override the path to a logo file that is by default provided by one of this module's CSS file.
I found information that I can achieve this with ...
-1
votes
1
answer
95
views
Grant a permission for the current page load
What is the best way to grant a user permission dynamically for a single page load? In other words, I want Drupal to behave as if the user has a certain permission when it loads the page, depending ...
0
votes
1
answer
79
views
Use specific theme [not template file] for 404 and 403 generated for specific path
I have 2 themes, both enabled, assume they are called my_first_theme (default) and my_second_theme. I have /whatever path and lots of the pages under this path, and I have a theme negotiator, which ...
0
votes
0
answers
20
views
Limitation submisson on webform hide my form
I've created a form with webform and configured the submission limit, however when I test when arriving at the submission limit, the form is hidden : Nothing is displayed, As if there were no form at ...
0
votes
0
answers
53
views
How to configure Page Manager variants based on Domain module?
I've inherited a Drupal 8 website that must be upgraded to Drupal 9.
The site has several subdomains declared, using Domain module.
Some pages are build with Page Manager, having 2 variants based on a ...
0
votes
0
answers
120
views
How do I programmatically attach a file to a webform submission
I'd like to attach a custom file to an email of a webform submission.
That means, I want to add the file as email attachment without an existing webform field (document file) or similar.
My idea was ...
1
vote
1
answer
62
views
Data is not saved on the entity when the source and destination field names are the same but have different types
I'm migrating from Drupal 7 to Drupal 9.
On the source Drupal 7 user entity there is a Text (list) field with various values. These need to be migrated to a taxonomy_term reference field on the Drupal ...