Latest Drupal related questions

Score: -2
Matoeil avatar
how to import 3 xml selectors in one drupal field using the migrate plus module?
za flag

the migrate_plus migration conf i had so far was

process:     
  title: title
  body: job_description
  field_job_diffusion: offer_type
  field_job_statut: statut
  field_job_domaine: domaine
  field_job_campus: campus
  field_job_niveau_etudes: study_level
  field_job_emailapi: application_email

It works for single XML selector to single field mapping and migration. I need now to get the value from 3 ...

Score: 0
andileco avatar
How can one programmatically get the bundle constraint for an entity reference field?
rs flag

I'm working in the context of a Views plugin. I have $entity_type and $field, as required in the snippet below. How can I get the bundle constraint for the entity reference field programmatically?

/** @var Drupal\field\Entity\FieldStorageConfig $field_configuration */
$field_configuration = FieldStorageConfig::loadByName($entity_type, $field);

$field_configuration->getType() gives me "entity_referen ...

Score: 2
How to create a view that lists all taxonomy terms of a vocabulary, filtered by a term id?
cn flag

I have a lot of different vocabularies. On The taxonomy page (the standard view provided) I would like to add a block (view) that takes the current taxonomy id from the url/page and displays all taxonomy terms belonging to the same vocabulary. I tried adding a contextual filter, but when I choose term id from url, the view only shows one term, but I would like to show all terms of the vocabulary the ter ...

Score: -1
How to create a custom example module?
cn flag

I want to create a custom module in minimum, i.e. a module which can be installed but generally doesn't do anything just for the sake of understanding how are custom modules get created after some hard time with the documentation.

example.info.yml

name: example
type: module
core_version_requirement: ^8 || ^9
description: 'example'

example.php

<?php
?>

Assuming that this is the way to go and no ...

Score: 0
pglatz avatar
How do I fix a var-dumper conflict?
in flag

My upgrade is failing. I am at 8.9.19 and I used upgrade-status to make sure all my modules are compatible with next major core version. I am following instructions at https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-later

When I get to step 3, running composer update, I get these problems:

- Root composer.json requires drupal/devel ^2.1 -> satisfiable by drupal/devel ...
Score: 0
Thony avatar
Migrate Json data with non-numeric unique identifier (from facebook...)
cm flag

I am trying to fetch posts form facebook, using migrate.

My question is:

in my migration conf.yml how should I set the source:ids key to handle non-numeric IDs, like the ones provided by facebook that look like that 1333842536759100_23306506123438


Some details:

I fetch a json from FB that look like that:

{
   "data": [
      {
         "permalink_url": "URL",
         "created_time": "2021-11-06T16:59: ...
Score: 1
Use async with drupal_http_request()
in flag

I need to make an asynchronous call with drupal_http_request(). Is it possible?

Score: 2
May  avatar
In event subscriber, how to redirect if value doesnt exist?
zw flag

I am trying to check a condition before page load, if value exists to load page if not to redirect.

I am following this page

I have created a /mymodule/mymodule.services.yml file and a /mymodule/src/MyModuleSubscriber.php file.

In MyModuleSubscriber.php I would like to check if a value exists, if it does to load site as normal, if the value doesn't exist to perform redirect.

This is the code, but not su ...

Score: 0
Hide pane based on cart state
tr flag

Can anyone point me to a right direction. I have created a custom Checkout flow and it has payment pane in it.

I'm trying to skip payment pane if the Cart state changed (default cart state is draft) I couldn't find any documentation for this in Drupal Commerce documentation or through Google.

I don't know what hook is available for this (if there is any) or where to start.

Thanks

Score: -3
pglatz avatar
Upgrading from 8.9.19 to 9 fails because of root composer.json require (^8.8.0)
in flag

My upgrade is failing. I am at 8.9.19 and I used upgrade-status to make sure all my modules are compatible with next major core version. I am following instructions at https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-drupal-9-or-later

When I get to step 3, running composer update, I'm getting a slew of problems of the form

- drupal/core-recommended 9.0.0 requires drupal/core 9 ...
Score: -2
Column isn't responsive
ca flag

this is what I want

this is what I'm getting

I have inserted a view and one column refuses to word wrap on mobile display. On normal desktop display it wraps just fine. But as seen in the second image taken on my phone, it puts everything in that one column only as one sentence.

This only happens with this view table. A regular table works fine as seen in the second image.

So, how do I fix this? Most using my site uses it via phone, and this  ...

Score: 0
drupalhorn avatar
Allow user to control access to own content for other authenticated users
ro flag

I just want a field in a content type, so that when a user creates new content he/she can select whether that content can be viewed by other authenticated users or not. I prefer doing this with a selection field displaying 'hidden/visible' to other users and then set the actual access in a custom module using some hook.

This is what I tried so far in my custom module hook entity access with conte ...

Score: 0
How to stop the need to flush browser cache AND rebuild Drupal cache after every sub theme CSS change?
in flag

How to stop the need to flush browser cache and rebuild Drupal cache after every sub theme CSS change?

Doing so would ease my testing of minor CSS changes done online (such as switching a background color) without repetitively doing both actions.

Score: 0
pazitos10 avatar
SQL Error when trying to remove content type field
np flag

I was trying to create a new Content Type for my site and I chose a field name ("description") that already used for other content types.

The problem occurred when saving changes as the machine name for the field already exists for the fields in other Content Types but with a different field type. In other Content types I used the default "Long Text" field type but in this case I chose "Read More ...

Score: 0
How to create a taxonomy term from a webform
pe flag

New to Webform. What I'm trying to do is build a somewhat simple site content-collecting tool using Webform. So users would 'collect' nodes by submitting forms on them. This appears to be easy to do. However, I need them to be able to group their nodes/form submissions into sets I'm calling 'folders.'

I could do this a couple of ways:

  • a content type of Folder + an entity reference element on the webform ...

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.