Problem/Motivation

Formatter is not working with tablefield field type, throwing an error due to wrong call in the const

TypeError: Drupal\charts_field_formatter\Plugin\Field\FieldFormatter\ChartsFieldFormatter::__construct(): Argument #10 ($uuidService) must be of type Drupal\Component\Uuid\Php, Drupal\Component\Uuid\Com given, called in D:\MAMP\htdocs\cms-drupal-d8\web\modules\contrib\charts_field_formatter\src\Plugin\Field\FieldFormatter\ChartsFieldFormatter.php on line 70 in Drupal\charts_field_formatter\Plugin\Field\FieldFormatter\ChartsFieldFormatter->__construct() (line 37 of modules\contrib\charts_field_formatter\src\Plugin\Field\FieldFormatter\ChartsFieldFormatter.php).

Steps to reproduce

The field tablefield is not rendering, It throws an error

Proposed resolution

Correct the call of the service in the constructor, replace Php $uuidService by UuidInterface $uuid_service.

CommentFileSizeAuthor
#3 3334827-3.patch8.88 KBmatio89
#2 3334827-2.patch8.93 KBmatio89

Comments

matio89 created an issue. See original summary.

matio89’s picture

StatusFileSize
new8.93 KB

Attached the patch, including enhancements and DI fixes (after running phpcs and phpcbf).

matio89’s picture

StatusFileSize
new8.88 KB

Fixing the patch, and attach it.

matio89’s picture

Title: TypeError: Drupal\charts_field_formatter\Plugin\Field\FieldFormatter\ChartsFieldFormatter::__construct(): Argument #10 ($uuidService) must be of type Drupal\Component\Uuid\Php » TypeError: FieldFormatter\ChartsFieldFormatter::__construct(): Argument #10 ($uuidService) must be of type Drupal\Component\Uuid\Php
Status: Active » Needs work
matio89’s picture

Status: Needs work » Needs review
omar alahmed’s picture

Status: Needs review » Closed (outdated)