Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Inline with #1737148: Explicitly declare all JS dependencies, don't use drupal_add_js
File should be declared as a library with dependency on jquery and attached using library, instead of js.

nick_schuch’s picture

Initial patch containing:

- Creation of hook.
- Update of text.js reference.

nick_schuch’s picture

Status: Active » Needs review
larowlan’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
17.52 KB
23.16 KB

Tested manually, looks good to me

Screenshots
Screen Shot 2013-01-15 at 11.18.49 AM.png

Screen Shot 2013-01-15 at 11.18.55 AM.png

Note this will conflict with #1704864: Add a "Required" and "Show by default" option for "Text area with a summary" field/widget. so one of the two will need a re-roll. Probably better to make it this one as the other is a larger patch.

larowlan’s picture

Status: Reviewed & tested by the community » Needs work

@nod_ pointed out we need the jquery.once dependency too

larowlan’s picture

and also, we don't need the jquery.form dependency

nick_schuch’s picture

Status: Needs work » Needs review
FileSize
418 bytes
1.64 KB

Have updated the patch with the refined dependancies.

nod_’s picture

Status: Needs review » Needs work

it's jquery.once the dependency name, not drupal.once :)

nick_schuch’s picture

Status: Needs work » Needs review
FileSize
426 bytes
1.64 KB

Woops. Thanks nod_!

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Good to go

webchick’s picture

Committed and pushed to 8.x, thanks!

However, I'm wondering if we need to put some babysitting code in here. This is at least the 3rd or 4th time we've caught one of these. If hook_library_info() is actually supposed to be required, it seems like we ought to throw a notice or something when a library is accessed out of band? Could we open up a follow-up (if it doesn't already exist) to discuss?

webchick’s picture

Status: Reviewed & tested by the community » Fixed
larowlan’s picture

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