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
9 views

drupal 9: editing media for content editor results in a 404

We have a custom access role location_editor, who can only manage media and one content type. This are his media related rights (all of them): And if the user now tries to enter any valid media edit ...
0
votes
0answers
15 views

Developing for Drupal9 on windows

I try do develop modules in Drupal9 using VSCode on Windows and Drupal 9 in a Docker Container (For that pupose, I am using the Docker for Drupal project) on the Window side I get in my VSCode ...
1
vote
0answers
24 views

If I am using PrivateTempStoreFactory, should I be using the Internal Page Cache Module?

I found a Stack Exchange question here that kind of answers this question, but I was not clear about the answer from the exchange in the comments. Regardless of the reason I am using ...
0
votes
1answer
12 views

Template preprocess to generate Font Awesome markup for menu links

In Drupal 9, I need the ability to prepend Font Awesome icons to menu links. I have attached Font Awesome 5 JS and CSS assets to my theme via *.libraries.yml. If I open a menu link in the DOM ...
0
votes
1answer
45 views

Insert PHP snippets in content

Drupal 9 doesn't have the PHP Filter module in core. I need to insert PHP snippets in the content editor (for example a Twig variable). Is there any way to insert PHP snippets in Drupal content?
0
votes
1answer
38 views

Pass a value via URL to a node edit form and use it to redirect after saving the node

