API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21...

Enter a descriptive title (above) relating to function hook_library_info_alter, then describe the problem you have found:

> array $libraries: An associative array of libraries registered by $extension. Keyed by internal library name and passed by reference.

The phrase 'internal library name' is not used anywhere else in Drupal and is not entirely clear.

This should say 'without the extension prefix'.

Issue fork drupal-3375497

Command icon 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:

Comments

joachim created an issue. See original summary.

Yujiman85 made their first commit to this issue’s fork.

yujiman85’s picture

Status: Active » Needs review

I tried to add some clarity as to how libraries are referenced in the code as well as provide an example.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Seems like a good update.

xjm’s picture

Title: docs have unclear term 'internal library name' » Unclear term 'internal library name' in theme API documentation
Status: Reviewed & tested by the community » Needs work

Nice improvement!

It was still not immediately obvious to me how the library name was connected to the example when I first read the documentation out of context, so I suggested a slight improvement.

Thanks!

xjm’s picture

Saving issue credits.

yujiman85’s picture

Status: Needs work » Needs review

I agree with #6, that is a bit clearer so I updated the MR. Thank you. Is that clear enough without having to state that the libraries are registered by $extension? I guess "Can either be 'core' or the machine name of the extension that registered the libraries." kinda clears that up.

xjm’s picture

Status: Needs review » Needs work

CS failure (wish it would mark the issue NW):

FILE: /var/www/html/core/lib/Drupal/Core/Render/theme.api.php
----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 1016 | ERROR | [x] Whitespace found at end of line
      |       |     (Squiz.WhiteSpace.SuperfluousWhitespace.EndLine)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------

I also think we should keep the first sentence about it being an associative array. It's not a library; it's an array of libraries. Right?

yujiman85’s picture

Status: Needs work » Needs review

Gave it some more thought and came up with another revision.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Think this is good for committer review again.

  • lauriii committed 01747e1c on 11.x
    Issue #3375497 by Yujiman85, xjm, joachim: Unclear term 'internal...
lauriii’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 01747e1 and pushed to 11.x. Also cherry-picked to 10.1.x as a docs fix. Thanks!

  • lauriii committed 495b6d94 on 10.1.x
    Issue #3375497 by Yujiman85, xjm, joachim: Unclear term 'internal...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.