Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Most of what we used Libraries API for can be done with hook_library(), so it would be better to rely on core instead of depending on another contrib module unnecessarily.
Proposed resolution
Simplify code by registering libraries with hook_library()
and '#attached' => 'library'
in a render array. We can still check for the Libraries API for people who want multisite libraries support, but we don't need to depend on it.
User interface changes
None.
API changes
- Updated the README, but this should not affect anything since we will continue to use
highcharts_render()
as before. - Updated the project page information.
Comments
Comment #1
scottrigbyThis was done in the following commits:
Use hook_library(). Convert chart container to a render array, making use of libraries and attachments, and pass through drupal_render(). Drop highcharts_settings() and highcharts_load_js() (since we can do all this with #attached js), and theme_highcharts_chart() (since modules can now alter the render array). Remove $ajax param from highcharts_render() (since drupal_process_attached() will handle ensuring libraries are only loaded once). Other related module and documentation cleanup. Clean up example in README.
Remove dependency on Libraries API. Use core library functionality
Update readme intro