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
-2 votes
0 answers
9 views

jQuery CDN misssing

I have a drupal 9 latest updated website When I render my content I can see bootstrap <script> tag as below src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js" ...
0 votes
2 answers
18 views

Change the "add entity" page title on a custom content entity type using alterRoutes()?

I created a custom content entity type dog using drush generate entity:content. When I go to www.example.com/dog/add, the page title (the one in the <title> tag, not the <h1> tag) is "...
0 votes
2 answers
16 views

How to set the text format in BaseFieldDefinition::create()?

I'm creating a base field (text_long) on a content entity and I want to limit it the Plain text text format for all users at all times. I know I can use the Allowed Formats module to limit the options,...
2 votes
1 answer
51 views

How to add additional drupalSettings to all pages with an event subscriber

I need to set the user timezone on all pages in the JS drupalSettings object, so that it can be accessed on any page. As drupalSettings.user is provided by core, I want to set drupalSettings.user....
  • 15.3k
0 votes
0 answers
13 views

Combining line items in cart

I am trying to "hide" individual line item values on my shopping cart. Is there a way to combine line items (possibly based on a term applied to each) such that they show as 1 item with the ...
  • 927
-3 votes
1 answer
22 views

Moving an existing site to a new server with a new directory architecture [closed]

I'm moving an existing Drupal 9 site from RHEL 7 to a new RHEL 8 server. On the new server, I did a clean composer install of Drupal which created a 'web' directory I didn't have before. I copied ...
  • 79
0 votes
0 answers
10 views

Cannot set properties of null (setting 'innerHTML') error for anonymous users when loading iframe

I have a custom module that is displaying a twig template with an iframe inside it: There is JS file also being loaded and when I load the page while I'm logged in as an admin, the iframe shows up ...
0 votes
0 answers
21 views

Error: Cannot create references to/from string offsets in Drupal\Component\Utility\NestedArray::setValue() [closed]

I am having trouble creating custom fields in the Drupal form state (conditional-form-fields). If anyone has solved this issue, please let me know as soon as possible. The following error occurs while ...
1 vote
1 answer
22 views

How can I have "minimum-stability": "stable" in my composer.json and install alpha version of a contrib module?

Trying to update Drupal core to 9.4.7 with composer update "drupal/core-*" --with-all-dependencies, I got 9.5.0-beta1 version. Digging a little in Drupal Answers, I found 'Update installs a ...
  • 982
0 votes
0 answers
48 views

Symfony Routing Error

My site has completely gone blank after updating modules with Composer. This is the error I get. I've found some similar errors in a topic from the past, but they are all about earlier version of php ...
0 votes
1 answer
17 views

RuntimeException when updating from command line

I went to my website's directory and ran: composer update [RuntimeException] Could not delete /home/example/public_html/example.com/web/sites/default/default.services.yml: ls -la output: -rw-rw-r-- ...
  • 1
-3 votes
0 answers
13 views

How can I create form with ajax validation and ajax callback?

I have a problem with the form, it was working as expected before, but we want to add css styling, when some required elements aren't filled and it makes the form add this css from ajaxCallback ...
1 vote
0 answers
18 views

List down only entities which share the same field value as another

I'd like to have a View of entities (e.g. nodes) that only "show duplicates", i.e. show entities that have a specific field having a value that's also used by two or more entities. To put it ...
  • 1,144
0 votes
0 answers
12 views

Only show other members with the same taxonomy term selected

On my site I have a "member" content type which has a field of field_member_pos that's a taxonomy reference field that allows you to select 1 or both options. This taxonomy term only has 2 ...
-3 votes
0 answers
36 views

When people install a new website with Olivero some empty space can be seen [duplicate]

When people install a new website with Olivero some empty space can be seen. I have marked the empty space in Red (this is from a fresh Drush install of Drupal 9 with Olivero as default general theme)....
  • 1
0 votes
0 answers
33 views

How to use striptags twig function in a commerce product template?

For a client I need a wysiwyg field on my nodes and commerce products so they can add <em> and <span>&nbsp;</span> tags in their titles. I display this title_nbsp field value in ...
  • 722
-2 votes
0 answers
16 views

Sorting on view by sub-term weight

