Latest Drupal related questions

Score: 0
Libbna Mathew avatar
Submit button of exposed form is not working when it is clicked 2nd time in drupal behaviors
in flag

I have created a search form using search API. After clicking on search button search results shows because of search API. Using drupal behaviors I have added a click event on search button, that when it is clicked the sub-menu's display:none; and clear search button - display:block;

The click event is not working on search button. It always shows results on every click but does not change the di ...

Score: 1
Sarah C avatar
How to change the CKeditor button for media library module
za flag

The Drupal 9 Media Library includes a button for CKeditor. The button depicts an image icon combined with musical notes. We plan to only use this button for video. How can I replace this button with one of our own design?

Score: 0
Ex0r avatar
How to define where to display form_state->setError when using multiple ajax callbacks?
cn flag

I am working on some custom functionality inside of a views table view that enables a 'quick edit' form as an available field via views field plugin.

The form is rendered to each row separately using a unique sub_id passed to the form builder for each row.

I have the form working, and it does the submit stuff correctly, but the problem is I need to do two things on ajax callback, so I am using the A ...

Score: 0
How to pass group context to custom form page using group module
in flag

I have a custom block that is displayed within each group on every page. The block visibility is set to /league/*

The custom block shows up fine for /league/{gid}, /league/{gid}/members, /league/{gid}/edit, /league/{gid}/invitations etc.

I created a custom form with a route of /league/{gid}/segments, but my block is not rendering correctly on that page because of this line in my block:

if (($group  ...

Score: 1
Lasutriv avatar
Can't seem to format date in twig from UTC to User's locale
in flag

I am trying to format the date field from an event content type that I've created so that I can pass the date into an event exporter that creates events in calendars such as Google, Apply, Yahoo, and Microsoft. I use calendar_link which takes a few fields and the dates to create the appropriate calendar event.

{# calendar_link(link_type, title, start_date, end_date, all_day, description, location) ...
Score: -2
Euclid.H avatar
How can I loop on checkboxes to hide all using mlid: from the datatable?
gb flag
function ts_core_form_menu_overview_form_alter (&$form, &$form_state, $form_id) {
  $form['mlid:11242']['hidden']['#type'] = 'hidden';
  $form['mlid:11246']['hidden']['#type'] = 'hidden';
  $form['mlid:11249']['hidden']['#type'] = 'hidden';
  $form['mlid:11250']['hidden']['#type'] = 'hidden';
  $form['mlid:11252']['hidden']['#type'] = 'hidden';
  $form['mlid:11253']['hidden']['#type'] = 'hidden';
 ...
Score: 0
EntityReference display french item when no english translation
cn flag

Ok... Maybe I don't understand the correct way to do this, but...

I have a (translatable) entity (entity1) with a entity_reference field embed by code (declared with baseFieldDefinitions method). This field is not translatable. The field embed another type of entity (entity2), which is translatable too.

I create two "entity2" entities in french, and translate only one. These two entities are attache ...

Score: 1
andileco avatar
How can one use one Webform element's selection as the argument in an Entity Select element using Views
rs flag

I am hoping to use the selected option of one Webform element ("Organization") as the argument in an Entity Select element ("Site") using Views handler.

organization:
  '#type': entity_select
  '#title': 'What is the name of your organization?'
  '#empty_option': 'Please select'
  '#target_type': node
  '#selection_handler': 'default:node'
  '#selection_settings':
    target_bundles:
      organiza ...
Score: 1
How can I display the NID in a views table template?
es flag

I want to take the NID field and display is as the row ID in a Views table. (I can then use that ID as an anchor to jump to the correct row in the table.)

However, I cannot for the life of me, find a way to 'print' the NID value in the views-view-table.html.twig template (I've changed the template name to match my view).

In a views-view-unformatted.html.twig template I've used the following (which w ...

Score: 1
gmak avatar
Entity Reference View as a 'Content' Field Select List only shows the last item
cn flag

I have a view that gets values from a series of paragraphs in a node. The view works, and shows a list of all of the values for a field, in each of the paragraphs.

I have an entity reference view, based on the above, that also shows the multiple items returned by the view.

In the Views preview, both the Page and the Entity Reference return a full list of values.

In a node, I have included an Entity Ref ...

Score: 1
How do I get the un-truncated error message from dblog?
ru flag

The "Recent log messages" is very handy to track down errors on sites. While this works great for errors in PHP code, it is often unhelpful for errors in Twig code. E.g. I've this error message in my log:

User error: "attributes" is an invalid render array key in Drupal\Core\Render\Element::children() (Zeile 98 in /web/core/lib/Drupal/Core/Render/Element.php)

#0 /web/core/includes/bootstrap.inc(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.