Latest Drupal related questions

Score: 0
Andrew Morris avatar
Load original email content via hook_mail_alter()
mw flag

I'm hooking into hook_mail_alter() to make an amendment to outgoing emails before they go, but by the time they are loaded by hook_mail_alter(), any token has already been replaced.

Is it possible to use any of the information from the email to retrieve the original "tokenized" version so that I can pass those separately?

Score: 0
Francesco Marchetti-Stasi avatar
Default values for route parameters in REST resources
iq flag

The title says it all: is it possible to set a deafult value for a parameter configured in the uri_paths of a RestResource? I had a look at the code of RestResource and I have a feeling that it is not supported, since uri_paths is simply a map; but still, I thought it was worth asking the question :)

Score: 0
Automatically Insert value in field while creating content depending on user
ru flag

I am stuck on something. I have different users each representing a specific Faculty. Using the groups module I let each one edit and delete its own content but while creating a content of custom type diploma, there is a field called Faculty in which the user can select any faculty he wishes. I am trying to make this field disabled and filled automatically with the faculty itself. For more clarification ...

Score: 0
Fareed Fattal avatar
Clear field value when edit node
mh flag

I have a List (text) field in a content type that will determine the importance of the content whether it is Major or Minor and that field is set to be required. I need to force content editors to make that selection each time they edit a content page. Is there a way to clear the data from that field upon edit event?

Note: I'm on Drupal 9.2.18

Score: 0
Sarah C avatar
Add a new contextual link to custom block type to edit layout
za flag

I have a custom block type using Layout Builder.

How do I add an Edit Layout item in the contextual link menu?

The link should go to /block/{nid}/layout; after saving, the layout returns to where you started.

Score: 0
mogio avatar
Best practice for getting field values of entity chains
cn flag

I really would like to make this if/else field value check just a little bit more sexy.

What's Best Practice for dealing with nested functions chains to get entity field values (check if they exist / check if they are not empty)

 if($entity->hasField('field_intro_teaser_image_media_')){
      $media_field = $entity->field_intro_teaser_image_media_;

      if($media_field->entity){
        $me ...
Score: 1
What does #markup mean?
us flag

I meet this array key all the time in Drupal (for example in Symphony's dpm()) yet I am not able to find any documentation about it, what it does, how can I use it? How do I display something that is given as #markup value in Twig?

Score: 0
websoft avatar
Send email with PDF attachment to user that completes the webform
cn flag

When someone submits a webform that has just two fields (Name and Email) I want the system to send them an email that thanks them for submitting the form and provides a PDF file.

Webform enables emails to be sent to the user that submits the form but is it possible to attach the PDF file?

To clarify the PDF file is not submitted by the user in the webform. The webform only has two fields (Name and  ...

Score: 0
Thirsty Six avatar
Composer\Downloader\TransportException: The "drupal.org/packages.json" file could not be downloaded (HTTP/1.1 404 Not Found)
gs flag

In Drupal 8.9.x, After composer cache-clear. I am getting this error [Composer\Downloader\TransportException] The "drupal.org/packages.json" file could not be downloaded (HTTP/1.1 404 Not Found) .

I can't run the composer install or composer update.

I tried to remove the vendor folder & composer.lock files too.

Even i tried,

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.