Latest Drupal related questions

Score: 0
What are the consequences of deleting the default webform content type provided by the webform module?
cn flag

I would like to delete this content type to simplify the Add content screen as we are only planning to use webforms as blocks.

What are the consequences if any of deleting the default webform content type provided by the webform module?

Score: 0
Madhav  avatar
How to render html video body in twig
br flag

I have following code in my CustomVideoBlock.php file

foreach ($video_result as $video){
    $title = $video->title;
    $video_body = $video->body_value; 
  }

$video_data = filter_var($video_body, FILTER_SANITIZE_FULL_SPECIAL_CHARS);

The $video_data hold this kind of value

<div itemscope="" itemtype="https://schema.org/VideoObject"><meta itemprop="uploadDate" content="Fri Jan 21  ...
Score: 0
Solr search field mapping
sn flag

In drupal 8 solr search not bring the result on some keys which are exist in solr data but due to solr dynamically added prefix in key fields unable to get search results on some key fields. I think prefix are depends on field types.

Suppose "title" is our key then solr store it's key in database with prefix like tm_X3b_en_title.

Don't know where to look to stop this behaviour

Score: 0
pglatz avatar
configuring backup migrate file name in settings file
in flag

Drupal 9.3.7, backup_migrate 5.0.1 --- On my dev machine, I've set the name for backup_migrate backup files in the config settings. When I export the database to my production machine, I'd like to use a different file name for the backup. How can I do this in the settings.php for the production site? (I have separate settings.php for the dev and prod sites). Can I set a $settings[] var in settings.php?  ...

Score: 0
Conditional form validation by role
us flag

I'm lost on how to do this. I need guest users to have the form fully validated (using the client side validation module) upon creation, but not validating for an authenticated user.

tldr;

The customer (always a guest) will be able to place an order for pickup on a particular date, that date cannot be earlier than 5 days from "today". The customer must always obey the validation rules. Easy, thes ...

Score: 1
bgeorge avatar
Get field value from multiple entities at once
ar flag

I have a Drupal site using paragraphs in which one of the content types, let's call it a Group, can contain any number of paragraphs, and each of these paragraphs, let's call them Members, contains a reference to a user. I want to get all the uids of users which are Members of a given Group.

I could accomplish this with a query of the database like

SELECT field_user_target_id
FROM paragraph__field_us ...
Score: 0
Off-site payment gateway success/failure return is caught by a differnt custom module
lc flag

I have created an offsite (redirect form) payment gateway Drupal 8 module for Opayo.co.uk. following drupal commerce documentation.

Issue: My custom off-site payment gateway module based on form redirect works perfectly fine on fresh Drupal 8 Commerce site with default checkout-flow. response from payment provider is received on these ends: /checkout/ORDER-ID/payment/return (on successful payment)

Score: 1
thiokol avatar
Commerce - empty cart of EXISTING items when adding new item of specific order item type
cn flag

When an item of a specific order item type is added to the cart, I want to remove any existing items from the cart, but keep the item that has just been added.

I presume CartEvents::CART_ENTITY_ADD is the only event I can do this in, but anything i try with ->emptyCart or ->removeItem removes both the existing items AND the item that has just been added, leaving the cart empty after adding  ...

Score: 0
Jorn Reed avatar
Twig template for specific node view
il flag

I have a views-view--resources-filter.html.twig file. Within here I have a better exposed filters form and I loop through the resources (node) with the available {{ rows }} variable. My question is, what is the naming convention to make a node view for an unformatted list where I use fields to show? So basically that it only styles the nodes within this view. I've been looking for a solution all day, ...

Score: 0
Joost avatar
Customize RSS feed
jp flag

I'm trying to create a RSS feed with 3 news items and one custom item. This custom item needs to be build manually. I want something like this.

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">

<channel>
  <title>RSS</title>
  <link>https://www.RSS.com</link>
  <description>RSS Example</description>
  <item>
    <title>New ...
Score: 1
emma avatar
Why do relationships return only one result?
ro flag

I am using Drupal 7. I created a view that uses 8 different (chained) relationships to access a specific entity type. Then, the view displays some fields of this entity type. The view has some filter criteria as well (making sure the fields of the entity type are not deleted), and a Contextual filter on the logged-in user's ID.

The first relationship of that view takes the user ID and makes avail ...

Score: 0
Twig Template - Div Element Being Inserted in Link URL
pe flag

I have a link field type that I'm referencing in a Twig template. I'm using this code:

<div class="outlined">
<a href="{{content.field_3_column_image_link}}">{{content.field_3_column_image}}</a>
</div>

...BUT when I hover over the link I am seeing https://nameofsite/<div>/node/1</div> instead of https://nameofsite/node/1.

Can someone help me figure out why this  ...

Score: 0
How do I make links from views to be opened in modal popups without adding custom rewrite?
hk flag

I was trying to find if there is a way to avoid writing custom rewrite for links to open in modal popups from a view.

Here is what I am rewriting a custom field for doing this now.

<a href="url/{{ field_value }}" target="_blank" class="use-ajax" data-dialog-type="modal" data-dialog-options='{"width":"60%", "title":"Popup title"}'>View</a>

The problem with this approach is that this would requ ...

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.