Latest Drupal related questions

Score: 0
Anonymous user redirected to core/install.php while admin does not
im flag

As an admin I've built a large table on Drupal 8 (php, mysql). It runs without issues for Admin, but trying as Anonymous user it redirects me to core/install.php

Since it's ONLY affecting Anonymous users, I suspect it's DRUPAL 8 that's setting the limit. I want to find where Drupal does that. Anyone can give tips to the specific Drupal 8 files I can look into?

(Resist trying the max_allowed_packet = ...

Score: 0
BassPlaya avatar
Use Views Rules to loop over a user's view
ma flag

I have a contextual view that lists the last expired Course Session of a teacher.

I use a contextual filter like this:

User: Uid

whereby:
WHEN THE FILTER VALUE IS NOT AVAILABLE
Provide default value Type:
User ID from Logged in user

And WHEN THE FILTER VALUE IS AVAILABLE OR A DEFAULT IS PROVIDED

Specific validation criteria Validator: basic validation
Action to take if filter value does not validate: A ...

Score: 1
awm avatar
How to use entityQuery with custom field type?
mx flag
awm

I am working on building a query for nodes that have a few custom fields (field types). The fields are custom build in a custom module with a custom schema. When I execute the query:

 $query = \Drupal::entityQuery('node')
    ->condition('type', 'place');
 $query->condition('my_custom_field', '', '<>');

It fails with a message indicating that: node__my_custom_field.my_custom_field_va ...

Score: 0
Geat avatar
Multi-lingual Webform, not entire website
de flag

Our client does not need their entire website to be translated into multiple languages. However, they have a webform that provides a number of different languages in a dropdown, and would like the form labels to be displayed in the chosen language.

Creating multiple versions of the form would be a maintenance headache. Is there a way to tap into Webform and Drupal's localization facilities withou ...

Score: 1
('text/plain') is not a supported stylesheet MIME type
cn flag

We just upgraded from Drupal 8 to Drupal 9, and now we have some css files not working in Chrome due to the below error.

Refused to apply style from '' because its MIME type ('text/plain') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

These css files are in the private files directory for the site. I've verified that the mime_module is loaded as I can see this in the apa ...

Score: 0
Jean da Silva avatar
Is there a way to customize a ListBuilder for a specific node content type?
cn flag

I'm having trouble with listing nodes and content types. There are many different content types in my drupal site, and all of them are listed inside "contents" page (/admin/content). I can filter then by type, but it would be much better for every content type to have its own listing page.

The only way I've done admin listing pages in the past was with custom entities using EntityListBuilder. The ...

Score: 0
Use ajax to save modal / dialog form instead of page reload
kr flag

I'm looking for a way to save modal & dialog forms through ajax instead of redirecting the user after the form submit. Ajax is quite unknown territory to me.

I've found several interesting topics here already:

jQuery UI Dialog attempt to submit a form using AJAX redirects me to the actual form page instead of AJAX submitting

How to close modal after form submit?

I tried all answers shown there,  ...

Score: 0
Steve Siddu avatar
How to change the condition to AND in accessing content by role in a view-block?
br flag

I have a view-block 'Expo', I want to display this block only if current user has two specific user roles i.e., 'Actor' and 'Singer'.

When I checked the both 'Actor' and 'Singer' , The block is displaying in users who have either 'Actor' or 'Singer' user role. When the user has two user roles it's displaying two blocks.

As per my understanding, It's using conditional OR in between the checked us ...

Score: 0
How do I know what properties and methods are available to an entity_metadata_wrapper object?
us flag

It may be easiest to start with an example.

The entity_metadata_wrapper() function seems to do a lot of complex magic behind the scenes in order to return an object with all data related to the entity in question. But how do I know what properties and methods are available to me once the object is returned?

Let's say I have Commerce Order. (This is not necessarily a Commerce question, it's just good ...

Score: 0
quantumized avatar
How can I prevent my migration from overwriting existing nodes instead of using the source's (D7) NID
ng flag

I have imported my content types from D7 to D9 using /upgrade for the complete migration and the data is all good. I then have a separate migration to import and convert my date fields and this works too, except that it overwrites all of the existing nodes instead of using their exiting NID or pulling it from the source again. Any ideas how to prevent this?

id: event_node
label: Event Nodes
migrati ...
Score: 0
rpayanm avatar
Drupal modal does not render remote forms (Mautic)
ru flag

I'm trying to embed Mautic forms in my drupal site. I created a controller pointing to '/mautic-form` and in the twig template I have this:

<script type="text/javascript" src="//mautic.coachingrealista.com/mautic/form/generate.js?id=3"></script>

enter image description here

When I go to that page (/mautic-form), the form renders well: enter image description here

But when I use it inside a modal, it does not render that form:

<a data-dialog- ...
Score: 0
Asatur Vardanyan avatar
Restrict access to specific node by role
jp flag

I am working on a Drupal 9 project. I need to restrict access to the node with id 1083 for "delegate" user role. For this I have used hook_node_access_records() and hook_node_grants():

/**
 * Implements hook_node_access_records().
 */
function wtotfaf_user_node_access_records(NodeInterface $node) {
  $grants = [];
  if ($node->id() == 1083) {
    $grants[] = [
      'realm' => 'delegate_view_acti ...
Score: 0
How to distinguish new users who haven't validated their email?
br flag

How can a site manager filter the list of users so they only see new users who have validated their email addresses?

Registration to the site requires approval, and the site manager does not want to review registrations unless the user has validated their email address.

Seemingly, this could be achieved with LoginToboggan, except the "non-authenticated role" feature only works if you allow users to  ...

Score: 0
Is there a way to synchronize a webpage from another website into Drupal?
es flag

A restaurant has its menu database in Foodpanda.

The owner wants that menu to appear in the website.

  • We can manually duplicate all menu courses from FoodPanda to Drupal, upload the same images, etc. each menu course as a standalone node of a menu content type and then add some module for purchasing courses from the website (as delivery).
  • We might also be able to move the database from FoodPanda to a  ...
Score: 2
Conrado Pueyo avatar
Drupal access without authentication depending on the source network
ug flag

Is it possible to avoid the login page depending on the user's network of origin? We have a Drupal setup that can be accessed from a VPN and from the internet. We would like to make it so that users accessing from the VPN don't need to authenticate, but users coming from the internet do. Is it possible? Thank you very much to all of you

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.