Latest Drupal related questions

Score: 0
ewik avatar
Warning: file_put_contents(): Filename cannot be empty
fi flag

After updating Drupal 8 to Drupal 9, the following error is displayed on the website page:

Warning: file_put_contents(): Filename cannot be empty in /var/www/html/web/modules/contrib/devel/src/DevelDumperManager.php on line 108

Although it is not in the logs. But there is a similar one:

Warning: file_put_contents(): Filename cannot be empty in Drupal\search_api_solr_devel\Logging\SolariumRequestLogger- ...

Score: 2
Bruno Branco Bicudo avatar
Can Drush display translated messages to users?
in flag

I'm working on a module which extended DrushCommands to create custom Drush commands. The maintainer wants those custom commands to display translatable custom messages (warnings, erros) upon usage.

(How) Can It be achieved?

Score: 0
Webform Conditional based on previous webform entry
us flag

I have a webform that we have people fill out two times - for a pre-test and a post-test and I am looking for a way to determine if a pre-test has been taken an if so, set a specific value on form element.

Currently we have people manually select whether they are taking the pre-test or post-test in a webform element, but they are not doing so very accurately. Given we have the data to know that,  ...

Score: 1
Free Radical avatar
How to invoke a custom operation in Views
kz flag

I have a View that lists some nodes. Each node instance has a boolean - "Spam" - that defaults to FALSE.

In the view there is an "Operations" column where there shall be a link with the anchor text "Flag as spam". When the user clicks on that link, the value of the boolean Spam field for that node becomes "TRUE".

I found this tutorial: https://www.drupal.org/docs/7/creating-custom-modules/howtos/how-to- ...

Score: 0
Kevin avatar
Set a page for different languages?
in flag

Is there a way to specify the front page per language of a Drupal 9 site? I am looking for an interface that allows this to be set by a user.

Score: 0
jayaprakash R avatar
Enable error logging from settings.php
pk flag

I am facing a The website encountered an unexpected error. error while setting up the site.

Most of the documentation I found online suggest to enable logging in the setting.php file.

I added this line in site/default/settings.php.

$config['system.logging']['error_level'] = 'verbose';

I added the following code.

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors ...
Score: 0
How to alter the end date views query for search api
cn flag
blu

I'm trying to alter an exposed date filter in a view I created that uses solr search api. I noticed that the end date filter doesn't work unless I add a day to the end date. so for example if i have the following nodes:

title start date end date
a 01/01/2020 01/01/2021
b 02/01/2020 02/01/2022
c 03/01/2020 03/01/2023

and i use an exposed filter to return the end date of 02/01/2022 wi ...

Score: 1
Anton avatar
How can I disable revisioning on specific node field
de flag

I currently use hook_entity_extra_field_info() and hook_ENTITY_TYPE_view() to create a custom field displayed in nodes that generates content dynamically via PHP.

However, Drupal 9 seems to be tracking changes to the output of this field each time I save a node revision, which I don't want because that field's content is generated dynamically and is already under version control in a custom modul ...

Score: -2
Bavramor avatar
After update to PHP 8, module no longer works
sg flag

I have updated my Drupal from 8 to 9 and used PHP 7.4. Now I have chosen the time to update to PHP 8. Everything runs so far, only with a self-built module I get now an Error message:

The website encountered an unexpected error. Please try again later.
Error: Attempt to assign property "format" on null in copy_fields_from_model_contract_node_edit_node_prepare_form() (line 57 of modules/custom/copy_ ...
Score: 0
Gilles9999 avatar
In Aegir panel (during verify platform hostmaster) “sudo: no tty present and no askpass program specified” - warning
it flag

enter image description hereI have managed to enter in the aegir panel and change the password. I have noticed that the platform hostmaster verify has an alert:

“ sudo: no tty present and no askpass program specified” - warning

I did some research In this forum and I tried to modify the file /etc/sudoers.tmp but it didn’t work. I have also tried many solutions proposed in this post: https://stackoverflow.com/questions/ ...

Score: 0
How do I add styles to regions?
cn flag

In Drupal layout builder I may have a section with several drag and drop regions. Each region can contain multiple components (fields for example). I would like to add a style to the region - not the section or the component. EG. In the below picture I would like the editor to be able to add a red border to the drag and drop region containing Field 5 and Field 6.

enter image description here

I have looked at the Layout Styles module ...

Score: 1
Gilles9999 avatar
How to login first time in the login panel
it flag

I have finally managed to install aegir on a vps. I have also set the dns of my domain and I can i can finally see my login panel. The problem is that I don’t have username and password. The documentation says I should have a temporary link to set the password but I can’t find that temporary link. I tried to reset the password but obviously I can’t receive any mail because I have never done any lo ...

Score: 0
KrzysiekK avatar
Overriding Drupal.ajax.prototype is not working
bn flag

I am trying to override Drupal.ajax.prototype.beforeSend like this:

(function($) {
  // In mymodule.js, which appears after ajax.js in the page build
  Drupal.ajax.prototype.beforeSend = function(xmlhttprequest, options) {
    console.log('overridden!')
  }
})(jQuery);

The file that contains the code is listed below core's ajax.js in the page's source, yet it's the console.log I put inside core's ajax ...

Score: 1
JSON:API FieldEnhancers - removing a resource object from a JSON:API response
de flag

I need to remove a resource object (in this case a paragraph) from a JSON:API response when it matches a specific condition. I do not want to delete it, I just want to exclude the object from the response.

Approach: I tried using a FieldEnhancer to access the resource object in "doUndoTransform()", check for the condition and skip/remove it before being displayed.

Problem: So far I only succeeded in alter ...

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.