Problem/Motivation
The docs say:
* @param array $components
* (optional) Array of component lists indexed by type. If not present or it
* is an empty array, it will update all components.
'update' is wrong surely, as everything else about the method says it just returns things.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3422919
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3422919-error-in-docs
changes, plain diff MR !6723
Comments
Comment #4
joachim commentedThanks for the MR!
Could you just fix the one problem for this issue though, rather than expand the scope?
I am going to be filing an issue to fix the confusing use of 'component' to mean extensions, but it's going to involve method renaming too.
Comment #5
prem suthar commentedComment #6
smustgrave commented@Prem Suthar just FYI this was tagged for novice, meaning for new users to Drupal contribution, and based on your post history believe you could work on non novice issues please.
Believe the goal was just to update getComponentNames function.
Comment #7
joachim commentedI think we could expand the scope to include the other error that @Prem Suthar spotted, which is that the structure of the @param array is incorrectly documented:
> Array of component lists indexed by type
However, the current MR is removing the '(optional)' part.
I've filed #3422955: Fix incorrect use of word 'component' in locale module, which is a bigger task which covers both code and docs.
Comment #8
smustgrave commentedSure but should be documented
Comment #9
joachim commentedHmm on second thoughts,
> Array of component lists indexed by type
does sort of describe it -- it's an array of several lists, and the array is keyed by the type of the things in the list.
The other issue is going to rewrite that text anyway so let's just fix the incorrect 'update' here.
Comment #10
lee jun long commentedHi, I am looking into this issue queue as part of Drupalcon Singapore 2024 Contribution day, and hope I can contribute in one way or another.
I have made a fresh installation of a Drupal 11 site to check on this, and tried to search the codebase for the code block shown in the Problem/Motivation. I realised that the only location I can find comes from
core/modules/locale/src/LocaleConfigManager.php. I checked that merge requestMR !6723, and found that the MR includes changes to bothcore/modules/locale/src/LocaleConfigManager.phpandcore/modules/locale/locale.bulk.inc. This confused me as I didn't understand the current state of the issue queue, and how I can contribute further.Comment #11
joachim commentedIt's core/modules/locale/src/LocaleConfigManager.php that needs fixing.
Comment #14
kul.pratap commentedWorking on this.
Comment #20
adwivedi008 commentedReverted the out-of-scope changes.
please review
Comment #21
smustgrave commentedIssue summary for good practice should still be filled out.
Also the parameter is still optional.
Comment #22
brandonlira commentedError in docs for getComponentNames()
Problem/Motivation
The docs say:
The use of the word "update" is incorrect, as the method actually returns configuration names rather than updating anything.
Steps to reproduce
core/modules/locale/src/LocaleConfigManager.php.getComponentNames()method.Proposed resolution
$componentsis empty or not provided, the method returns all configuration names.Remaining tasks
User interface changes
None.
API changes
None; this is purely a documentation fix.
Data model changes
None.
Release notes snippet
Not applicable.
Comment #23
brandonlira commentedComment #24
brandonlira commentedHi everyone,
I've updated the issue summary in my comment (#22) with the correct documentation details for the getComponentNames() method. It seems I don't have permission to edit the main issue summary directly. Could someone with the necessary permissions please update the issue summary with my changes?
Thank you!
Comment #25
joachim commentedComment #26
brandonlira commentedI have pushed my changes for Issue #3422919, which restore the "(optional)" note in the docblock of the getComponentNames() method. Please review my changes in MR and let me know if further adjustments are needed.
Comment #27
joachim commentedLooks good. Thanks!
Comment #31
nod_Committed e7a6df2 and pushed to 11.x. Thanks!