Skip to content

Fix all viewElements() compatibility with FormatterInterface::viewElements #57

Description

@otarza

After adding addthis field to a content type and try to visit form display I get following error:

PHP Fatal error: Declaration of Drupal\\addthis\\Plugin\\Field\\FieldFormatter\\AddThisBasicButtonFormatter::viewElements() must be compatible with Drupal\\Core\\Field\\FormatterInterface::viewElements(Drupal\\Core\\Field\\FieldItemListInterface $items, $langcode) in /modules/contrib/addthis/src/Plugin/Field/FieldFormatter/AddThisBasicButtonFormatter.php on line 26

Fix:

  • Add $langcode parameter to viewElements() method of 3 FieldFormatters that are implemented in this module.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions