Account switching to user 1 is now fraught

Created on 19 April 2024, 7 months ago
Updated 8 May 2024, 7 months ago

Problem/Motivation

We switch to user 1 in \Drupal\Core\DefaultContent\Importer::importContent(). We need to ensure we switch back with a try/finally construction. BUT also now that has landed switching to user 1 is fraught.

Pointed out by @larowlan in ✨ Add recipes api as experimental API to core Needs review

Steps to reproduce

Proposed resolution

I think we need to make this configurable somehow. Default to user 1. Check if they have an role with administrator and error if they do not and tell people to configure this. I think for now this should be an option on the CLI and not stored in config. In the long run this needs to be configurable via the UI but as we don't have a UI I think we can ignore that for now.

We should also check the default content module for existing issues.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

11.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024