Latest Drupal related questions

Score: 0
Disable form element depending on media image dimensions
in flag

I have paragraph that contains one media image field and one checkbox field. What I need is to disable that checkbox if selected image media is less then X pixels wide. So it should work when paragraph is opened for editing and also react if image is changed during paragraph editing. How can I achieve that? Is there some event which reacts on media image being changed that can be attached to form?

 ...
Score: 0
Get all entity reference options from a field name
in flag

I would like to create a node programatically and one field field_supervisors has an entity reference field for the node type People.

In order to set the correct entity reference information I need to set:

[
  ["target_id" => 1],
  ["target_id" => 2],
  // etc..
]

How can I get the individual id of the entity reference from the field_supervisors. Do I really need to look up the node People

Score: 0
The "node" parameter was not converted for the path "/node/{node}"
tr flag

I have the following error in the filters with parameters in view type pages. will there be any solution to this problem?

Drupal\Core\ParamConverter\ParamNotConvertedException: The "node" parameter was not converted for the path "/node/{node}" (route name: "entity.node.canonical") in Drupal\Core\ParamConverter\ParamConverterManager->convert() (line 104 of /var/www/html/web/core/lib/Drupal/Core/P ...
Score: 1
How to display all data from a paragraph field in views (Drupal 7)
ae flag

I am currently a caretaker for a Drupal 7 website and I can't figure out how to group paragraph items in views. I have created a content type Products and one of the fields is called product variation which is field type paragraphs. I have created a paragraph bundle for that field.

Then I created a view to show the products on the front page. To display the paragraph fields I created a content re ...

Score: 0
JaSiMi avatar
Drupal7 Views relationship multi value custom column
bo flag

Im using Drupal7 and views, views relationship

Im displaying the results in table format with the help of view along with other custom tables as well as by using views relationship.

I need a help in below issue:

I have a custom table: employee

Columns: nid, uid, role

nid uid role
100 4 manager
100 5 dept-manager
100 6 assistant
100 7 manager2

In the table format of the view, I need  ...

Score: 0
Sudheesh S Babu avatar
How to get the base URL of a site in Queue API?
co flag

I am trying to get the base url of the drupal 8 website in a queue process but I am getting http://default as the base url. What am I missing here?

  public function testUrl() {
    global $base_url;
    var_dump($base_url);
    $host = \Drupal::request()->getSchemeAndHttpHost();
    var_dump($host); // output - http://default
    $host2 = \Drupal::request()->getHost();
    var_dump($host2);  ...
Score: -1
OmarAc avatar
Webform 6.1.0 help text not showing
us flag

I updated my webform Module from 5.3.0 to 6.1.0,

I have one the Following Error: the help text isn't displaying its content on any form on my site (Example of help icon in the shared image) help icon

It should return the following when i do the mouseover: wanted result

I tried:

  • searching on google: no clear solution
  • changing the css and js file persmissions to 777
  • looked into my console: no return when i do mouseover o ...
Score: 1
FooBar avatar
Migration away from Open Atrium
cn flag

We have an intranet site running on Open Atrium (A product which has not been supported or updated in some time) and would like to migrate to a Vanilla Drupal install on either 8 or 9.

We do not use any custom code (we do use a few additional modules, which as far as I can tell are supported in at least 8.x).

Is there an accepted method for doing this?

I have tried disabling all the OA modules and then ...

Score: 1
Attempting to return region in theme suggestions for the book module book tree block
cn flag

Editing question based on information from @NoSssweat

The book module uses the same hook for the book tree block and the rendered index view in the book page.

I have used the below code to return file name suggestions, so that I can override the html output for the book tree block in a specific region - "sidebar-first". I expected the below code would spit out something like book-tree--book-toc-180--sid ...

Score: 0
View injecting weird html elements (b element)
in flag

I've noticed recently that, in a drupal website I'm maintaining, a view displaying a list of content type called Event, has some weird html elements injected. This messed up the layout and I'm not sure what caused it.

The element injected is <b data-stringify-type="bold">, which is placed inside the views-row element.

I'm wondering, is someone of you already encountered this? I haven't found a way ...

Score: 0
Node access based on the user reference field
mx flag

I have a content type that is used for temporary access. The node is created and has an expiration date; it's deleted after that date. On this node there is a user reference field; only the users added to this field should have access to viewing this node. I can't find a hook to handle this access. In Drupal 7 I used hook_node_access(), but it doesn't seem to exist for Drupal 9.

The only information I'm ...

Score: 1
liquidcms avatar
How to alter Layout Builder block visiblity?
us flag

Is there a hook to alter block access for blocks placed using Layout Builder? I see there is hook_block_access; but sadly this is not triggered when the block is placed using Layout Builder.

There is also work going on here: https://www.drupal.org/project/drupal/issues/2916876#comment-14279293 to allow standard block visibility settings to be made available to Layout Builder blocks; but this only all ...

Score: 0
Bulk assign content to Book
cn flag

I've decided to reorganize my site to use the book module. How do I bulk move specific content types to be children of a book?

Bulk Update Fields doesn't include the Book meta data, so I am unable to update that way.

Score: 0
Warning when repeating migrate:import process
in flag

I created source and data process plugins for mongo db. And when I run import for the first time it works well. But if I run it again, immediately after that I get warning:

[warning] Could not load the following items on index Content index: "entity:node/104:en", "entity:node/105:en", "entity:node/106:en", "entity:node/107:en", "entity:node/108:en".

Where those are the ids of previously imported nodes ...

Score: 2
Giuseppe avatar
How get the view mode\third_party_settings of a field inside hook_preprocess_image_formatter(&$variables)
br flag

I'm on D9.

I've added a custom option to the image field formatter following Drupal guidelines

In the preprocess of the field I can get the settings I've created:

function my_module_preprocess_field(&$variables) {
  if ($variables["element"]["#formatter"] === 'image') {
    $entity = $variables['element']['#object'];
    $view_mode = $variables['element']['#view_mode'];
    $field_name = $variables[' ...
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 ...

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.