Latest Drupal related questions

Score: 1
How to use migrate process plugin concat on multiple values?
bv flag

I am trying to import from a csv that has multiple files in the same column, e.g.

title,gallery,tag
node1,img1.jpg|img2.jpg|img3.jpg,2
node2,img4.jpg,2
node3,img5.jpg|img6.jpg,3

I need to prepend the path to these file names to get something of the form /path/to/file/img4.jpg.

I have written a process pipeline similar to the following (which doesn't work):

source:
  constants:
    file_source: '/ ...
Score: 1
Render view inside block with caching
lc flag

My setup is a bit unconventional. I have a view displaying a block, relying on a contextual filter (let's call it product ID). I also have a custom block that renders this view programmatically because I need to include this block in multiple places on the page and I have some custom logic that pulls the actual product ID to call the view with. Basically:

$view = Views::getView('view_id'); 
$args = ...
Score: 1
Lambic avatar
How to import a custom content type in phpunit
ph flag

I'm trying to write some PHPUnit Kernel tests that use a custom content type which seem to work until I try to reference fields on the content type. I'm guessing the content type isn't being imported from config. Is there a correct way to do this?

Example code which works in drush php but does not work in phpunit:

  public function createAction() {
    $storage = $this->container->get('entity_ty ...
Score: 0
Meta Tags Module: Set of available meta tags is different for certain node types
ve flag

I have a behaviour, which I don't understand: using Meta Tags and a couple of sub modules (like twitter cards, schema.org: JobPosting, etc.) On /admin/config/search/metatag/add I see them for certain node types and for others not. Does anybody know why this is and how to fix it?

Expected for all content types:

enter image description here

Not Expected, I just switched the type and everything under twitter-cards vanishes:

enter image description here

Th ...

Score: 0
Nathan Zim avatar
Build custom form with entity form field
de flag

I have a feature to migrate from Drupal 7 to Drupal 9. This allows me to build a custom form made up of static fields, which I define in the code of my module, and fields dynamically retrieved from an entity.

It worked with the "ctools_field_invoke_field function", which relies on the Chaos Tools module. This function is itself based on a native Drupal function "field_default_form".

This function wa ...

Score: 0
Drush 10 sql-sync and multi site --uri not working
in flag

I am doing some D8 to D9 migrations and having a problem with a multisite. I upgraded my local version to drush 10 as well as on my dev server and included the drush/sites/us2.site.yml file.

I can sql-sync the default db no problem, but when I try and specify a --uri it still targets my default database.

drush sql-sync @us2.dev @self says it will replace us2_local with us2dev which is correct.

drush s ...

Score: 0
Jean da Silva avatar
Breakpoints in custom theme not showing in the "group breakpoints" field
cn flag

I'm having a problem that i simply can't find how to resolve it. I've created a custom theme based on the "claro" from drupal core. Then I've installed the modules Breakpoints + Responsive Image.

I've renamed the theme as "nescau", and created a new breakpoints file. "nescau.breakpoints.yml". I've created 2 breakpoints: "nescau.mobile", and "nescau.desktop" to test the module.

The problem is when I  ...

Score: -2
BlondeSwan avatar
View Filters' OR operator not applied
br flag

I created a content view that has a filter group using the AND operator that is ANDed with another filter group using the OR operator (see image below)

enter image description here

However, the query constructed is all AND operators and groups aren't even applied. Here is the WHERE clause of the query:

WHERE 
(
  (
    // Content: Type (= On-demand)
    node__field_format.field_format_target_id = '29'
  )
) 
AND 
(
  (
    (
   ...
Score: 0
Using both Drupal Core Contact Form and contributed Webform module
th flag

I have a Drupal 8 site already utilizing core Contact Form. However, we now need a more complex form and thinking about installing a contributed module: Webform (https://www.drupal.org/project/webform).

My concern is that having both Contact form and Webform enabled, will there be an issue like one impacting the other?

Thanks.

Score: 1
Edoardo Cordani avatar
How can I access the parent entity values inside a custom paragraph formElement?
in flag

I created a select custom field that must be inserted inside a paragraph and the options values are dynamically inserted based on another reference field present in the paragraph itself. How can I access the actual paragraph instance to read the value of the reference field, so I can manage the right values inside the formElement function of the custom field?

Score: 0
hotwebmatter avatar
Set ['#default_value'] of taxonomy term reference field via hook_form_alter()?
nr flag

Here's a different question with the same taxonomy term reference field I mentioned in my previous question.

Users with Administrator and Coach roles are granted permission to register Student users via a custom "Add student" form mode (user_add_student_form). It would be better for UX if I could set the ['#default_value'] of the select_a_school taxonomy term reference field to the same school that  ...

Score: 1
Yusmely Mejias avatar
How can I let users select existing media entities in a webform?
br flag

I am a beginner in drupal and I am creating a course form I would like you to help me with a field in the webform. I need to add a field where users can add an image and documents but from the files that I have in drupal media, not from my computer. I tried with webform entity view and file entity browser but they did not work for me, I can upload my images and documents but from the computer and it is  ...

Score: -1
Not allowing the user to access the website within the given time period
ro flag

My client want to offline the site for 12:00 AM to 06:00 AM and show this message to users. How can I achieve this in drupal8

Score: 0
Regokonda avatar
How can we directly display/download attached document on Media path
us flag

I am trying to directly display/download the attached file when the Media link is reached. Main reason behind this is to avoid providing file path directly.

For example: if a user is visiting www.dummy.com/media/redcar_brochure/ then they should be able to view the www.dummy.com/sites/default/files/2021-10/redcar_brochure.pdf file directly in the attached media page. This will avoid clicking the file  ...

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.