Cause: #1737148: Explicitly declare all JS dependencies, don't use drupal_add_js

#type machine_name doesn't work at all right now and throws a JS error instead.

Due to #1639012: Guard against broken behaviors I guess no one noticed yet, since the error is "nicely" hidden in the JS console and all other scripts/behaviors continue to work on the page. (In hindsight, was it a good idea to hide blatant JS errors...?)

I suspect the cause for this is that dependencies are not properly computed. Instead, they need to be manually specified for every single library that is defined. I already stated on the original JS dependencies issue that having to manually specify the entire dependency chain is a bad idea - that's what machines are for.

So we should

1) fix the missing dependency

2) make that machine compute dependencies for us (this can be deferred to a separate issue, but should at least be major)

CommentFileSizeAuthor
#3 1776030_3.patch588 byteschx
#1 drupal8.machine-name.1.patch444 bytessun
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sun’s picture

Status: Active » Needs review
FileSize
444 bytes
chx’s picture

Status: Needs review » Reviewed & tested by the community

Correct (note to committers: make very sure the patch applied to the drupal.machine-name array in system.module, there's not enough context for the patch utility).

chx’s picture

FileSize
588 bytes

Note: this is absolutely not sun's fault, simply there are too many similar lines there. I am actually breaking core conventions here when reposting it with git diff -U6 but otherwise it could apply to something else.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Confirmed with git diff --U=10, committed and pushed to 8.x. Thanks!

Agreed w/ the follow-up on 2). I'd also love a follow-up to get something like the Libraries API module test that tstoeckler describes at #1772466-3: Broke overlay with the dependency patch to get a basic sanity checking that these things are being loaded when they ought to be. This is the third or fourth time JS refactoring like this has caused such a regression.

Status: Fixed » Closed (fixed)

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