Latest Drupal related questions

Score: 1
Fill multi-value field from comma separated values in a field
kr flag

I have data in xml which I want to import into drupal. Which works fine. But one field in the xml is filled with a comma separated list of terms. There is a target field in drupal which is a multi-valued field. I do not need those as a taxonomy, just as multi-value for solr search. I just want to expand the one,fourty,flower,... values to fill the multiple-value field.

It absolutely will not work. Any h ...

Score: 0
Map profile_id based on previously mapped uid when migrating user profiles from CSV file
us flag

I'm trying to migrate users and user profiles to site, where both entities might be already present. In this case I would like to overwrite specified fields and leave others in the original state. I'm trying to map profile_id like this:

  uid:
    plugin: migration_lookup
    no_stub: true
    # previous user migration
    migration: mayors_users
    # property in the source data
    source: lau
  profile ...
Score: 0
One Taxonomy with multiple views to show content related to a specific term and referenced content
gb flag

I have two content-type:

  • Job
  • Organisation

and a taxonomy:

  • categories

The content type "Job" has a field referenced to "categories" and another field referenced to "organisation".

On the front page, I put a "view block" to list all the "categories", therefore I can browse all the jobs related to a specific category. enter image description here

On the organisation node, I put another "view block" to list all the "categor ...

Score: 0
Michael Lechasseur avatar
drupalcommerce/project-base prohibits upgrade to Drupal 9.2.4
fi flag

I'm running into composer errors while trying to update a Drupal Commerce site to Drupal 9.2.4.

I'm not sure how to interpret this output when I try composer prohibits drupal/core 9.2.4

results: https://pastebin.com/EWaDQejD

eg: drupal/core 9.2.4 requires twig/twig (^2.12.0) drupalcommerce/project-base - does not require twig/twig (but v1.44.4 is installed)

Not s ...

Score: 1
TytooF avatar
Guzzle responses from POST on REST API are mixed
so flag

I develop a custom module to store and retrieve users data from an API. I used the user entity hooks to call the API on registration, edition and consultation of the Drupal users. It works well, and we use it on several website all using the same partner API.

To update or save the data, we use a POST method with the fields in the body and without URL parameters.

In some cases, when 2 users are regis ...

Score: 0
Dorian Winterfeld avatar
Why is composer deleting and reinstalling core?
ae flag

I am running Drupal 9.2.4 on Lando on Mac Big Sur. When I use composer to install a module it first deletes core.

Removing package drupal/core so that it can be re-installed and re-patched.
 - Removing drupal/core (9.2.4)

Then it reinstalls it.

 - Installing drupal/core (9.2.4): Extracting archive

If the module fails to install, no core!

I think these are the relevant lines from composer.json.

Score: 1
Why is -content-add-list.html.twig template not being used?
fi flag

I have generated a custom content entity via the Drupal Console. It has bundles. I would like to customise the screen which you get to when adding a new such entity - the screen which displays the list of bundles, to click on the type you want to add.

When I generated the entity, a bunch of template files were created, including one called <my_entity>-content-add-list.html.twig. I am certain this  ...

Score: 0
user33550 avatar
Include jasper report in drupal 9
in flag

I want to print a report from the Jasper Report Server in Drupal. I use their PHP Client in my own controller.

$report = $jasperClient->reportService()->runReport($pathJS, $format, null, null, $controls);

I have an answer from the server and the images are displayed for a simple report, but when the report contains JavaScript code, the page remains white.

I tried using the following code.

Score: 3
Michael McGinn avatar
How to add captions to media library items?
tz flag

Anyone know how to associate a caption to a image that gets uploaded into a media library field? I can get the name of the file to show up but I can't see how to associate a caption to the image. I have the image library filed set to allow unlimited items to be uploaded to it so I can have an array of images returned when I display it in my layout builder block. I got the css to style the image array ...

Score: 1
Michael Lechasseur avatar
Should I remove "Commerce Base" from site before an upgrade?
fi flag

The "Upgrade Status" module reports that "Commerce Base" exists in site file structure, but is not installed and suggests removing it. I expect that the Commerce project references those files to work, but I don't know.

Should this project in my composer/json 'requires' list be removed using Composer? "drupalcommerce/commerce_base": "dev-8.x-1.x",

Remove listing in Upgrade Status module report

My original Drupal 8 install was with Composer u ...

Score: 1
blur avatar
How can I assign custom field layouts using paragraphs?
bn flag

For reference:

-modules
--contrib
---ds
--custom
---ds

I'm looking to add paragraph layouts using flexbox. I don't see a module specifically for this, so I realize I'm going to have to adapt an existing module.

Right now, I'm trying to add custom layouts in the Display Suite module by adding a template config to ds.layouts.twig with the appropriate html.twig and css files.

My concern is that any e ...

Score: 1
quantumized avatar
Custom block is still caching for anonymous users despite getCacheMaxAge() being set to 0 and can't figure out why
ng flag

I have a custom Drupal 8 block with class with build() and getCacheMaxAge() functions. getCacheMaxAge() is set to 0 but it is still being cached for anonymous users.

If I put debug code in the build() function I can see it being called when I'm logged in but not for anonymous users.

My code is below. We do have Memcached installed. Would that be causing the issue?

The only other caching modules are cor ...

Score: 0
Patrick avatar
Loading content in a View via a sibling entity reference
za flag

I think what I need to do is use one Drupal View's results to filter the results of another view. Here is what I am trying to accomplish.

I have 3 content types (node types): Blog, Blog Post, Biography Page (aka Blog Author)

The blog post contains an entity reference to both the blog it should be in and one or more author's biography pages.

What I need to be able to do is take the ID for a given blog a ...

Score: 2
What is the insecure orange tag in the modules release pages?
cn flag

I was checking today the release page for the Admin Toolbar module and see an orange tag with the text Insecure I tried to find an explanation about it without luck, anyone knows what this means?

enter image description here

Score: 0
Mauricio avatar
Migration of a custom Rest API using PATCH/POST
lb flag

I had a custom REST API working with Drupal 8 perfectly. After upgrading to Drupal 9.2.X, the Patch and Post methods of this custom REST API stopped working. Now they throw the following exception.

RuntimeException: Callable "Drupal\my_module\Plugin\rest\resource\UpdateBoxes::patch" requires a value for the "$payload" argument. in Drupal\Component\Utility\ArgumentsResolver->handleUnresolvedAr ...

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.