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
-1
votes
0answers
12 views

Entity_print + Dompdf issues an error

I am using Drupal 9.0.5 When I use composer require drupal/entity_print it automatically install dompdf/dompdf in its v0.8.6 version and then entity_print in the 2.2.0 version. I then add a link View ...
0
votes
1answer
12 views

“attempt to write a readonly database” with BrowserTestBase Functional tests

I have a functional test that is currently empty. I run it with the following command; php core/scripts/run-tests.sh --sqlite /db/drupal.sqlite --php /usr/local/bin/php --verbose --directory modules/...
3
votes
0answers
41 views

Require v8 only contrib module with v9 patch

Given I have Drupal 9 composer installation with composer-patches plugin and given a contrib module with a stable v8 release, but no v9 release (not even dev branch) and given that contrib module has ...
1
vote
1answer
37 views

Why do functional tests require a running website?

I'm trying to set up functional tests in Drupal 9 using the BrowserTestBase class. The Type of Tests page on drupal.com and Browser test tutorial are quite clear that browser tests will build their ...
0
votes
1answer
41 views

How to properly program AJAX links?

I have a custom module that uses AJAX. Everything works fine the way it is. I'm just wondering if it's the proper way to do it in Drupal. I'm new to Drupal 8 and 9 programming This is a line from my ...
0
votes
0answers
29 views

Curl error in basic functional test

I'd like to test whether my module's controller functions correctly query and update the DB, so I thought I'd set up a simple functional test using BrowserTestBase. namespace Drupal\Tests\rsvplist\...
0
votes
1answer
36 views

run-tests.sh error: Test class not found

Hi and thanks in advance for your patience - I really appreciate the patience this community has shown me despite my silly questions. I'm using Drupal 9 and have just read this tutorial on unit ...
0
votes
1answer
47 views

Composer killed when installing a module

I am actually running Drupal on a LAMP (XUbuntu 20-04 with 4 GB RAM in VirtualBox) At the beginning of the installation I had no problem with installing dependencies using composer But since yesterday ...
-1
votes
0answers
25 views

“The website encountered an unexpected error. Please try again later” [duplicate]

I get this error on drupal 9, when I tried to install modules. I even removed the module files. But still whenever I click on extend in the manage menu i get the same everytime. What should I do now? ]...
2
votes
1answer
39 views

How do I populate report page using a controller?

I'm following this tutorial on creating a report page for a custom plugin, but note that I'm using Drupal 9, and not Drupal 8 as per the tutorial. I've created a report() method inside my ...
0
votes
1answer
27 views

How to programatically hide node field on viewing?

Using Drupal 9, How do I hide a node field when viewing it? Let's say I have field info. I would like to conditionally not display the label or the value. I assume I use hook_node_view_alter but I'm ...
0
votes
0answers
33 views

How can I add a block to a region?

A similar question was asked for Drupal 7: Add a block to a region using drush. However, as far as I can see, this feature is not available in newer versions of Drupal. Looking at the Drush Extras ...
0
votes
0answers
17 views

Issue with CKeditor

I am building in Drupal 9.0.5 and just discovered that the Styles dropdown menu in the CKEditor is disabled even though I have classes listed. Not sure what's wrong. I've read and read and I'm pretty ...
-2
votes
0answers
55 views

Update problems

I have tried to update drupal 9.0. to 9.0.1 using the following command composer require drupal/core:9.0.5 --update-with-dependencies Problem 1 - drupal/core-recommended 9.0.0 requires drupal/...
0
votes
0answers
26 views

How can I use the grouped nid in a views template with two content types?

In Drupal 8.9x, I have a view with two content types in it: Each business (and its details are grouped), and underneath each business I'm displaying multiple offers by that business...and then I want ...
0
votes
0answers
15 views

How do I display media in a colorbox?

The colorbox module functionality is now part of Drupal core media module, that is what i read in the colorbox project page. However, I can't find documentation or guidelines how that actually works. ...
0
votes
1answer
25 views

How do I programmatically add a link when viewing a node?

