Latest Drupal related questions

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/ ...

Score: 0
Search API views is displaying empty pages
kr flag

My search page is displaying results. The pager is displaying. But the first 15 pages display no results and then on the 16th page, I can see the content.

I have deleted all the data from the index, and re-index the data again but no effect. Can anyone tell me why the first 15 pages are empty? and how can I fix it?

When I print the results in hook_search_api_results_alter, it is something like th ...

Score: 1
How to filter webform by custom field "ThirdPartySettings"
de flag

I've created a new field for all my webforms called "color" inside of settings (this field is only for CMS users)

To create this I used "ThirdPartySettings" like this: https://codimth.com/blog/web/drupal/webform-settings-entity-adding-custom-fields#comment-1129

It's ok. But now inside of /admin/structure/webform I need to create a filter with this field.

Example: to show all webforms with "color" = "bl ...

Score: 0
Jorn Reed avatar
How to show a field in a view for another field?
il flag

I have twig template named views-view-field--banner--block_1--field-banner.html.twig Here I print <a href="">{{ output -}}</a> To put an anchor tag around an image field named field_banner. I also have another field named field_slider_banner_link that I want to print within the href="". But I have no clue how to get the value from that other field into this template.

Score: 0
Is it possible to use WSL-based Drush on a Windows 10 XAMPP and if so how?
mu flag

I currently use Drupal 9 but concepts about Drupal 10 may be useful.

I use Windows 10 Home with XAMPP and C:/xampp/htdocs is my web application root.

I want to establish a minimal Drupal development environment on my Windows 10 Home instance by installing Composer and then Drush.

I can use WSL to install both Composer and Drush but then a question arises:
If WSL only effects its own Linux environment, ho ...

Score: 0
Jhon Manny Loto avatar
IP Restriction on a admin pages
gb flag

Currently I'm working on how to restrict the admin pages on a certain IP. I'm using Drupal 9 version This is what I put on the htaccess

<Location "/admin/dashboard">
  Order deny,allow
  deny from all
  allow from 123.12.12.12
  allow from 123.123.43.43
</Location>

but it is still not working. Is there any suggestion on how to fix this one. Thanks in advance.

Score: 0
pglatz avatar
Route reported as not existing, but I'm not referring to it
in flag

Drupal 9.28; I removed some test code, and am now getting the error

Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "member.test" does not exist." at /Users/pglatz/dev/wdocs/wdocs-d9-code/www/web/core/lib/Drupal/Core/Routing/RouteProvider.php line 206

I grepped my code and there is no longer a reference to member.test in any of the yml files (or anywhere el ...

Score: 1
tis avatar
How can I programmatically render the summary of a textfield?
br flag
tis

I can output a textarea field with the following code:

$entity->fieldname->view();

How do I need to change that code for getting the summary of that field?

(Where can I find a documentation of that view-function?)

Score: 0
How do I configure Scout APM?
cn flag

Their docs have setup instructions for Symfony, but I'm not sure how they translate to Drupal: https://scoutapm.com/docs/php/symfony. Could anybody provide some insight on how the xml/bundle instructions work in a Drupal context (if they do)?

Score: 0
Samuel Fernandez avatar
The tag is replaced by '*' character
ng flag

While sending out html emails that are configured to use the following template.

<p>Submitted on [webform_submission:created]</p>
<p>Submitted by: [webform_submission:user]</p>
<p>Submitted values are:</p>
[webform_submission:values:html]

The actual value returned is the following one.

*First Name*
Bobcares
*Last Name*
Developer
*Email*
[email protected] [1]
*Plea ...
Score: 0
Lambic avatar
Custom entity access control based on group membership
ph flag

I am using the group module in Drupal 9 to control access to content by user groups.

I have a custom entity defined as a single table unfieldable entity. The entity has a "group ID" base field defined.

I want to add an access controller that checks if an entity is associated with a group the user is a member of.

Is there a simple way to do this, or I do I need to go down the rabbit hole of creating a g ...

Score: 0
C.A. Vuyk avatar
How can I debug cache tags not invalidated as expected?
cn flag

Up unto last week my Drupal site and varnish_purge worked together fine with Varnish. After updating the modules to the latest versions, cache tag invalidation seemed to stop. Nothing else really changed in the meantime. In /var/log/varnish/varnishncsa.log I get messages like the following.

127.0.0.1 - - [16/Nov/2021:09:04:13 +0100] "BAN http://127.0.0.1:6081/ HTTP/1.1" 200 254 "-" "varnish_purger m ...
Score: 0
yuuuu avatar
Programmatically getting variation type fields in order
ao flag

I am trying to get variation type field values from the order entity but I can't find any documentation on this. I am using an event subscriber to run the following code when an order is paid. The code works, but I can't see any reference to the fields in kint and I can't find any references to any kind of "getVariation" or equivalent function online.

/**
 * This method is called when the commerce_or ...
Score: 0
Joost avatar
Restore menu items using database backup
jp flag

When working on a site I accidentaly removed all my menu items I now want to recover them from a database back-up I have. Is it enough to just copy all data from these tables from the backup to my sites database?

  • menu_link_content
  • menu_link_content_data
  • menu_link_content_field_revision
  • menu_link_content_revision
  • menu_tree
Score: 0
Order item - title missing product attributtes
ng flag

i'm placing a manual order, and when I search for a product, I have only the sku and the title, but with that I don't know the size for example or the color, as they are attributes, how can I do to have those information in the autocomplete, see image. order item autocomplete enter image description here

Score: 1
bdereta avatar
Custom node routing
cz flag

I have a product content type with alias: /products/headphone. This product page has two url variations:

  • /products/headphone/wire
  • /products/headphone/wireless

Both urls should point to the same node, however within preprocess function or twig, I should be able to capture which variation is loaded (wire|wireless)

I figured I should create a custom module and handle custom routing:

my_module.routing.yml: ...

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.