Latest Drupal related questions

Score: 1
Editing paragraphs field settings returns 404 with php development server
ve flag

I have this strange behaviour on my local drupal9 instance. I start it in the web folder with the build in php development server: php -S localhost:8000

Now if I try to edit any paragraphs field, eg. /admin/structure/paragraphs_type/manual_news/fields/paragraph.manual_news.field_news_entries

[Fri Aug 13 12:47:39 2021] 127.0.0.1:55544 [404]: POST /admin/structure/paragraphs_type/manual_news/fields/paragra ...

Score: 1
How do I add a template suggestion for form input fields that have containers?
in flag

I've been able to successfully add the parent form ID to all form elements, based on these two questions: How can we find the id of the parent form in preprocess_HOOK() or HOOK_alter() theme functions? and Add the Form name to the theme suggestions input field.

However, the two elements I really need template suggestions for are inputs that have containers... therefore the parent form ID is added to the  ...

Score: 0
Gabriel Fernandez avatar
How do I query for all the entities for which a multi value field doesn't contain a specific value?
cn flag

I have a multi value field which contains plain text. This is how it looks from the edit form.

screenshot

I want to fetch entities that don't contain the Expired value. How can achieve it?

This is the code I wrote so far.

$query = \Drupal::entityQuery('taxonomy_term')->condition('vid', 'series');
$group = $query->orConditionGroup()
  ->notExists('field_multi_value')
  ->condition('field_multi_va ...
Score: 0
Павел Герасюта avatar
hook_forms() not working
br flag

I'm trying to add a button to all node forms via callback in hook_forms. I get a similar error. Can someone help.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'my_dossier_form' not found in drupal_retrieve_form() (line 844 of /var/www/includes/form.inc).
Notice: Array to string conversion in drupal_prepare_form() (line 1094 of /var/www/includes/form.inc).
Notice ...
Score: 2
Matt Campbell avatar
How do I get rate and configuration values?
ar flag

I'm stumped. How do you get values off of the shipment method config? For example I have a the Flat Rate shipping method "Express". I want to get the raw config form values stored on that shipping method. Such as rate, or a custom field I've provided.

I've plugged into the shipping methods to add a custom form field. But now need to retrieve it later on. The values aren't on the shipment entity.



										
Score: 0
How do I display nodes of two different content types that use the same taxonomy term?
cn flag

I have two content types, typeA and typeB. Both the content types have a taxonomy reference field.

I created a view for each content type. In the view showing typeA nodes, I want to show also typeB nodes using the same taxonomy term.

How can I achieve this?

Score: 0
"PHP Warning: require(drupal.php): failed to open stream"
bj flag

I have created two fresh installations of Drupal, one version 8.9.17 and the other 9.2.3 and have been trying to get the Drupal console to work so that I can generate a module.

I used the following command in Composer and successfully downloaded it.

composer require drupal/console:~1.0 \
--prefer-dist \
--optimize-autoloader \
--sort-packages \
--no-update

Then run the following to avoid a Symphony confl ...

Score: -1
How can I programmatically download webform results?
cn flag

I want to download the results of certain webforms. I currently download them as CSV file by navigating to the download tab within the Drupal UI.

Is it possible to programmatically download the results?

Score: 0
user3108268 avatar
Taxonomy dynamic dependent exposed filters
us flag

I have a content type with two taxonomy term fields: Region and Country.

I created some nodes and entered values for those fields. I created a view with both the fields as exposed filters. When a region is selected, is there a way to only to shown in Country all the related terms as shown in the screenshot?

screenshot

The project page for the Views Reference Filter module says, at the bottom:

By default, the vie ...

Score: -1
stckvrw avatar
Can't get page html after updating the page and flushing all caches
gb flag

Once I updated a page via admin panel, I need to programatically flush all the caches, then get the page source code and write it to a file. I use the following code inside of my module:

function mymodulename_node_update($node) {
    drupal_flush_all_caches();
    $nid = $node->nid->value;
    $nodePath = \Drupal::service('path.alias_manager')->getAliasByPath('/node/'.$nid);
    $content = ...
Score: 3
mt.i.1 avatar
Exclude settings from a contrib module on export
us flag

I've two environment, dev and staging. I'm using the ReCaptcha module.

In the developpement environment, I have some api keys a other config which until now, are exported thanks to drush cex inside the recaptcha.settings file

site_key: mysite_key
secret_key: mysite_secret
verify_hostname: false
use_globally: false
widget:
  theme: dark
  type: image
  size: ''
  tabindex: 0
  noscript: false
_core: ...
Score: 1
Why is my split config not loaded with drush config:import?
am flag

I have a setup with different environments called prod and dev.

I need to distinguish API Keys and Urls between these two environments and thought that split-config would be the ideal solution for that.

What I have done so far:

  1. Created a split config for dev (not active!) because the default sync config should be for prod.
  2. Duplicated the configurations for the specific modules and changed the valu ...
Score: 1
metalac avatar
Where should I include method to pass current selection to entity browser select view?
us flag

I'm following this guide https://drupal.stackexchange.com/a/277898/56676 which I found very useful. So, I understand where the first function goes, but when it comes to the method public function getArgument(), I'm not sure where this function should be included?

Considering that we don't have a custom widget, we are using entity browser in configuration.

So, do we need to create custom widget, plu ...

Score: 2
liquidcms avatar
How to send email with commas in the name?
us flag

I am trying to send email of the format: 'Tom Smith, Jr <[email protected]>'; but it fails due to the comma in the name.

This closed issue: https://www.drupal.org/project/drupal/issues/2936032 dealt with handling commas in the site name for handling the From address. It basically added a helper function to wrap the name part in double quotes. But this doesn't work for the To address.

Any sugges ...

Score: 0
tonytheferg avatar
How to close a modal with a submit form and implement a CloseModalDialogCommand?
cn flag

I saw this issue here, but I wanted to post this question as the answers seem incomplete and the question is not specific to closing a modal with a submit form.

In my .module file, I am using a my_module_form_alter and using ajax to open up a modal dialog:

$form['actions']['submit']['#ajax'] = [
  'callback' => 'my_module_form_submit',
  // prevent jump to top of page.
  'disable-refocus' => TRUE ...

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.