Latest Drupal related questions

Score: 1
Stefan Korn avatar
Use deriver in Drupal Migration yml
in flag

I am trying to use the deriver key in a migration yml to have dynamically build migrations for each bundle of an Entity Type (Drupal 9).

I read this and I am trying to use the deriver key to point to a Deriver class in my migration. However it seems that the deriver key is just ignored.

Is there something else that I need to do beside using the deriver key and create a deriver class that inherits fro ...

Score: 1
Joost avatar
Make table fully accessible use CKEditor 4.17.1
jp flag

I'm working on a website that needs to be fully accessible following the WCAG guidelines. Therefor I need my table output, created via the CKEditor 4.17.1 in Drupal 9, to be set with the scope attribute.

Something like this:

<table>
  <caption>Reiskosten</caption>
  <tr>
    <td></td>
    <th scope="col">2e klas</th>
    <th scope="col">1e klas< ...
Score: 0
rukya avatar
How can I extend custom class extending BlockBase in contrib module?
id flag

The block opigno_documents_last_group_block is located in opigno_learning_path/src/Plugin/Block/DocumentsLastGroupBlock.php, which looks like this:

<?php

namespace Drupal\opigno_learning_path\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Url;

/**
 * Provides a documentslastgroupblock block.
 *
 * @Block(
 *   id = "opigno_documents_last_group_block",
 *   admin_label = @Trans ...
Score: 0
Set data value of created date with Rules
in flag

I need to set the created date of all nodes of a content type X to 'now' if the created date is older than 14days. It should be happening when running cron.

Cant get it running with Data Comparison and a relative time date like '-14days' in the conditions.

And in Actions with a set data value 'now' for node.created.value (or @node.node_route_context:node.created )

thanks for any hints in advance

 ...
Score: 0
Giuseppe avatar
How do I save a specific "state" of the product in the order item?
br flag

I'd be necessary for my site to save "a specific state" of the product(s) and relative variation(s) purchased in the order.

I mean, with the "standard" Commerce configuration, in the relative order item are stored only:

a reference to the purchasable entity, a quantity, a unit price and a total price

Therefore, for example if the body of the purchased product or relative variation is changed after a use ...

Score: 1
How to deal with config sync changing the order of lines in files causing spurious changes in source control?
fi flag

I am really enjoying Drupal 8/9's built-in config sync mechanism which allows you to export config to a directory. This makes it possible to store config in a git repo and easily deploy from dev to live from example. Amazing. Just one niggle...

When I do a config export (using drush) it often changes the order of the lines in the .yml files (in ways that don't matter) so it looks to git as though ...

Score: 0
S.Gou avatar
Return two values from views exposed filter - filtered value and a default value
us flag

Is it possible to return two values when user chooses a value from a defined list? The values I wish to return are the value that a user chose AND a default value if it exists.

I have a taxonomy list of values (example: 10%, 20%, 25%, 100%, Any%). This list is exposed to the user as a dropdown filter on form.

I have a content type with an entity reference field referring to these values. Some or all ...

Score: 5
Jeroen avatar
Does the built-in PHP web server have disadvantages over other local development alternatives?
br flag

When watching Install Drupal for Local Development, I leant that Drupal 8 and Drupal 9 come with a built-in PHP web server that can be set up quickly by cloning the core and running php -S localhost:8000. However, the official Local Development Guide does not mention this and instead advises to use DDEV for local development.

If the built-in PHP web server is so quick to set up, why should I be us ...

Score: 0
user106977 avatar
Iterate over bundles to create entity bundle class for each
in flag

I'm curious if anyone has a way to produce an entity bundle class for several bundles at once. For example:

function MYMODULE_entity_bundle_info_alter(&$bundles) {

  // My array of different content types.
  $target_bundles = ['page', 'article'];

  // Iterate over the content types.
  foreach($target_bundle as $bundle) {

    $Bundle = ucfirst($bundle); // page to Page
    $bundles['node'][$bun ...
Score: 0
amuli avatar
No more access to user login
jp flag

The URL mysite.com/user/login redirects to home page, so that I've lost access to administration.

I tried mysite.com/?q=user/login. Sadly, same redirection. :-(

Has anyone encountered this probleme or any idea ? Thanks :-)

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.