Questions tagged [drupal-9]

Drupal 9 is the Drupal version that was officially released on June 3, 2020. Rather than using this tag, consider posting your question directly on https://drupal.stackexchange.com/.

The key changes in 9.0 are:

  • Deprecated code has been removed.
  • Dependencies have been updated to new major versions as appropriate.
  • Platform requirements (supported PHP and database versions) have been increased.

Compared to Drupal 8.0.0, Drupal 9 is more usable, accessible, inclusive, flexible, and scalable than previous versions.source

  • Drupal 9 is dramatically easier to use for marketers
  • Drupal 9 is easier to maintain and upgrade for developers
  • Drupal is innovating with its headless or decoupled capabilities

Use this tag only if your question relates specifically to this version.

Requirements

  • Web server: Web server: Apache, Nginx, or Microsoft IIS
  • Database server: MySQL or Percona 5.7.8, MariaDB 10.3.7, PostgreSQL 10 with the pg_trgm extension, SQLite 3.26
  • PHP: 7.3 or higher

Note: Drupal 8 and later versions work on any web server with a version of PHP that meets the PHP version requirements. the version requirement for Apache has been increased to Apache 2.4.7 or higher.

Related tags:

Resources

305 questions
1
vote
0 answers

How to display unique nodes for a page?

The scenario is like this: we have a news website, every page display different type of news nodes. We like to set the in this way that, for a single page, no news node should be display more twice. i.e. should not be duplicate. We are creating…
1
vote
1 answer

Drupal 9.2.9 - Conditional field in inline_entity_form (#states) not working

I have entity "parking_lot" with several "pricings", in the "parking_lot" entity form, there is a field "pricings" using the widget inline_entity_form_complex. In the parking_lot form I set conditional fields with the #states API (to display fields…
Jasmin
  • 103
  • 5
1
vote
0 answers

Put filters and sorting to separate blocks into Drupal 9 Views

I am regularly working on Drupal projects where Views lists are involved. The possibility to put filters into a block and place them at a dedicated place into my layout is great but not enough. Indeed, the most part of time, the designers which I am…
1
vote
2 answers

Drupal 9: How to reference a view in a paragraph field type

In my Drupal website, I'm using the paragraphs module to build the pages's main content. One of my paragraph types is called 'News'. This paragraph type contains a field that should reference to a 'recent news items view'. This view is already…
Pieter
  • 117
  • 3
  • 10
1
vote
0 answers

HTTP Basic Auth spontaneously ceases to work on a Drupal 9 site using Rest API

This is an odd problem. I am using REST API to send patch requests from a node server to update user data. The patch requests look like this: const response = fetch(SHARED_CONFIG.cmsBaseURL + 'entity/flagging?_format=json', { method:…
Chris Scott
  • 583
  • 1
  • 7
  • 23
1
vote
0 answers

Drupal 9 disable cache page with query string

I have Drupal 9. I want to disable cache when query string exists. This is my code: function mytheme_preprocess_page(&$variables) { if(isset($_SERVER['QUERY_STRING'])) { if(!empty($_SERVER['QUERY_STRING'])) { …
MarioProject
  • 417
  • 4
  • 25
1
vote
1 answer

Upgrade to Drupal 9 from8 having Twig related error

I recently upgrade drupal to 9 versions via composer. And i am getting following error in drush watchdog:show command Error: Class 'Twig_Function_Function' not found in Drupal\bookmark_field\TwigExtension\BookmarkExtension->getFunctions()
1
vote
1 answer

Can't edit or delete fields from custom content type (Drupal 9)

I'm working on a clean install of Drupal 9. The first thing I did was create a couple of custom content types, and added some fields. But when I try to edit or delete the fields, I get a 404 error: The requested resource…
1
vote
1 answer

Drupal 9.2 Login not working after logout

My site upgraded from Drupal 8.x to Drupal 9.2.4 (PHP 7.4). Once logout then login was not working. No error or warning, just page refresh happened. I checked the cookie compared with my old version, one of the cookies was not set after first login…
kowsalya v
  • 31
  • 5
1
vote
0 answers

Change the folder structure in drupal 9 project

I have created the new project in drupal 9 now my project folder looks like project_name/web. I need to run my project as project_name.I have dpwnloaded my drupal package with composer. How to run the project as project_name. I have tried…
user3386779
  • 6,883
  • 20
  • 66
  • 134
1
vote
1 answer

Drupal 9.2 template_preprocess_image hook not working

I am using drupal 9.2 latest version. For images height and width are setting automatically also loading = 'lazy' this attribute added in every images in website. I tried to unset these attributes using the below hook. function…
kowsalya v
  • 31
  • 5
1
vote
0 answers

How to add custom exception on JSON:API requests?

I'm using Drupal 9, JSON:API module, Domain access module. My task is to throw a custom exception when the request doesn't contain a specific parameter (domain-entity in my case). For example - test-website.com/domain-parameter/jsonapi/some-entity I…
Yaroslav
  • 11
  • 2
1
vote
2 answers

Cannot update Drupal 9 db and locale with Drush 10

I'm using drush locally without any problems, but on my hosting there is an error with locale and db update. I checked so many things and nothing. Strange is that commands like config import/export, sql:dump, drush status works fine, and there is a…
Daimos
  • 1,473
  • 10
  • 28
1
vote
0 answers

How can I get IntelliSense/Intelephense to look inside a Drupal Docker Container?

I am developing a Drupal site using the latest official Drupal/PHP/Apache Docker image. I have some local directories mapped to inside the Drupal container as expected (modules, profiles, sites, themes). When I create a module and try to, for…
Bradley
  • 369
  • 5
  • 11
1
vote
0 answers

Get field translated default values programmatically in Drupal 9

Fields definition in Drupal 9 can be translated: field label, field description and default value(s) can get per-language values. In a hook_form_alter I need to "copy" some existing fields, but with a different language. My process is: // force…
hexasoft
  • 677
  • 3
  • 9