-
Notifications
You must be signed in to change notification settings - Fork 172
Description
Current Behavior
If I create an event subscriber for LifeCycle::EVENT_PRE_REFERENCE and in that subscriber I alter metadata for the dataset, it does not persist. It gets overwritten because the reference uses the metadata from before the event is dispatched, rather than after any subscribers have run.
When referenceMetadata() fires it extracts the $metadata, then dispatches the event. Then my event subsciber alters the metadata inside $data. However then on line 361 it essentially saves the metadata that it set aside at the beginning, which is unchanged. So all my metadata maniplulation never got saved.
Expected Behavior
If I alter metadata as part of an event subscriber to LifeCycle::EVENT_PRE_REFERENCE, the alteration should persist and get saved with the referenced entity.
Steps To Reproduce
- Create an eventsubscriber to LifeCycle::EVENT_PRE_REFERENCE
- Alter the dataset node's metadata in the subscriber.
- Inspect the saved dataset and notice that the alteration did not get saved.
- Curse the PHP gods for their abject cruelty.
Relevant log output (optional)
Anything else?
This will be testable on PDC.