Latest Drupal related questions

Score: 0
fallenturtle avatar
Create custom views filter to return nodes based on elapsed business days since a date field
au flag

Background: I need to produce some tables in Views that show entities that have had a certain status (based on a taxonomy field) for x number of business days. I've already set up fields and rules so that each time the entity has its status changed a datetime field is filled with the current date and time.

Next I created a custom module that added custom fields to the View showing how many busine ...

Score: 1
Lambic avatar
Uploading a user picture with json:api
ph flag

I'm trying to craft a curl request to upload an image to the user_picture field on a user entity using json:api.

The documentation is, umm, minimal, but I've used it as a starting point and I have this:

curl -s -X POST -b cookie.txt \
    --header "Accept: application/vnd.api+json" \
    --header "Content-type: application/octet-stream" \
    --header "X-CSRF-Token: $TOKEN" \
    --header "Content-Disp ...
Score: 0
How to output nodes tagged only one term?
in flag

I have many nodes with taxonomy term field "Tags"

For example:

1 node with tid: 10, 12, 20

2 node with tid: 10

3 node with tid: 10, 16, 18

4 node with tid: 10, 20

5 node with tid: 10

I try use filter Term ID = 10 in Views, but it output all nodes with term 10.

How I can output nodes tagged only one term - tid 10 (nodes: 2 and 5)?

Score: -1
May  avatar
How to load content depending on screen size without hiding using CSS?
zw flag

I have a responsive site. Lots of content is hidden depending on screen size.

This slows down page speed. And on slow devices has a lot of content shifting whilst content is hidden/shown.

In drupal 7 I used browser cap, to detect whether the browser was mobile or desktop and was able to not show blocks/content without having to hide them via CSS.

Is there a way in Drupal 9 to only have content loaded f ...

Score: 0
How to translate front but keep admin in FR
pk flag

I have a website with translation by domain, ex :

  • monsite.fr
  • fr.monsite.ca
  • en.moniste.ca ...

But in admin i'd like to stay on monsite.fr/admin whatever content that i translate, is it possible ?

Regards

Score: 0
E-mail uploaded file from file field in node to user using Rules + Swiftmailer
kr flag

I have a node type "invoice" which contains a file field "field_invoice" (pdf). I'm setting up following rules action and am searching for a way to rules pick up the file from "field_invoice" and send out an e-mail with the file attached to an user.

I'm on D9.3.x and have Rules + Swiftmailer running properly.

This is my current Rules

  • Event: After saving a new content entity of type Invoice
  • Conditi ...
Score: 0
How to execute migration in queue through cron run?
kr flag

I am migrating some nodes from an API.

The API only accepts 60 requests per minute.

So it means if 60 items are imported in a minute, all other items will not be imported because the API will return 429 error code in that case.

So on the next cron, the same 60 items will be processed and will be updated. All the other items will never be imported.

    function mymodule_cron() {
      /** @var \Dru ...
Score: 1
sonfd avatar
How can I migrate the values from a multi-value D7 taxonomy term reference field into a D9 field?
in flag

I have a node migration using the d7_node source plugin.

I'm trying to migrate the values of a multi-value taxonomy term reference field into a multi-value taxonomy reference field in D9. There is a separate migration to import the taxonomy terms that works great.

In my node migration, I have something like:

field_my_tax_field:
  plugin: migration_lookup
  migration: my_taxonomy_migration_id
  source: fie ...
Score: 0
AlbionBrown avatar
FormAPI - Values of AJAX added fields missing from values array on submission
vn flag

I'm using the Form API to create a form where I have multiple instances of a fieldset. Each fieldset contains the same fields, one for storing an email address and another for another bit of information. But essentially they're both textfields that use autocomplete which works fine. But I'm having an issue in the submission handler, described underneath my code below.

$form['authors_container']['au ...
Score: 1
Bass-Ninja avatar
Set entity field to read-only after user input
ru flag

I am using hook_entity_presave() to check some conditions and set field value. I would like to set the field to read-only after all conditions pass and the value is saved to database. Is it possible to achieve this or must I use another hook for this?

Score: 2
How would I disallow special characters in usernames?
tr flag

By default, Drupal 9 allows usernames to have spaces, periods(.), hyphens(-), apostrophes('), underscores(_) and @ symbols.

How would I disallow spaces, periods, apostrophes and @ symbols?

Score: 1
Giuseppe avatar
Views: how show a link to the translated entity?
br flag

I'm on D9. I've a View of moderated content nodes, so of Content revisions elements.

Those nodes are also translatable: the default language is it and the eventual translation is en.

The views formatter is a table which shows both original nodes and their eventual translations.

I need to show for the elements of default language it:

  • a link to the translated language version if it exists - which could be  ...

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.