Latest Drupal related questions

Score: -1
Steffen  avatar
How do I programmatically set a database connection?
cn flag

Hello can anybody help with a external Database Connection.

$postgis_database = array(
        'database' => $drugis_postgis_connection->getdatabase(),
        'username' => $drugis_postgis_connection->getusername(),
        'password' => $drugis_postgis_connection->getpassword(),
        'host' => $drugis_postgis_connection->gethost(),
        'driver' => 'pgsql',

    ) ...
Score: 1
How to restore layout builder override layouts from old DB snapshot?
ru flag

After upgrading from Drupal v9.1.7 to v9.2.0, on a lot of nodes the custom layout builder override layouts were reset to the default layout, resulting in a massive data loss. To make things worse, this only happened on live and not on stage, and was only noticed a few days later. I don't know what has caused the issue, the customer is pretty upset, and I quickly and selectively need to restore the overr ...

Score: 0
Stanley Fernandes avatar
How to move Panels with content from development site to live?
gt flag

I want to move the content which is there on panels from local to dev. (Panopoly module is used on the project) So that I don't have to re-create the content on dev. I have tried to used this modules but it was not working : Features Node Export Panels Import

I wanted to export the panels with content so that I don't need to add the content all over again and that the panels have the same class with the  ...

Score: 0
stckvrw avatar
How do I enable breadcrumbs?
gb flag

I have a page showing a list of Article nodes. I need to display breadcrumbs on them as Homepage / Tag title / Article title. By default, Drupal shows the breadcrumbs as Homepage / Article title. I don't see any option to include the taxonomy term title*.

I also installed the Menu Breadcrumbs module, but I don't understand how to display its breadcrumbs. (Are they shown in a block?)

Score: 0
trashpanda avatar
Route name returns 404 despite working view
cz flag

I'm assigning breadcrumbs based on the view route names using the following code in hook_preprocess_breadcrumb().

$route_name = \Drupal::routeMatch()->getRouteName();
if ($route_name == 'view.news_list.main') {
  // Declare breadcrumbs.
}

My problem occurs with one of my views. For some reason, getting the route on the view returns system.404 despite the view being shown correctly. Why is this happ ...

Score: 0
Why do I get "The file could not be created." on a site I locally duplicated?
jp flag

I've duplicated an online site to a WAMP localhost site. The front page layout is broken and the front page shows this error.

The file could not be created. The website encountered an unexpected error. Please try again later.

The WAMP PHP error log contains about 20 copies of the following 2 errors.

PHP Notice: unserialize(): Error at offset 347 of 1093 bytes in C:\wamp\www\example.local\sites\all\modu ...

Score: 0
Balde Binos avatar
Drush 10 is not working - seems unable to properly find the site
br flag

Greetings to all of you.

Drush seems unable to properly find the site.

The output of vendor/drush/drush/drush status

PHP binary    : /usr/bin/php                                                   
PHP config    : /etc/php.ini                                                   
PHP OS        : Linux                                                          
Drush script  : /usr/share/site_dir/vendor/drush/d ...
Score: 3
Extect avatar
Why does installing from an existing configuration fail?
cn flag

I am struggling to install a drupal site from an existing configuration. Here the two approaches I tried:

OPTION 1: Import the config by changing the UID:

  • drush cex on existing site
  • drush site:install to install new site
  • drush cset system.site uuid 478e7e74-fea3...... to set UUID on new site equal to exisiting site
  • drush cim on new site

RESULT:

  The import failed due to the following reasons:

  Unex ...
Score: 0
HennyKo avatar
How to expose custom webform fields to GraphQL?
cn flag

I would like to use https://www.drupal.org/project/captcha with Webforms. For exposing Webforms via GraphQL I use https://github.com/duartegarin/graphql_webform.

As CAPTCHA is not a standard field https://github.com/duartegarin/graphql_webform does not expose it via GraphQL. As I did not find any documentation on how to expose custom webform fields to GraphQL I thought I ask about it here.

Thank yo ...

Score: 0
Jiah avatar
Read view row entities and create a node for each entity
in flag

I have a view that looks like in the following screenshot.

screenshot

I am creating a custom action to publish selected comments and create a node for each comment. The custom action code is the following.

class publishtraction extends ViewsBulkOperationsActionBase {
  use StringTranslationTrait;

  /**
   * {@inheritdoc}
   */
  public function execute($entity = NULL, $view = NULL) {
    // Publish the selected  ...
Score: 2
Jaypan avatar
Eliminate results from a relationship (add an ON condition to JOIN)
de flag

I need to add an ON condition to a views JOIN. I cannot use a contextual filter, as it will filter out results altogether, and I need to get a result regardless (there are other joins). So I need to ensure the filter happens on the JOIN, and not as a WHERE condition.

To be more specific, I want to show a value when no relationship exists. The relationship is from one NODE type to another NODE of  ...

Score: -2
How can I render a view as JSON inside a template file?
ph flag

I would like to render a view as JSON, within the page template. I would hide it with CSS and use it with JavaScript.

Is there a way to alter the Format field used when creating a view, which normally shows options like Grid, HTML List?

I did try the Rest Export core module, but it seems to render the view as JSON with no other page content.

Score: -3
Display all the nodes from a specific content type on the front page
cn flag

I have a custom content type (news). I want to show all those nodes on the front page.

How can I achieve this?

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.