Problem/Motivation

Seven's implementation of hook_library_info_alter() is missing $extension parameter. This could potentially cause name conflicts with non-core libraries, as library names are not unique.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug, Seven is not using hook_library_info_alter() consistently with the other implementations in core and it could cause hard to diagnose bugs later.
Issue priority Normal because as of now nothing is broken.
Disruption No disruption for anyone, just makes things more solid.

Proposed resolution

Add the missing parameter and update the 'if' statements to check against it. That way we only target libraries coming from the intended source.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Comments

jstoller’s picture

StatusFileSize
new1.57 KB
jstoller’s picture

Status: Active » Needs review
aburrows’s picture

testing patch now

jstoller’s picture

Title: seven_library_info_alter() is missing $extensions parameter » seven_library_info_alter() is missing $extension parameter
Issue summary: View changes
aburrows’s picture

Are we counting libraries as js/css as mentioned in d8 or like we did libraries in d7 sites/all/libraries etc

jstoller’s picture

@aburrows: I'm not sure I understand the question. hook_library_info_alter() is specific to d8. Seven is using it to override a number libraries from core.libraries.yml and add its own CSS/js.

star-szr’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This checks out, thanks @jstoller!

star-szr’s picture

Title: seven_library_info_alter() is missing $extension parameter » seven_library_info_alter() is missing $extension parameter and condition
Issue tags: +Quick fix
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed c6415d4 and pushed to 8.0.x. Thanks!

  • alexpott committed c6415d4 on 8.0.x
    Issue #2490974 by jstoller: seven_library_info_alter() is missing $...

Status: Fixed » Closed (fixed)

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