diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 88b3909..fec8a70 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -397,7 +397,7 @@ function editor_entity_revision_delete(EntityInterface $entity) { } /** - * Records file usage of files referenced by filtered text fields. + * Records file usage of files referenced by formatted text fields. * * Every referenced file that does not yet have the FILE_STATUS_PERMANENT state, * will be given that state. @@ -420,7 +420,7 @@ function _editor_record_file_usage(array $uuids, EntityInterface $entity) { } /** - * Deletes file usage of files referenced by filtered text fields. + * Deletes file usage of files referenced by formatted text fields. * * @param array $uuids * An array of file entity UUIDs. @@ -441,7 +441,7 @@ function _editor_delete_file_usage(array $uuids, EntityInterface $entity, $count } /** - * Finds all files referenced (data-editor-file-uuid) by filtered text fields. + * Finds all files referenced (data-editor-file-uuid) by formatted text fields. * * @param EntityInterface $entity * An entity whose fields to analyze. @@ -452,30 +452,30 @@ function _editor_delete_file_usage(array $uuids, EntityInterface $entity, $count function _editor_get_file_uuids_by_field(EntityInterface $entity) { $uuids = array(); - $filtered_text_fields = _editor_get_filtered_text_fields($entity); - foreach ($filtered_text_fields as $filtered_text_field) { - $text = $entity->get($filtered_text_field)->value; - $uuids[$filtered_text_field] = _editor_parse_file_uuids($text); + $formatted_text_fields = _editor_get_formatted_text_fields($entity); + foreach ($formatted_text_fields as $formatted_text_field) { + $text = $entity->get($formatted_text_field)->value; + $uuids[$formatted_text_field] = _editor_parse_file_uuids($text); } return $uuids; } /** - * Determines the filtered text fields on an entity. + * Determines the formatted text fields on an entity. * * @param ContentEntityInterface $entity * An entity whose fields to analyze. * * @return array - * The names of the fields on this entity that support filtered text. + * The names of the fields on this entity that support formatted text. */ -function _editor_get_filtered_text_fields(ContentEntityInterface $entity) { +function _editor_get_formatted_text_fields(ContentEntityInterface $entity) { $field_definitions = $entity->getFieldDefinitions(); if (empty($field_definitions)) { return array(); } - // Only return filtered text fields. + // Only return formatted text fields. return array_keys(array_filter($field_definitions, function (FieldDefinitionInterface $definition) { return in_array($definition->getType(), array('text', 'text_long', 'text_with_summary'), TRUE); })); diff --git a/core/modules/editor/js/editor.formattedTextEditor.js b/core/modules/editor/js/editor.formattedTextEditor.js index 082316a..1dd2c21 100644 --- a/core/modules/editor/js/editor.formattedTextEditor.js +++ b/core/modules/editor/js/editor.formattedTextEditor.js @@ -1,6 +1,6 @@ /** * @file - * Text editor-based in-place editor for filtered text content in Drupal. + * Text editor-based in-place editor for formatted text content in Drupal. * * Depends on editor.module. Works with any (WYSIWYG) editor that implements the * editor.js API, including the optional attachInlineEditor() and onChange() @@ -78,8 +78,8 @@ break; case 'activating': - // When transformation filters have been been applied to the filtered - // text of this field, then we'll need to load a re-filtered version + // When transformation filters have been been applied to the formatted + // text of this field, then we'll need to load a re-formatted version // of it without the transformation filters. if (this.textFormatHasTransformations) { var $textElement = this.$textElement; @@ -151,7 +151,7 @@ /** * Loads untransformed text for this field. * - * More accurately: it re-filters filtered text to exclude transformation + * More accurately: it re-filters formatted text to exclude transformation * filters used by the text format. * * @param Function callback diff --git a/core/modules/editor/src/Ajax/GetUntransformedTextCommand.php b/core/modules/editor/src/Ajax/GetUntransformedTextCommand.php index 0429aa4..3465729 100644 --- a/core/modules/editor/src/Ajax/GetUntransformedTextCommand.php +++ b/core/modules/editor/src/Ajax/GetUntransformedTextCommand.php @@ -11,7 +11,7 @@ use Drupal\quickedit\Ajax\BaseCommand; /** - * AJAX command to rerender a filtered text field without any transformation + * AJAX command to rerender a formatted text field without any transformation * filters. */ class GetUntransformedTextCommand extends BaseCommand { diff --git a/core/modules/editor/src/EditorController.php b/core/modules/editor/src/EditorController.php index 618d91a..44feda3 100644 --- a/core/modules/editor/src/EditorController.php +++ b/core/modules/editor/src/EditorController.php @@ -29,15 +29,15 @@ class EditorController extends ControllerBase { /** * Returns an Ajax response to render a text field without transformation filters. * - * @param int $entity - * The entity of which a filtered text field is being rerendered. + * @param \Drupal\Core\Entity\EntityInterface $entity + * The entity of which a formatted text field is being rerendered. * @param string $field_name - * The name of the (filtered text) field that that is being rerendered + * The name of the (formatted text) field that that is being rerendered * @param string $langcode - * The name of the language for which the filtered text field is being - * rererendered. + * The name of the language for which the formatted text field is being + * rerendered. * @param string $view_mode_id - * The view mode the filtered text field should be rerendered in. + * The view mode the formatted text field should be rerendered in. * * @return \Drupal\Core\Ajax\AjaxResponse * The Ajax response. diff --git a/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php b/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php index 25a357c..d56cfff 100644 --- a/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php +++ b/core/modules/editor/src/Plugin/InPlaceEditor/Editor.php @@ -32,7 +32,7 @@ public function isCompatible(FieldItemListInterface $items) { if ($field_definition->getFieldStorageDefinition()->getCardinality() != 1) { return FALSE; } - // This editor is compatible with filtered ("rich") text fields; but only + // This editor is compatible with formatted ("rich") text fields; but only // if there is a currently active text format, that text format has an // associated editor and that editor supports inline editing. elseif (in_array($field_definition->getType(), array('text', 'text_long', 'text_with_summary'), TRUE)) { diff --git a/core/modules/quickedit/src/Plugin/InPlaceEditor/PlainTextEditor.php b/core/modules/quickedit/src/Plugin/InPlaceEditor/PlainTextEditor.php index 2e93272..4b24ac8 100644 --- a/core/modules/quickedit/src/Plugin/InPlaceEditor/PlainTextEditor.php +++ b/core/modules/quickedit/src/Plugin/InPlaceEditor/PlainTextEditor.php @@ -29,7 +29,7 @@ public function isCompatible(FieldItemListInterface $items) { if ($field_definition->getFieldStorageDefinition()->getCardinality() != 1) { return FALSE; } - // This editor is incompatible with filtered ("rich") text fields. + // This editor is incompatible with formatted ("rich") text fields. elseif (in_array($field_definition->getType(), array('text', 'text_long', 'text_with_summary'), TRUE)) { return FALSE; } diff --git a/core/modules/quickedit/tests/modules/src/Plugin/InPlaceEditor/WysiwygEditor.php b/core/modules/quickedit/tests/modules/src/Plugin/InPlaceEditor/WysiwygEditor.php index 9dba6d6..8727b63 100644 --- a/core/modules/quickedit/tests/modules/src/Plugin/InPlaceEditor/WysiwygEditor.php +++ b/core/modules/quickedit/tests/modules/src/Plugin/InPlaceEditor/WysiwygEditor.php @@ -30,7 +30,7 @@ public function isCompatible(FieldItemListInterface $items) { if ($field_definition->getFieldStorageDefinition()->getCardinality() != 1) { return FALSE; } - // This editor is compatible with filtered ("rich") text fields; but only + // This editor is compatible with formatted ("rich") text fields; but only // if there is a currently active text format and that text format is the // 'full_html' text format. elseif (in_array($field_definition->getType(), array('text', 'text_long', 'text_with_summary'), TRUE)) { diff --git a/core/modules/rdf/src/Tests/Field/TextFieldRdfaTest.php b/core/modules/rdf/src/Tests/Field/TextFieldRdfaTest.php index 85da5f2..e0d36b9 100644 --- a/core/modules/rdf/src/Tests/Field/TextFieldRdfaTest.php +++ b/core/modules/rdf/src/Tests/Field/TextFieldRdfaTest.php @@ -65,13 +65,13 @@ protected function setUp() { * @todo Check for the summary mapping. */ public function testAllFormatters() { - $filtered_value = strip_tags($this->entity->{$this->fieldName}->processed); + $formatted_value = strip_tags($this->entity->{$this->fieldName}->processed); // Tests the default formatter. - $this->assertFormatterRdfa(array('type'=>'text_default'), 'http://schema.org/text', array('value' => $filtered_value)); + $this->assertFormatterRdfa(array('type'=>'text_default'), 'http://schema.org/text', array('value' => $formatted_value)); // Tests the summary formatter. - $this->assertFormatterRdfa(array('type'=>'text_summary_or_trimmed'), 'http://schema.org/text', array('value' => $filtered_value)); + $this->assertFormatterRdfa(array('type'=>'text_summary_or_trimmed'), 'http://schema.org/text', array('value' => $formatted_value)); // Tests the trimmed formatter. - $this->assertFormatterRdfa(array('type'=>'text_trimmed'), 'http://schema.org/text', array('value' => $filtered_value)); + $this->assertFormatterRdfa(array('type'=>'text_trimmed'), 'http://schema.org/text', array('value' => $formatted_value)); } } diff --git a/core/modules/text/config/schema/text.schema.yml b/core/modules/text/config/schema/text.schema.yml index fd46b4a..b41705c 100644 --- a/core/modules/text/config/schema/text.schema.yml +++ b/core/modules/text/config/schema/text.schema.yml @@ -10,7 +10,7 @@ text.settings: field.text.settings: type: mapping - label: 'Text settings' + label: 'Text (formatted) settings' mapping: max_length: type: integer @@ -18,7 +18,7 @@ field.text.settings: field.text.instance_settings: type: mapping - label: 'Text settings' + label: 'Text (formatted) settings' sequence: - type: string @@ -37,12 +37,12 @@ field.text.value: label: 'Text format' field.text_long.settings: - label: 'Settings' + label: 'Text (formatted, long) settings' type: mapping mapping: { } field.text_long.instance_settings: - label: 'Text (filtered, long) settings' + label: 'Text (formatted, long) settings' type: mapping mapping: { } @@ -61,13 +61,13 @@ field.text_long.value: label: 'Text format' field.text_with_summary.settings: - label: 'Default' + label: 'Text (formatted, long, with summary) settings' type: mapping mapping: { } field.text_with_summary.instance_settings: type: mapping - label: 'Text area with a summary' + label: 'Text (formatted, long, with summary) settings' mapping: display_summary: type: boolean @@ -92,7 +92,7 @@ field.text_with_summary.value: entity_view_display.field.text_default: type: entity_field_view_display_base - label: 'Filtered text default display format settings' + label: 'Formatted text default display format settings' mapping: settings: type: sequence @@ -102,7 +102,7 @@ entity_view_display.field.text_default: entity_view_display.field.text_summary_or_trimmed: type: entity_field_view_display_base - label: 'Summary or trimmed filtered text display format settings' + label: 'Summary or trimmed formatted text display format settings' mapping: settings: type: mapping diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextItem.php index f146c3b..6c32f08 100644 --- a/core/modules/text/src/Plugin/Field/FieldType/TextItem.php +++ b/core/modules/text/src/Plugin/Field/FieldType/TextItem.php @@ -15,8 +15,8 @@ * * @FieldType( * id = "text", - * label = @Translation("Text (filtered)"), - * description = @Translation("This field stores varchar text in the database."), + * label = @Translation("Text (formatted)"), + * description = @Translation("This field stores a text with a text format."), * default_widget = "text_textfield", * default_formatter = "text_default" * ) diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php index 7ef750d..bf1054f 100644 --- a/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php +++ b/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php @@ -8,15 +8,14 @@ namespace Drupal\text\Plugin\Field\FieldType; use Drupal\Core\Field\FieldStorageDefinitionInterface; -use Drupal\Core\Form\FormStateInterface; /** * Plugin implementation of the 'text_long' field type. * * @FieldType( * id = "text_long", - * label = @Translation("Text (filtered, long)"), - * description = @Translation("This field stores long text in the database."), + * label = @Translation("Text (formatted, long)"), + * description = @Translation("This field stores a long text with a text format."), * default_widget = "text_textarea", * default_formatter = "text_default" * ) diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php index 9a97dbf..fd8b528 100644 --- a/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php +++ b/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php @@ -16,8 +16,8 @@ * * @FieldType( * id = "text_with_summary", - * label = @Translation("Text (filtered, long, with summary)"), - * description = @Translation("This field stores long text in the database along with optional summary text."), + * label = @Translation("Text (formatted, long, with summary)"), + * description = @Translation("This field stores long text with a format and an optional summary."), * default_widget = "text_textarea_with_summary", * default_formatter = "text_default" * ) diff --git a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php index f82a3d4..c9e0422 100644 --- a/core/modules/text/src/Tests/Formatter/TextFormatterTest.php +++ b/core/modules/text/src/Tests/Formatter/TextFormatterTest.php @@ -55,7 +55,7 @@ protected function setUp() { ))->save(); entity_create('field_storage_config', array( - 'name' => 'filtered_text', + 'name' => 'formatted_text', 'entity_type' => $this->entityType, 'type' => 'text', 'settings' => array(), @@ -63,7 +63,7 @@ protected function setUp() { entity_create('field_instance_config', array( 'entity_type' => $this->entityType, 'bundle' => $this->bundle, - 'field_name' => 'filtered_text', + 'field_name' => 'formatted_text', 'label' => 'Filtered text', ))->save(); } @@ -80,7 +80,7 @@ public function testFormatters() { // Create the entity to be referenced. $entity = entity_create($this->entityType, array('name' => $this->randomMachineName())); - $entity->filtered_text = array( + $entity->formatted_text = array( 'value' => 'Hello, world!', 'format' => 'my_text_format', ); @@ -88,13 +88,13 @@ public function testFormatters() { foreach ($formatters as $formatter) { // Verify the text field formatter's render array. - $build = $entity->get('filtered_text')->view(array('type' => $formatter)); + $build = $entity->get('formatted_text')->view(array('type' => $formatter)); drupal_render($build[0]); $this->assertEqual($build[0]['#markup'], "

Hello, world!

\n"); $expected_cache_tags = array( 'filter_format' => array('my_text_format'), ); - $this->assertEqual($build[0]['#cache']['tags'], $expected_cache_tags, format_string('The @formatter formatter has the expected cache tags when formatting a filtered text field.', array('@formatter' => $formatter))); + $this->assertEqual($build[0]['#cache']['tags'], $expected_cache_tags, format_string('The @formatter formatter has the expected cache tags when formatting a formatted text field.', array('@formatter' => $formatter))); } }