updated core from 8.4 to 8.5 : bug with login_destination

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-13 14:01:21 +01:00
parent 0d78da249b
commit e668535a4e
3486 changed files with 89604 additions and 33283 deletions
@@ -0,0 +1,32 @@
<?php
/**
* @file
* Contains database additions to drupal-8.bare.standard.php.gz for testing the
* upgrade path of https://www.drupal.org/node/2455125.
*/
use Drupal\Core\Database\Database;
use Drupal\Core\Serialization\Yaml;
$connection = Database::getConnection();
// Structure of a view with timestamp fields.
$views_configs = [];
$views_configs[] = Yaml::decode(file_get_contents(__DIR__ . '/drupal-8.views-entity-views-data-2846614.yml'));
foreach ($views_configs as $views_config) {
$connection->insert('config')
->fields([
'collection',
'name',
'data',
])
->values([
'collection' => '',
'name' => 'views.view.' . $views_config['id'],
'data' => serialize($views_config),
])
->execute();
}
@@ -0,0 +1,240 @@
uuid: 001475a0-daec-4e8a-8ca7-97b0d24100a6
langcode: en
status: true
dependencies:
module:
- user
id: test_user_multi_value
label: test_user_multi_value
module: views
description: ''
tag: ''
base_table: users_field_data
base_field: uid
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'access user profiles'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Filter
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: default
options:
grouping: { }
row_class: ''
default_row_class: true
uses_fields: false
row:
type: fields
options:
inline: { }
separator: ''
hide_empty: false
default_field_elements: true
fields:
roles:
id: roles
table: user__roles
field: roles
relationship: none
group_type: group
admin_label: ''
label: ''
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: false
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: target_id
type: entity_reference_label
settings:
link: true
group_column: target_id
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: user
entity_field: roles
plugin_id: field
filters:
roles:
id: roles
table: user__roles
field: roles
relationship: none
group_type: group
admin_label: ''
operator: '='
value: ''
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: user
entity_field: roles
plugin_id: string
sorts: { }
header: { }
footer: { }
empty: { }
relationships: { }
arguments:
roles:
id: roles
table: user__roles
field: roles
relationship: none
group_type: group
admin_label: ''
default_action: ignore
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: fixed
default_argument_options:
argument: ''
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: false
validate:
type: none
fail: 'not found'
validate_options: { }
glossary: false
limit: 0
case: none
path_case: none
transform_dash: false
break_phrase: false
entity_type: user
entity_field: roles
plugin_id: string
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.permissions
tags: { }
@@ -4,8 +4,8 @@ type: module
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
@@ -2,16 +2,15 @@
namespace Drupal\accept_header_routing_test\Routing;
use Drupal\Core\Routing\RouteFilterInterface;
use Drupal\Core\Routing\FilterInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
/**
* Filters routes based on the media type specified in the HTTP Accept headers.
*/
class AcceptHeaderMatcher implements RouteFilterInterface {
class AcceptHeaderMatcher implements FilterInterface {
/**
* {@inheritdoc}
@@ -59,11 +58,4 @@ class AcceptHeaderMatcher implements RouteFilterInterface {
throw new NotAcceptableHttpException('No route found for the specified formats ' . implode(' ', $acceptable_mime_types));
}
/**
* {@inheritdoc}
*/
public function applies(Route $route) {
return TRUE;
}
}
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ description: 'Test for AJAX form calls.'
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
@@ -9,6 +9,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder: Builds a form that has each FAPI elements triggering a simple
* Ajax callback.
*
* @internal
*/
class AjaxFormsTestAjaxElementsForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form constructor for the Ajax Command display form.
*
* @internal
*/
class AjaxFormsTestCommandsForm extends FormBase {
@@ -8,6 +8,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder: Builds a form that has image button with an ajax callback.
*
* @internal
*/
class AjaxFormsTestImageButtonForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder: Builds a form that triggers a simple AJAX callback.
*
* @internal
*/
class AjaxFormsTestLazyLoadForm extends FormBase {
@@ -8,6 +8,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder: Builds a form that triggers a simple AJAX callback.
*
* @internal
*/
class AjaxFormsTestSimpleForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder: Builds a form that triggers a simple AJAX callback.
*
* @internal
*/
class AjaxFormsTestValidationForm extends FormBase {
@@ -7,8 +7,8 @@ package: Testing
dependencies:
- contact
# 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
@@ -11,6 +11,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Dummy form for testing DialogRenderer with _form routes.
*
* @internal
*/
class AjaxTestDialogForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Dummy form for testing DialogRenderer with _form routes.
*
* @internal
*/
class AjaxTestForm extends FormBase {
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Generate form of id batch_test_chained_form.
*
* @internal
*/
class BatchTestChainedForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Generate form of id batch_test_mock_form.
*
* @internal
*/
class BatchTestMockForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Generate form of id batch_test_multistep_form.
*
* @internal
*/
class BatchTestMultiStepForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Generate form of id batch_test_simple_form.
*
* @internal
*/
class BatchTestSimpleForm extends FormBase {
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ description: 'Support module for Database layer 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
@@ -8,6 +8,8 @@ use Drupal\user\Entity\User;
/**
* Form controller for database_test module.
*
* @internal
*/
class DatabaseTestForm extends FormBase {
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -0,0 +1,34 @@
<?php
/**
* @file
* Contains functions for testing calling deprecated functions in tests.
*/
/**
* A deprecated function.
*
* @return string
* A known return value of 'known_return_value'.
*
* @deprecated in Drupal 8.4.x. Might be removed before Drupal 9.0.0. This is
* the deprecation message for deprecated_test_function().
*/
function deprecation_test_function() {
@trigger_error('This is the deprecation message for deprecation_test_function().', E_USER_DEPRECATED);
return 'known_return_value';
}
/**
* Implements hook_deprecated_hook().
*/
function deprecation_test_deprecated_hook($arg) {
return $arg;
}
/**
* Implements hook_deprecated_alter_alter().
*/
function deprecation_test_deprecated_alter_alter(&$data, $context1, $context2) {
$data = [$context1, $context2];
}
@@ -0,0 +1,6 @@
deprecation_test.route:
path: '/this-calls-a-deprecated-method'
defaults:
_controller: \Drupal\deprecation_test\DeprecatedController::deprecatedMethod
requirements:
_access: 'TRUE'
@@ -0,0 +1,22 @@
<?php
namespace Drupal\deprecation_test;
/**
* Defines a controller that calls a deprecated method.
*/
class DeprecatedController {
/**
* Controller callback.
*
* @return array
* Render array.
*/
public function deprecatedMethod() {
return [
'#markup' => deprecation_test_function(),
];
}
}
@@ -0,0 +1,28 @@
<?php
namespace Drupal\deprecation_test\Deprecation;
@trigger_error(__NAMESPACE__ . '\DrupalStandardsListenerDeprecatedClass is deprecated.', E_USER_DEPRECATED);
/**
* Fixture class for use by DrupalStandardsListenerDeprecationTest.
*
* This class is arbitrarily deprecated in order to test the deprecation error
* handling properties of DrupalStandardsListener.
*
* @see \Drupal\Tests\Core\Listeners\DrupalStandardsListenerDeprecationTest
* @see \Drupal\Tests\Listeners\DrupalStandardsListener::endTest()
*/
class DrupalStandardsListenerDeprecatedClass {
/**
* Returns a known value.
*
* @return string
* A known return value.
*/
public function testFunction() {
return 'test';
}
}
@@ -5,8 +5,8 @@ description: 'Support module for Dialog Renderer 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ description: 'Support module for CRUD hook 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
@@ -10,8 +10,8 @@ dependencies:
- views
- entity_test
# 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
@@ -7,8 +7,8 @@ package: Testing
dependencies:
- views
# 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
@@ -7,8 +7,8 @@ package: Testing
dependencies:
- entity_test
# 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
@@ -94,5 +94,6 @@ function entity_schema_test_entity_bundle_delete($entity_type_id, $bundle) {
->setTargetBundle($bundle);
// Notify the entity storage that our field is gone.
\Drupal::entityManager()->onFieldDefinitionDelete($field_definitions['custom_bundle_field']);
\Drupal::entityManager()->onFieldStorageDefinitionDelete($field_definitions['custom_bundle_field']);
}
}
@@ -0,0 +1,5 @@
# Schema for the configuration of the 'internal property test' field type.
field.storage_settings.internal_property_test:
type: field.storage_settings.string
label: 'Internal property settings'
@@ -8,8 +8,8 @@ dependencies:
- field
- text
# 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
@@ -109,6 +109,28 @@ function entity_test_entity_type_alter(array &$entity_types) {
function entity_test_entity_base_field_info(EntityTypeInterface $entity_type) {
$fields = [];
if ($entity_type->id() === 'entity_test' && \Drupal::state()->get('entity_test.internal_field')) {
$fields['internal_string_field'] = BaseFieldDefinition::create('string')
->setLabel('Internal field')
->setInternal(TRUE);
}
if ($entity_type->id() === 'entity_test_mul' && \Drupal::state()->get('entity_test.required_default_field')) {
$fields['required_default_field'] = BaseFieldDefinition::create('string')
->setLabel('Required field with default value')
->setRequired(TRUE)
->setDefaultValue('this is a default value');
}
if ($entity_type->id() === 'entity_test_mul' && \Drupal::state()->get('entity_test.required_multi_default_field')) {
$fields['required_multi_default_field'] = BaseFieldDefinition::create('string')
->setLabel('Required field with default value')
->setRequired(TRUE)
->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
->setDefaultValue([
['value' => 'this is the first default field item'],
['value' => 'this is the second default value'],
['value' => 'you get the idea...'],
]);
}
if ($entity_type->id() == 'entity_test_mulrev' && \Drupal::state()->get('entity_test.field_test_item')) {
$fields['field_test_item'] = BaseFieldDefinition::create('field_test')
->setLabel(t('Field test'))
@@ -201,6 +223,26 @@ function entity_test_entity_bundle_info() {
return $bundles;
}
/**
* Implements hook_entity_bundle_info_alter().
*/
function entity_test_entity_bundle_info_alter(&$bundles) {
$entity_info = \Drupal::entityTypeManager()->getDefinitions();
$state = \Drupal::state();
foreach ($bundles as $entity_type_id => &$all_bundle_info) {
if ($entity_info[$entity_type_id]->getProvider() == 'entity_test') {
if ($state->get('entity_test.translation')) {
foreach ($all_bundle_info as $bundle_name => &$bundle_info) {
$bundle_info['translatable'] = TRUE;
if ($state->get('entity_test.untranslatable_fields.default_translation_affected')) {
$bundle_info['untranslatable_fields.default_translation_affected'] = TRUE;
}
}
}
}
}
}
/**
* Implements hook_entity_view_mode_info_alter().
*/
@@ -3,6 +3,7 @@
namespace Drupal\entity_test\Entity;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
/**
* Defines the test entity class for testing entity constraint violations.
@@ -39,6 +40,16 @@ class EntityTestConstraintViolation extends EntityTest {
]);
$fields['name']->addConstraint('FieldWidgetConstraint', []);
// Add a field that uses a widget with a custom implementation for
// \Drupal\Core\Field\WidgetInterface::errorElement().
$fields['test_field'] = BaseFieldDefinition::create('integer')
->setLabel(t('Test field'))
->setDisplayOptions('form', [
'type' => 'number',
'weight' => 1,
])
->addConstraint('FieldWidgetConstraint', []);
return $fields;
}
@@ -2,6 +2,8 @@
namespace Drupal\entity_test\Entity;
use Drupal\Core\Entity\EntityTypeInterface;
/**
* Defines the test entity class.
*
@@ -44,4 +46,11 @@ namespace Drupal\entity_test\Entity;
*/
class EntityTestMul extends EntityTest {
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
return parent::baseFieldDefinitions($entity_type) + \Drupal::state()->get($entity_type->id() . '.additional_base_field_definitions', []);
}
}
@@ -2,6 +2,9 @@
namespace Drupal\entity_test\Entity;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\Core\Field\BaseFieldDefinition;
/**
* Defines the test entity class.
*
@@ -47,4 +50,18 @@ namespace Drupal\entity_test\Entity;
*/
class EntityTestMulRev extends EntityTestRev {
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type) + \Drupal::state()->get($entity_type->id() . '.additional_base_field_definitions', []);
$fields['non_mul_field'] = BaseFieldDefinition::create('string')
->setLabel(t('Non translatable'))
->setDescription(t('A non-translatable string field'))
->setRevisionable(TRUE);
return $fields;
}
}
@@ -71,6 +71,7 @@ class EntityTestMulRevChanged extends EntityTestMulChanged {
$fields['name']->setRevisionable(TRUE);
$fields['user_id']->setRevisionable(TRUE);
$fields['changed']->setRevisionable(TRUE);
$fields['not_translatable']->setRevisionable(TRUE);
return $fields;
}
@@ -9,6 +9,9 @@ namespace Drupal\entity_test\Entity;
* id = "entity_test_no_bundle",
* label = @Translation("Entity Test without bundle"),
* base_table = "entity_test_no_bundle",
* handlers = {
* "views_data" = "Drupal\views\EntityViewsData"
* },
* entity_keys = {
* "id" = "id",
* "revision" = "revision_id",
@@ -8,12 +8,17 @@ namespace Drupal\entity_test\Entity;
* @ContentEntityType(
* id = "entity_test_no_label",
* label = @Translation("Entity Test without label"),
* internal = TRUE,
* persistent_cache = FALSE,
* base_table = "entity_test_no_label",
* handlers = {
* "access" = "Drupal\entity_test\EntityTestAccessControlHandler",
* },
* entity_keys = {
* "id" = "id",
* "bundle" = "type"
* }
* "uuid" = "uuid",
* "bundle" = "type",
* },
* )
*/
class EntityTestNoLabel extends EntityTest {
@@ -65,7 +65,7 @@ class EntityTestRev extends EntityTest {
->setCardinality(1)
->setReadOnly(TRUE);
return $fields;
return $fields + \Drupal::state()->get($entity_type->id() . '.additional_base_field_definitions', []);
}
}
@@ -7,6 +7,8 @@ use Drupal\Core\Url;
/**
* Provides the entity_test delete form.
*
* @internal
*/
class EntityTestDeleteForm extends ContentEntityDeleteForm {
@@ -8,6 +8,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form controller for the test entity edit forms.
*
* @internal
*/
class EntityTestForm extends ContentEntityForm {
@@ -0,0 +1,45 @@
<?php
namespace Drupal\entity_test\Plugin\Field\FieldType;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Field\Plugin\Field\FieldType\StringItem;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\TypedData\DataDefinition;
use Drupal\entity_test\TypedData\ComputedString;
/**
* Defines the 'Internal Property' entity test field type.
*
* @FieldType(
* id = "internal_property_test",
* label = @Translation("Internal Property (test)"),
* description = @Translation("A field containing one string, from which two strings are computed (one internal, one not)."),
* category = @Translation("Test"),
* default_widget = "string_textfield",
* default_formatter = "string"
* )
*/
class InternalPropertyTestFieldItem extends StringItem {
/**
* {@inheritdoc}
*/
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
$properties = parent::propertyDefinitions($field_definition);
// Add a computed property that is non-internal.
$properties['non_internal_value'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Computed string, non-internal property'))
->setComputed(TRUE)
->setClass(ComputedString::class)
->setInternal(FALSE);
// Add a computed property that is internal.
$properties['internal_value'] = DataDefinition::create('string')
->setLabel(new TranslatableMarkup('Computed string, internal property'))
->setComputed(TRUE)
->setClass(ComputedString::class);
return $properties;
}
}
@@ -0,0 +1,53 @@
<?php
namespace Drupal\entity_test\TypedData;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\TypedData\TypedData;
/**
* A computed property for test strings.
*/
class ComputedString extends TypedData implements CacheableDependencyInterface {
/**
* {@inheritdoc}
*/
public function getValue() {
/** @var \Drupal\Core\Field\FieldItemInterface $item */
$item = $this->getParent();
$computed_value = "Computed! " . $item->get('value')->getString();
return $computed_value;
}
/**
* {@inheritdoc}
*/
public function getCastedValue() {
return $this->getString();
}
/**
* {@inheritdoc}
*/
public function getCacheTags() {
return ['you_are_it', 'no_tag_backs'];
}
/**
* {@inheritdoc}
*/
public function getCacheContexts() {
return ['request_format'];
}
/**
* {@inheritdoc}
*/
public function getCacheMaxAge() {
return Cache::PERMANENT;
}
}
@@ -7,8 +7,8 @@ package: Testing
dependencies:
- entity_test
# 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
@@ -7,8 +7,8 @@ package: Testing
dependencies:
- entity_test
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,6 +5,9 @@ namespace Drupal\entity_test_revlog\Entity;
/**
* Defines the test entity class.
*
* This entity type does not define revision_metadata_keys on purpose to test
* the BC layer.
*
* @ContentEntityType(
* id = "entity_test_mul_revlog",
* label = @Translation("Test entity - data table, revisions log"),
@@ -21,11 +24,6 @@ namespace Drupal\entity_test_revlog\Entity;
* "label" = "name",
* "langcode" = "langcode",
* },
* revision_metadata_keys = {
* "revision_user" = "revision_user",
* "revision_created" = "revision_created",
* "revision_log_message" = "revision_log_message"
* },
* )
*/
class EntityTestMulWithRevisionLog extends EntityTestWithRevisionLog {
@@ -6,8 +6,8 @@ package: Testing
# core: 8.x
dependencies:
- entity_test_update
# 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
@@ -7,8 +7,8 @@ package: Testing
dependencies:
- entity_test
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -38,7 +38,8 @@ function entity_test_update_update_8400() {
$revision_metadata_keys = [
'revision_user' => 'revision_user',
'revision_created' => 'revision_created',
'revision_log_message' => 'revision_log_message'
'revision_log_message' => 'revision_log_message',
'revision_default' => 'revision_default',
];
$entity_type->set('revision_metadata_keys', $revision_metadata_keys);
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -7,8 +7,8 @@ dependencies:
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Core (Experimental)
# version: VERSION
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Core (Experimental)
# version: 8.y.x-unstable
# core: 8.x
# 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
@@ -5,8 +5,8 @@ package: Testing
# version: VERSION
# core: 8.x
# 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
@@ -497,3 +497,11 @@ form_test.get_form:
_form: '\Drupal\form_test\Form\FormTestGetForm'
requirements:
_access: 'TRUE'
form_test.optional_container:
path: '/form-test/optional-container'
defaults:
_form: '\Drupal\form_test\Form\FormTestOptionalContainerForm'
_title: 'Optional container testing'
requirements:
_access: 'TRUE'
@@ -6,6 +6,8 @@ use Drupal\Core\Url;
/**
* Provides a test confirmation form with a complex cancellation destination.
*
* @internal
*/
class ConfirmFormArrayPathTestForm extends ConfirmFormTestForm {
@@ -8,6 +8,8 @@ use Drupal\Core\Url;
/**
* Provides a test confirmation form.
*
* @internal
*/
class ConfirmFormTestForm extends ConfirmFormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder for testing hook_form_alter() and hook_form_FORM_ID_alter().
*
* @internal
*/
class FormTestAlterForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a simple form to test form button classes.
*
* @internal
*/
class FormTestButtonClassForm extends FormBase {
@@ -6,6 +6,11 @@ use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Form for testing checkbox.
*
* @internal
*/
class FormTestCheckboxForm extends FormBase {
/**
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a form to test return values for checkboxes.
*
* @internal
*/
class FormTestCheckboxTypeJugglingForm extends FormBase {
@@ -8,6 +8,8 @@ use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Form constructor to test expansion of #type checkboxes and radios.
*
* @internal
*/
class FormTestCheckboxesRadiosForm extends FormBase {
@@ -8,6 +8,8 @@ use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Tests checkboxes zero.
*
* @internal
*/
class FormTestCheckboxesZeroForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder to test button click detection.
*
* @internal
*/
class FormTestClickedButtonForm extends FormBase {
@@ -8,6 +8,8 @@ use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Form constructor for testing #type 'color' elements.
*
* @internal
*/
class FormTestColorForm extends FormBase {
@@ -8,6 +8,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Defines a form for testing form element description display options.
*
* @internal
*
* @see \Drupal\system\Tests\Form\ElementsLabelsTest::testFormDescriptions()
*/
class FormTestDescriptionForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a simple form to test the #group property on #type 'container'.
*
* @internal
*/
class FormTestDetailsForm extends FormBase {
@@ -9,6 +9,8 @@ use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Builds a form to test disabled elements.
*
* @internal
*/
class FormTestDisabledElementsForm extends FormBase {
@@ -8,6 +8,8 @@ use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Form constructor for testing #type 'email' elements.
*
* @internal
*/
class FormTestEmailForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a form to test select elements when #options is not an array.
*
* @internal
*/
class FormTestEmptySelectForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder for \Drupal\Core\Form\FormState::cleanValues() test.
*
* @internal
*/
class FormTestFormStateValuesCleanAdvancedForm extends FormBase {
@@ -8,6 +8,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form builder for \Drupal\Core\Form\FormState::cleanValues() test.
*
* @internal
*/
class FormTestFormStateValuesCleanForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Form to test whether GET forms have a CSRF token.
*
* @internal
*/
class FormTestGetForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a simple form to test the #group property on #type 'container'.
*
* @internal
*/
class FormTestGroupContainerForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a simple form to test the #group property on #type 'details'.
*
* @internal
*/
class FormTestGroupDetailsForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a simple form to test the #group property on #type 'fieldset'.
*
* @internal
*/
class FormTestGroupFieldsetForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a simple form to test the #group property on #type 'vertical_tabs'.
*
* @internal
*/
class FormTestGroupVerticalTabsForm extends FormBase {
@@ -6,6 +6,11 @@ use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Form to test input forgery.
*
* @internal
*/
class FormTestInputForgeryForm extends FormBase {
/**
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* A form for testing form labels and required marks.
*
* @internal
*/
class FormTestLabelForm extends FormBase {
@@ -9,6 +9,8 @@ use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Builds a form to test the language select form element.
*
* @internal
*/
class FormTestLanguageSelectForm extends FormBase {
@@ -7,6 +7,8 @@ use Drupal\Core\Form\FormStateInterface;
/**
* Builds a simple form with a button triggering partial validation.
*
* @internal
*/
class FormTestLimitValidationErrorsForm extends FormBase {
@@ -8,6 +8,8 @@ use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Form constructor for testing #type 'machine_name' elements.
*
* @internal
*/
class FormTestMachineNameForm extends FormBase {

Some files were not shown because too many files have changed in this diff Show More