Latest Drupal related questions

Score: 0
How can I disable the core migrations?
sr flag

After I enabled the Drupal Migrate module in Drupal 10, every time I do a drush ms I get a page of errors about Drupal 7 migrations like the following one.

[error] Could not retrieve source count from d6_filter_format: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'PRODUCTION_content_shared.filter_formats' doesn't exist: SELECT COUNT(*) AS "expression"

Is there a way to disable migratio ...

Score: 0
Form States not working when compressed javascript is enabled
cn flag
blu

I have visible states setup for a 2 fields that correctly work when javascript aggregation is disabled. When I turn JS aggregation on both fields are visible no matter what option I select on the triggering field.

The error I see in the console is:

jQuery.Deferred exception: undefined is not an object (evaluating 'drupalSettings.dialog.buttonClass = 'btn'') 
(anonymous function) — js_fsUR56avHuCdleL ...
Score: 1
Ben Alan avatar
How do I hide the label of disabled field groups?
do flag

In the Manage Display tab, I have disabled fields because they are rendered in the page.html.twig file inside of a region. I don't want the field to display the label.

I can set the label to hidden for the non-disabled fields, but for the disabled ones, when I change the label to "- Hidden -" it simply reverts itself back to "Above"

Here is the field before clicking save:

Label for image before save

Here it is after save:

Score: 0
GeorgeCiesinski avatar
Am I hardening the permissions in settings.php correctly?
mv flag

Last month, I encountered an issue where I could not edit settings.php as it was read-only.

I asked this question and learned how to change the permissions to edit the file, and then harden them again. The result was that vim would warn me a file is read-only until I used chmod a+w settings.php. After this, vim would no longer warn me about this and I could make the changes I need. Finally, I use ...

Score: 0
JohnC95 avatar
Alphabetically sorting by taxonomy name
mc flag

I have a content type with a taxonomy term entity reference tagged to it. I am trying to make a view that lists all nodes of this content type but I want the sorting to be alphabetical based on the taxonomy term tagged rather than by the node title.

It sounds simple in my head. I simply put in the Field of the taxonomy entity reference under "sort" in the view and set it to be ascending order. Bu ...

Score: 0
ice70 avatar
Toolbar and gulp/browsersync: body tag overwritten with comment
cn flag

In Drupal 10, with a gulp/browserSync sync to localhost:3000, I am getting the comments in web/core/modules/toolbar/toolbar.module showing up at the top of my page.

// These are classes that toolbar typically adds to <body>, but this code
// executes before the first paint, when <body> is not yet present. The
// classes are added to <html> so styling immediately reflects the current ...
Score: 0
David Barrett avatar
Populate a 2nd date field min date from a previous date field in webform before submission
jp flag

I have 2 date fields on a webform. The 1st date field has a min date set

first_date:
  '#type': date
  '#title': 'First Date'
  '#date_date_min': 'today + 3 days'
  '#datepicker': true
  '#date_date_format': 'l, F j, Y'

The 2nd date field needs to be populated with a minimum date, reflecting the date entered into the 1st date field so that the user cannot select a date before the date entered into the ...

Score: 0
Tyler avatar
Server went down while uninstalling a module; now I cannot install or uninstall the module
ca flag

I am unable to remove the ECA Core module on my Drupal 10.1 site due to the below error.

Core module for ECA framework.
The following reason prevents ECA Core from being uninstalled: Required by: eca_user

Unfortunately while I was initially removing the ECA User module, my host/server crashed and this is where I am at once everything came back up. I can select the ECA User module to re-enable, how ...

Score: 1
ThankYouNeco avatar
How to find PathAuto state?
cn flag

I am trying to put together a list of content on the site that has the PathAuto setting still checked so it will update when the title of the page is changed. Can't seem to find where this would be stored in the database.

Just wondering if it is possible to find what Pathauto state is set for each entity on my site. I know in previous versions of Drupal there was a database table called pathauto_ ...

Score: -1
mahasri avatar
If conditions in twig to check if field has a value
et flag

I have used this below code to check if the field has a value

{% if content.field_title is not empty %}
    <p>{{ content.field_title }}</p>
{% endif %}

