Latest Drupal related questions

Score: 0
drupal view how can i filter results for certain node ids
ca flag

i have created a view via the gui. I have tried to filter on the nodes i want, either with a normal filter and an or, and adding a few of them in a contextual filter. I face two issues: 1. i cannot add as a filter say 1000 nodes, and as a contextual filter as well.

  1. Even if i manage to get running the views for the given ids, i get timeouts, since i am searching against thousands of nodes.

Is ther ...

Score: 0
simp you avatar
Webform custom element layout twig
ph flag

I am creating a custom webform element, im using the /modules/contrib/webform/webform_example_example, i installed the module and added the element to a form but now i want to customize the webform in a twig file.

Is this possible?

Score: 1
dwienecke avatar
Two step entity reference selection
vn flag

I want to create a two step entity reference selection in Drupal 9.

The structure so far:

Content Type: Company

--> Entity reference: Jobs (multiple)

Content Type: Job

--> Entity reference: Qualification (multiple)

Content Type: Qualification

I created an import for the company profiles and there is a entity reference for multiple jobs. This is already working.

In a second step there should ...

Score: 0
Francisco Javier Valero Moreno avatar
Why is not printing the Table?

I have this code:

$form["noah-search-container"]['actions'] = [
  '#type' => 'button',
  '#value' => $this->t('Buscar'),
  '#ajax' => [
    'callback' => '::noahSearchQuery',
  ],
];
$form["noah-table-container"] = [
  "#type" => "container",
  "#attributes" => [
    "id" => "noah-table-container"
  ]
];
$form["noah-table-container"]["accession-table"] = [
  "#type" => "t ...
Score: 2
How to check if path alias exists
in flag

In Drupal 8, my custom module includes the code

if (\Drupal::service('path.alias_storage')->aliasExists($path, 'en')) {
    return true;
}

What should this look like in Drupal 9.2? Seems so simple, but I can't figure it out after reading every post I can find.

Score: 0
How to authenticate users with SAML on a decoupled site
ru flag

I have a Drupal 9 website that uses SimpleSAMLPHP for SSO with MS ADFS. Now I want to convert this website to decoupled architecture and would like to create some pages in Angular and the rest of the site will remain the same. Drupal will serve as the backend for these Angular pages.

In the above scenario what approach should I take. When a user hits a page created using Angular, how should I aut ...

Score: 1
quantumized avatar
Is it possible to create new node ID's when migrating content instead of using the existing one?
ng flag

We're working on migrating a D7 site to D9 and will be creating new nodes (with new node ID's) before the site launches. The next time we sync the content from the D7 site to D9 the migration will overwrite the new nodes that we create on the new site.

Is there a way to run a migration and create new node ID's instead of using the old/existing ones?

Score: 0
bigboy avatar
How to get language prefix in URL for terms without translation?
gu flag

I have a multilingual website with taxonomy vocabulary, which terms are not translatable (company names).

But each term has translated meta tags and paths, depending on the selected site language.

For example, term paths:

  • /vocab-name/term-name (default, english)
  • /de/vocab-name/term-name
  • /es/vocab-name/term-name
  • /it/vocab-name/term-name
  • etc

I can access all of them, metatags are displayed in the c ...

Score: -1
Webform Table missing in Views
ad flag

I have a webform created on our site we want to be able to show the user its submitted values and everything seems to be working but the table, I have downloaded webform views. Please help i'm not very good with css but learning. My thinking is the css in the theme but unsure. We have a drupal 7 site and its seems to show up the way its suppose to.

Fuel ReimbursementFuel Webform submissions

Score: 1
Giuseppe avatar
How to hook on paragraph deletion?
br flag

I'm on D9 and I've a paragraph inside a content type node.

I need to hook when the paragraph is deleted to do some custom logic and set up a queue.

I've tried hook_entity_delete, hook_entity_predelete or hook_paragraph_delete, hook_paragraph_predelete: those hooks run during cron, if the node containing the paragraph is deleted.

However, it seems to me those aren't triggered if an existing paragraph ...

Score: 1
Setting latest revision has been delayed
ar flag

We are (still) using Drupal 8, the latest version, as a CMS for content editing. Our platform is huge and it has 100+ editors who are constantly adding/editing content, and also 20 importers which are importing content all the time.

We are hosting our platform on Azure Kubernetes Service, and using custom Azure VM where we host our custom MySQL server. We have had this setup for a year and a half ...

Score: 0
Yakimkin Roman avatar
The sequence of actions upon cookie-authentication to Drupal site
jp flag

There is a drupal 9 site that has a REST-endpoint that can be accessed for logged-in users (not for anonymous ones).

And, it's necessary to make a GET request to the endpoint using cookie authentication.

Could you clarify, what the correct algorithm of this request is?

I tried to do it two ways.

Way #1.

Send a POST-request to user/login with credentials and get CSRF-token, then use the token in hea ...

Score: 0
finnishNinja avatar
Migrating one field into multiple rows
kn flag

I am trying to migrate html code into multiple paragraphs that need to be linked together somehow. My idea is to have them linked my ID that comes from the dataset, maybe using that ID as second source. My code currently creates multiple paragraphs but there is no link between them. The data comes form csv an I am using Drupal 9

TLDR: How to map one column from csv file into multiple rows in mapp ...

Score: 0
Marwen Amri avatar
Batch Error: Using $this when not in object context, so Can I call batch method in non static way?
sy flag

The existing code

when a form is submitted I execute this batch :

/**
 * {@inheritdoc}
 */
public function submitForm(array &$form, FormStateInterface $form_state) {

  $node_titles = ['node1', 'node2', 'node3', 'node4', 'node5'];

  $batch_builder = (new BatchBuilder())
    ->setTitle(t('Processing Batch'))
    ->setInitMessage('Batch is starting')
    ->setProgressMessage('Processed @ ...
Score: 0
SomebodySysop avatar
How to use sql MAX() function in views plugin query
gb flag

I am creating a custom views filter for a custom views field. The following SQL will accomplish the filter I seek:

select nid, moderation_state, content_entity_id, MAX(content_entity_revision_id) 
  from node inner join content_moderation_state_field_revision on nid = content_entity_id 
    where content_entity_id = 59 group by content_entity_id

In my views filter plugin php file, I have the followin ...

Score: 0
Frédéric Hébert avatar
specific submit handler to user form
us flag

I have a submit handler to the user form. It redirect the user to a specific page.

use Symfony\Component\HttpFoundation\RedirectResponse as RedirectResponse;

/**
 * @file
 * Primary module hooks for EHESS Propositions 3 module.
 *
 * @DCG
 * This file is no longer required in Drupal 8.
 * @see https://www.drupal.org/node/2217931
 */
function ehess_propositions_3_form_alter(&$form, &$form_s ...

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.