Latest Drupal related questions

Score: -1
Philippe Chaissac avatar
Send HTML mail with plain text mime/alternative (for anti-spam)
us flag

We use Webform Drupal 8 module to handle newsletter subscription on a website. An html formatted email is sent to confirm subscription. Unfortunately, this email is sent with only content-type:text/html, and you know how picky Spamassassin is about this. It's a real deliverability issue. We'd like to be able to send that email with a content-type:multipart/alternative, with 2 parts : one with text/html  ...

Score: 0
bigboy avatar
Display field label (not key) as views page title in contextual filter
gu flag

In continuation of these questions:

I have taxonomy terms of games and a View representing them. Each game has a select-type of field called "genre" with "key|label" format. There are 16 genres, stored like that (default language is russia ...

Score: 0
Image field input renders with type text instead of file
om flag

(Drupal newb - please go easy and give references that help me learn how to debug stuff in Drupal myself, thank you!)

I've taken over a Drupal site with 7.80.

There's a type called Event which has a bunch of fields including an Image. There are many existing Events where Image upload presumably worked fine in the past. The images are visible when editing those Events.

Problem: The form for adding a new E ...

Score: 0
Extend Commerce api shipping methods response with custom fields
cn flag

With commerce api module, you can fetch all available shipping methods of an order with a GET request on {{host}}/jsonapi/checkout/{{cart_uuid}}/shipping-methods. Result is something like this:

    {
        "type": "shipping-rate-option",
        "id": "3--default",
        "attributes": {
            "shipping_method_id": "3",
            "service": {
                "id": "default",
                "la ...
Score: 0
cocq avatar
rebuild a form with ajax (solved)
gb flag

In a hook, I use ajax on a form field, designed with drupal user interface. It is declared as this :

$form['field_unite_de_recherche']['widget']['#ajax'] = array(
'callback' => 'ajax_equipes_from_unites_callback',
'event' => 'change',
'method' => 'replace',
'wrapper' => 'edit-field-equipe-membre2',
);

In the callback function, I retreive some values in the database from the selected value  ...

Score: 1
How can I receive and process form data submitted from an external site?
fi flag

I'm working on a CRM implementation in Drupal for a client and they have an existing website with forms on for people to make enquiries and so on. They would like the data submitted via those forms to automatically become entities in the CRM.

I could replace the forms with webforms from the Drupal site but that would be clunky, as they would have to either be in iframes, or users would be taken t ...

Score: 0
pierostz avatar
Module update with composer, updates module but not really
na flag

I am updating modules on my drupal site and I am using the composer like this:

composer require 'drupal/module'

The output I get from composer looks like everything is working fine but when I go to the update page of the modules nothing seems to change. The output from composer looks like this:

enter image description here

This is an occurence on every module I have.

composer.json :

{
"name": "drupal/legacy-project",
"descriptio ...
Score: 0
Stanley Fernandes avatar
How to use [node:title] token as filename for media type fields?
gt flag

I have a Drupal 9 site have two modules FILE (FIELD) PATH module and token is used.

So for a content type, one image field is there where in the File (Field) Path settings I have the file name as [node:title].[file:extension] and it works. https://nimb.ws/z8imjN

But when I add a media field, and go here admin/structure/media/manage/image/fields/media.image.field_media_image to add the file as [node:title ...

Score: 0
stckvrw avatar
Old GZ file is generated after editing CSS original
gb flag

After editing CSS file in the /sites/default/files/css directory I removed its GZ version and it's generated after a while, but with old CSS code.

How to edit CSS correctly? And how to force generating GZ immediately after editing CSS?

ps. Drupal 8.7.3

Score: 0
Gabriel Fernandez avatar
Avoid sending email (content moderation) when node updated programatically
cn flag

I have a csv import function which also will have to update the "moderation_state" field. Once csv import is ran, email will be triggered by content_moderation module. Is there a way to disable this when updating nodes programatically?

Score: 0
upgrade_status - unexpected error about PHP version
ru flag

I'm doing preparatory work for upgrading a site from D8 to D9...

The Drupal dev site (macOS 10.14.6 served with Laravel Vagrant) is running PHP 7.3.28, both on command line and php-fpm, and I'm seeing the correct version with php --version and at /admin/reports/status

And yet, whenever I scan my custom modules via the upgrade_status UI, I consistently get:

PHPStan command failed:

/Users/wt/Sites/sitename ...
Score: 1
Validation on custom entity edit form
lc flag

I have a custom entity where, instead of using the usual way of specifying edit form options with setDisplayOptions('form' and relying on ContentEntityForm to create my edit form for me, I have to make my own form in buildForm() (I have Ajax interactions between the fields that the stock from can't provide). It works all right, just that I can't trigger validation as with the stock form. The constraints  ...

Score: 0
stckvrw avatar
Class Drupal\dfm\EventSubscriber\DfmSubscriber not found when try to remove the Drupella File Manager
gb flag

I installed the Drupella File Manager module for Drupal 8.8, but I have Drupal 8.7. I received this error.

Call to undefined method Drupal\Core\File\FileSystem::scanDirectory()

I don't need the module anymore, so I'm trying to remove it. Because of the same error on the uninstall page, I'm trying to manual remove it.

First, I removed dfm (which is the module machine name) from the $module_data  ...

Score: 0
Unable to preview media items
kr flag

I have a node page where, in the WYSIWYG, I have embedded about 50 media items. When I edit the node, I can see this error for some of the media items.

An error occurred while trying to preview the media. Please save your work and reload this page.

In the browser console, the error is the following.

mysite.com/media/wysiwyg/preview?text=%3Cdrupal-media%20data-entity-type%3D%22media%22%20data-entity-uui ...

Score: 0
Override/remove title of view with contextual filter as a block
br flag

I have a block in a page that is a view with a contextual filter. As a block does not have a path, I have to provide a default value "raw value from URL" as per Contextual filter with a block view

This all works as it should, the view in the block gets filtered per the URL's last/third component as configured in the contextual filter's settings.

I use this block both in an overview mode where it shows al ...

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.