- π«π·France andypost
+++ b/core/lib/Drupal/Core/Extension/Requirement/RequirementInterface.php @@ -0,0 +1,107 @@ + const SEVERITY_OK = 0; ... + const SEVERITY_INFO = -1; ... + const SEVERITY_ERROR = 2; ... + const SEVERITY_WARNING = 1;
Instead of constants it could be enum or even removed in favour of methods (like accessResult doing).
But this weight used only for frontend to group sort requirements - that usage is missing in replacement - First commit to issue fork.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
We could possibly roll this into π Add value objects to represent the return of hook_requirements Needs work
- Merge request !5952Resolve #2909472 "Add Requirement value object and enums" β (Open) created by kim.pepper
- Status changed to Needs review
over 1 year ago 12:08am 26 December 2023 - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Converted to a single
Requirement
class with enums forRequirementSeverity
andRequirementPhase
.Remaining tasks:
- Decide if we should just enforce required properties by using constructor args
- Ensure sorting works
- Replace usages of requirements arrays
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Hiding old patches
- Status changed to Needs work
over 1 year ago 9:25pm 26 December 2023 - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
I think this issue is quite large, having to convert all of cores hook requirements to value objects as well as handle deprecations.
We should split out the smaller task of creating enums for RequirementSeverity and RequirementPhase π Create enums for RequirementSeverity and RequirementPhase Active
- π¨πSwitzerland berdir Switzerland
π Replace hook_requirements with tagged services Active is two thirds done.
If we can get this also into 11.2 then this might considerably simplify the BC layer. New hook use value objects, old hooks use arrays, we just need to merge it together in the places where core calls both the old and the new hooks?
- πΊπΈUnited States dww
Agreed this would be great to do in 11.2.0 so the new hooks only use the new API. Tagging as such. But this should now be postponed on π Create enums for RequirementSeverity and RequirementPhase Active , no?
- Issue was unassigned.
- Status changed to Postponed
15 days ago 5:25am 21 May 2025 - πΊπ¦Ukraine voleger Ukraine, Rivne
π Create enums for RequirementSeverity and RequirementPhase Active is merged
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Rebased on 11.x
- πΊπΈUnited States nicxvan
Several failures, this definitely won't make it in for 11.2 I think.
Personally I would want to postpone this in the system_requirements conversion. That issue was green and just need to take the new enum into account.
I'll link it later when I fix that issue.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Damn. I wish I saw your comment before I started converting
system_requirements()
π - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
I pushed up my work in progress in case it's useful later.