This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getUntransformedText(EntityInterface $entity, $field_name, $langcode, $view_mode) { | |
$response = new AjaxResponse(); | |
// Direct text editing is only supported for single-valued fields. | |
$field = $entity->getTranslation($langcode, FALSE)->$field_name; | |
$editable_text = check_markup($field->value, $field->format, $langcode, FALSE, array(FILTER_TYPE_TRANSFORM_REVERSIBLE, FILTER_TYPE_TRANSFORM_IRREVERSIBLE)); | |
$response->addCommand(new GetUntransformedTextCommand($editable_text)); | |
return $response; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment