Active
Project:
Drupal core
Version:
main
Component:
entity system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 May 2026 at 13:58 UTC
Updated:
18 Jun 2026 at 12:02 UTC
Jump to comment: Most recent
Comments
Comment #2
Anonymous (not verified) commentedHey, I am a novice and was looking around to make my first ever open source contribution. Can I pick this one up? Thank you
Comment #3
avinash.jha commentedComment #6
joachim commentedLooks good.
> public function getWeight(): ?int;
This should always be an int. If it's not set, we return 0 -- and the pattern in existing entities is that there is a default value of 0.
> public function setWeight(?int $weight): static;
No reason to set as NULL.
Docs for EntityWeightTrait should mention the interface and vice versa.
Comment #7
mildertechnologies commented@joachim. will take care of it.. Thanks a lot for such speedy response!
Comment #8
longwaveIs there a core entity that we could convert here as a proof of concept?
Comment #9
mildertechnologies commentedComment #10
mildertechnologies commentedHey @joachim 👋🏻
just made my MR and implemented the asked changes
Thank you
Comment #11
joachim commented> Is there a core entity that we could convert here as a proof of concept?
There's taxonomy terms. But it would be good to do both a content and config entity for this.
Comment #12
joachim commented@mildertechnologies are you using an LLM for this?
Comment #13
mildertechnologies commentedto understand the syntax and to get the context of the codebase yes. But, the concept and the use case is clear to me as to why this issue arose in the first place. Is there a reason as to why you are asking this?
Are you referring to the previous response of mine in the chat? If that is so.. then no. I typed it out myself.
Comment #14
joachim commentedBecause of its impact on climate collapse, I refuse to review AI code. I'll happily guide and mentor contributors, especially newcomers, but I don't want anything to do with AI code.
Comment #15
mildertechnologies commentedI am more than happy to get the guidance of yours and make contributions to the project. Could you tell me how do we proceed from this point? I have dm'd you on slack too
Really looking forward to this
Thanks
Comment #16
joachim commentedI would recommend converting Term for content (shortcut is getting removed) and Block or Role for config.
The trait docs should maybe explain that the base field def is only useful for content entity types.
If there's AI involved in the code for the current MR, I am going to take a step back from this issue now.
Comment #18
joachim commentedComment #19
avpadernoComment #20
avpaderno(I apologize: I do not know from where the linked issue comes.)
Comment #21
joachim commentedI added it.