Core and composer updates
This commit is contained in:
parent
a82634bb98
commit
62cac30480
1118 changed files with 21770 additions and 6306 deletions
|
@ -67,7 +67,7 @@ class FieldUiTable extends Table {
|
|||
unset($list[$name]);
|
||||
|
||||
// Determine the region for the row.
|
||||
$region_name = call_user_func($row['#region_callback'], $row);
|
||||
$region_name = call_user_func_array($row['#region_callback'], [&$row]);
|
||||
|
||||
// Add the element in the tree.
|
||||
$target = &$trees[$region_name][''];
|
||||
|
|
|
@ -161,6 +161,9 @@ class FieldConfigListBuilder extends ConfigEntityListBuilder {
|
|||
'title' => $this->t('Edit'),
|
||||
'weight' => 10,
|
||||
'url' => $entity->urlInfo("{$entity->getTargetEntityTypeId()}-field-edit-form"),
|
||||
'attributes' => [
|
||||
'title' => $this->t('Edit field settings.')
|
||||
],
|
||||
];
|
||||
}
|
||||
if ($entity->access('delete') && $entity->hasLinkTemplate("{$entity->getTargetEntityTypeId()}-field-delete-form")) {
|
||||
|
@ -168,6 +171,9 @@ class FieldConfigListBuilder extends ConfigEntityListBuilder {
|
|||
'title' => $this->t('Delete'),
|
||||
'weight' => 100,
|
||||
'url' => $entity->urlInfo("{$entity->getTargetEntityTypeId()}-field-delete-form"),
|
||||
'attributes' => [
|
||||
'title' => $this->t('Delete field.')
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -177,8 +183,6 @@ class FieldConfigListBuilder extends ConfigEntityListBuilder {
|
|||
'attributes' => ['title' => $this->t('Edit storage settings.')],
|
||||
'url' => $entity->urlInfo("{$entity->getTargetEntityTypeId()}-storage-edit-form"),
|
||||
];
|
||||
$operations['edit']['attributes']['title'] = $this->t('Edit field settings.');
|
||||
$operations['delete']['attributes']['title'] = $this->t('Delete field.');
|
||||
|
||||
return $operations;
|
||||
}
|
||||
|
|
|
@ -817,12 +817,12 @@ abstract class EntityDisplayFormBase extends EntityForm {
|
|||
* @return string|null
|
||||
* The region name this row belongs to.
|
||||
*/
|
||||
public function getRowRegion($row) {
|
||||
switch ($row['#row_type']) {
|
||||
case 'field':
|
||||
case 'extra_field':
|
||||
return $row['region']['#value'] ?: 'hidden';
|
||||
public function getRowRegion(&$row) {
|
||||
$regions = $this->getRegions();
|
||||
if (!isset($regions[$row['region']['#value']])) {
|
||||
$row['region']['#value'] = 'hidden';
|
||||
}
|
||||
return $row['region']['#value'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -410,7 +410,7 @@ class FieldStorageAddForm extends FormBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Configures the newly created field for the default view and form modes.
|
||||
* Configures the field for the default form mode.
|
||||
*
|
||||
* @param string $field_name
|
||||
* The field name.
|
||||
|
@ -428,7 +428,7 @@ class FieldStorageAddForm extends FormBase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Configures the newly created field for the default view and form modes.
|
||||
* Configures the field for the default view mode.
|
||||
*
|
||||
* @param string $field_name
|
||||
* The field name.
|
||||
|
|
|
@ -33,6 +33,7 @@ class ManageDisplayTest extends WebTestBase {
|
|||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->drupalPlaceBlock('system_breadcrumb_block');
|
||||
$this->drupalPlaceBlock('local_tasks_block');
|
||||
|
||||
// Create a test user.
|
||||
$admin_user = $this->drupalCreateUser(['access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'administer taxonomy', 'administer taxonomy_term fields', 'administer taxonomy_term display', 'administer users', 'administer account settings', 'administer user display', 'bypass node access']);
|
||||
|
@ -403,8 +404,11 @@ class ManageDisplayTest extends WebTestBase {
|
|||
$manage_display = 'admin/structure/types/manage/' . $this->type . '/display';
|
||||
$this->drupalGet($manage_display);
|
||||
$this->assertNoLink('Full content');
|
||||
$this->assertLink('Teaser');
|
||||
|
||||
$this->drupalGet($manage_display . '/teaser');
|
||||
$this->assertNoLink('Full content');
|
||||
$this->assertLink('Default');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,8 +5,17 @@
|
|||
* Field UI test module.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Access\AccessResult;
|
||||
use Drupal\Core\Form\FormStateInterface;
|
||||
use Drupal\Core\Render\Element;
|
||||
use Drupal\Core\Field\FieldConfigInterface;
|
||||
|
||||
/**
|
||||
* Implements hook_ENTITY_TYPE_access().
|
||||
*/
|
||||
function field_ui_test_field_config_access(FieldConfigInterface $field) {
|
||||
return AccessResult::forbiddenIf($field->getName() == 'highlander');
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_form_FORM_BASE_ID_alter().
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\field_ui\Functional;
|
||||
|
||||
use Drupal\Tests\BrowserTestBase;
|
||||
|
||||
/**
|
||||
* Tests the Manage Display page of a fieldable entity type.
|
||||
*
|
||||
* @group field_ui
|
||||
*/
|
||||
class ManageFieldsTest extends BrowserTestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = [
|
||||
'field_ui',
|
||||
'field_ui_test',
|
||||
'node',
|
||||
'text',
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$account = $this->drupalCreateUser(['administer node fields']);
|
||||
$this->drupalLogin($account);
|
||||
$this->config('system.logging')
|
||||
->set('error_level', ERROR_REPORTING_DISPLAY_ALL)
|
||||
->save();
|
||||
}
|
||||
|
||||
public function testFieldDropButtonOperations() {
|
||||
$node_type = $this->drupalCreateContentType();
|
||||
|
||||
/** @var \Drupal\field\FieldStorageConfigInterface $storage */
|
||||
$storage = $this->container->get('entity_type.manager')
|
||||
->getStorage('field_storage_config')
|
||||
->create([
|
||||
'type' => 'string',
|
||||
'field_name' => 'highlander',
|
||||
'entity_type' => 'node',
|
||||
]);
|
||||
$storage->save();
|
||||
|
||||
$this->container->get('entity_type.manager')
|
||||
->getStorage('field_config')
|
||||
->create([
|
||||
'field_storage' => $storage,
|
||||
'bundle' => $node_type->id(),
|
||||
])
|
||||
->save();
|
||||
|
||||
$this->drupalGet('/admin/structure/types/manage/' . $node_type->id() . '/fields');
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue