Latest Drupal related questions

Score: 1
thornley avatar
Difference between a front-end theme and an administrative theme?
im flag

I am teaching myself Drupal 9 and I see that the Claro theme is defined as a "Drupal administration theme" while Olivero is defined as a "Drupal front-end theme." Are these complementary themes? I'm not sure about whether I should install both - to have both a front-end and an administration theme or whether I need only one or the other. Any help you might offer in understanding the difference between a " ...

Score: 0
pglatz avatar
logging working on local site but not remote site
in flag

I recently migrated from Drupal 8 to 9. Works ok on my local (MAMP on Mac), but not on the remote (AWS Lightsail). Local has PHP 7.4.12, Remote has PHP 7.4.2.

I put the entire codebase in git, and pulled it to my remote server. I created settings.php for the remote host, set trusted_host_patterns, sites.php, .htaccess. I had a similar setup for Drupal 8 on the remote, which worked flawlessly.

Here's ...

Score: 1
etb5115 avatar
How does the config sync directory work exactly?
co flag

I just had a question quick about how Drupal's config sync works. I work on a large Drupal site where I am having some coworkers joining in on working on the project. It's a version controlled site where we develop locally on Docker and then pull changes to a web server.

I recently discovered that Drupal has a "config synchronization" feature. If making changes to the site (be it views, blocks,  ...

Score: 2
New To 'C' avatar
Block Settings inside Form
in flag

Please I need help with my code. I have a form and a block created programmatically. The block embeds the form to show it on the frontend. The block also has some settings (form preffix text). I want to load the block settings inside my buildForm in my Form.php to get the preffix text and show it in the form markup field. But I can't seem to find a way to pass on the $block_id to the buildForm() so it c ...

Score: 0
meh avatar
How to debug permission problems
th flag
meh

I already found answers for older versions here and here but as far as I can tell none of it directly translates into drupal 9.

The matter in practice: I don't have a huge experience but I was very surprised when in the not so complicated setup I'm building I could see the page of a taxonomy term but none of the items in it under the introductory text when viewing the page as anonymous user. Viewing  ...

Score: 0
miststudent2011 avatar
How to add internal path in *.links.menu.yml
fr flag

I am trying to add an internal link to admin toolbar but I am not able to achieve it.

According to documentation we add an internal link in *.links.menu.yml in the below manner but the link is not being appeared in the toolbar.

hello_world.admin2:
  title: 'Hello module settings'
  description: 'example of how to make an admin settings page link'
  parent: system.admin_config_development
  url: interna ...
Score: 0
Creating a custom module caused "The website encountered an unexpected error. Please try again later."
mu flag

Drupal 9.2.7 on XAMPP 7.3.29 , 7.4.21 on Windows 10 Home.

I tried to create a custom module which allows global JavaScript and CSS (effective in all webpages in my website), by creating the directory root/modules/globalrs with the following files:

globalrs.info.yml

name: globalrs
type: module
core_version_requirement: ^8 || ^9
description: 'globalrs'
libraries:
  - globalrs/globalrs

globalrs.module

Score: 2
RitikaDesai avatar
How to automatically generate two aliases for the same node?
kr flag

I am working on a Drupal website. I need to automatically generate 2 url aliases for the same node on the website. I have tried installing Pathauto but it lets me generate only 1 alias when a new page is created. Is it possible to have it automatically create 2 aliases when the page is created?

Do we do this via the module itself or can we have this done by code?

Thanks

Score: 1
Uploading local files via composer
bo flag

I'm using composer to manage a Drupal 9 instance. I'm brand new to composer and have no idea what i'm doing. That being said, I've successfully set it up and have used it to install modules and an admin theme. I just purchased a theme and realized that I don't know how how to upload it with composer. For modules and the admin theme I installed, I used composer require drupal/name-of-module(or theme) but ...

Score: 0
liquidcms avatar
Upgrading to Composer 2 blocked by Symfony dependecies
us flag

I have an existing Drupal 8.9.16 site which uses Composer 1 (and Commerce 2.24). I am trying to upgrade to using Composer 2 using this guide: https://www.drupal.org/docs/develop/using-composer/preparing-your-site-for-composer-2.

I have gotten through all the required steps up to the last step of dealing with drupal-scaffold (https://www.drupal.org/docs/develop/using-composer/using-drupals-composer-s ...

Score: 0
How to generate order pdf in drupal commerce and attach in hook_mail_alter
in flag

How to generate order pdf in drupal commerce and attach in hook_mail_alter using custom code. I trying another of method but seems not worked for me

Score: 1
Bohus Ulrych avatar
Place field in "Url Alias" advanced group section (path-0)
jp flag

I'm trying to place my node field to the Advanced group - URL alias section. I'm doing it in custom hook_form_BASE_FORM_ID_alter(), where I'm trying to set custom #group like this:

$form['my_filed']['#group'] = 'path-0';

But "path-0" neither "path_0", "path" works. But if I use something else e.g. "meta", "menu" ... then my field is displayed in right place. What's the trick to place it in "Url Alias" ...

Score: 0
Unable to upload files through RESTful services
us flag

I am trying to upload pdf files to webform submission using REST API.

Since the Core File Upload functionality did not seem applicable for webform submission, I applied the patch from webform_rest module which would allow uploading files for webform submissions.

When POSTing the file via /webform_rest/{webform_id}/upload/{field_name} with the necessary Content-Type and Content-Disposition, Cookie a ...

Score: 0
Attach PDF file to Drupal Commerce Order Notification generated with invoice commerce
ls flag

How do I attach a pdf file to the commerce email?

I have invoice commerce.

Invoice commerce show view pdf option on every order and I want to send that pdf in email

I am stumped on how to get the pdf into a File object.

module_name_mail_alter(&$message) {
 $my_attachment = array(
'filecontent' => $pdf,
'filemime' => $pdf->filemime,
'filename' => $pdf->filename,
'filepath' => ...
Score: 1
How can I bootstrap my site from an external script?
cn flag

Community asked.. Please clarify your specific problem...

Fair comment. What I'd like help with is how do I correct the script below so it works with D9.

<?php


use Drupal\Core\DrupalKernel;

$autoloader = require_once 'autoload.php';

// This next line is the problem
$request = Request::createFromGlobals();


$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod');

$kernel->boot( ...
Score: 0
Drupal 9 core multilingual: cannot translate main navigation menu - button translate missing on menu items
cn flag

I'm trying to catch multilingual features of Drupal 9 and have wamp64 local development server and clean Drupal 9.2.8 install.

I've enabled 4 multilingual core modules:

  • Configuration Translation,
  • Content Translation,
  • Interface Translation,
  • and Language.

Two languages enabled: en and ru.

I'm trying to translate Main Navigation Menu, but menu items don't have a "translate" button along with "edit" ...

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.