Problem/Motivation
While going through comment #6 in #2301239: MenuLinkNG part1 (no UI or conversions): plugins (static + MenuLinkContent) + MenuLinkManager + MenuTreeStorage reviewing @todos in MenuTreeStorage.php and MenuLinkManager notice the definition of fields need to be in sync.
Proposed resolution
Perhaps use a new method to keep them in sync, or use array_keys
Remaining tasks
- Use appropriate keys for field definitions in MenuTreeStorage and avoid duplication
User interface changes
No
API changes
No, but an addition might be required
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | interdiff_22-24.txt | 427 bytes | pooja saraah |
| #24 | 2302085-24.patch | 5.4 KB | pooja saraah |
| #22 | 2302085-22.patch | 5.38 KB | rishabh vishwakarma |
| #10 | menu-keep_field_definition_in_sync-2302085-10-8.6.x.patch | 5.57 KB | voleger |
| #8 | menu-keep_field_definition_in_sync-2302085-08-8.5.x.patch | 6.92 KB | voleger |
Comments
Comment #1
pwolanin commentedShouldn't be worked on until after #2301319: MenuLinkNG part5: Remove dead code; and party!
Comment #2
mgiffordComment #7
volegerJust try to use trait for this.
Comment #8
volegerDefine magic properties in the trait. Add doc property definitions in related interfaces.
Comment #10
volegertry to just share
$defaultproperty and overridedefinitionFields()method with returning keys from$defaultproperty inMenuTreeStorage.Comment #11
borisson_@voleger; no need to run tests for all php versions. This patch looks good, but since there are only 2 implementations, I don't think it's needed to do this refactor.
Comment #21
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
Tagged for novice for beginner developers to reroll.
Comment #22
rishabh vishwakarma commentedAdding patch for 10.1.x-dev. Please review.
Comment #23
borisson_The phpcs failure in #22 needs to be fixed.
Comment #24
pooja saraah commentedFixed failed commands on #22
Attached patch against Drupal 10.1.x
Attached interdiff
Comment #25
rpayanmComment #26
smustgrave commentedReroll looks good.
Good job @pooja saraah!
Comment #28
catchLooks great. Don't think we need a CR for this trait, it's quite internal but good to share the code between the two places in core.
Committed 475a3c7 and pushed to 10.1.x. Thanks!
Comment #29
catch