Latest Drupal related questions

Score: 0
Untangle Composer Drush and non-Composer Drush
mx flag

I have Drush 10.3.2-dev working on my system but I also need to work on an old project in Drupal 7, so I need Drush 7 to work on that particular project.

I downloaded Drush 7, unpacked it in a folder, drush script is executable, but when I try to use it with ./drush I get

Unable to load autoload.php. Drush now requires Composer in order to install its dependencies and autoload classes. Please see REA ...

Score: 0
0711master avatar
Exposed filter on a number field also shows results when filtering with less digits
cn flag

I have a number field that contains mostly 4/5-digit numbers. This field is exposed in a view. I want to also show results when putting only the first, second, and third digits of the number into the exposed filter.

I already tried to set a regular expression (^\d{1,5}$) as a filter criteria, but then I also get results where the entered digits are in the middle of the number. For example, enterin ...

Score: 2
rmompoin avatar
I cannot access PDF files uploaded in the private directory
gb flag

PDF files uploaded to the private directory cannot be viewed and returns a 404 error. This also happens to the user with the Administrator role. Other file types can be viewed with no issue. This issue happens in a production environment, hosted on Cloudways, where the private directory is set from the following line in the settings.php file.

$settings['file_private_path'] = $app_root . '/../private';
 ...
Score: 0
Shawn avatar
How to target a specific table with Twig on a specific page?
cn flag

I have a table I would like customize in CSS but first need to target it with Twig. The problem I am running into is that the twig template is global so it is for ALL tables. If I edit this table with this twig template, it will change all the tables on all the pages.

views-view-table.html.twig

In the Twig Documentation, I see no mention of any Table ID's so how do I target this specific table for this ...

Score: 0
L.wadii avatar
How to change order items in autocomplete entity?
sn flag

I override alter autocomplete in my custom module but I don't know how I can change the display order (DESC or ASC)

<?php

namespace Drupal\alter_entity_autocomplete;

use Drupal\Component\Utility\Html;
use Drupal\Component\Utility\Tags;
use Drupal\Core\Entity\EntityAutocompleteMatcherInterface;
use Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface;

/**
 * Matcher clas ...
Score: 0
Change default user tab
it flag
MMT

After logging in, users would be redirected to their user profile page. I have added a new tab, My dashboard using hook_menu(). Everything functions well.

After the users log in, I would like they are redirected to My dashboard, but I can't make it work.

I tried with in two ways, which both have the same problem.

First I tried with this code.

function mymodule_menu() {
  $items['user/%user/dashboar ...
Score: 0
Interlated avatar
How do I post a PDF?
km flag

I followed these steps to post a PDF file to Drupal.

  1. Enable JSON API to create at admin/config/services/jsonapi

  2. Enable the media POST resource

    Media /media/{media}/edit: GET, PATCH, DELETE
          /entity/media: POST
    
    Methods: POST, formats: json: authentication: cookie
    
  3. Create an Angular application and embed it in the Drupal page as a block

The Angular application captures the page using js ...

Score: 2
Drush 10 pass alias to remote
in flag

Our remote environments are currently fronted by a Linux instance acting as the gatekeeper between the developers and the actual environments (apache and mysql instances running Drupal). This was done to limit the exposure of the actual environments and limit the details that need to be shared to developers (e.g. ssh keys, URLs, IP addresses).

On the gatekeeper machine, Drush is installed and a ~/.dr ...

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.