Commit f5c20ee4 authored by mvc's avatar mvc Committed by targoo

Issue #2660864 by mvc, mglaman, Boobaa, sdstyles, Philippe Labat: Fatal error...

Issue #2660864 by mvc, mglaman, Boobaa, sdstyles, Philippe Labat: Fatal error in all field formatters
parent 9bbbb07f
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespace Drupal\color_field\Plugin\Field\FieldFormatter; namespace Drupal\color_field\Plugin\Field\FieldFormatter;
use Drupal\color_field\Plugin\Field\FieldType\ColorFieldType;
use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
...@@ -141,7 +142,7 @@ class ColorFieldFormatterCss extends FormatterBase { ...@@ -141,7 +142,7 @@ class ColorFieldFormatterCss extends FormatterBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function viewValue(FieldItemInterface $item) { protected function viewValue(ColorFieldType $item) {
$opacity = $this->getFieldSetting('opacity'); $opacity = $this->getFieldSetting('opacity');
$settings = $this->getSettings(); $settings = $this->getSettings();
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
namespace Drupal\color_field\Plugin\Field\FieldFormatter; namespace Drupal\color_field\Plugin\Field\FieldFormatter;
use Drupal\color_field\Plugin\Field\FieldType\ColorFieldType;
use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Field\FieldItemInterface; use Drupal\Core\Field\FieldItemInterface;
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
...@@ -147,7 +148,7 @@ class ColorFieldFormatterSwatch extends FormatterBase { ...@@ -147,7 +148,7 @@ class ColorFieldFormatterSwatch extends FormatterBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function viewValue(FieldItemInterface $item) { protected function viewValue(ColorFieldType $item) {
$opacity = $this->getFieldSetting('opacity'); $opacity = $this->getFieldSetting('opacity');
$settings = $this->getSettings(); $settings = $this->getSettings();
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
namespace Drupal\color_field\Plugin\Field\FieldFormatter; namespace Drupal\color_field\Plugin\Field\FieldFormatter;
use Drupal\Core\Field\FieldItemInterface; use Drupal\color_field\Plugin\Field\FieldType\ColorFieldType;
use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FormatterBase; use Drupal\Core\Field\FormatterBase;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
...@@ -114,7 +114,7 @@ class ColorFieldFormatterText extends FormatterBase { ...@@ -114,7 +114,7 @@ class ColorFieldFormatterText extends FormatterBase {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function viewValue(FieldItemInterface $item) { protected function viewValue(ColorFieldType $item) {
$opacity = $this->getFieldSetting('opacity'); $opacity = $this->getFieldSetting('opacity');
$settings = $this->getSettings(); $settings = $this->getSettings();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment