Latest Drupal related questions

Score: 0
Hubert avatar
How can I build a specific data structure?
cn flag

I have a Course content type which has several "modules." (A module is just a name.) There are also several "units," which may or not belong to a module. A unit has several fields, for example Location, Description.

I have created a Course unit paragraph type, and a Units field in the "course" content type, which references this paragraph type. That way I can create units that belong to the course.

Score: 0
Joe Balfour avatar
How can I send an email for confirmations via a webform?
in flag

I'm fairly new to Drupal development but have been learning quickly. I've been trying to setup my Drupal site to send emails for form submissions confirmations through Webform (I just need us to be notified when the contact form has been submitted), yet struggling to get this functionality to work. The site is unable to send any emails for any user confirmation or reset passwords as well. I've been tryi ...

Score: 0
Mattias avatar
How do I redirect users from the server IP to the URL with path?
ru flag

I'm working on a Drupal site. Everything works when I access the site using its IP address. My supervisor made an Nginx redirection on another server to the site's IP. Now the site should be accessible from http://example.com/services/drupal, but it isn't.

I have tried modifying the settings.php file with the following lines.

$base_url = 'example.com/services/drupal';
$settings['trusted_host_patterns ...
Score: 0
rukya avatar
Metatag image secure_url - how to find from where it comes from?
id flag

From where:

    <meta property="og:image" content="https://example.com/sites/default/files/2021-06/example.jpg">
    <meta property="og:image:url" content="https://example.com/sites/default/files/2021-06/example.jpg">
    <meta property="og:image:secure_url" content="https://example.com/sites/default/files/2021-06/example.jpg"> 

can come from? We have metatag module installed, but in ...

Score: 1
Rubix05 avatar
Dynamically load the menu items created from the links.task.yml file
cn flag

I need to programmatically load the links that are generated from my_module.links.task.yml on another page.

My exact use case is that I have a set of links that are shown when viewing my node page. The links will be shown and hidden based on the current user's access and the access control is handled through the options in the my_module.routing.yml file.

I need to create a separate page that displa ...

Score: 0
Twig template for just one page in a view
br flag

I have a Drupal view (Product Section) where I have a master view. This is the view I'm currently using for Computers, Cell Phone, and other pages I am still creating.

screenshot

I also have a Product Shop page, which is almost like the parent page. For this page, the path is /products, for Computers is /products/computers, and so forth.

In my theme folder, inside of the templates folder, I created a page--produc ...

Score: 0
jo0815 avatar
Encoding problems in drush 7 running on Windows
cn flag

I am not very familiar with PHP, Drupal and drush but I inherited a site running on Windows Server 2019 (in the process of being migrated from Ubuntu). When I want to download some webforms using drush wfx, special characters like German "Umlaute" ä, ö and ü in the webform contents are not correctly displayed.

I am running Drupal 7.81 und using drush 7.0.0. I also tried to specifially set the encodin ...

Score: -1
Renato Francia avatar
Webform submissions to 3rd party API with Refresher Authentication token
id flag

How can you send the submitted information in a webform to a 3rd party API?

I have read this: https://www.drupal.org/docs/8/modules/webform/webform-cookbook/how-to-programmatically-create-and-update-a-submission

But it looks this recipe is more about updating a submission rather that doing requests.

Any help?

Note:

I realized I can use handlers for submission, but need to use a refresh authenticat ...

Score: 1
How to prevent theme change caused by $rendererService->renderPlain()
ru flag

I'm trying to re-use the output from a heavily customized field formatter as <select><option> text in a Webform. I managed to re-use field display, but it has the side-effect of switching the theme used for rendering.

Below is a simplified code, the lines $dateRenderArray = ... and $dateHtml = ... are original and cause the problem:

function mymodule_webform_options_alter(array &$optio ...
Score: 0
Hometoy avatar
Composer not updating modules
in flag

I have a Drupal 8.9.16 website and when I try running composer update to update the modules, I get this output

$ composer update
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package container-interop/container-interop is abandoned, you should av ...
Score: 1
How to display a user's webform submissions?
gb flag

I would like the user's profile page to have a block that shows their submissions to several [webform]s. So if I go to Chris's user page, it will show the basic fields and also a block of Chris's answers to webform1 and maybe another block with Chris's answers to webform2.

Any suggestions?

Score: -2
j0e avatar
Editing the "Send private message" link to include the username
in flag
j0e

I'm using the Private Message module version 8.x-2.0-beta16 and I want to change the message from 'Send private message' to 'Send private message to @username' which should display the username from the user's page that we are visiting and contacting.

The module uses the following code.

'#title' => t('Send private message'),

Is there are way to override this line directly and insert the usernam ...

Score: 0
Get list of applicable shipping methods
ni flag

I would like to get the list of applicable shipping methods for the current cart but dependent on the selected shipping profile. I'm programming a custom controller that should returns the list of available shipping methods and rates but, obviously, given a cart and a customer's shipping profile.
Has commerce shipping module any service or class that could I use to get this information? Perhaps, is there ...

Score: 0
Akshar Vijay avatar
Issues after updating Composer 2
in flag

I have been using drupal for over a month now. I am unable to install modules properly because of the composer 2 updating issues.

So far I have made the following changes while updating composer 2 "oomphinc/composer-installers-extender": "^2", "wikimedia/composer-merge-plugin": "^2", "drupal/core-composer-scaffold": "^8"

When I try composer update I get the following errors

Problem 1
    - acquia/lightnin ...
Score: 0
Unable to check if variable is empty in views twig
in flag
Lub

I am trying to overwrite views-view-unformatted.html.twig file and want to check if title variable is empty or not, but whatever I do, it always acts just like it is not empty.

I know title variable is an object, I tried dpm() it but no modifiers work in checking if it is empty.

My code:

{#
/**
 * @file
 * Default theme implementation to display a view of unformatted rows.
 *
 * Available variables:
 ...

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.