Change Sessions to either 'files' or NativeFileSessionHandler - D8.9

We have a context where we have a traditional php website which uses 'files' session_handler and both the drupal-8.9 website and this other website needs to share session information.

With D8 the default session handler uses a database.

I would like to have the D8 site use the 'files' session_handler to be able to share session information.

There seems to be two ways to do this:

1) ini_set('session.save_handler', 'files');

2) $sessionStorage = new NativeSessionStorage([], new NativeFileSessionHandler());

Default values in form_alter

Drupal 8.8.5

In form_alter I insert this code to assign a default value to an Entity reference field
$form['field_localita_partenza']['widget'][0]['target_id']['#default_value'] = 'ROME';

During the insertion phase, I change Rome In Milan but when I save it forces me to value ROME and not MILAN.
I have done various tests but without success.
I don't understand why it doesn't work

Error while updating the module using composer

Hi All,

I am trying to update the composer as well as trying to use the below command to update the module

It always give me below error.

composer update

Error as below

Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 1982464 bytes) in Unknown on line 0

composer require commerceguys/addressing

Error as below

Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 1982464 bytes) in Unknown on line 0

Thanks in advance,

What entites are provided by the Drupal 8/9 core?

Entities was the big thing when Drupal 7 arrived, and AFAIR, there were exactly five entities that came with the Drupal 7 core:

  1. Users
  2. Comments
  3. Content
  4. Taxonomy terms
  5. Files

I've tried to find a similar list of entities that exists in the core alone for Drupal 8/9, but no luck so far. Does anybody know?

How to clean out Twig file cache?!

I am removing several of Drupal 8 sites (from multisites);

After I delete a Drupal 8 installation folder (I can not completely remove), delete database, etc....

- There remains a folder files/php/twig with many, many cache folders/ files - with 444 permission....

I will need probably a week of meaningless hard labour or so to manually go into each small folder, change permission for each trashy file and press Delete for each of them, it will take hours and hours...

Where is my responsive image formatter?

I'm working on a local copy of a website that was originally created in Drupal 7 that we're migrating to Drupal 8. Current Drupal version is 8.9.1.

The problem that is driving me slowly nuts is that when I try to set up the display of image fields, I don't have access to the Responsive Image formatter in Views or Layout Builder. My only options are Thumbnail, Label, Entity ID, and Rendered Entity. The Breakpoint and Responsive Image modules are both enabled. 

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x