Closed (fixed)
Project:
Drupal core
Version:
11.3.x-dev
Component:
default content system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 May 2025 at 19:59 UTC
Updated:
27 Nov 2025 at 21:49 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
mglamanComment #4
phenaproximaI think we can make the metadata read-only and therefore remove some accessors from the event.
Comment #5
mglamandid the change
Comment #6
mglamanComment #7
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #8
nod_Comment #9
mglamanComment #10
phenaproximaThis looks really good to me, but I suspect we can tighten scope slightly and reduce the size of the change set.
Comment #11
mglamanI need to fix the phpcs/phpstan
Comment #12
phenaproximaI'm happy with this. I ended up removing the unit test because, after the simplifications we made, it's not really testing anything worthwhile. The kernel test remains.
Comment #13
phenaproximaComment #14
thejimbirch commentedReading through the tests, When entities are imported, the test subscriber listens for PreEntityImportEvent and modifies the entity data before creation. After import, the test confirms that the entity’s label was changed as expected ("Changed name"), proving event data modification works. All threads resolved. Moving to RTBC
Comment #15
alexpottComment #16
phenaproximaFixed with a test (confirmed that it fails without the appropriate fix).
Comment #17
phenaproximaNice idea, @alexpott. That's a lot cleaner!
Comment #18
mglamanI know I touched the MR, but it's been changed quite a bit by @phenaproxima and looks great, and has addressed @alexpott feedback
Comment #19
alexpottCommitted and pushed 44799b5173b to 11.x and 74f8df5f8cd to 11.3.x. Thanks!