Latest Drupal related questions

Score: 0
Custom payment module form problem
cn flag

I'm a bit new to drupal and i'm trying to create custom payment gateway module and stuck with a problem. When creating OnSitePaymentGateway, everything is ok and i can edit checkout form with PaymentMethodAddForm. But for OffsitePaymentGatewayBase, I'm unable to output additional information to checkout form. This is the code I am using.

/**
 * Provides the Cresh payment gateway.
 *
 * @CommercePayme ...
Score: 0
mariosdaskalas avatar
Generate Link based on custom content field types
as flag

I am using Drupal 8.9.8 and I have created a custom content type with field types such as plain text, number (integer), and so on. Then, I created Content based on the custom content types and filled in the field values. This generated a /node/2 page.

I want to combine the field values from the custom content type and generate a URL link that will be displayed in the /node/2.

The generated URL will  ...

Score: -1
Filter block by tag
cn flag

I consider to filter blocks by taxonomy tag.

Making a block to appear only in webpages which include a certain taxonomy tag.

From the last time I checked, one can filter blocks by content type but not by tag.

Is this possible to do from core and if not what would be a decent alternative, if at all?

Score: 0
Get an entity URL, not its path alias
cn flag

How can I get the URL of an entity without its alias?

This code just gives me the path alias, but what I actually want would be, for example, /en/node/1 instead of /en/node/my-title.

$entity->toUrl('canonical', ['absolute' => true, language' => $entity->language()])
  ->toString(true)
  ->getGeneratedUrl());
Score: 0
HasseWilson avatar
Views exposed filter on multiple references
pf flag

I have a site built with domain_access and quiz modules. I have a content type Page and quizzes. Both the Page and Quiz share two taxonomies (theme and category), and ofcourse domain reference.

I have a view based on taxonomy terms, where I list all pages and quizzes available on the active domain. And have two exposed filters on theme and category.

In the view i have two relationships to Page and

Score: 0
Non-admins cannot see commerce entity bundle labels
cn flag

I've got a drupal commerce site with two types of user roles -- admins and merchants. Merchants the ability to administer products for their stores, and so they have the Access the products overview page permission. What's odd, though, is that they are unable to see the "type" column. Sames thing seems to be happening on the "orders" view.

From reading around, it seems like access to entity bundle label ...

Score: 0
Carlos avatar
How do I get the submitter of a webform submission?
in flag

I'm developing my first webform handler and I need to access the submitter of the webform submission in the postSave method.

I know I can get the webform submission ID with $webform_submission->id(), but I can't figure out how to get the submitter. As far as I know, $webform_submission->getWebform()->getOwner() is NOT what I'm looking for, because it tells me the owner of the form, not th ...

Score: 0
Fields in content form are below save button
de flag

I got a problem in drupal 7.x which is that i'm trying to edit and create content from a content type that has 140+ fields and the save button section has fields below it as shown in this image: drupal form before save button

drupal form after save button

I don't know what to do in this case, i found a similar case in this page: https://www.drupal.org/node/2609736 but it never got answered.

Can you please help me?

Thank you for the attention!

Score: 1
Matt avatar
How to add new fields to the 'edit media' dialog box on media embeds
cn flag

I'm attempting to add a new select box to the dialog box that pops up when choosing 'edit media' on a media embed in a WYSIWYG. I'm referring to the dialog box that presents options like 'caption' and 'alignment'

I was able to make the field appear by using

function mymodule_form_alter(array &$form, FormStateInterface $form_state, string $form_id)  {
if($form_id=='editor_media_dialog'){
  $form['s ...
Score: 0
quantumized avatar
Clarify difference between hook_form_TYPE_alter and hook_form_TYPE_EDIT_alter
ng flag

I have a site with a lot of hook form alters for node forms and I'm finding that I have to create two separate hook functions to affect both the node create and node edit forms.

For example, I have to put both:

module_events_form_node_event_form_alter()

and

module_events_form_node_event_edit_form_alter()

With the same functionality in both functions so that it covers both new and edited nodes. I ...

Score: 0
modernizr.min.js?v=3.3.1 was blocked due to the MIME type ("text/html") not matching (X-Content-Type-Options: nosniff) - how to fix it?
cn flag

I developed a site using drupal 7. Now I migrated the site to another webserver.

The server is getting an error that I can not solve.

In the file 'core.libraries' I have the following code:

'modernizr:

Block the page from being loaded until Modernizr is initialized.

header: true remote: https://github.com/Modernizr/Modernizr license: name: MIT url: http://modernizr.com/license/ gpl-compatible: true versio ...

Score: 0
Libbna Mathew avatar
How to hide the fields in manage display when layout module is installed and display when module is uninstalled programmatically?
in flag

In the below config I want to remove the body field from content and add it in hidden as body: true when I uninstall the layout module. Basically when I install the layout module the fields in manage display should get disabled/hidden and when I uninstall the module the fields should be displayed. How can I achieve this programatically?

This config code is of entity_view_display.node.article.default ...

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.