But p tag is rendering even though the field doesn't have a value. Same happening for {% if content.field_title is not null %} as well and {{ dump(content.field_title) }} is not an empty array if the field has no value. So how to che ...

Score: 0
Why is the Cache-Control always "no-cache" and "X-Drupal-Dynamic-Cache" UNCACHEABLE on this site?
kn flag

I have a production website for quite a long time now. By digging, we found that the Cache-Control was always to "no-cache" and "X-Drupal-Dynamic-Cache" is UNCACHEABLE

enter image description here

My settings.prod.php look like this

# ================================================================
# Performance settings
# ================================================================
$config['system.logging']['error_level'] = ER ...
Score: 1
How to use bundle classes with config entities (vocabularies)?
ru flag

I'd like to use bundle classes with taxonomy vocabularies. Vocabularies are bundleable config entities inheriting from EntityBase just like nodes, term and other content entities. The doc states bundle classes should work with all entities that are a subclass of the base entity class, but I can't get it to work with config entities.

works:

// in my module file
function foo_entity_bundle_info_alter(& ...
Score: 0
How can I prevent a specific node type from caching for anonymous users (when using hook_node_access)?
bv flag

I am using hook_node_access to decide the whether a node should be visible to anonymous users based on their IP address. To prevent this being cached I am using \Drupal::service('page_cache_kill_switch')->trigger() within hook_node_view_alter, but if access is forbidden then hook_node_view_alter is not run and so the cache is not killed.

Where should I put \Drupal::service('page_cache_kill_switc ...

Score: 0
Counting by rewritten element
kn flag

In my view, I'd like to group my row by values.

The initial data look like this.

enter image description here

In the field configuration in the view, I rewrite each value like this {{ field__value |split('-')[2] }} to get only the last part (CB, VISA...).

How do I group each row by the rewritten value? The idea would be to have this.

enter image description here

Score: 0
Aurora avatar
Contrib module service overriding not working
cn flag

I am using the ‘Path Redirect Import module along with the Redirect module. I am trying to override its service ‘path_redirect_import.importer’ To do this, I have added a service provider and a custom class that extends the service class that I want to override. however, the overridden function is not getting called. Followed this tutorial:

Any suggestions?

  1. inside my custom module's src folder, I ...

Score: 0
Hometoy avatar
View connection info from Webforms to SMTP
in flag

I have a Drupal 8 site with webforms and the site is configured to use our Office 365 for mail.

The site's SMTP settings are right because I have been getting auto-generated emails about out-of-date modules.

The webform fails to send, with the meat of the error message:

SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: TenantAttribution; Relay Access Denied [ValidationStatu ...
Score: 0
Geat avatar
How do I add cusom settings for the "Rendered entity" view mode?
de flag

When using the "Rendered entity" field formatter for an entity display, there's a dropdown where you can select the View mode.

Is there a way (programmatically or otherwise) to add settings to a particular view mode? I want to add a checkbox that will display or hide a particular section of the rendered output.

I know I could create another view mode, but that does seem overkill for something that's ...

Score: 1
Drupal root not found on multisite setup after upgrading Drush 10 to 11/12
br flag

This is a (25 sites) multisite setup running smoothly on Drupal 9.4 with Drush 10.x still. Upgrading to Drupal 10.1.x and Drush 11 or 12 however makes Drush unusable.

Dir layout as installed by drupal/core-recommended:

/var/www/projectroot/
├── composer.json
├── composer.lock
├── config
│   └── mysite.com
├── vendor
│   ├── asm89
│   │   └── st ...
Score: 0
ChumKui avatar
Can I set default access settings?
mx flag

The Webform module defaults to allowing anonymous and authenticated users to submit a form.

The vast majority of the webforms we use are for internal staff that have a particular Drupal role.

Is there a setting for defaulting to a particular role/roles when creating a new form? There seems to be for everything else.

We are using Drupal 9.5.x and Webform 6.1.x.

Score: 0
Aambro avatar
How to prevent empty field wrapper from rendering in views
cn flag

In views I display fields for specific content types. One field is referenced to taxonomy term. Not every node has the term reference. I need to style this field with paddings and colours so I would want it not to be rendered at all if term reference is missing. I have chosen under "no result behaviour" in field settings in views to "hide if empty" and "hide rewriting if empty". However, the two divs st ...

Score: 0
Book child title containing html tags is escaped
it flag
MMT

I have a Drupal 7.97 with a book e.g. node 1 that has three children nodes of e.g. nodes 2,3,4. In one of the children nodes title e.g. node 3 title I'm using an simple html tag:

Node 3 sample title <em style="color:blue;">highlighted text</em>

All the nodes are of type book page.

When displaying the page site.com/node/3 everything is fine, the html title is stripped of the tag as it should  ...

Score: 0
Ricardo Castañeda avatar
DBTNG sentence that sums a column from all rows of a specific user and dpm the total
at flag

This is my table test_sum_expression with columns:

uid (int) Stores the UID of the user.
points (int) Stores a number.

enter image description here

I have this SQL sentence which SUMS all points from user with uid 1.

SELECT uid, SUM(points) AS total_points 
FROM `test_sum_expression` 
WHERE uid = 1
GROUP BY UID;

Which produces
enter image description here

How can I produce this same sentence in DBTNG (Database: The Next Generation) format? I mean somethi ...

Score: 0
Eluchel avatar
How do I get a media entity image's url/src in a block twig file?
so flag

I have a custom block type that has a media entity field that is an image. I want to extract that image url and set it as a div background image in the html.twig file, but I can't get it to work. The twig file is block--inline-block--hero-w-title.html.twig If I do

{{ content.field_hero_image[0] }}

it will display the rendered image with all the divs and stuff, but I can't figure out how to get the imag ...

Score: 0
Tyler avatar
Updated Google Analytics breaks website
de flag

I uninstalled the Google Analytics module and installed a newer version for Drupal 8. Now the website crashes with this exception error.

Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "view.google_analytics_summary.page_1" does not exist." at /opt/drupal/web/core/lib/Drupal/Core/Routing/RouteProvider.php line 208

I have no idea how to fix this since I can' ...

Score: 0
Ricardo Castañeda avatar
Database addExpression SUM: Call to a member function execute() on string
at flag

I need to get the sum of all points values of the user with uid 1 from the test_sum_expression table. But when I try to execute I get this message Error: Call to a member function execute() on string.

If I don't execute, I get the count 6 of the word points, as if it were counting the characters from the string points.
enter image description here

$queryPoints = $connection->select('test_sum_expression', 'n')
    ->fields('n' ...
Score: 1
Mike Burman avatar
Is Drupal Commerce compatible with Drupal 10?
us flag

Don't see this answered anywhere. I have Drupal 10 installed, as a dev site cohabiting with a live Drupal 7 on the same server. I don't use composer for the D7 install, but can't get it to work on the D10 install since the "php.composer.phar" (in an attempt to make modules installs and updates) command jumps to server root over which I have no control & can't update. If commerce isn't compatible ma ...

Score: 0
Basil Vlasyuk avatar
Using Geofield, how do I create links that would center the map on required point?
pk flag

This appears to me as a rather basic requirement, but surprisingly enough, I can find no information on how this can be done.

You know how when you search something on Google maps, apart from just a map with points on it, you are also given a list of those points on the left side, and you can choose any of the names, click on it, and the map will get centered on this point?

So I have a few hundreds  ...

Score: 0
Alex Sh avatar
Migrating content from production to development
de flag

I have a multilingual site built on the Glazed Drupal CMS installation profile (Drupal 8).

It was upgraded to Drupal 9, but the upgrading process lasted around 3 months, and now new content from the production site (Drupal 8.9) needs to me be migrated to the new Drupal 9 site.

I can't just use the production site database - it was a lot of changes when switching from Glazed CMS to DXPR and these ch ...

Score: 0
CKeditor 5 generic block level styles
ru flag

Is it possible to define generic block level styles in CKeditor5, instead of targeting a specific HTML tag?

E.g. I can define this in editor.full_html.twig

settings:
  plugins:
    ckeditor5_style:
      styles:
        -
          label: 'looks like header 1'
          element: '<p class="h1">'
        -
          label: 'looks like header 2'
          element: '<p class="h2">'

But with this ...

Score: 1
steven avatar
How can I copy a field to another field?
br flag

I have an Article content type for which I want to change the machine name of its fields. I created new fields with a different machine name.

How do I copy the old fields to the new fields?

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.