Closed (won't fix)
Project:
Drupal core
Version:
8.0.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2011 at 14:40 UTC
Updated:
29 Jul 2014 at 19:53 UTC
Hi,
I wrote a js library which uses the jQuery datepicker module.
Whenever this library is used by drupal_add_library a callback should be called to
set the date format depending on the users language.
Although drupal_process_attached supports callback functions drupal_add_library does not.
The solution would be quite simple:
if(isset($library['callback'])){
$elements['#attached']+=$library['callback'];
}
This would allow to register callbacks similar to the second drupal_process_attached example:
http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_pr...
| Comment | File | Size | Author |
|---|---|---|---|
| drupal_add_library.patch | 486 bytes | jantimon |
Comments
Comment #1
nod_That should happen in hook_library_info_alter(). Won't work with caching otherwise, see #1996238: Replace hook_library_info() by *.libraries.yml file and #1787758: drupal_get_library() / hook_library_info() is not cached.