I'm using Drupal 9 and have a custom module. I'm new to Drupal 9 module programming. When I display a node, I want to add a link before and after the node content. These links will eventually use AJAX ...
-1
votes
0answers
32 views

How to display a “manage form display” in a page views?

How to display a "manage form display" in a page views ? I have stores and groups on my site. I want to create a page with only part of the stores and groups form. How to do this ? In a ...
0
votes
1answer
41 views

How do I render search block form in theme template?

I've customized the search block in "block--search-form-block.html.twig" and it works using block layout on Drupal 9. Is it possible to render the Search Block directly in page.html.twig? I'...
-2
votes
1answer
39 views

Is there a working example of programmatically creating a webform? [closed]

Is there a working example of programmatically creating a webform? I just need to see what works. The smallest excerpt will be helping out a lot. I can build on a foundation.
-2
votes
0answers
57 views

Fatal error after upgrade

I am trying to upgrade a Drupal 8.9.3 multi-site installation to 9.0.3 using composer. Here are the steps that I took to do so: I wrote a script that adjusts the file permissions on the remote host ...
0
votes
0answers
36 views

I cannot make the paragraph preprocess work at all

I have a Barrio-based subtheme and I am rewriting from scratch an old Drupal 7 site to be moved to Drupal 9 (my first Drupal 9 site). All pages in the new site is built by different paragraphs and ...
0
votes
1answer
35 views

How do I migrate translated content?

I'm working on migration from an old Drupal 8 site to new Drupal 9 site: I developed a source plugin to get data from D8 database: My migration works, but it doesn’t migrate all my contents and get ...
0
votes
0answers
26 views

How to add the Group Role as body class in the page template

I like to add the Group Role of the currently logged in user to the body class of the page twig template. So this is not the same as the user roles the user account has. Currently using Drupal 9.0.3. ...
-2
votes
1answer
41 views

Since upgrading from 8.9.2 to 9.0.3 I cannot install custom modules

In Drupal 8.x I experimented with some modules and custom blocks, but whatever I do after upgrading to 9.0.3, the modules don't show up in the Extend menu. In the .info.yml file I changed the core: 8....
1
vote
1answer
33 views

How to make node edit form meta panel accordions default to closed?

When editing a node the meta panel fieldset accordions default to being open if they contain data. I understand why this has been done, but I think it makes for a very noisy and potentially confusing ...
11
votes
1answer
285 views

Should I use Drush or Drupal Console with a new site?

Between Drush and Drupal Console, which seems to have similar functionalities, which one should I install?
2
votes
1answer
52 views

What is the recommended way for using PHPUnit?

Installing Drupal 9 with the drupal/recommended-project Composer package ships without PHPUnit. Why? (In Drupal 8 it is included. The documentation only tells about Drupal 8.) Which version of PHPUnit ...
0
votes
1answer
33 views

User edit form on custom page is resetting roles when user belongs to the “Administrator role”

I'm trying to display the user edit form on a custom page with limited fields. Submitting my form works well, but if I have the Administrator role, roles are reset. I don't understand why this is ...
0
votes
1answer
31 views

doctrine/reflection conflicts with doctrine/common

My current Drupal version is 8.9.3, running on PHP 7.3.20, and updated from Drupal 8.9.2 (fresh install) using compose update. I tried to upgrade to Drupal 9 used this https://www.drupal.org/docs/...
0
votes
0answers
52 views

How do I add CSS classes to an image field?

My goal: I'm learning drupal. I'm creating bootstrap carousel myself. Without any plugins or themes. I use default classy theme. So far what I have done. Administration -> Configuration -> ...
0
votes
1answer
25 views

How to create block to list all children of an entity?

I want to list all the nodes that have the currently viewed node as their parent. To make this more tangible and less abstract, let's do an example: I have a content type Locations which has an ...
0
votes
1answer
32 views

why my custom jquery code stopped working on a multipage webform after upgrade to WF x6

I have a long questionnaire as multi-page webform and I do many mostly simple counting and addclass using jquery done via a custom module I made for the purpose. This was perfectly working before on ...
0
votes
0answers
40 views

