Update to Drupal 8.2.0. For more information, see https://www.drupal.org/project/drupal/releases/8.2.0
This commit is contained in:
parent
2f563ab520
commit
f1c8716f57
1732 changed files with 52334 additions and 11780 deletions
|
@ -15,9 +15,6 @@ use Drupal\Core\Field\FieldItemListInterface;
|
|||
* "text",
|
||||
* "text_long",
|
||||
* "text_with_summary",
|
||||
* },
|
||||
* quickedit = {
|
||||
* "editor" = "plain_text"
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
|
|
|
@ -120,7 +120,6 @@ class TextField extends CckFieldPluginBase {
|
|||
return 'text_long';
|
||||
default:
|
||||
return parent::getFieldType($row);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ use Drupal\entity_test\Entity\EntityTest;
|
|||
use Drupal\field\Entity\FieldConfig;
|
||||
use Drupal\field\Tests\String\StringFieldTest;
|
||||
use Drupal\field\Entity\FieldStorageConfig;
|
||||
use Drupal\filter\Entity\FilterFormat;
|
||||
|
||||
/**
|
||||
* Tests the creation of text fields.
|
||||
|
@ -195,7 +196,7 @@ class TextFieldTest extends StringFieldTest {
|
|||
$this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
|
||||
|
||||
// Display the entity.
|
||||
$entity = entity_load('entity_test', $id);
|
||||
$entity = EntityTest::load($id);
|
||||
$display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full');
|
||||
$content = $display->build($entity);
|
||||
$this->setRawContent($renderer->renderRoot($content));
|
||||
|
@ -211,7 +212,7 @@ class TextFieldTest extends StringFieldTest {
|
|||
);
|
||||
$this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
|
||||
filter_formats_reset();
|
||||
$format = entity_load('filter_format', $edit['format']);
|
||||
$format = FilterFormat::load($edit['format']);
|
||||
$format_id = $format->id();
|
||||
$permission = $format->getPermissionName();
|
||||
$roles = $this->webUser->getRoles();
|
||||
|
@ -234,7 +235,7 @@ class TextFieldTest extends StringFieldTest {
|
|||
|
||||
// Display the entity.
|
||||
$this->container->get('entity.manager')->getStorage('entity_test')->resetCache(array($id));
|
||||
$entity = entity_load('entity_test', $id);
|
||||
$entity = EntityTest::load($id);
|
||||
$display = entity_get_display($entity->getEntityTypeId(), $entity->bundle(), 'full');
|
||||
$content = $display->build($entity);
|
||||
$this->setRawContent($renderer->renderRoot($content));
|
||||
|
|
|
@ -59,16 +59,16 @@ class TextWithSummaryItemTest extends FieldKernelTestBase {
|
|||
$this->createField($entity_type);
|
||||
|
||||
// Create an entity with a summary and no text format.
|
||||
$entity = $this->container->get('entity_type.manager')
|
||||
->getStorage($entity_type)
|
||||
->create();
|
||||
$storage = $this->container->get('entity_type.manager')
|
||||
->getStorage($entity_type);
|
||||
$entity = $storage->create();
|
||||
$entity->summary_field->value = $value = $this->randomMachineName();
|
||||
$entity->summary_field->summary = $summary = $this->randomMachineName();
|
||||
$entity->summary_field->format = NULL;
|
||||
$entity->name->value = $this->randomMachineName();
|
||||
$entity->save();
|
||||
|
||||
$entity = entity_load($entity_type, $entity->id());
|
||||
$entity = $storage->load($entity->id());
|
||||
$this->assertTrue($entity->summary_field instanceof FieldItemListInterface, 'Field implements interface.');
|
||||
$this->assertTrue($entity->summary_field[0] instanceof FieldItemInterface, 'Field item implements interface.');
|
||||
$this->assertEqual($entity->summary_field->value, $value);
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
use Drupal\Component\Utility\Html;
|
||||
use Drupal\Component\Utility\Unicode;
|
||||
use Drupal\Core\Routing\RouteMatchInterface;
|
||||
use Drupal\filter\Entity\FilterFormat;
|
||||
|
||||
/**
|
||||
* Implements hook_help().
|
||||
|
@ -80,7 +81,7 @@ function text_summary($text, $format = NULL, $size = NULL) {
|
|||
|
||||
// Retrieve the filters of the specified text format, if any.
|
||||
if (isset($format)) {
|
||||
$filters = entity_load('filter_format', $format)->filters();
|
||||
$filters = FilterFormat::load($format)->filters();
|
||||
// If the specified format does not exist, return nothing. $text is already
|
||||
// filtered text, but the remainder of this function will not be able to
|
||||
// ensure a sane and secure summary.
|
||||
|
|
Reference in a new issue