Latest Drupal related questions

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 ...

Score: 0
Sergey avatar
Geolocation Geometry (Geometry) field cannot be edited in taxonomy term
us flag

I have a taxonomy type with Geolocation Geometry (Geometry) field type. I use custom Geolocation Geometry Lat/Lng to WKT widget (but the problem occurs with other widgets too).

The problem is that after filling in latitude and longitude and saving the taxonomy term I cannot change the field value anymore.

How to reproduce.

  1. Create a new taxonomy type with "Geolocation Geometry - Geometry" field ty ...
Score: -1
Monster971 avatar
Get the value of a field to do an if statement Twig
id flag

I am trying to generate a PDF with Entity Print. Until then all is well.

In my Twig page, I try to make conditional displays. But I can’t get the conditions to work.

I render my fields using {{ content.field_custom }} and that also works fine.

But the condition don't work , when I do something like :

{% if content.field_custom == 'John' %} ...

or

{% set field = content.field_custom %}
{% if field = ...
Score: 0
How can I avoid double line breaks (

) in a text field (field type: text unformatted long)?
ke flag

How can I avoid double line breaks (<br><br>) in a text field (field type: text unformatted, long)?

Users write text into this text field. When they hit Enter twice, the result is: <br><br>. But <br><br> is not themable with css, the height of <br> can NOT be set with css.

Therefore <br><br> should be avoided and paragraphs <p> used instead o ...

Score: 1
LeraA avatar
How can I customize breakpoints in USWDS base theme?
cz flag

I'm using the USWDS_base theme as a base for my custom theme. Version 8.x-2.10

In this file: web/themes/custom/my_child_theme/sass/_uswds-theme-utilities.scss I find the tokens used for the breakpoints (see screenshot).

In the comments, I can see what size those tokens represent. I can't find anywhere where those numbers are set so that I can override them. I've been combing through the theme for h ...

Score: 0
Sidney Sousa avatar
How to add index to paragraph template
af flag

I want to use paragraphs to implement a carousel, and for now, I have the outer paragraph called slideshow, and the template is paragraph--slideshow.html.twig. Then, inside this paragraph, I can add slides, and the template is paragraph--slide.html.twig.

At the moment, I only have the default paragraphs template which looks like this:

{%
  set classes = [
    'paragraph',
    'paragraph--type--' ~ par ...
Score: 0
Adi avatar
Show pop-up form after every drag and drop
um flag
Adi

I'm working on functionality based on the Homebox module. Whenever a drag and drop operation is performed, I want to show a form in pop-up. Does anyone have experience with it?

Score: 0
Extect avatar
With sites/default/files not part of the git repo, which content will be used in dev?
cn flag

I am using a composer managed Drupal install and want to use git to move it between development and production environments. From what I understand, the only directory that is not supposed to be in the git repo is sites/default/files. Everything else incl. modules, themes, composer files etc. would be in the repo. Composer would only be run in local dev, but not in production.

What I don't unders ...

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.