How to subscribe to the “order placed” “order paid” event?

I created a module for generating a license and recording it in the user field, I want to create an event, it should be triggered when the user has completed a purchase (bought an item or paid for an ...
1
vote
1answer
55 views

How do I replace drush_set_error()?

Just updating a module for Drupal 9 and Drush 10 and drush_set_error() no longer appears as a function in the Drush code (as far as I can see). What should I be using instead?
0
votes
1answer
53 views

How to save an image resource

I have brought an image in from an API and cropped it using imagecrop in a custom module. I now have an image resource. But I cannot figure out how to turn the resource into a file I can save in ...
-2
votes
1answer
57 views

Show node summary (teaser) as tooltip/ Alt/ Title text on hover over nodes titles on front page with Views

I have a custom front page view showing nodes titles only without teasers. I want to have the teaser of each node show when hovering over any title. Something like: <a href="{{ url }}" ...
0
votes
0answers
11 views

Entity where member variable is different type than when serialized

Not entirely sure how to phrase this. I've got a config entity that needs to store a block id. In my config I have the mapping set to a string for the id. When I load the entity, I'd think it would be ...
2
votes
0answers
75 views

What is the design pattern for plugins (and their managers) called?

I am trying to figure out how to design (and subsequently implement) as plugin-like solution in Symfony. I found this article https://drupalize.me/tutorial/what-are-plugins?p=2766 that says: Plugins ...
0
votes
0answers
301 views

Why am I getting an error that kint is an unknown function?

Why am I getting an error that kint is an unknown function? When I use kint in my twig template, I get the following error: The website encountered an unexpected error. Please try again later. Twig\...
0
votes
0answers
40 views

How to create a term reference field programmatically

I need to add a taxonomy reference field to a node bundle, programmatically. I found a couple examples here, but one actually is incorrectly titled and is about creating a from field for it, and the ...
0
votes
1answer
12 views

REST API OAuth Authorization and Authentication

I am very much confused about the way OAuth authorization and authentication works in Drupal 8/9. Let me put my points first, please correct me if I am wrong. Authorization is when an entity proves a ...
0
votes
1answer
53 views

Why is this if statement not working in twig?

It's a bidirectional D9 site where I removed dir=rtl from my theme's html.html.twig with an if statement and it's working fine. I did that to avoid an MS browsers bug ignoring position: sticky in css ...
1
vote
1answer
37 views

array_flip() error when using phpunit

I've got a form, which when I use normally works perfectly fine, but when I load the form in phpunit I get the following error : Drupal\digest\tests\DigestSubscriptionFormTest::testFormDisplay ...
1
vote
1answer
24 views

How to change the value of a user field through Restfull?

I can’t change the value of field_motherid field through restfall. GET running, PUT disabled, PATCH enabled and configured. When I do GET there is no user field.
0
votes
1answer
80 views

How do I upgrade the PHP version used?

I've been away from Drupal a few years. I now want to develop a site. I see it's up to version 9. However, when I tried to install Drupal 9 in DevDesktop to get a feel for it, I got the message PHP ...
0
votes
2answers
57 views

Categorized view for an entity reference content

I am trying to implement a Magazine in Drupal 9. I am confused about whether to use taxonomy term or content type since the data I want to handle is used for both categorizations and storing of ...
1
vote
1answer
36 views

How do I fetch versions of a module compatible with latest core version?

I've been using the endpoint https://updates.drupal.org/release-history/[module]/[version], where [module] is the module name and [version] is its version (as 8.x or 7.x). This endpoint, however, ...
0
votes
0answers
31 views

How to specify a patch for dependencies inside a module's composer file?

I would like to know how to specify a patch inside a module's composer file. The scenario is like this: On my Drupal 9 site, I want to run the command composer require module. The module composer ...
2
votes
1answer
91 views

How can I manually upgrade my site?

I have updated my core to 8.9.0, all modules are Drupal 9 compatible and now I want to upgrade to Drupal 9.0.0. I always did my updates completely manually via FTP/web (swap core/vendor/root files, no ...