Latest Drupal related questions

Score: -2
I am unable to run "drush site-install" without getting errors
us flag

When I open Terminal on the david/Sites/animals directory, and I run drush site-install --db-url=mysql://david:root@localhost:3306/animals, the get the following error.

In SiteInstallCommands.php line 152: Drush was unable to drop all tables because mysql was not found, and therefore Drupal threw an AlreadyInstalledException. Ensure mysql is available in your PATH.

Did I write the correct comma ...

Score: 0
Private file not being displayed on Twig template
ru flag

I am trying to get an image from the private folder to display on a printer-friendly Twig template page. The private folder is inaccessible to browsers and the only display method I know of is to load the image and convert it to Base64 and pass the Base64 characters into the 'src' attribute of an 'img' element.

My controller code looks something like this:

class PrinterFriendlyController extends Contr ...
Score: 0
drupalfanatic avatar
Making content type fields into an exposed filter dropdown?
gr flag

I have several taxonomy reference fields in a content type that I would like to make into an exposed filter dropdown. With other taxonomy reference fields, it's easier to do so because they only have one parent term for each vocabulary. In this particular case, though, I have a vocabulary term with parent and child terms.

Since the contextual filter isn't working for me in this case, I was wonder ...

Score: -2
Baud avatar
Why an exception is raised when I insert a token as a value of an html src attribute
sa flag

How to raise the exception:

In any text_area field using ckeditor, insert the following code <img src="[node:my_custom_token]"> and save the form.

You will get the following error: (assuming the edited form was http://mysite/fr/node/8/edit)

page not found|127.0.0.1|http://mysite/fr/node/8/[node:my_custom_token]

This is a NotFoundHttpException thrown in RouterListener

Here is the trace

PHP internal ...
Score: 0
Drush issue duplicating includes/ directory
za flag

Using drush either globally or with a composer installed version, I get this double includes showing up in my fatal error (/includes/includes/):

include_once(/srv/www/htdocs/sites/drupal/includes/includes/entity.inc): failed to open stream: No such file or directory bootstrap.inc:3492 [warning] include_once(): Failed opening '/srv/www/htdocs/sites/drupal/includes/includes/entity ...

Score: 0
Matoeil avatar
Pass current langage to twig on custom blocks
za flag

my custom module block, with supposely no cache

<?php

namespace Drupal\amu_social_icon\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * Provides a 'Icon' Block
 *
 * @Block(
 *   id = "amu_social_icon_block",
 *   admin_label = @Translation("Social Icon block"),
 * )
 */
class IconBlock extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function build() {
    $config = \Drupal: ...
Score: 1
Hide Admin Toolbar in iFrame
cn flag

Is it somehow possible within Drupal 8 to hide the Admin Toolbar when the site is loaded within an iFrame? Like e.g. passing an argument? :-)

I thought about using some sort of preprocess on the page that is getting rendered within the iFrame, but this will not work since the html is cached by Drupal. Also I thought about doing it within Javascript, but I do not want to include a javascript file  ...

Score: 0
Greenhorn avatar
How to generate cropped image on upload with Image Widget Crop module?
us flag

When I upload the image it only crops it with the preset size in style if there is, but not with the manual crop in form.

I tried Image Style Warm module, with that the manual crop gets applied when I re-edit the image. Without Image Style Warm module the file only created on image url call.

I also tried to modify the module weight by changing Crop API and Image Widget Crop modules to -10 but it als ...

Score: 3
How to setup access dependency on a block content created programatically
ng flag

In Drupal 8, I am creating block instances (BlockContent) for node layouts programatically and setting them all as non-reusable. That causes a following access error: "Non-reusable blocks must set an access dependency".

How do I set access dependency on an existing block instance (or during it's creation)? Was never in a position to have to manipulate access from such angle and I can't find a goo ...

Score: -1
universaldenker.org avatar
After upgrade to Drupal 9.2: Call to undefined function escapeshellcmd(). Why?
kp flag

When I want to submit a form (webform module) I get get the followng error:

Call to undefined function Drupal\Core\Mail\Plugin\Mail\escapeshellcmd() in Drupal\Core\Mail\Plugin\Mail\PhpMail::_isShellSafe() (line 165 of core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php).

This error disappears if I remove all mails in "/admin/structure/webform/manage/MY-FORM/handlers".

This error occurs also using s ...

Score: 1
How to load a JS library (in a custom module) from a theme using only JS?
ph flag

I want custom subthemes, one for admin and one for front end. both need to load the leaflet js library that im trying to put into a custom module.

Ive got the subtheme bit working, and my global-scripts js running, but cant get module loaded or running.

themes/angas_admin/

angas_admin.info.yml

# subtheme by haydent httech.com.au
name:  Angas Admin
type: theme
description: 'seven subtheme by hayden - h ...
Score: 0
Thirsty Six avatar
How can I programmatically check if a view's result is not empty?
gs flag

Programmatically, How to check if view result is not empty with in custom function? I want to check the views result is it empty or not, and then display the result. How can i do?

use Drupal\views\Views;
use Drupal\views\ViewExecutable;

$view = Views::getView($view_name = "My View");
$view->setTitle('Sample Title');
$view->setArguments($args = ['all']);
$view->display_handler->setOptio ...
Score: -1
Balwant Singh avatar
Change Block view using custom Views
au flag

I have one content type(Contains Image & body field). for that, I have created a custom block view using Views. currently, it's showing content like on the left side the image is placed and on the right side, the body content is placed. I have added content 4 times for that content type. now I want to show that content like:

    LEFT           RIGHT

    image          body
    body           i ...
Score: 0
Extect avatar
How to update a module in production?
cn flag

I am using git to deploy my composer.lock to production. Contrib is not part of my git repo. Therefore, in production I then run composer install to add contrib to production.

What happens when I update a module in dev via composer update, then deploy the updated composer.lock to production and run composer install there? Will it update/replace the existing module code or what is the best practice ...

Score: 1
Why do I get a 403 response code when submitting changes at /admin/people/permissions?
de flag

I have documented the warnings and notices I get in the drupal watchdog logs at this link:

https://gist.github.com/hesco/1797208819f7b239d8be9deca6b8bac4

I see nothing in apache2 error logs.

I see a WSOD with the message: Not allowed. in the browser.
I see the 403 code in the browser inspect tool's js concole.
I also see that 403 in the apache2 access logs for every: POST /admin/people/permission ...

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.