Latest Drupal related questions

Score: 1
Drush can't write to /tmp
eg flag

Drush does not seem to be able to move files to the tmp folder on my local machine. Changing the tmp folder location to for instance "sites/default/files" works, but I would like to know why it doesn't work with /tmp.

I am using this script from the fontawesome module:

$this->fileSystem->move($path . '/fontawesome-free-' . $fontawesome_library['version'] . '-web', $this->fileSystem->getTem ...
Score: 1
griz avatar
Key based access control for private files
jp flag

I'm building a site that provides paid video content, for embedding in customer's own sites. I'm successfully controlling access to the nodes that contain the video content based on purchasable user roles.

Now I need to provide users with an embed code which ideally would only work from their domain. For now I'd be happy just to be able to limit it to specific users.

I have installed the key_auth an ...

Score: 0
How can I alter an order item field depending on inline entity form (IEF) validation?
fr flag

I extended my order item type with an additional boolean field. Before the order item gets submitted via "order edit form" (/admin/commerce/orders/{order_id}/edit), it should be validated and the boolean field should become "true" or remain "false".

The "order edit form" contains multiple inline entity forms (IEF). One of the IEF handles the order items of the order. I add a custom validation func ...

Score: 0
summerg avatar
Migration: Core fields - one missing
in flag

I'm writing my first D7 to D9 migration by taking the migrate-upgrade configure files and bring them over one-by-one, and tweaking as needed to pull only over a small subset of my data. Things are going fairly well, and I have a few content types, fields, and content coming over as expected.

I tweaked the source plugin "d7_field" so I only pull a few fields from the old site, all of them field ty ...

Score: 0
dasj19 avatar
How do I set an incremental property on a custom field?
jp flag

I built a custom module which creates a custom field type (with formatter and widget), and I would like to make one property of the field incremental (to increase its value by one for each instance of the field.)

What I have so far is:

  1. web/modules/custom/asciinema/src/Plugin/Field/FieldType/AsciinemaItem.php (the field definition)
  public static function schema(FieldStorageDefinitionInterface $field_ ...
Score: 2
consuela avatar
Can't preselect time zone in hook_form_alter
ba flag

I'm writing a custom installation profile/distribution and I want to pre-populate some fields in the 'Configure Site' form (/core/install.php). I have managed to prefill/preselect other fields like (Site name, Site email address and Default country) but cannot preselect the Default time zone field. This is the code I am using:

function mydistribution_form_install_configure_form_alter(&$form, FormSta ...
Score: 0
How to deal with "Recursive router rebuild detected." exception error
ke flag

I am frequently seeing module installation and uninstallation fail with the error

Uncaught PHP Exception RuntimeException: "Recursive router rebuild detected." at /path/to/drupal/web/core/lib/Drupal/Core/Routing/RouteBuilder.php line 121

It seems the underlying problem is that something goes wrong, and the way that the error is handled tries to get router information that is already being changed.

 ...
Score: 1
quantumized avatar
How can we hide shipping information section if a user selects pickup shipping method?
ng flag

Using Commerce 2, we have created a flat rate shipping method for Local Pickups.

screenshot

Since the order is not shipped for local pickups, we would like to avoid users have to enter their shipping information.

How can this be achieved?

Score: -2
How do I show a block with a unique QR for each node?
th flag

There is requirement where I need to Place a Block on node where each block will be having the Unique QR code.

I created an hard-coded QR code block with the following code.

public function build() {
  $path = '';
  $directory = "public://Images/QrCodes/";
  \Drupal::service('file_system')->prepareDirectory($directory, \Drupal\Core\File\FileSystemInterface::CREATE_DIRECTORY);
  $qrName = 'myQrcode';
 ...

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.