In my theme:
libraries-override:
classy/base: false
classy/user: false
classy/dropbutton: false
classy/dialog: false
In Classy:
libraries:
- classy/base
- core/normalize
libraries-extend:
user/drupal.user:
- classy/user
core/drupal.dropbutton:
- classy/dropbutton
core/drupal.dialog:
- classy/dialog
Results in:
Drupal\Core\Asset\Exception\InvalidLibrariesExtendSpecificationException: The specified library "classy/dialog" does not exist. in Drupal\Core\Asset\LibraryDiscoveryCollector->applyLibrariesExtend() (line 169 of /Users/jmburnz/Sites/contrib/drupal8/drupal/core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php).
Perhaps this is a critical oversight in the design of the libraries override/extend system and in particular with regards to how Classy is using these systems. I want to use Classy for its templates, but I do not want the CSS it is adding - I am using my own and Classy adds a lot of style that I simply don't want. All I want to do is blow away all classy CSS files - how do I do this and avoid writing PHP and not get an exception?
Comment | File | Size | Author |
---|---|---|---|
#23 | 2589601-nr-bot.txt | 150 bytes | needs-review-queue-bot |
Issue fork drupal-2589601
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
Comment #2
Jeff Burnz CreditAttribution: Jeff Burnz commentedComment #3
pwolanin CreditAttribution: pwolanin as a volunteer commentedThis doesn't look like it meets the criteria for critical: https://www.drupal.org/core/issue-priority
Comment #4
Jeff Burnz CreditAttribution: Jeff Burnz commentedYou're correct, stylesheets-remove works - there is an alternate workaround.
Comment #5
Wim LeersI think this has been fixed since then. Please check/confirm.
Comment #6
Jeff Burnz CreditAttribution: Jeff Burnz commentedWim, I think you're right, however I can run some tests later next week. Cheers.
Comment #7
Wim LeersThanks!
Comment #8
almaudoh CreditAttribution: almaudoh commentedIs this still an issue, can we close it out?
Comment #10
Salsero72 CreditAttribution: Salsero72 commentedHi,
for those who'll encounter this same problem and get a blank page here's what happened to me.
(the page was'nt really blank. i got an "Unexpected general error" (or something similar. Sorry i do not remember)
I was running Drupal 8.1.0
WHAT CAUSED THE ERROR:
Really I do not know. I installed Zircon D8, and it was not working. Then I disabled. Everything was ok.
Than did many other config things.
Then I cleared the cache and boom! the problem popped.
Truncating all cache tables with mysql client didn't work for me.
WHAT I DID:
I googled and found this only page. But I could not find any fix here.
So I went the heavy way. I edited
core/lib/Drupal/Core/Asset/LibraryDiscoveryCollector.php
at line where "protected function applyLibrariesExtend" is declared. (line 149 for me)
at the very first line I put:
Well I started adding first line and with trial and error, added lines one by one.
The final result is as shown here above.
By doing this I could get a raw display of the front end and admin panel.
In that i went to
admin/config/development/performance
and cleared the cache by pressing the "empty cache" button.
After that I got back control of my site (normal full version)
Truncating cache tables or upgrading to 8.1.1 didn't solve the problem.
Hope this helps.
Comment #18
pameeela CreditAttribution: pameeela commentedThanks for reporting this issue. We rely on issue reports like this one to resolve bugs and improve Drupal core.
As part of the Bug Smash Initiative, we are triaging issues that are marked "Postponed (maintainer needs more info)".
Since there were no specific steps to reproduce the issue provided since the issue was postponed, I'm marking the issue "Closed (cannot reproduce)". If anyone can provide complete steps to reproduce the issue (starting from "Install Drupal core"), document those steps in the issue summary and set the issue status back to "Active".
Thanks!
Comment #19
Driskell CreditAttribution: Driskell as a volunteer and at Other Media commentedI am able to reproduce this in Drupal 9.2.10.
Effectively the libraries overrides from the active theme are applied when the extension's libraries are loaded.
However, extends is applied afterwards.
This can mean that a libraries-extend definition can fail because the library listed to be added to the existing library, won't exist anymore due to it being completely removed by the libraries-override.
I hit this because there was a library in parent theme that was both attached in some places, and in others it was attached via libraries-extend of another existing library from another module.
I wanted to remove this and add my own in the child theme. But as soon as you override to false to remove it, the libraries-extend begins to fail in the parent theme because it cannot find the library.
The example in the OP should work too as that's the same process.
Comment #21
Driskell CreditAttribution: Driskell as a volunteer and at Other Media commentedMR 1617 is a possible way to fix but I'm unsure on the acceptability of changing library-overrides so it "empties" a library rather than removes it. Although emptying it does mean it's practically had its JS and CSS removed, but still exists so can be referenced by libraries-extend still without an exception being thrown and getting a WSOD, and can also still be referenced in code anywhere else as an empty library. Issues could arise in contributed code I guess if it relies on libraries-override removing a library completely.
Open to ideas on this. Anything else I think changes the design a little - such as the overrides need to account for extends or there needs to be memory of what was removed by overrides to suppress the exception. None seem clean or desirable TBH but I do think the issue should be fixed...
Comment #22
Driskell CreditAttribution: Driskell as a volunteer and at Other Media commentedComment #23
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.