On beta 16...

When adding a new Metatags field to a content type, the following error is thrown:

Fatal error: Declaration of Drupal\metatag\Plugin\Field\FieldFormatter\MetatagEmptyFormatter::viewElements() must be compatible with Drupal\Core\Field\FormatterInterface::viewElements(Drupal\Core\Field\FieldItemListInterface $items, $langcode) in /var/www/drupal/modules/contrib/metatag/src/Plugin/Field/FieldFormatter/MetatagEmptyFormatter.php on line 0

I am guessing this is because of an update to the most recent beta.

Steps to reproduce:

1. Structure > Content Types
2. Select "Manage Fields" of any content type
3. Add new field of type Metatags
4. Click "Save and continue"

CommentFileSizeAuthor
#2 2579279-metatag-formatter.patch610 bytespaulmckibben

Comments

nerdstein created an issue. See original summary.

paulmckibben’s picture

StatusFileSize
new610 bytes

I ran into that same issue. Here's a patch!

damienmckenna’s picture

Priority: Normal » Critical
Parent issue: » #2563605: Plan for Metatag 8.x-1.0-beta1 release

Thanks for reporting it. Yes, there were some API changes in beta16.

nerdstein’s picture

I was just about to submit the same patch as well. Cool!

damienmckenna’s picture

Status: Active » Needs review

Thanks for the patch, paulmckibben! I'll try to review it shortly.

PS, don't forget to update the issue status to "needs review" when you add a patch!

Status: Needs review » Needs work

The last submitted patch, 2: 2579279-metatag-formatter.patch, failed testing.

The last submitted patch, 2: 2579279-metatag-formatter.patch, failed testing.

The last submitted patch, 2: 2579279-metatag-formatter.patch, failed testing.

The last submitted patch, 2: 2579279-metatag-formatter.patch, failed testing.

The last submitted patch, 2: 2579279-metatag-formatter.patch, failed testing.