Hi!

In Drupal 8 there is a hook, which is intended for adding assets in to page before it rendered -- https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!theme.api....

In currently 8.x-1.x branch for attach library used hook_page_build().

Comments

dunin created an issue. See original summary.

dunin’s picture

I replace hook_page_build() on hook_page_attachments() for add library.

dunin’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: add-coffee-drupal-coffee-library-in-to-page-2597826-1.patch, failed testing.

willzyx’s picture

Status: Needs work » Reviewed & tested by the community

I have tested the patch and it solves the issue. RTBC

willzyx’s picture

StatusFileSize
new1.7 KB
new2.32 KB

let's add a very simple test for this

The last submitted patch, 6: add-2597826-6-test-only.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 6: add-2597826-6.patch, failed testing.

willzyx’s picture

The CI errors are caused by 'No schema for coffee.configuration in Drupal\Core\Config\Testing\ConfigSchemaChecker->onConfigSave()'.
We need to declare the coffee.configuration config schema

opened #2631002: Add coffee.schema.yml and coffee.configuration.yml

willzyx’s picture

Status: Needs work » Needs review
willzyx’s picture

StatusFileSize
new1.69 KB

rerolled

  • willzyx committed 5dbad6b on 8.x-1.x
    Issue #2597826 by willzyx, dunin: Add coffee/drupal.coffee library in to...
willzyx’s picture

Status: Needs review » Fixed

Committed an pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

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