Skip to content
Snippets Groups Projects

Issue #2744905: Inline images in the answer field are removed during file garbage collection

Open Issue #2744905: Inline images in the answer field are removed during file garbage collection
@@ -6,6 +6,7 @@ use Drupal\Core\Field\FieldItemBase;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\TypedData\DataDefinition;
use Drupal\editor\EditorFieldItemInterface;
/**
* Plugin implementation of the 'faqfield' field type.
@@ -18,7 +19,7 @@ use Drupal\Core\TypedData\DataDefinition;
* = "faqfield_accordion"
* )
*/
class FaqFieldItem extends FieldItemBase {
class FaqFieldItem extends FieldItemBase implements EditorFieldItemInterface {
/**
* {@inheritdoc}
@@ -134,4 +135,12 @@ class FaqFieldItem extends FieldItemBase {
parent::setValue($values, $notify);
}
/**
* {@inheritdoc}
*/
public function getFormattedText() {
$answer = $this->get('answer')->getValue();
return is_array($answer) ? $answer['value'] : $answer;
}
}
Loading