Change record status: 
Project: 
Introduced in branch: 
11.2.x
Introduced in version: 
11.2.0
Description: 

Previously, when importing default content using core's Importer class, content belonging to a non-existent user would be reassigned to the first available user with an administrative role.

It is now possible to explicitly set which user the content is assigned to, by passing it as a parameter to Importer::importContent:

$fallback_author = User::load(40);
$finder = new Finder('/path/to/some/default/content');
\Drupal::service(Importer::class)->importContent($finder, account: $fallback_author);

If no account is passed to importContent, it will try to use the first available user with an administrative role, same as before.

Impacts: 
Module developers