Latest Drupal related questions

Score: 0
How to make the private image accessible with image style?
kr flag

I have a private image with this URL.

http://mystite.com/system/files/images/IMG_0371_24.jpg/IMG_0371_24.jpg

An image style is created for the above image on location

http://mysite.com/system/files/styles/square/private/images/IMG_0371_24.jpg/IMG_0371_24.jpg

The problem is when I display the original image, it works fine. But when I display the image with style, the image is not displaying and in th ...

Score: 0
Plugin not found
in flag

I am overwriting the CommentBulkForm class in my module.

namespace Drupal\mymod\Plugin\views\field;

use Drupal\comment\Plugin\views\field\CommentBulkForm;

/**
 * Defines a custom comment operations bulk form element.
 *
 * @ViewsField("custom_comment_bulk_form")
 */
class CustomCommentBulkForm extends CommentBulkForm {

  /**
   * {@inheritdoc}
   */
  protected function emptySelectedMessage() { ...
Score: 1
frank.schram avatar
Filter GeoJSON feed on a value in the path
ca flag

I have GeoJSON feed, created with a view in Drupal 7, that I want to filter on a path value in the url of the loaded page (/path/%). The feed is loaded as an Openlayers map on a page. The feed seem to work with its own feed-url and is not aware of the site url. Contextual filters in the view don't work either. I can use hook_views_query_alter or hook_views_pre_view. But I don't know how to bring the val ...

Score: 0
How to stop duplicates caused by date range in views
eg flag

On my site I have a content type called Course. Courses can have several sessions. To display these sessions I am using the date range.

When a course has more than one date range entered an instance appears in the view for each start date.

How do I only display one instance for each course? There is only one course, even though there are multiple sessions.

The Distinct option in Query settings doesn't  ...

Score: -2
Why is Docker needed for DDEV?
ke flag

I need to establish a Drupal development environment on Windows 10 and I consider DDEV.

I read that DDEV requires Docker but I never worked with Docker. Why is it required for DDEV and should I master Docker itself before developing Drupal on DDEV (or any similar software for that matter)?

Score: 0
How to get user custom field in order email twig
ls flag

I am trying to add user custom field in order receipt pdf using below file commerce_purchase_order under template.

commerce-order-receipt--purchase-order-gateway.html.twig

I tried below code

     {% for order_item in order_entity.getItems %}
       {{ order_item|commerce_entity_render('field_custom_fielname') }}
     {% endfor %}

Also Used but this will not work as this is not field in order

   ...
Score: 0
SomebodySysop avatar
create views filter from sql
gb flag

I've been trying to create a view that gets all nodes that are in moderated "draft" state as created by the group content moderation module. The current views content state filter will not work. The module has a patch, but this patch requires giving a user site-wide content revision permissions, and we only want to give those permissions on the group level.

I wish to create my own views filter f ...

Score: 1
user3713929 avatar
Issues with beans in the migration (some nodes don't migrate, some migrate old revisions)
th flag

I am trying to do a migration from Drupal 7 to Drupal 9. Most seems to migrate okay but I noticed the following problems:

  • I am missing some nodes
  • Some nodes migrated only old revisions of the node (IE: In the live site a node has 8 revisions, and the migration only migrated the first 2, leaving the most recent of the 2 as the live content, which is a review from 2015. The most recent review in the sit ...
Score: 0
Overwrite a specific VBO action processed message
in flag

I am using VBO to perform bulk operations on my view. I have 2 core VBO actions and 2 custom actions.

  • Publish comment
  • Unpublish comment
  • Publish resource
  • Unpublish resource

When the Apply action button is clicked with none of the grid row is selected, I get this error message.

Select one or more comments to perform the update on.

I would like to rewrite this error message as An attachment has to  ...

Score: 1
jfc avatar
Can I choose specific nodes to show in a view?
us flag
jfc

I have a Drupal 9 site with a view that shows products, but I do not want to show all products, I only want to show a select few of them.

Is it possible to filter like this? Instead of showing all the products?

Ideally I'd like a UI where I can manage the products manually. E.g. if I have 5 products but only want to display Product 1 and Product 4, I can select those 2 products.

Score: -1
user888 avatar
emailing the webform's submission values in a table
ph flag

I have been trying to email the submitted values via email handler every time an user submit a form. I have added on custom body so the submitted values would be in the table formally, but the table is all broken as you can see on the photo. Is there a way to fix the problem? Thank you in advance

Here is what I added on the custom body:

    <table>
    <tr>
        <th>D ...
Score: 0
How to make pagination for php data inside preprocess_paragraph_HOOK
ru flag

I have data coming from External Entity (MongoDB) and I need to make pagination inside hook theme suggestion of a paragraph :

code snippet

Is there a way to use built-in pagination of Drupal in this scenario? thanks!

Score: 0
Altering user_admin_account and user_register_form
ro flag

I'm pretty new to Drupal and I'm trying to build a Drupal 7 custom module to alter the user listings table in admin/people. I would like to display the first and last names of the users. I've already added the text fields to the user registration form in admin/config/people/account-settings/manage-fields and I've managed to store the user input in my database table. I've added the extra fields to the us ...

Score: 2
Lambic avatar
How do I switch user account in drush to test permissions?
ph flag

I'm playing around with the D9 Groups module and I want to test the access control in drush, either using drush php or writing a script and using drush scr.

In drush 8 I would always use drush -u to run as a specific user but that option seems to have disappeared in drush 10.

What's the easiest way to either run drush as a specific user or switch the user in drush php or a script?

Edit: I'm working aro ...

Score: 0
Matoeil avatar
hook_cron triggered manually but not automatically
za flag

That hook cron below is executed when i manually trigger the cron but is not on a regular automatic base (every 3h).

How can it be ?

function my_module_cron() {    
  \Drupal::logger('my_module')->notice('entering hook_cron');
  //some more code
}
 
Score: 0
jmzea avatar
How can I give access to shipping information to authenticated users?
br flag

As administrator when I visualize the page for the order of a user (user/[user-id]/orders/[order-id]) I can see the shipping and billing address.

But setting the same type of information for authenticated users that are not administrators, the addresses are not shown in the summary of the order, despite I have modified the display of the order for users (/admin/commerce/config/order-types/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.