Problem/Motivation

part of #3299855: [META] Get rid of #[\AllowDynamicProperties] attribute
Remove attribute added in #3299853: Apply #[\AllowDynamicProperties] attribute to base classes to make PHP 8.2 log size sane for ConfigEntityBase

Proposed resolution

provide API (probably magic __get()/__set()) to add properties to config entity dynamically

Remaining tasks

- agree
- patch/review/commit

User interface changes

no

API changes

TBD

Data model changes

no

Release notes snippet

no

Comments

andypost created an issue. See original summary.

andypost’s picture

Status: Active » Needs review
StatusFileSize
new4.13 KB
andypost’s picture

StatusFileSize
new4.84 KB
wim leers’s picture

StatusFileSize
new486 bytes

If I understand this correctly, #3 is what is necessary to be able to do

diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
index 6c614097cf..08731ab9d7 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
@@ -18,7 +18,6 @@
  *
  * @ingroup entity_api
  */
-#[\AllowDynamicProperties]
 abstract class ConfigEntityBase extends EntityBase implements ConfigEntityInterface {
 
   use PluginDependencyTrait {

… so if that's right, let's see what fails on PHP 8.2, because I have yet to find a failing test on PHP 8.2 if I do that 😅

Status: Needs review » Needs work

The last submitted patch, 4: 3299857-3-GOAL.patch, failed testing. View results

berdir’s picture

Mostly this is about the #3311442: Only set defined properties on config entities in EntityForm::copyFormValuesToEntity (new child but existing issue, renamed).

This is not a short-term/quickfix issue and those properties are _not_ the solution. We don't want to add them, we want them to not get set.

andypost’s picture

requeued "goal" patch to get baseline, patch in #3 still needs work for naming (comments) and what #6 said

andypost’s picture

Title: Remove AllowDynamicProperties attribute from ConfigEntityBase » [PP-1] Remove AllowDynamicProperties attribute from ConfigEntityBase
Status: Needs work » Postponed
Related issues: +#2839195: Add a method to access the original property

The most of 2248 failed tests are caused by #2839195: Add a method to access the original property

Probably better to postpone it

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.