I have a node that includes a series of embedded views. When displaying, I have to pass a value via URL arguments (http://example.org/node/x?id=y), so that the views can get the appropriate ...
0
votes
1answer
72 views

FieldItemList::getValue always returns a string, even for a Boolean field

Supposed I added a custom Boolean field, whose cardinality is 1, to a content type. I create a node of that content type, enter a value for that field (for example, TRUE), and save the node. When I ...
1
vote
0answers
30 views

How to get access to a $form in hook_entity_view_display_alter?

In Drupal 9, I added a views_add_to_cart_form view mode to be able to render a product entity with only the Variations field formatted as add to cart form being displayed. That all works as expected, ...
1
vote
0answers
26 views

Programmatically add a taxonomy field to a custom content type

I'm familiar with adding fields to a custom content type in the yaml files of the module. I'm unable to find an example of how to add taxonomy fields to a content type at programmatically at install. ...
-2
votes
0answers
14 views

Exposed form conditional fields

In exposed filter criteria, I'm trying to make a certain exposed form appear only if a value from another exposed form is selected. Is this possible to do in JavaScript? I do not see any working ...
0
votes
0answers
27 views

Pass parameters from block to a JSON endpoint using taxonomy term from URL

I've been searching for a solution to being able to pass a taxonomy term on a views block that is on a given page using the term name that is in the URL. I agree with my team that it would be a best ...
0
votes
1answer
31 views

How to translate content but not backend interface?

I'm trying to set up an English administrator back-end and a URL based front-end (anonymous user content) translation. I follow a guide on the subject, but I haven't been able to achieve what I wanted....
0
votes
0answers
26 views

How do I fix the error I get when installing a site using Docker?

I need to install a Drupal 9 site using Docker and Docker-based Drupal stack. I installed the Docker engine and Docker Composer. I installed Drupal following https://www.youtube.com/watch?v=...
0
votes
0answers
26 views

Set set cache-control no store for user/login page [closed]

I'm trying to set cache-control headers to NO-STORE on a D9 site for the user/login page. I've tried the http_cache_control module but it doesn't give the granular control I need. I've also tried ...
1
vote
1answer
35 views

Fatal error: Cannot redeclare Drupal\views\Routing\ViewPageController::getTitle()

I have updated Drupal 9.0.1 to 9.2.2 via Composer. After updating, I am getting a fatal error. Fatal error: Cannot redeclare Drupal\views\Routing\ViewPageController::getTitle() in /var/www/html/...
0
votes
0answers
50 views

How do I connect to a database while building a custom module? [closed]

I am trying to connect to a MySQL database to get fields for analytics and D3.js visualizations. My code worked in Drupal 8, but as I switched to Drupal 9, it stopped working. I have found that the ...
0
votes
0answers
8 views

Views Jump Menu containing only sibling taxonomy terms

I'm using Views Jump Menu with Drupal 9. Nodes are tagged with a software_version hierarchical taxonomy, following this pattern: ├── foo │   ├── 0.1.0 │   └── 0.2.0 ├── bar │   ├── 0.3.0 │   ├── 0.3.1 ...
0
votes
0answers
45 views

Create cache context for anonymous users based on ip range

I have a form within a custom block that is displayed on the front page of a Drupal 9 site on Acquia Cloud. I want to be able to have different displays for users coming from certain ip ranges. Is ...
0
votes
0answers
10 views

Feeds: Import JSON nested fields

I am using feeds and feeds_ex modules, and JSON Path parser to import data from the endpoint. Here is imported data: { "products": [ { "id": 103839858696, &...
0
votes
1answer
16 views

Node url alias pattern based on taxonomy not working properly

I have taxonomy named Category with two terms: News and Articles. Articles term has custom url alias - /useful. The website was upgaded from D7 to D9. On old D7 version node url pattern was [node:...
0
votes
0answers
8 views

How to import content with multiple taxonomy terms with translations?

I have a CSV file like this. id,Title,body,tags,dutch title,dutch body,dutch tags 1,Content1,Description,tag1;tag2,Dutch Content1,Dutch Description,dutch tag1;dutch tag2 I have the migration file for ...
0
votes
0answers
16 views

How to change the display order of webform elements (conditional logic)?

How to change order (weight) of webform elements in conditional logic based on the visibility of other elements? My webform example, six fields: Open field A? (Checkbox yes/no) Field A is hidden (...
0
votes
0answers
27 views

I'm not able to fully disable caching during development

I'm currently developing a new Drupal 9 website. I build quite a few custom modules for this but for some reason the changes I make in the modules during development are not visible immediately. I ...
1
vote
1answer
42 views

How to add a secondary Ajax submit to a regular node form?

I'm trying to add an Ajax submit to a regular node edit form (Drupal 9). I'm using Field Groups so that there's a series of tabs, and I've added a pair of "buttons" (Right now they're just ...
-4
votes
1answer
38 views

Why does a query string return a 404 error? [closed]

I recently upgraded from Drupal 8 to Drupal 9 and noticed a problem that occurs when the URL has a query string. For example for the following URL Drupal throws a 404 page not found. https://example....
0
votes
1answer
53 views

Using Twig in global custom text to check for a specific content type

I am filtering for two content types to display in a view: Artwork Page and Cover Page. I want to change the HTML markup for Cover Page. I have researched and tried many field names for Content Type, ...
1
vote
1answer
25 views

How can I delete a file served by a custom controller after it has been downloaded?

Starting from How do I create a file download URL? I've build a custom controller that allows users to download a PDF file. my_module.routing.yml my_module.pdf_link: path: '/my-module/pdf/download' ...
1
vote
0answers
11 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 ...
-4
votes
0answers
66 views

How do I create an Olivero sub-theme? [closed]

I have a Drupal 9.3 site where I installed the Olivero experimental theme. I need to do some modification in the CSS. How do I create an Olivero sub-theme?
-1
votes
0answers
28 views

How should I read reverse-entity-relationship fields?

I have a comment type (Default comments) and a content type (Level3). The comment type has the Author, Comment, and Attachment fields. The content type has the level2_title, level2_attachment, and ...
2
votes
1answer
36 views

How to verify if a custom logo is used?

How can I check whether the site is using the default theme logo or a custom logo? When I use the Twig debug tools to dump the site_logo variable, I only get the path of the logo, which doesn't tell ...
0
votes
0answers
28 views

How can I select multiple rows from a table and let the submission handler know which rows have been selected?

In a custom module, I have a form showing a table with multiple rows, as in the screenshot. Once users select one or more rows, and they click on the Delete button, rows in the database should be ...
-1
votes
1answer
26 views

Configuration synchronization page throwing 504 timeout error

This issue is happening on every level above my vagrant local box. It's a brand new website and a few days back I had to copy my database from local to staging environment. Once done, I ran drush -cim ...
0
votes
1answer
22 views

How do you set the file extension while uploading images through file_save_data?

I am trying to create a product with a product image on drupal using API. I have created a custom module for the same under which following code to upload my image to the Drupal: $path = base64_decode(...
3
votes
1answer
153 views

Can we add custom CSS class in \Drupal::messenger()->addStatus()?

I did some research regarding adding custom CSS classes in the message but could not find the actual solution. As per Drupal 9 documentation: \Drupal::messenger()->addMessage(t($message)); public ...
0
votes
0answers
17 views

Subsequent migrations take long time to being importing data to destination

I've got a pretty large migration set of roughly 200k users. The first time I run the migration (via drush), or after rolling it back and starting again, the rollback+import starts immediately. By ...
1
vote
0answers
22 views

Get the breadcrumb inside my node template [duplicate]

How can I move my breadcrumb from my page.html.twig into my node--content-type.html.twig ? In my page template, I display the breadcrumb like this : <div id="main-wrapper" class="...
1
vote
1answer
33 views

How to make a vertical menu properly?

Good morning all, Today I would like to ask a simple question about the menus. How do you make a clean sidebar that takes up the entire length of the page? In general, the themes offer only natively ...
0
votes
1answer
45 views

Jquery to move field above the table - changes during page refresh

I have the below jquery code to move a multiselect field and a button above the table. jQuery(document).ready(function($){ $('#views-form-resources-block-1 .form-item-ka-types').insertBefore($('#...
1
vote
1answer
73 views

How can I customize the 403 page for specific routes?

On a D9 site, with an existing custom 403 page twig. I've been requested to show a different, variable, message from the "standard one" for a couple of specific routes. I've tried with ...
3
votes
0answers
18 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
41 views

Unable to delete a tempstore that contains an en dash or an em dash

I am trying to delete a shared temporary storage for a key containing an en dash or an em dash. $keyword = '2020–2021'; $tempstore = \Drupal::service('tempstore.shared')->get('my_module_name'); $...
0
votes
0answers
86 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
0answers
31 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?
0
votes
1answer
21 views

How can I return a 404 error when the contextual filter value is provided in the URL, but the view returns no result?

I'm on building a rest view of nodes using Serializer as formatter. This view has a contextual filter on a plain-text field of that content type. How can I return a 404 error when the contextual ...
1
vote
0answers
14 views

?page=n conficts with the Infinite Scroll Views module

I have one main view with pager where I actually using ?page=n (which can't be changed in my case) to navigate on the main view using the Pagerer module without AJAX. Underneath (with AJAX) I got ...
0
votes
0answers
61 views

Different installs on localhost load the latest site

I have a single Drupal 9 site along with three Drupal 8.9 sites installed on my localhost running MAMP. All these sites I installed with Composer. Whenever I go to any of the sites in a browser, the ...
0
votes
0answers
56 views

How do I add colorbox-load classes and attributes to links that come from an svg image?

I have SVG images that are added to nodes via svg_image_field module. They have internal links in them /load-parts-ajax/{nid}. The path leads to a pop-up page view of content with this path /load-...
1
vote
1answer
18 views

Entity Browser Modal closes on Exposed Filter Submit Button

I've set up a commerce shop that uses Entity Browser to select product images. I set up a view to display the selectable images which has an exposed filter for the filename, so the user can search for ...
1
vote
1answer
39 views

Programmatically publish unpublished nodes

I want to publish unpublished nodes in a custom action. To do this, I query the database on a specific condition and want to use 'exists' condition to find the node IDs to publish. This is the code I ...

1
2 3 4 5
9