updated core from 8.4 to 8.5 : bug with login_destination
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
}
|
||||
.field-ui-overview .field-plugin-summary {
|
||||
float: left; /* LTR */
|
||||
font-size: .9em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
[dir="rtl"] .field-ui-overview .field-plugin-summary {
|
||||
float: right;
|
||||
@@ -25,7 +25,7 @@
|
||||
.field-ui-overview .field-plugin-summary-cell .warning {
|
||||
display: block;
|
||||
float: left; /* LTR */
|
||||
margin-right: .5em;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
[dir="rtl"] .field-ui-overview .field-plugin-summary-cell .warning {
|
||||
float: right;
|
||||
|
||||
@@ -212,13 +212,10 @@
|
||||
// Separate keys and values.
|
||||
const rowNames = [];
|
||||
const ajaxElements = [];
|
||||
let rowName;
|
||||
for (rowName in rows) {
|
||||
if (rows.hasOwnProperty(rowName)) {
|
||||
rowNames.push(rowName);
|
||||
ajaxElements.push(rows[rowName]);
|
||||
}
|
||||
}
|
||||
Object.keys(rows || {}).forEach((rowName) => {
|
||||
rowNames.push(rowName);
|
||||
ajaxElements.push(rows[rowName]);
|
||||
});
|
||||
|
||||
if (rowNames.length) {
|
||||
// Add a throbber next each of the ajaxElements.
|
||||
|
||||
@@ -7,8 +7,8 @@ package: Core
|
||||
dependencies:
|
||||
- field
|
||||
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
# Information added by Drupal.org packaging script on 2018-03-07
|
||||
version: '8.5.0'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1515021228
|
||||
datestamp: 1520457825
|
||||
|
||||
@@ -120,13 +120,10 @@
|
||||
AJAXRefreshRows: function AJAXRefreshRows(rows) {
|
||||
var rowNames = [];
|
||||
var ajaxElements = [];
|
||||
var rowName = void 0;
|
||||
for (rowName in rows) {
|
||||
if (rows.hasOwnProperty(rowName)) {
|
||||
rowNames.push(rowName);
|
||||
ajaxElements.push(rows[rowName]);
|
||||
}
|
||||
}
|
||||
Object.keys(rows || {}).forEach(function (rowName) {
|
||||
rowNames.push(rowName);
|
||||
ajaxElements.push(rows[rowName]);
|
||||
});
|
||||
|
||||
if (rowNames.length) {
|
||||
$(ajaxElements).after('<div class="ajax-progress ajax-progress-throbber"><div class="throbber"> </div></div>');
|
||||
|
||||
@@ -82,6 +82,7 @@ class FieldStorageConfigListBuilder extends ConfigEntityListBuilder {
|
||||
*/
|
||||
public function buildHeader() {
|
||||
$header['id'] = $this->t('Field name');
|
||||
$header['entity_type'] = $this->t('Entity type');
|
||||
$header['type'] = [
|
||||
'data' => $this->t('Field type'),
|
||||
'class' => [RESPONSIVE_PRIORITY_MEDIUM],
|
||||
@@ -102,12 +103,15 @@ class FieldStorageConfigListBuilder extends ConfigEntityListBuilder {
|
||||
$row['data']['id'] = $field_storage->getName();
|
||||
}
|
||||
|
||||
$entity_type_id = $field_storage->getTargetEntityTypeId();
|
||||
// Adding the entity type.
|
||||
$row['data']['entity_type'] = $entity_type_id;
|
||||
|
||||
$field_type = $this->fieldTypes[$field_storage->getType()];
|
||||
$row['data']['type'] = $this->t('@type (module: @module)', ['@type' => $field_type['label'], '@module' => $field_type['provider']]);
|
||||
|
||||
$usage = [];
|
||||
foreach ($field_storage->getBundles() as $bundle) {
|
||||
$entity_type_id = $field_storage->getTargetEntityTypeId();
|
||||
if ($route_info = FieldUI::getOverviewRouteInfo($entity_type_id, $bundle)) {
|
||||
$usage[] = \Drupal::l($this->bundles[$entity_type_id][$bundle]['label'], $route_info);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Provides the add form for entity display modes.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class EntityDisplayModeAddForm extends EntityDisplayModeFormBase {
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ use Drupal\Core\Entity\EntityDeleteForm;
|
||||
|
||||
/**
|
||||
* Provides the delete form for entity display modes.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class EntityDisplayModeDeleteForm extends EntityDeleteForm {
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace Drupal\field_ui\Form;
|
||||
|
||||
/**
|
||||
* Provides the edit form for entity display modes.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class EntityDisplayModeEditForm extends EntityDisplayModeFormBase {
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Edit form for the EntityFormDisplay entity type.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class EntityFormDisplayEditForm extends EntityDisplayFormBase {
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Provides the add form for entity display modes.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class EntityFormModeAddForm extends EntityDisplayModeAddForm {
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Edit form for the EntityViewDisplay entity type.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class EntityViewDisplayEditForm extends EntityDisplayFormBase {
|
||||
|
||||
@@ -112,7 +114,6 @@ class EntityViewDisplayEditForm extends EntityDisplayFormBase {
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getDisplayModesLink() {
|
||||
;
|
||||
return [
|
||||
'#type' => 'link',
|
||||
'#title' => t('Manage view modes'),
|
||||
|
||||
@@ -12,6 +12,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Provides a form for removing a field from a bundle.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class FieldConfigDeleteForm extends EntityDeleteForm {
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ use Drupal\field_ui\FieldUI;
|
||||
|
||||
/**
|
||||
* Provides a form for the field settings form.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class FieldConfigEditForm extends EntityForm {
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* Provides a form for the "field storage" add page.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class FieldStorageAddForm extends FormBase {
|
||||
|
||||
@@ -310,14 +312,16 @@ class FieldStorageAddForm extends FormBase {
|
||||
'translatable' => FALSE,
|
||||
];
|
||||
$widget_id = $formatter_id = NULL;
|
||||
$widget_settings = $formatter_settings = [];
|
||||
|
||||
// Check if we're dealing with a preconfigured field.
|
||||
if (strpos($field_storage_values['type'], 'field_ui:') !== FALSE) {
|
||||
list(, $field_type, $option_key) = explode(':', $field_storage_values['type'], 3);
|
||||
$field_storage_values['type'] = $field_type;
|
||||
|
||||
$field_type_class = $this->fieldTypePluginManager->getDefinition($field_type)['class'];
|
||||
$field_options = $field_type_class::getPreconfiguredOptions()[$option_key];
|
||||
$field_definition = $this->fieldTypePluginManager->getDefinition($field_type);
|
||||
$options = $this->fieldTypePluginManager->getPreconfiguredOptions($field_definition['id']);
|
||||
$field_options = $options[$option_key];
|
||||
|
||||
// Merge in preconfigured field storage options.
|
||||
if (isset($field_options['field_storage_config'])) {
|
||||
@@ -338,7 +342,9 @@ class FieldStorageAddForm extends FormBase {
|
||||
}
|
||||
|
||||
$widget_id = isset($field_options['entity_form_display']['type']) ? $field_options['entity_form_display']['type'] : NULL;
|
||||
$widget_settings = isset($field_options['entity_form_display']['settings']) ? $field_options['entity_form_display']['settings'] : [];
|
||||
$formatter_id = isset($field_options['entity_view_display']['type']) ? $field_options['entity_view_display']['type'] : NULL;
|
||||
$formatter_settings = isset($field_options['entity_view_display']['settings']) ? $field_options['entity_view_display']['settings'] : [];
|
||||
}
|
||||
|
||||
// Create the field storage and field.
|
||||
@@ -347,8 +353,8 @@ class FieldStorageAddForm extends FormBase {
|
||||
$field = $this->entityManager->getStorage('field_config')->create($field_values);
|
||||
$field->save();
|
||||
|
||||
$this->configureEntityFormDisplay($values['field_name'], $widget_id);
|
||||
$this->configureEntityViewDisplay($values['field_name'], $formatter_id);
|
||||
$this->configureEntityFormDisplay($values['field_name'], $widget_id, $widget_settings);
|
||||
$this->configureEntityViewDisplay($values['field_name'], $formatter_id, $formatter_settings);
|
||||
|
||||
// Always show the field settings step, as the cardinality needs to be
|
||||
// configured for new fields.
|
||||
@@ -416,12 +422,20 @@ class FieldStorageAddForm extends FormBase {
|
||||
* The field name.
|
||||
* @param string|null $widget_id
|
||||
* (optional) The plugin ID of the widget. Defaults to NULL.
|
||||
* @param array $widget_settings
|
||||
* (optional) An array of widget settings. Defaults to an empty array.
|
||||
*/
|
||||
protected function configureEntityFormDisplay($field_name, $widget_id = NULL) {
|
||||
protected function configureEntityFormDisplay($field_name, $widget_id = NULL, array $widget_settings = []) {
|
||||
$options = [];
|
||||
if ($widget_id) {
|
||||
$options['type'] = $widget_id;
|
||||
if (!empty($widget_settings)) {
|
||||
$options['settings'] = $widget_settings;
|
||||
}
|
||||
}
|
||||
// Make sure the field is displayed in the 'default' form mode (using
|
||||
// default widget and settings). It stays hidden for other form modes
|
||||
// until it is explicitly configured.
|
||||
$options = $widget_id ? ['type' => $widget_id] : [];
|
||||
entity_get_form_display($this->entityTypeId, $this->bundle, 'default')
|
||||
->setComponent($field_name, $options)
|
||||
->save();
|
||||
@@ -434,12 +448,20 @@ class FieldStorageAddForm extends FormBase {
|
||||
* The field name.
|
||||
* @param string|null $formatter_id
|
||||
* (optional) The plugin ID of the formatter. Defaults to NULL.
|
||||
* @param array $formatter_settings
|
||||
* (optional) An array of formatter settings. Defaults to an empty array.
|
||||
*/
|
||||
protected function configureEntityViewDisplay($field_name, $formatter_id = NULL) {
|
||||
protected function configureEntityViewDisplay($field_name, $formatter_id = NULL, array $formatter_settings = []) {
|
||||
$options = [];
|
||||
if ($formatter_id) {
|
||||
$options['type'] = $formatter_id;
|
||||
if (!empty($formatter_settings)) {
|
||||
$options['settings'] = $formatter_settings;
|
||||
}
|
||||
}
|
||||
// Make sure the field is displayed in the 'default' view mode (using
|
||||
// default formatter and settings). It stays hidden for other view
|
||||
// modes until it is explicitly configured.
|
||||
$options = $formatter_id ? ['type' => $formatter_id] : [];
|
||||
entity_get_display($this->entityTypeId, $this->bundle, 'default')
|
||||
->setComponent($field_name, $options)
|
||||
->save();
|
||||
|
||||
@@ -12,6 +12,8 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
* Provides a form for the "field storage" edit page.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class FieldStorageConfigEditForm extends EntityForm {
|
||||
|
||||
|
||||
@@ -3,14 +3,15 @@
|
||||
namespace Drupal\field_ui\Routing;
|
||||
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\Core\Routing\Enhancer\RouteEnhancerInterface;
|
||||
use Drupal\Core\Routing\EnhancerInterface;
|
||||
use Symfony\Cmf\Component\Routing\RouteObjectInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Route;
|
||||
|
||||
/**
|
||||
* Enhances Field UI routes by adding proper information about the bundle name.
|
||||
*/
|
||||
class FieldUiRouteEnhancer implements RouteEnhancerInterface {
|
||||
class FieldUiRouteEnhancer implements EnhancerInterface {
|
||||
|
||||
/**
|
||||
* The entity manager.
|
||||
@@ -33,6 +34,10 @@ class FieldUiRouteEnhancer implements RouteEnhancerInterface {
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function enhance(array $defaults, Request $request) {
|
||||
if (!$this->applies($defaults[RouteObjectInterface::ROUTE_OBJECT])) {
|
||||
return $defaults;
|
||||
}
|
||||
|
||||
if (($bundle = $this->entityManager->getDefinition($defaults['entity_type_id'])->getBundleEntityType()) && isset($defaults[$bundle])) {
|
||||
// Field UI forms only need the actual name of the bundle they're dealing
|
||||
// with, not an upcasted entity object, so provide a simple way for them
|
||||
@@ -46,7 +51,7 @@ class FieldUiRouteEnhancer implements RouteEnhancerInterface {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function applies(Route $route) {
|
||||
protected function applies(Route $route) {
|
||||
return ($route->hasOption('_field_ui'));
|
||||
}
|
||||
|
||||
|
||||
@@ -750,6 +750,7 @@ class ManageFieldsTest extends WebTestBase {
|
||||
$this->assertEqual($form_display->getComponent('field_test_custom_options')['type'], 'test_field_widget_multiple');
|
||||
$view_display = entity_get_display('node', 'article', 'default');
|
||||
$this->assertEqual($view_display->getComponent('field_test_custom_options')['type'], 'field_test_multiple');
|
||||
$this->assertEqual($view_display->getComponent('field_test_custom_options')['settings']['test_formatter_setting_multiple'], 'altered dummy test string');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,8 +5,8 @@ description: 'Support module for Field UI tests.'
|
||||
package: Testing
|
||||
# version: VERSION
|
||||
|
||||
# Information added by Drupal.org packaging script on 2018-01-03
|
||||
version: '8.4.4'
|
||||
# Information added by Drupal.org packaging script on 2018-03-07
|
||||
version: '8.5.0'
|
||||
core: '8.x'
|
||||
project: 'drupal'
|
||||
datestamp: 1515021228
|
||||
datestamp: 1520457825
|
||||
|
||||
Reference in New Issue
Block a user