Remove AllowDynamicProperties attribute from UserSession

Created on 27 February 2023, almost 2 years ago
Updated 28 February 2023, almost 2 years ago

Problem/Motivation

Part of 🌱 [META] Get rid of #[\AllowDynamicProperties] attribute Active

There's a set of undefined properties muted with attribute, it should be defined and attribute removed

From #3295821-94: Ignore: patch testing issue for PHP 8.2 attributes

		+  protected $langcode;
		+  protected $pass;
		+  protected $status;
		+  protected $created;
		+  protected $changed;
		+  protected $login;
		+  protected $init;
		+  protected $default_langcode;
		+  protected $content_translation_source;
		+  protected $content_translation_outdated;
		+  protected $content_translation_uid;
		+  protected $content_translation_status;
		+  protected $content_translation_created;
		+  protected $rest_test_validation;
		+  public $pass_raw;
		+  public $passRaw;
		+  public $sessionId;

Proposed resolution

define all missing properties, refactor test code if it using object without reason

Remaining tasks

- agree
- patch/review/commit

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

📌 Task
Status

Needs work

Version

10.1

Component
Base 

Last updated 3 days ago

Created by

🇫🇷France andypost

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Comments & Activities

  • Issue created by @andypost
  • Status changed to Needs review almost 2 years ago
  • 🇫🇷France andypost

    all properties

  • Status changed to RTBC almost 2 years ago
  • 🇮🇳India Ranjit1032002

    I had Reviewed the patch and it's working as expected mentioned in comment #2

  • Status changed to Needs work almost 2 years ago
  • 🇫🇷France andypost

    At least half of this properties are externally set by rest and content translation modules - needs refactoring of usage, removal of dynamic access or replacing userSession with real User entity

  • 🇨🇭Switzerland berdir Switzerland

    That (using user entity) won't be enough. The user password stuff is drupalLogin() related and will likely require is to refactor that to avoid storing arbitrary stuff on either UserSession or content entities, these are just hiding the problem for now.

Production build 0.71.5 2024