Latest Drupal related questions

Score: -1
Anton avatar
How can I override a displayed node with the content rendered by a custom module?
de flag

I have a path /application, which is rendered by a custom module (through a combination of theme hook/controller/routing/twig). It's basically a mini-application.

I also have a Drupal node /data, which is a Drupal node with content loaded by Drupal.

However, I need to load the contents of /application at /data. I tried setting the routing of my custom module to use /data instead of /application, but ...

Score: 2
How to use a referenced entity's values in a TableSort?
ai flag

I have a custom entity with a field which is defined as follows.

$fields['file'] = BaseFieldDefinition::create('file')
  ->setDescription('Reference to the built-in core File entity type.')
  ->setLabel('File')
  ->setRequired(TRUE)
  ->setSetting('file_extensions', 'pdf rtf doc docx')
  ->setSetting('max_filesize', '20MB')
  ->setSetting('description_field', TRUE)
  ->setDisplay ...
Score: 0
quantumized avatar
How to prevent changing specific module installed status during config syncs?
ng flag

I know there are methods for preventing specific configurations from being exported but how do you prevent specific module's installed/un-installed status from being exported?

For example, I'd like dev,stage_file_proxy to be enabled on dev but not prod. And the reverse for mem_cache.

Also, is there a way to prevent the performance page settings (CSS, JS aggregation) from being exported?

Score: 1
Why am I getting different results for entity::save() between REST and web?
cn flag

I'm refactoring my user entities to use entity bundle classes.

Before, I saved the value of a time offset in a field using hook_user_presave():

// Initialize in user timezone.
$user_timezone = timezone_open($this->getTimeZone());
$time_to_convert = new \DateTime('now', $user_timezone);
// Set the user's preferred time.
$time_to_convert->setTime($hours, $minutes);
// Convert to the site's de ...
Score: -2
quantumized avatar
After I upgraded the site, some admin pages get a "Field storage definition for 'uuid' could not be found." error
ng flag

Upgrading Drupal 8 to Drupal 9 went smooth and without any issues, but now when I visit admin/reports/status or admin/modules/uninstall, I get this exception.

Drupal\Core\Field\FieldException: Field storage definition for 'uuid' could not be found. in Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema->getEntitySchema() (line 968 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php) ...

Score: 1
What is the correct way to get the rendered fields values in a block view twig template?
in flag

I have a block on the main page of my website that displays most recent news stories from the News page (3 latest entries). This is a view, here is its settings:

enter image description here

I'm trying to make this block look better. As this is a view, I use block--views-block--news-block-1.html.twig template file for my purpose. All I wanted was to get the rendered field values in it to wrap each of them in a <div> wit ...

Score: -3
rukya avatar
Error while updb, how to debug it?
id flag

I've updated opigno_lms to 2.29 version without any problems by composer and then "drush updb", then installed 3.0.2 version through composer, but "drush updb" gives me:

[notice] Update started: opigno_statistics_update_9001 [error] Argument 2 passed to Drupal\Core\Config\CachedStorage::write() must be of the type array, bool given, called in /home/mine/praca/gitowanie/opigno_project/web/modules/contri ...

Score: -1
Kamal Oberoi avatar
How do I debug Drupal\Component\PhpStorage\FileStorage::createDirectory()?
in flag

On my site, I am getting this warning.

Alert: User warning: mkdir(): Permission Denied in Drupal\Component\PhpStorage\FileStorage->createDirectory() (line 123 of core/lib/Drupal/Component/PhpStorage/FileStorage.php).

I want to debug or get the exact path and directory where Drupal is trying to create the directory.

I tried changing the file permissions for sites/default/files with chmod -R 777

Score: 0
Cannot set subscriptions_status on migration from csv
us flag

Modules used: Simplenews and Migrate.

I have a single newsletter, to which I want to subscribe all users imported from the csv file.

This is my csv file content:

id,email,date_submitted

This is my yml import file

langcode: en
status: true
dependencies: {  }
id: test_subscriber
class: null
field_plugin_method: null
cck_plugin_method: null
migration_tags:
   - CSV
migration_group: test
label: 'Test Subsc ...
Score: 1
Changing the PHP memory limit in settings.php is not reflected in phpinfo()
cn flag

Of the various methods to increase the PHP memory limit, the only one I can use for a certain site is ini_set('memory_limit', 'XXXM'); in settings.php.

This value does not appear to change the memory_limit shown in phpinfo(). However, I know it is actually being modified because the site breaks without it.

Is there another way to view the current memory limit OR the actual memory limit ceiling?

Score: 0
jacksparrow avatar
Update field without node save
ve flag

I am a beginner in Drupal, I would like to insert a value into a node field. But instead of a node->save() I want to avoid any presave hook and insert it directly using sql query. I have the entity_id to insert also in the field_NAME_value column, is this the node id? Or how do I get this? Or is there a way to do a node save without calling presave ? Thanks

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.