- Issue created by @PatriciaCB
- πΊπΈUnited States Chris Burge
Instead of setting a dynamic property on the config object, I'm wondering if we can use
ConfigCrudEvent::isChanged
.ConfigEventsSubscriber::configSave
modifies config and then saves it, which fires off anotherConfigCrudEvent
event. The purpose of$oembedProvidersProcessed
is prevent an infinite loop. We need to figure out another way to check ifConfigEventsSubscriber::configSave
has already acted on the config save. - πΊπΈUnited States Chris Burge
On second thought, I bet we can leverage
drupal_static()
here. We should include the config object's name as part of the$name
parameter to cover the case where multiple config objects are saved during the same request.$config_processed = &drupal_static(__METHOD__ . ':' . $config->getName()); ... // Skip if the media config entity has already been processed. if (isset($config_processed) { return; } ... $config->setData($data); $config_processed = TRUE; $config->save();
- πΊπΈUnited States Chris Burge
Steps to reproduce:
- Install Drupal 10 with PHP 8.2.
- Install oEmbed Providers module.
- Open the Media Type entity edit page (/admin/structure/media/manage/remote_video)for 'Remove video' and save the form.
- last update
over 1 year ago 60 pass - @chris-burge opened merge request.
- last update
over 1 year ago 60 pass - πΊπΈUnited States Chris Burge
Let's go ahead and scope this issue to this use of a dynamic property on an object. If there are additional PHP 8.2 issues, we can address those separately.
- last update
over 1 year ago 60 pass - Issue was unassigned.
-
Chris Burge β
committed a0e35570 on 2.x
Issue #3380430 by Chris Burge, PatriciaCB: Use drupal_static() instead...
-
Chris Burge β
committed a0e35570 on 2.x
- Status changed to Fixed
over 1 year ago 7:13pm 21 August 2023 - πΊπΈUnited States Chris Burge
@PatriciaCB - Thanks for reporting this issue.
Automatically closed - issue fixed for 2 weeks with no activity.