Latest Drupal related questions

Score: 1
Mykyta Miakushka avatar
"migrate:status" freezes on "Try to validate bootstrap phase 0"
sm flag

Drupal community!

I am working on migrating from D7 to D9. Both are located on separate servers. I configured D7 database as db to migrate in my D9 settings.php, like this:

$databases['migrate']['default'] = [
  'database' => 'dbname',
  'username' => 'username',
  'password' => 'password',
  'prefix' => '',
  'host' => 'd7_ip_host',
  'port' => '3306',
  'namespace' => 'Drupal\\Cor ...
Score: 2
Kevin avatar
CKEditor 5 - access PHP plugin configuration from JS plugin?
in flag

I have provided a CKEditor 5 plugin a PHP configuration class. I am able to set and store configuration for the text editor plugin now, but do not know how to access that configuration value(s) from my JS plugin files that create the editor button/logic. How do you do that?

Score: 0
RafaTicArte avatar
CKeditor 5 does not load with Aggregate JavaScript files option
ph flag

I use Drupal 9.5.5, CKeditor 5 and BootstrapBarrio theme.

When I enable "Aggregate JavaScript files" option in Performance, CKeditor does not load when a user (non admin) edits node.

I uninstalled Advanced CSS/JS Aggregation module also.

Any idea?

Thanks.

Score: 1
Martijn avatar
How do I migrate 1000+ nodes iteratively with term hierarchy and links in a CSV file?
US flag

I run for almost 15 years now a Drupal website as a hobby. I had lots of help of the great Drupal commmunity with this. And was able to migrate from drupal 5-6-7 with the modules which were add hand. Now I need to go to Drupal 10. But how?

My site is fully dependent on the weblinks module, and there is no Drupal 10 version of this. I have 1000+ nodes on it.

My thoughts are to migrate the content thr ...

Score: 0
Mariano Banchio avatar
Export product image with Commerce Cart API module
gb flag

I'm usng the "Commerce Cart API" module on my website to build a custom cart js layer. The problem i am facing is the purchased entity has a field_image field and I would like get the url of that images instead of the file id.

The json response of cart?_format=json looks like the following:

    [
  {
    "order_id": 9,
    "uuid": "a4604a10-f956-41e7-87f6-0d745b9345a4",
    "order_number": null,
    " ...
Score: 0
thiokol avatar
How can I display the output of a view with no surrounding templates that can be embedded in an iframe inside another website?
cn flag

I have a user contextual view which is accessed via a URL like:

/user/114/my-view

I want to provide the output of this view in a raw format without any surrounding page HTML so that it can be emdedded in an iframe in any website.

I bascially need to get rid of anything that is produced by the page template.

A similar question can be found here, but it is very old and refers to Drupal 7: https://st ...

Score: 1
ChumKui avatar
Alias listed but cannot be used
mx flag

I am using Drupal 9.x now and using Drush 10.x. I have always used drush aliases to manage my D7 sites as it makes life so much easier with various environments etc.

To test the newer YAML file (Drush for my old D7 uses a php file), I created a single Drush alias for a uat environment. The file, local.site.yml, is located in my ~/.drush/sites directory. When I do a drush sa to check what aliases exist, ...

Score: 0
ymdahi avatar
Auto assign term to node from term field from user
in flag

I have a term field called "Organization" on both Content and User entities.

On the Content entity, the field for Organization is hidden.

For the user, they select a value for Organization.

I'd like to automatically assign a value on a Node to be equal to the value of Organization in the User entity (if available, other leave empty).

There seems to be a number of ways to do this:

  • Rules, ECA, and other  ...
Score: 0
wil_SRQ avatar
Do I need to apply changes in default.settings.php to settings.php?
ec flag

Recent updates to Drupal 7 have included changes in default.settings.php.

Do they need to be incorporated into settings.php manually, or does the code automatically look up in default.settings.php when it can't find something in settings.php? Apologies if this is in the documentation, I couldn't find it.

Score: 0
johnfallen avatar
How can I add workbench_access to a custom content entity?
us flag

I have a custom entity and want to use our current workbench_access scheme to it.

I've google for a long time and can't find and example.

This article says that workbench_access now supports multiple access schemes and maybe I can use that to add access control that way.

Do I write code in hook_install()?

Do I add a specific handler in the @ContentEntityType annotation?

Sorry if this has been cov ...

Score: 1
Orane B. avatar
Hook post update not found
bf flag

I have a problem with the drush updb command which does not find the hook post updates of my custom module. I noticed that the module install saves the module's name string here in database, table "key_value", in BLOB file.

Table key_value : enter image description here BLOB file :

enter image description here

My post update in mymodule.post_update.php :

enter image description here

As it is present in the database, the command seems to consider that the hooks are executed when not. Is ...

Score: 0
pierostz avatar
Run composer installed drupal from root (/) and not /web directory
na flag

How do I run a composer-installed Drupal site from / instead of /web?

The default install with composer create-project drupal/recommended-project ./ will install Drupal in the /web directory. So when the site is uploaded to a host, the actual website root will be www.example.com/web. In most cases, the desired path to run the website is www.example.com/.

I have managed to do this, like this. And actuall ...

Score: 0
raresample avatar
401 error when trying to retrieve OAuth access token
in flag

I'm trying to configure simple_oauth to use with local Lando install of a Drupal 9 site with decoupled React frontend.

I followed the instructions at https://drupalize.me/tutorial/install-and-configure-simple-oauth?p=3003 and generated the necessary RSA keys in the terminal:

$ openssl genrsa -out private.key 2048
$ openssl rsa -in private.key -pubout -out public.key

...placing the keys into /drup ...

Score: 0
sidgrafix avatar
Form field states with media fields that use media library widget and conditionally displaying visibility based on other media fields
rw flag

I am trying to get some media fields to hide/show conditionally using $form fields #states API, based on other media fields (all the media fields are using the "Media Library" widget in form display.) I'm working with a node/add and edit for a content type in Drupal 9.5.4 and using hook_form_alter() to manage the states.

There are 3 media fields in total - if one has media added the other two sho ...

Score: 0
raresample avatar
Errors when providing or generating keys for Simple OAuth module
in flag

I'm trying to configure simple_oauth to use with local Lando install of a Drupal 9 site with decoupled React frontend.

I've tried to manually generate the keys in the terminal:

$ openssl genrsa -out private.key 2048
$ openssl rsa -in private.key -pubout -out public.key

...placing the keys into a sibling directory of /web/ and /vendor/ called /keys/.

It throws these error messages:

"The Public Key fil ...

Score: 1
Francesco Marchetti-Stasi avatar
How do I alias jQuery to $ before loading a remote library?
iq flag

I am trying to use Bootstrap autocomplete in my module. I added this to my .libraries.yml.

bootstrap-autocomplete:
  remote: https://bootstrap-autocomplete.readthedocs.io/en/latest/
  version: 2.3.7
  license:
    name: MIT
    url: https://getbootstrap.com/docs/4.0/about/license/
    gpl-compatible: true
  dependencies:
    - core/jquery
  js:
    https://cdn.jsdelivr.net/gh/xcash/bootstrap-autocom ...
Score: 0
Patoshi パトシ avatar
Displaying all pages in a BOOK teaser block within a block
kr flag

I'm trying to display all the BOOKS in my site as a teaser block with the pages below it.

Like this:

Title: This is the book of my Cat
Page: 1 2 3 4 5 6 7 8 

Title: This is the book of my Dog
Page: 1 2 3 4 5 6 7 8 

Title: This is the book of my Bird
Page: 1 2 3 4 5 6 7 8 

I have the following View setup to display the teaser of the books on the site filtered by the value of having children or not.

 ...
Score: 0
Glenn avatar
How do I conditionally restrict an attribute
ph flag

I'm using Drupal Commerce 8.x-2.x on Drupal 9.5.x. I need to restrict a particular product attribute to certain regions (regions selected via an attribute). My thinking is that the region is selected via an attribute; I can't see another way to do it for my means.

In my use case, regions are not location based geographical regions; they are locally defined regions, so I can't see a way other than ...

Score: 0
LBRTYCAT avatar
Attaching a library to only one custom module
us flag

I wrote a sample custom module (juniper) and created the corresponding juniper.libraries.yml file to link the CSS and JS. I am trying to load this library only on this module pages (/juniper). However, I have issues:

  1. I tried to add the library via juniper.info.yml:
libraries:
  - juniper/june

but this doesn't work for some reason

  1. I added the juniper_page_attachments hook to the juniper.module
Score: 0
River Liver avatar
Can't get Plupload Integration test module to work
je flag

I've installed Plupload integration on my Drupal 9 local Docksal site but can't get the example module to work. The library is properly installed according to Status Report. I enabled "Plupload test" went to the test page, tried to upload a zip file and the file won't upload. In the console I see an error at /plupload-handle-uploads?token=XJtEGstKW7...

{"jsonrpc":"2.0","error":{"code":105,"message":"I ...
Score: 0
Patoshi パトシ avatar
Display the last page in a BOOK content type as a link?
kr flag

I'm currently using the core BOOK content type as a form of discussions. I created a views page with all the books and titles exposed. But I also want to append the last page of the book in the Views page. Setting the Depth = 1 I get the first page of the book and title, which is correct. But how do I set it to show the last Depth of the book so it can create a link to the last page?

enter image description here

Score: 0
quantumized avatar
How to add condition via views_query_alter() to filter a multi-value select field that does not contain a value?
ng flag

I have _views_query_alter() hook that I need to filter out nodes whose multi-value select does not contain a value ("National"). The code below works to show the nodes that do contain "National" but I need to do the opposite and cannot get it to work due the field being a multi-value field.

function HOOK_views_query_alter(ViewExecutable $view, QueryPluginBase $query) {

  if ($view->id() == 'state_lan ...
Score: 0
Brian Gradin avatar
Is it possible to recreate cache tables from a more fixed source?
th flag

I am working with a dockerized Drupal environment in which we want to track content alongside our theme, modules, etc in source control. We achieve content tracking by using mysqldump to dump the database to disk, with one table per file. Then when the environment is created using Docker Compose, the SQL files on disk recreate the database state. We also track certain files from sites/default/files

Score: 0
Switching from table to graph give wrong data
kn flag

I'm using the Drupal Commerce Report module as a base for my stats. I have a table which give me data about my sales per month.

enter image description here

I'd like to use graph instead of table, to make it easier to compare. For some reason, the coma is gone, so all my sales reports are wrong

enter image description here

I tried to alter data in a pre_render, in a preprocess (by checking the format, test with a dot instead of a coma) but still having ...

Score: 0
timmyblaze avatar
Field values in node HTML body
do flag

I am using Drupal 10 and trying to edit the body of a node. I want to use the node field values in the HTML body, for example [field_name], but this does not appear to work as it only shows that specific text and not the actual value of the node. I also have tried [field:field_name] with no such luck. Is there any way to do this without having to edit any template file? I have the text format set to 'Full ...

Score: 0
Attach a webform to a content type such that you fill out the webform when editing the content
cn flag

Adding an entity reference of type Webform makes it so when creating the content, the specific webform can be selected and it can be set to open or closed, but the webform is filled out by people viewing the content, rather than by content creators when editing the content.

Another sort of entity reference could theoretically make it so the webform is shown when creating/editing the node or other c ...

Score: 1
Tomáš Bažant avatar
Display only search box with live search and no content with results
de flag

I have configured search API with autocomplete, the search box is exposed in a views block. But the block displays the default 5 results below the search box even if the box is not used yet. I want the search box only to be visible, not the content of the block. But i cant seem to set the number of displayed result to 0. Any idea?

search api live box

Score: 0
user3108268 avatar
How to upload .webp to Image field?
us flag

https://www.drupal.org/project/imagewebp lets you upload a regular jpg/png which converts it into webp, but how to upload already a file that is in webp?

Adding it as one of allowed extensions in the field setting does not work.

update As an alternative this can be solved with https://www.drupal.org/project/file_entity, but this is for the file field and not image field.

The question is about image  ...

Score: 0
Drupal Learner avatar
Use AJAX On Node Add Form To Change Field Required Status
gf flag

On a node/add form I have a pair of fields that need to be able to control one another. The first field allows a user to enter a birthdate, the second field allows the user to say the birthdate is unknown.

I have attempted to work with Conditional Fields to make this work but I think for my case AJAX would be better.

If the birthdate_unkown field is not checked then the birthdate field should be requi ...

Score: 0
How to find bad tokens stored in config automatically?
cn flag

I recently deleted some fields (media_term_fruits) and created new fields (media_fruits) on a local dev site. I then exported the config and pushed it to my dev server.

My dev server uses Github Actions to import config and everything imported with no errors.

However, for my media image fields, I set the image path using a token via the Filefield Paths module. This token referenced a deleted field (

The Stunning Power of Questions

Much of an executive’s workday is spent asking others for information—requesting status updates from a team leader, for example, or questioning a counterpart in a tense negotiation. Yet unlike professionals such as litigators, journalists, and doctors, who are taught how to ask questions as an essential part of their training, few executives think of questioning as a skill that can be honed—or consider how their own answers to questions could make conversations more productive.

That’s a missed opportunity. Questioning is a uniquely powerful tool for unlocking value in organizations: It spurs learning and the exchange of ideas, it fuels innovation and performance improvement, it builds rapport and trust among team members. And it can mitigate business risk by uncovering unforeseen pitfalls and hazards.

For some people, questioning comes easily. Their natural inquisitiveness, emotional intelligence, and ability to read people put the ideal question on the tip of their tongue. But most of us don’t ask enough questions, nor do we pose our inquiries in an optimal way.

The good news is that by asking questions, we naturally improve our emotional intelligence, which in turn makes us better questioners—a virtuous cycle. In this article, we draw on insights from behavioral science research to explore how the way we frame questions and choose to answer our counterparts can influence the outcome of conversations. We offer guidance for choosing the best type, tone, sequence, and framing of questions and for deciding what and how much information to share to reap the most benefit from our interactions, not just for ourselves but for our organizations.