Latest Drupal related questions

Score: 0
Jennifer avatar
Error when instantiating custom field in custom module
nl flag

I apologize if the answer to this is obvious, but I am newly-embarked on porting a number of complex custom Drupal 7 modules to Drupal 9. I am using Drupal version 9.3.6, PHP version 7.4.28, mysql, apache2. I have created a custom field as follows, which on install goes without errors and appears in the field list report:

langcode: en
status: true
dependencies:
  module:
    - user
  enforced:
     ...
Score: 0
Alex avatar
How to find all nodes that have no translation for specific language?
in flag

I am looking for a programmatic way to find all nodes of language en that have no translation for language XY. Is there even a way to do that without raw sql? I tried using entityQuery but I cant get the negative condition get to work...

Score: -1
Robert avatar
hook_menu() items disappeared and no longer work
id flag

I'm feel like I'm losing my mind here. I have written a custom module and implemented hook_menu to add custom admin pages. Last week this worked perfectly - this week they stopped working then vanished altogether. I can't understand what the problem is and I can't even get simple pages to work now.

This is the code I am using.

nhs_session_judge.module

/**
 * Implements hook_menu().
 */
function nhs_se ...
Score: 0
Sam Bara avatar
Is there a way to downgrade core from 9.3.6 to 9.2.7?
ua flag

After updating the Drupal core version from 9.2.7 to 9.3.6 I got an error.

TypeError: Argument 1 passed to Drupal\Core\File\FileUrlGenerator::generateAbsoluteString() must be of the type string, null given

I tried to apply the patch in TypeError: Argument 1 passed to Drupal\Core\File\FileUrlGenerator::generateString() must be of the type string, null given but it gives an error.

Could not appl ...

Score: 0
Bass-Ninja avatar
Disabling Flag link access on view
ru flag

I have a custom entity displayed in a view. If some field is of a certain value, the Flag link should not be available and replaced by some text.

function my_module_preprocess_flag(&$vars){
  $f = \Drupal::service('flag.link_builder');
  if ($vars["flaggable"]->field_my_field->getValue() != null) {
    if ($vars["flaggable"]->field_my_field->getValue()[0]["value"] == "0") {
      $l ...
Score: 0
ymdahi avatar
Views Block Language Detection
in flag

I have a site with two languages (EN/FR). I have a Content Type (Article). I have a Block built with Views that is displayed on the Article Node page. This Views Block has a translation.

When the user switches to FR, all other Blocks and UI components detect and render in this language. Even if the user visits a node that does not have a FR translation, it will render the rest of the site in FR.

How ...

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.