Hey,

I am running the following Writer 8.x-2.2-alpha5 on Drupal core 8.0.0-beta2.

Installed with the basic settings d8, enabled and hit the site and I get..

Fatal error: Call to undefined function drupal_add_html_head() in /nfs/c04/h03/mnt/181775/domains/d8.fixmytechnology.ca/html/themes/writer/writer.theme on line 70

Drupal Core (basic install) Includes: Bartik, Block, Breakpoint, CKEditor, Classy, Color, Comment, Configuration Manager, Contact, Contextual Links, Custom Block, Custom Menu Links, Database Logging, Datetime, Entity Reference, Field, Field UI, File, Filter, Help, History, Image, Menu UI, Node, Options, Path, Quick Edit, RDF, Search, Seven, Shortcut, System, Taxonomy, Text, Text Editor, Toolbar, Tour, Update Manager, User, Views, Views UI

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bryanbraun’s picture

Thanks for reporting. This looks like another instance of D8 shifting underneath us. Should be easy enough to fix by looking up the D8 paradigm that replaced drupal_add_html_head().

I think I'd get to this eventually, but feel free to submit a patch if you're anxious for an immediate fix.

IshaDakota’s picture

This is the relevant change record:

https://www.drupal.org/node/2160069

I didn't have a ton of time to figure it out right now tough, and couldn't get the meta tags to "attach" correctly.

IshaDakota’s picture

Status: Active » Needs review
FileSize
2.99 KB

This gets your part of the way there. Meta tags and fonts are added to head, but it only add, doesn't replace, originals. See: #2359987: Overriding core metatag using hook_page_attachments_alter results in two tags

This patch also moves the google font links into the hook_page_attachments_alter function, which is a fix for #2329721-1: JS not loaded

  • IshaDakota authored 44ff24f on 8.x-2.x
    Issues #2367587 and #2329721 by IshaDakota: Fixed mechanism to load JS...
bryanbraun’s picture

Status: Needs review » Closed (fixed)

Thanks for the patch! It applied cleanly and works great. Committed to 8.x-2.x-dev, and included it in a 8.x-2.2-beta1 release.

By the way, I followed your commit with another one removing my viewport metatag from the HTML source. I had included that metatag in the 7.x version since Drupal core didn't provide it, but now that D8 provides it out of the box, I don't need to add my own.

c3rberus’s picture

thank you for the fix :)