Latest Drupal related questions

Score: -1
Programmatically create a new image style
us flag

I'm creating my own module and I need to programmatically create an image style to use with a new media type.

I found the core/profile/standard/config/optional/image.style.max_1300x1300.yml file whose content is the following one.

name: max_1300x1300
label: 'Max 1300x1300'
effects:
  04caae9a-fa3e-4ea6-ae09-9c26aec7d308:
    id: image_scale
    data:
      width: 1300
      height: 1300
      upscale:  ...
Score: -1
steevee666 avatar
How can I re-organize the user account tabs?
in flag

I have a Drupal 9 site. I can't find how to rearrange or rename the user account tabs.

How can I re-organize the user account tabs?

screenshots

Score: 0
A new field doesn't show on the page
cn flag

I recovered a site from a backup which had run on Drupal 7.7. I upgraded it to Drupal 7.80 on another instance. Now, we need to add new fields to content types and add new nodes. I added a field as an administrator. I can't see the added field on either the old site or the new one.

What I have done so far:

  • I checked the node is published
  • I checked the permissions
  • I flushed the cache
  • I verified t ...
Score: 0
HazeDesigns avatar
Prevent webform from submitting when clicking button in markup component
in flag

I have a very complex webform in a Drupal 7 website I've inherited. I have added a markup component which builds a button and added some JS that links this button to trigger a modal window to open. In the modal a block is displayed which contains a view listing some user profiles.

When I visit the webform everything functions normally and I can click the button to open the modal, but when revisit ...

Score: 1
hotwebmatter avatar
Configuration overrides have unpredictable results
nr flag

I'm setting up configuration splits with Drupal 9 and encountering unexpected results.

None of my splits are marked as Active in the active configuration or the exported configuration YAML.

I want to set the default Local split in settings.php and then use settings.local.php to override it on dev, stg, prd environments.

My local development environment is DDEV-Local v1.17.5. The three remote envir ...

Score: 0
Pin avatar
Limit avaliable dates in a event where user can sign up mutiple people in multiple dates in one single form
cn flag
Pin

Problem context

I'm bulding a site where parents can sign-up their childrens for a summer camp. Parents can choose one or more weeks for sign-up one or more children in the same form.

There are 20 seats for each week, and 8 weeks to choose, so parents should know how many seats are avaliable in each week to manage to sign-up their children (usually they prefer their children go together but if is not p ...

Score: -1
StefanYYC avatar
Access a user entity reference in a commerce-product template file
cn flag

I have a field_intervenantfield which contains a user entity reference. In the commerce-product template file, I want to access the description field of each intervenant.

How can I achieve it?

I tried reading the following values, but none of them returns what I am looking for.

  • product.field_intervenants.entity.field_description
  • product.field_intervenants.0.entity.field_description
  • product_entity. ...
Score: 0
steevee666 avatar
How do I modify the permissions assigned to a comment type?
in flag

On my Drupal 9 site, I created 2 types of comments:

  • comment_type_a
  • comment_type_b

When I go for permissions, there are only permissions for all comments in general.

How do I modify the permissions assigned to a comment type?

I want for comment_type_a only admin role can comment.

I want for comment_type_b all roles to be able to comment.

Score: 0
Tomáš Bažant avatar
Send an email to a group of users after new content has been created
de flag

In Drupal 9, I need to notify all users belonging to a role by sending them an email about the new created content.

Everything's fine, but I don't know how to put together the email addresses of these users in the Send to data selector of the Rules module.

Score: -1
Extect avatar
How to send email verification link with webform?
cn flag

I am using a webform for anonymous users (logging in is not an option). Once a webform is submitted, I want to send out an email asking to click on a confirmation link. Only once this link is clicked, I want to take further actions (i.e. trigger an email handler or change the status of the webform).

How can I achieve this or something similar?

Score: 0
Mira chalak avatar
html Form within a block
eg flag

I have a form within custom block in drupal 8 and I know that this is not the right method to write a form within a block but someone wrote it and I am trying to fix it without changing the method. In the return of the public function build() , he rendered the html of a form within the markup.

 return array(
      '#markup' => '<form>
//we have here many inputs
//then at the end:       
 <in ...
Score: 0
How do I add a custom URL for node/add/{custom-content-type}?
th flag

I have a custom content type which I fill up with the help of the Forms Steps module.

I want to set custom URL for node/add/{custom-content-type}. I tried using a route subscriber and the following code.

/**
 * {@inheritdoc}
 */
protected function alterRoutes(RouteCollection $collection) { 
  if ($route = $collection->get('node.add_page')) {
    $current_uri = \Drupal::request()->getRequestUri();
  ...
Score: 2
Monika avatar
CSRF token is not varying in Ajax callback while submitting form
us flag

I have a form with ajax callback as following , on each submit token is not varying , it remains constant for all submit .

wall.routing.yml

wall.commentform:
  path: '/commentform'
  defaults:
    _title: 'Comment form'
    _form: '\Drupal\wall\Form\WallCommentPost'
  requirements:
    _permission: 'access content'
    _csrf_token: 'TRUE'

In from as following

WallCommentPost.php

$ajax = [
  'callback'  ...
Score: 0
How to get a product variant field (not attribute) value?
au flag

I have created a product variant with 1 attribute (say "Subscription Plan" or attribute_sub_plan) and 1 field (say "Number of Issues" or field_num_issues). The attribute was for human readability while the field was an integer for internal use.

The attribute was added to the variation type when created, while the field was added to the variation type on the "Add field" button after creation. I can se ...

Score: 1
steevee666 avatar
How do I organize the display of product variation fields?
in flag

I have a new site with Drupal 9 and Commerce 2. I am trying to display my products with:

  • Title
  • Photo
  • Price
  • Delay
  • Options
  • Add to cart button
  • Description

I tested all the possible settings in manage display, but nothing works. What I get is inconsistent with the configuration.

How do I organize the display of product variation fields?

screenshot

screenshot

screenshot

Score: 0
tonytheferg avatar
How to create a dblog record from a views exposed form submission
cn flag

I am trying to create a log record of searches made though my Search API View exposed form block in Drupal 9.

For some reason on a brand new search I get 2 duplicates (3 total entries), and it seems like I remember reading somewhere that the forms can be submitted multiple times. So I would like to know how I could eliminate that.

Update: here is an issue for Drupal 7 https://www.drupal.org/project/views/ ...

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.