Latest Drupal related questions

Score: 1
James Young avatar
Can't restore existing site (no route found for "GET /")
ru flag

I have a site with Drupal 9.2.5 and the site was clobbered after installing WordPress in the web root.

I have a backup of the site database, and the sites/default/* files, but I just can't get Drupal up and running again to restore it to the way it was.

I have tried installing again and placing the files back, but this doesn't work.

I have looked at the Drupal docs and searched for migrating or restori ...

Score: 0
Bradley avatar
The "is-active" class is added to the main-menu links only when the site is accessed by an anonymous user
kr flag

I use this simple template (menu--main.html.twig) to render the main menu I created.

<ul>
    {% for item in items %}
    <li>
        {{ link(item.title, item.url) }}
        {% if item.below is not empty %}
            <div class='submenu'>
                {% for subitem in item.below %}
                    {{ link(subitem.title, subitem.url) }}
                {% endfor %}
     ...
Score: 1
How to create a search api facet for filtering user access
pk flag

I'm trying to figure out how to create a search api facet, that will filter results based on user access. By default, I'm bypassing access check hence showing all the nodes. I need to add a checkbox, which will filter results by access for current user (showing only already purchased items). One approach could be perhaps indexing all accessible nodes per user (about 300 nodes and 4000 users at the momen ...

Score: 0
Gaurang Agrawal avatar
Field enabled in Display mode isn't showing up when node is accessed?
ru flag

I am using a third-party theme that is using panelizer. When I created a new field (entity_reference) and enabled that in Display mode, the field is not showing up for the webpages but when it does show up for other content type which doesn't have Panelizer enabled.

Is there any other way through which Drupal takes the display settings?

Score: 1
hotwebmatter avatar
"The import is empty" errors validating config synchronization after core upgrade
nr flag

After Drupal 9 upgrade, I can no longer use configuration synchronization to deploy configuration to Acquia Cloud environment:

 Import the listed configuration changes? (yes/no) [yes]:
 > >  [error]  Drupal\Core\Config\ConfigImporterException: There were errors validating the config synchronization.
> This import is empty and if applied would delete all of your configuration, so has been r ...
Score: 0
How disable submit button after call OpenModalDialogCommand in Ajax callback?
us flag

I have a block that has a button, when pressing that button an ajax is triggered that shows a popup with the OpenModalDialogCommand event, after closing the popup I want to deactivate the submit button, does anyone know how to do that?

The form

    $form['actions']['submit'] = array(
      '#type' => 'submit',
      '#value' => $this->t('Get cupon'),
      '#prefix' => '<div id="cupon_f ...
Score: 0
Aves2432 avatar
How to add conditions to display product variations in Drupal commerce?
eg flag

In the products page, I want to limit product variations based on user roles. For example, I only want admin to be able to see some of the product variation. I tried to achieve this by adding an extra field in variation and then checking that field in twig template (commerce-product.html.twig). Unfortunately, this method only works with rendered entity and I couldn't use the "add to cart" functionality. ...

Score: -2
Gokulakrishnan Shankar avatar
"The website encountered an unexpected error" when creating contrib and custom folders
ng flag

My Bootstrap Theme in Drupal is currently in the location var/www/html/project/themes/bootstrap on my laptop. However, when I create a new directory- contrib (inside the themes directory) and move the bootstrap directory into it, I get the 'website encountered error' message. I launch the website via chrome using .localhost/project

Score: 1
Customized email twig templates
pt flag

Can anyone tell me if there is a mechanism for creating user registration acceptance / rejection emails from different template files for the default email system ?

In admin/config/people/accounts, the account activation section seems the correct area for crafting the registration acceptance email. BUT, I don't think anyother section is right for te registration rejection email.

So, I tried to find a me ...

Score: 0
NaseemMahasneh avatar
Page not found while accessing website content
tn flag

I set up a Drupal 9.2.1 site, which working fine until I set it up as multi-site.

  • I have the master site in the main directory for Xampp (C:\xampp\htdocs) in the master.com directory

  • I created six multi-sites in C:\xampp\htdocs\master.com\sites with the following sub-directories: site1.com, site2.com, site3.com, site4.com, site5.com, site6.com

  • I updated the the C:\Windows\System32\drivers\etc file

     ...
Score: 0
xax avatar
Change booking end-date in iCal Feeds import
in flag
xax

I have an D9 site for a villa that can be rented. To show availability, I import the iCal calendar of bookings from a booking site, using the Feeds and Feeds iCal modules (the last one I updated the .info so it works in D9).

The import works fine, it collects the .ics file at regular intervals, turns each into a node, and I display all booking-nodes through Fullcalendar View. So far brilliant.

The booki ...

Score: 2
rickdenhaan avatar
How to use a module-relative path to translations in .info.yml
id flag

I'm new to using Drupal and am building a custom module to learn how it all works.

I'm building my module in modules/custom/my_module. I have a Dutch locale file in modules/custom/my_module/translations/my_module-0.1.nl.po.

If I specify it like that in my .info.yml file, it works great:

name: My Module
description: Just testing
version: 0.1
package: Custom
type: module
core_version_requirement: ^8.8 || ^9 ...
Score: 1
C.A. Vuyk avatar
Why is Drupal not sending mail?
cn flag

When submitting a contact form there is no mail sent, eventhough there is a confirmation message. Or when trying to send a password reset link, everything goes well, Drupal says "If [email protected] is a valid account, an email will be sent with instructions to reset your password." but no mail is sent.

  • Sendmail is installed, tested with PHP mail() and working fine.

  • Tested Sendmail through the comm ...

Score: 0
Ajax form ReplaceCommand functionality breaks after first fire
cn flag

I Have a form on a page which updates a single field of a Node. The form uses ajax to update the field and returns the newly saved entity and replaces the current HTML so the new field is showing up correctly.

This works fine the first time the form is fired, but breaks after that with the following error in my console:

An AJAX HTTP error occurred

There's no further error report which would tell me mor ...

Score: 0
Arthur Sauer avatar
ddev Too many arguments, expected arguments "command" "key"
cz flag

I'm trying to run

ddev exec drush state:set system.maintenance_mode 1

With MAMP drush state:set system.maintenance_mode 1 works fine. With ddev I get the error:

Too many arguments, expected arguments "command" "key".

I've tried every possible variation of this command I could think of, also using ddev ssh. Nothing works.

Am I missing something? Is this impossible with ddev?

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.