On enabling the module, the following error is displayed:

Fatal error: Call to undefined function get_t() in /home/filesand/public_html/drupal8sites/modules/fontyourface/fontyourface.install on line 93

And the install won't proceed.

I've searched the module from end to end and can't find get_t(), searching the Drupal 8 code doesn't turn it up either! I'm guessing I'm missing something obvious.

Comments

mark lacroix’s picture

I've had a few of these types of errors when installing Drupal 8 modules, including this one. It appears that the Drupal 8 API, even after the second beta release, is changing enough that many of these modules, especially the ones which have not been updated in some time, are being rapidly outdated.

It appears that, specifically, the get_t() return function has been depreciated (or rather, obsoleted) in Drupal 8. According to issues in other modules, the solution is to simply replace it with t().

In this module, the lines are:

  $t = get_t(); // <-- line 93

  $vocabulary = entity_create('taxonomy_vocabulary', array(
    'name' => $t('Font Tags'), // <-- line 96
    'vid' => 'font_tags',
    'langcode' => language_default()->langcode,
  ));
  taxonomy_vocabulary_save($vocabulary);

The solution here would be to delete line 93 entirely and remove the $ variable prefix from line 96, so that it calls t() directly.

Of course, when I tried this myself, I got a few other undefined function errors, in both the installer and the module, so it looks like this module just needs some more porting work (I wish I knew a bit more about what I was doing so I could help).

sreynen’s picture

Yes, the Drupal 8 version still needs a lot of work. That's why it doesn't have a recommended release yet. In general, I would recommend avoiding development releases unless you're wanting to do development. If anyone is interested in helping with the development of the Drupal 8 version of @font-your-face, I'd be happy to help train someone.

nikathone’s picture

I can help if you still need someone to help push the d8 version forward.

btmash’s picture

Status: Active » Closed (fixed)

There is a new dev release for 8.x-3.x if you want to give it a try. If you encounter any new bugs, please file a new ticket.

@nikathone You're welcome to help - please file any new tickets and/or patches and I'll gladly review/commit them.