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
0 answers
24 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 ...
user avatar
0 votes
1 answer
99 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 ...
user avatar
  • 169
1 vote
1 answer
365 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'...
user avatar
  • 985
-2 votes
1 answer
48 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.
user avatar
0 votes
0 answers
83 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 ...
user avatar
  • 27
0 votes
1 answer
339 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 ...
user avatar
  • 6,567
0 votes
0 answers
37 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. ...
user avatar
  • 566
-2 votes
1 answer
49 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....
user avatar
1 vote
1 answer
59 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 ...
user avatar
  • 1,017
11 votes
1 answer
522 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?
user avatar
2 votes
1 answer
823 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 ...
user avatar
0 votes
1 answer
61 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 ...
user avatar
0 votes
1 answer
598 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/...
user avatar
  • 1
0 votes
1 answer
59 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 ...
user avatar
  • 164
0 votes
1 answer
42 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 ...
user avatar
  • 49
4 votes
1 answer
390 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?
user avatar
  • 178
0 votes
1 answer
404 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 ...
user avatar
  • 120
-2 votes
1 answer
120 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 }}" ...
user avatar
  • 49
1 vote
0 answers
127 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 ...
user avatar
0 votes
0 answers
1k 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\...
user avatar
  • 120
0 votes
0 answers
122 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 ...
user avatar
0 votes
1 answer
269 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 ...
user avatar
  • 109
0 votes
1 answer
338 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 ...
user avatar
  • 49
1 vote
1 answer
87 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 ...
user avatar
  • 195
2 votes
4 answers
4k views

How do I fix the The service "sanitize.userfields.commands" has a dependency on a non-existent service "entity.manager" error?

I am running Drush the first time in a Drupal 9 site. I get the following error. In CheckExceptionOnInvalidReferenceBehaviorPass.php line 86: The service "sanitize.userfields.commands" has ...
user avatar
0 votes
1 answer
41 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.
user avatar
0 votes
1 answer
420 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 ...
user avatar
  • 73
0 votes
2 answers
86 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 ...
user avatar
  • 109
2 votes
1 answer
45 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, ...
user avatar
  • 329
0 votes
0 answers
65 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 ...
user avatar
  • 101
2 votes
1 answer
835 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 ...
user avatar
  • 160
0 votes
1 answer
762 views

How do I install without having these errors? [closed]

So far, Drupal Commerce is the best module for e-commerce on Drupal. But now Drupal 9.0.0 was released, and when I want to install Drupal Commerce on Drupal 9, both way is out of luck. Both way I ...
user avatar
0 votes
1 answer
296 views

How to update MariaDB?

I was following Set up Demo Site for Theming Practice; then, I realized that, since Drupal 9 is out, by default Drupal 9 is installed instead of Drupa 8.x is installed when running composer create-...
user avatar
0 votes
1 answer
247 views

The "Modules" page doesn't load

I am running a setup on Ubuntu and WSL (Windows Subsystem for Linux) with Nginx and PHP7.4. Drupal 8 and Drupal 9 fresh installations load every page with no problem, except the page on /admin/...
user avatar
1 vote
0 answers
126 views

Patch gets not applied to Drupal locally in DDEV built with Composer from the Drupal Git repo

I try to build a local workflow to be able to review patches for core. I am using DDEV for the local environment. Steps I have taken: git clone https://git.drupalcode.org/project/drupal.git . ddev ...
user avatar
  • 111
-3 votes
1 answer
783 views

How to get a list of entity types the Drupal 9 way?

I need to get a list of all entity types. EntityManager is deprecated. In Drupal 9 EntityTypeRepository should be used, though I don't see any reference to its being used. How would I use this ...
user avatar
0 votes
1 answer
408 views

Deprecated code cleanup: Updating EntityManager to EntityFieldManagerInterface

EntityManager is deprecated so I am trying to update code for Drupal 9. The documentation says it should usually be changed to EntityTypeManager, but in this case the code is using ...
user avatar
1 vote
1 answer
42 views

How can I find out if the present theme version would work

In the last years I've used pixture reloaded, a subtheme to adaptive theme, on some drupal sites and I was wondering whether this will work on Drupal 9. I've seen that the Adaptive theme homepage has ...
user avatar
  • 23
-4 votes
2 answers
322 views

How can I get a list of all my site's module and themes? [closed]

I want to get the list of current modules and themes and modify them on Drupal 9, previously in Drupal 8,7 I used the following functions to get and save them but it seems they are depricated on ...
user avatar
  • 20.8k
0 votes
2 answers
199 views

Tokens in menu link and title

menu_token module is working fine to achieve the purpose. Does the module token_filter has this functionality? I can use tokens in wysiwyg using token_filter but cannot make it working for menu title ...
user avatar
12 votes
2 answers
5k views

Command to install Drupal 9 with Composer

The latest version of Drupal 8 can be installed via Composer with the following command: composer create-project drupal/recommended-project mynewproject What is the equivalent command to install the ...
user avatar
8 votes
2 answers
855 views

Set SameSite=strict for session cookies

I'm trying to figure out how to set the SameSite cookie attribute for Drupal 8 session cookies, but I can't find a solution. I thought SessionConfiguration might give me enough options, but it seems ...
user avatar
4 votes
1 answer
161 views

Drupal 8's last minor release = Drupal 9?

I have read about the planned release date of Drupal 9 is scheduled to be on June 3rd, 2020. I read this documentation about how to prepare a Drupal 8 site for Drupal 9: Prepare a Drupal 8 site for ...
user avatar
  • 143
0 votes
0 answers
46 views

entity_print module -> file_unmanaged_save_data writes a pdf with 0 bytes

We have a custom written module (not by me), that uses entity_print to create PDF documents. It was working fine until I upgraded drush from 9.0-beta4 to 9.5 (had to update drush commands). The ...
user avatar
1 vote
3 answers
2k views

hook_node_view_alter not working

I'm hoping to finally find some solutions here. I'm new to custom module development in Drupal and I'm trying to learn the basics. What I'm trying to do is use hook_node_view_alter, however even at ...
user avatar
7 votes
2 answers
5k views

How can I verify users the first time they log in?

I was reading this article. I would like to know how logging in with the REST API in Drupal 8 works. By default, when users log in, Drupal will verify username and password. After the login, the ...
user avatar
  • 726
1 vote
1 answer
11k views

How do I fix an uncaught TypeError? [closed]

I am using Drupal 8.1.8. It is giving me many JavaScript errors. Uncaught TypeError: Cannot read property 'permissionsHash' of undefined Uncaught TypeError: Cannot set property 'StateModel' of ...
user avatar
7 votes
3 answers
7k views

How to programmatically assign user roles

I am assigning a role to user by this code: $user = user_load($user->uid); $role = user_role_load_by_name("10-dis"); $user->roles = $user->roles + array($role->rid => $role->name); ...
user avatar
  • 686
2 votes
4 answers
4k views

How to delete a webform submission in a custom module?

I want to delete a webform submission from a custom module that I've written. I'm using webform_submission_delete(123, 76). The error I receive is: Notice: Trying to get property of non-object in ...
user avatar
6 votes
4 answers
479 views

Is it better to use the latest version released 1 month ago, or use the older but still supported version?

I am going to create a new website: Is it better to use the latest major version recently released, or the previous still-supported version? For example, if Drupal 9 were released one month ago, ...
user avatar
  • 94.1k

1
20 21 22 23
24