Latest Drupal related questions

Score: 0
Automatically import fontyourface fonts
dk flag

Is is possible to automatically import selected fontyourface fonts via config? Ideally, this would be just the fonts I've selected, not all from the source API.

I'm in the middle of a D7 -> D9 migration, and I keep having to manually press that 'Import from fontsquirrel_api' button each time I test the migration from scratch. And that entails downloading all 1021 FontSquirrel fonts, rather tha ...

Score: 0
user3717206 avatar
Unable to filter fields in Search API Solr index Query
cc flag

I'm trying to run a Search API search programmatically on my solr index. The issue is that the query is quite expensive so I'm trying to reduce the cost by filtering for specific fields. In Solr I would do this through the Field List Parameter as e.g. "fl=name,surname" but I'm unsure how to do this through a Search API Search. I've tried setting the parse mode to direct as well but I just get an error th ...

Score: 0
Site stuck in 'headers have already been sent' login loop after D9 upgrade
ru flag

Suggestions for debugging a site which is now stuck in a "headers have already been sent" loop after successful login (redirect back to login form)?

This is a production server for a site that's just been upgraded to Drupal 9. Session handling is absolutely fine on the development server so I'm sceptical about it being whitespace, closing tag issue (my one custom module is fine).

  • Comparing against defau ...
Score: 0
Lambic avatar
Entity reference field dependant on other entity reference field
ph flag

Drupal 9.

I have a content type with two entity reference fields.

The first entity reference field references group entities provided by the group module.

The second entity reference field references nodes of a certain type.

I want the second autocomplete to only find nodes belonging to the group selected on the first entity reference field.

What's the easiest way to accomplish this?

Edit: Still haven ...

Score: 1
Kevin avatar
Delete millions of unused Paragraphs and their data?
in flag

We have a site that after a few years has built up 10 million records in the paragraphs_item table. This is a result of lots of data migrations (where paragraphs are involved) and there are many orphans now (probably 90% of that).

Entity Reference Revisions ships with a Drush command now to 'purge' orphaned entities. This does appear to work - but with this many to look through it seems like it w ...

Score: -2
Read view field value in VBO action
in flag

I have a view grid that has custom actions to perform based on selected grid row. To read the view fields from the grid dpm-ed the below command:

dpm($this->view->result);

The above command returns:

enter image description here

I am trying to specifically read the "field_comment_id_comment_field_data_nid" and I get null every time:

 dpm($this->view->result[0]->field_comment_id_comment_field_data_nid);

Update: ...

Score: 1
GraphQL query to validate User Login
cn flag

I'm working on the Drupal decoupled project, where the client is VueJs and the backend is Drupal 9. I'm using Drupal's contrib module GraphQL 8.x-3.1 for the interaction between client and server. I'm new to GraphQL.

I created a GraphQL query to validate the user during login. Below is the query,

query{
  userQuery(filter: {
    conjunction: AND, 
    groups: [{conditions: [
      {operator: EQUAL,  ...
Score: -1
Matoeil avatar
How to configure upload of webform document files to public folders?
za flag

When configuring the storage location of a webform document file,i am not proposed to changed it from private to public.

That is problématic to expose that URI to a distant server.

enter image description here

Score: 0
How do I omit webforms submission number (serial) from results?
om flag

We have webforms that use Webform Entity Print (PDF) Attachment. These PDFs have Submission number show up right after form's headline. How do I hide this number so it doesn't show up in the results?

enter image description here

enter image description here

Score: 0
Joehoe avatar
How to prevend duplicates of content in a view?
tr flag

On a multilingual drupal website (version 9.2.10) A block duplicates content on the landing page when 2 of more languages are enabled.

The block shows random published content for a custom content type in a grid system with a cards layout.

Due to 2 extra enabled languages, for example Dutch and German, Dutch content is duplicated and showed 3 times in this views grid now.

This duplication of content di ...

Score: 1
Jean da Silva avatar
Custom Entity "changed" field is unknown
cn flag

I'm having a problem I really don't know how to solve, and need your knowledge. I have a custom entity that someone created, and forgot to add the "changed" field. So the objective is to add this field, and updated all entities to set the "changed" field to be equal to the "created" field.

Somehow even if I've updated the entity inserting this changed field, the database shows it, and when dumpin ...

Score: 0
Media Library: How can I pre-fill the caption when an image is inserted into a text area?
in flag

If I use Media Library to insert an image into a text area, the image's caption is empty and hidden.

Instead I want the caption displayed by default, pre-filled with text in the format: [Image entity name], by [username], eg '1960s street scene, by David'

(I'm migrating a site that uses D7 + the Scald module to D9 + core Media, and I want to replicate the old site's behaviour in the new site.)

Is there ...

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 ...
Score: 1
Interlated avatar
How to filter autocomplete on a dependent field?
km flag

Goal - How to filter autocomplete based on a related field? In this domain, an organisation is selected and then the autocomplete should only allow items created by that organisation to be selected.

The setup involves an

  • inline entity form to select the organisation. This is the triggering field.
  • auto complete field to select a related bond by that organisation

The triggering element is called 'issue ...

Score: 0
Alfonso_MA avatar
Geofield -> Filter points inside a polygon
cl flag

I have two content types. Each of them has a Geofield field:

A -> It has a Geofield of type polygon

B -> It has a Geofield of type point

I would like to build a view to show all B nodes that are inside a polygon defined from a A node, on a map.

I did not find any way to get that with Drupal 8 (I tried different geo modules such as Leaflet and Views GeoJSON). Is it possible with any module comb ...

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.