I wanted to start asking this question, clarifying that I'm pretty new on drupal and maybe getting some concepts wrong. I have a vocabulary of products and categories ordered like this. Category 1 ...
0 votes
0 answers
20 views

How do I create a condition to test if the value of a field is unchanged?

In Drupal 7 Rules I could create a condition "Data Value is Empty" and could drill down in the data selector to node-unchanged.field_to_test. However in Drupal 9 Rules when I create a ...
  • 1
1 vote
1 answer
35 views

Replacement for hook_user_presave() for saving values captured in the user form to the user profile

I am porting a module from Drupal 7 to Drupal 9. The code uses hook_user_presave() to save two fields on the fly into the user profile data. /** * Implements hook_user_presave(). */ function ...
  • 848
0 votes
0 answers
52 views

Lando runtime exception during installation

I keep getting the same error when trying to install Drupal locally on my Windows 10 Pro machine with Lando. Steps to reproduce: Install lando.exe on Windows 10 Pro, including bundled Docker Download ...
-2 votes
0 answers
30 views

How to put the result that return function form the .module file to the method of the class that is in the file of the src folder? [closed]

In my module file custom/entity_product_admin/entity_product_admin.module there is a function: function _entity_product_admin_get_product_min_price($custom_product_id) { // code } Which returns an ...
  • 1
0 votes
1 answer
32 views

Printing the node title instead of the file name from a field

I have a block view, which is an unformatted list which prints my content type. All content has a field_file which I access using views-view--download--field-file.html.twig. This prints a file link ...
-1 votes
0 answers
28 views

How can I install a npm package? [closed]

I want to use ntp-client on my Drupal site. What is the proper workflow to install and maintain this or other npm packages under Drupal?
  • 406
0 votes
1 answer
35 views

Why does the site redirect from https to http when I do some modification?

Browsing through my site is working fine, but when I do some modification on my Drupal site, it goes to http instead of https, which gives "Connection timeout". The Drupal site depend on ...
0 votes
1 answer
19 views

How do I make the default content View filterable by multiple content types?

Below is a clip from the content list admin page in Drupal 9, showing the Content type field drop-list, allowing admin users to filter the content list by content type. Is there any way to alter this ...
  • 3
-3 votes
0 answers
47 views

html to drupal conversion [closed]

Someone might say that my question is too broad or out of scope, but please read my post carefully and try to understand what I am asking. I want to convert an html template to drupal. There are ...
  • 435
-4 votes
0 answers
24 views

jQuery modules are missing [closed]

Probably by mistake I have deleted jQuery modules. vendor/bin/drush updatedb [error] (Currently using Missing or invalid modules The following modules are marked as installed in the core.extension ...
0 votes
0 answers
24 views

How can I set the visibility for the user registration form custom fields? [closed]

I am new to Drupal. I have created new two custom fields via the admin panel in the user registration form. For example, I want to show only the "DOB" field should be visible only on the ...
  • 1
0 votes
0 answers
15 views

Filter by two fields in a paragraph

I’m trying to add an exposed filter to a content type, containing a paragraph than can have multiple entries. This paragraph contains two taxonomy fields with hierarchy. And I’ve got a view with ...
0 votes
1 answer
16 views

How to remove or hide the Subject field for comments?

I have added a comment field to a content type. It is of the default comment type. I don't want my commenters to fill in a subject, rather, just a comment body. Trying to remove the Subject field, I ...
-5 votes
0 answers
32 views

How to remove Olivero empty area? [closed]

If you install Drupal 9 with Olivero and check the website from desktop display, you may see the following empty area in the rightmost or leftmost part of the window. I want to remove that empty area ...
1 vote
0 answers
24 views

How do I recreate Ubercart's product attributes?

While rebuilding an old D7 site with Ubercart into a new D9/Commerce installation, among other problems, I stumbled upon this one. In Ubercart I can add as many product attributes as I want and make ...
  • 11
0 votes
0 answers
72 views

I've just installed drush and am getting this error. What to do?

So I've just installed drush 11.2.0 with Drupal 9.4.6 and the first time I executed drush si, I got PHP Fatal error: Declaration of Drush\Application::setLogger(Psr\Log\LoggerInterface $logger) must ...
  • 547
-2 votes
0 answers
18 views

Adding HTML to page via module

I'm trying to inject some HTML into my DOM when I have my custom module enabled, because I'm want to add a block of HTML so that I can use it for popups controlled via javascript at a later point I'm ...
-1 votes
0 answers
53 views

How to layout blocks?

How to layout blocks? How to split a block into two or more sub-regions (sub-layouts) responsively, without involving any CSS coding by the end-user? We would get, for example: |-| |-| Or |-| |-| |-...
1 vote
0 answers
19 views

Facets not working with Algolia search

I am implementing Algolia search and using the following contributed modules Search API Algolia Facets After configuring the modules, the content/data indexing is working fine and is reflecting on ...
-1 votes
1 answer
22 views

How to create a view of the most popular nodes?

How to create a view of the most popular nodes? I went through the filter criteria looking for something such as "most read" or "most visited" or "most popular" but I ...
-1 votes
1 answer
22 views

How to install a theme with the command line?

I am trying to install the theme Adaptivetheme. I have tried this composer require drupal/adaptivetheme and then: vendor/bin/drush theme:enable adaptivetheme But I got: Unknown themes: ...
0 votes
1 answer
26 views

Preprocessing twig templates

I currently have two templates, one of which is page.html.twig, which is the main page and I can preprocess with MYTHEME_preprocess_page(). MYTHEME_preprocess_page() affects all the other pages in ...
0 votes
0 answers
17 views

How do I include a list of nodes in Webform, with multiple fields per node / views row?

In a Drupal 7 project, I had used the webform_view (https://www.drupal.org/project/webform_view) module to list a number of nodes in a webform with a "quantity" and "size" field ...
0 votes
0 answers
21 views

Why is the view page reloading when clicking on the exposed filter value after adding such jquery code?

I had a problem, with two view filters (VERF selector) from the Views Entity Reference Filter module, when selecting any value, reload the page while Use AJAX is enabled. It turned out that the reason ...
0 votes
1 answer
40 views

How can I compare two fields in a filter?

Since Drupal 9 no longer has the Globals: Fields Comparison option (as Drupal 7 did) in the view's filter section, how can I compare two fields?
-1 votes
0 answers
32 views

Why do VERF filters reload the View page when a certain value is selected?

I have a View, Use Ajax is checked in the settings. It has 5 exposed filters. VERF filters that are provided using the Views Entity Reference Filter module reload the View page when selecting some ...
0 votes
0 answers
33 views

Programmatically add values in a select field: issues when submitting

I'm inserting some options in the #options element of the select render array: foreach ($files['files'] as $file) { $form['field_session_row']['widget'][0]['subform'][$field_name]['widget']['#...
0 votes
0 answers
13 views

Devel Debug Log produces empty messages

Drupal 9.4.5, Devel 4.1.5, Devel Debug Log 8.x-1.1 ddl function produces empty messages (they only have timestamp and id in the DB and at /admin/reports/debug. Other methods work correctly. Am I ...
  • 91
2 votes
0 answers
20 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....
1 vote
1 answer
19 views

How do I display user signatures in comments?

Drupal 7 has a "personalization" section on ...admin/config/people/accounts If this exists in Drupal 9, I'd love to know where it is. The goal: enable signatures for user accounts. If it's ...
  • 133
0 votes
0 answers
42 views

Why does the view page reload when the button is clicked even after the RefreshView has been added?

Problem: The View page is reloaded when clicking on the buttons even after adding RefreshView: (function($, Drupal) { Drupal.behaviors.switchContentViewMode = { attach: function attach(context) ...
0 votes
0 answers
19 views

Migration upgrade_commerce1_order. Field stuck, don't update the config

I'm stuck on a problem with the migration from my website D7-D9. What happens is that i want delete a 'field' from upgrade_commerce1_order.yml because i don't need this. The problem is that the ...
  • 1
0 votes
1 answer
56 views

Alter DrupalDateTime Timezone To Correct the Timezone

I have a situation where I need to conditionally correct the default timezone defined in a drupalDatetime object. But I'm clearly not understanding how to do it properly. Example: use Drupal\Core\...

1
2 3 4 5
29