core/core.services.yml | 5 ++ core/includes/install.core.inc | 6 +- .../Plugin/Discovery/AnnotatedClassDiscovery.php | 33 ++------ .../Drupal/Core/Action/ConfigurableActionBase.php | 6 ++ .../Core/Authentication/Provider/HttpBasic.php | 86 +++++++++++++++++++ .../Core/Entity/DatabaseStorageController.php | 37 +++++---- .../FieldableEntityStorageControllerInterface.php | 5 -- core/lib/Drupal/Core/Form/ConfigFormBase.php | 2 +- core/lib/Drupal/Core/Form/ConfigFormInterface.php | 23 ++++++ .../Plugin/Discovery/AnnotatedClassDiscovery.php | 14 ---- .../lib/Drupal/Core/Plugin/PluginFormInterface.php | 8 ++ .../lib/Drupal/aggregator/Form/SettingsForm.php | 90 +++++++++++++------- .../Plugin/AggregatorPluginSettingsBase.php | 6 ++ .../aggregator/processor/DefaultProcessor.php | 7 ++ .../aggregator/Tests/Views/IntegrationTest.php | 2 +- .../Plugin/aggregator/processor/TestProcessor.php | 7 ++ core/modules/basic_auth/basic_auth.info.yml | 6 -- core/modules/basic_auth/basic_auth.module | 19 ----- core/modules/basic_auth/basic_auth.services.yml | 6 -- .../Authentication/Provider/HttpBasic.php | 86 ------------------- .../Tests/Authentication/HttpBasicTest.php | 96 ---------------------- core/modules/block/lib/Drupal/block/BlockBase.php | 7 ++ .../Drupal/block/Tests/Views/DisplayBlockTest.php | 2 +- .../book/lib/Drupal/book/Form/BookSettingsForm.php | 7 ++ .../Drupal/comment/Tests/Views/CommentTestBase.php | 2 +- .../contact/lib/Drupal/contact/Entity/Message.php | 2 + .../Drupal/contact/Tests/Views/ContactLinkTest.php | 2 +- .../Tests/Views/TranslationLinkTest.php | 2 +- .../dblog/Tests/Views/ViewsIntegrationTest.php | 2 +- .../lib/Drupal/field/Tests/Views/FieldTestBase.php | 2 +- .../file/Tests/Views/ExtensionViewsFieldTest.php | 2 +- .../forum/lib/Drupal/forum/ForumSettingsForm.php | 7 ++ .../forum/Tests/Views/ForumIntegrationTest.php | 2 +- .../lib/Drupal/hal/Tests/NormalizerTestBase.php | 2 +- .../language/Form/ContentLanguageSettingsForm.php | 7 ++ .../language/Form/NegotiationBrowserForm.php | 7 ++ .../language/Form/NegotiationSelectedForm.php | 7 ++ .../language/Form/NegotiationSessionForm.php | 7 ++ .../Drupal/language/Form/NegotiationUrlForm.php | 7 ++ .../lib/Drupal/locale/Form/LocaleSettingsForm.php | 7 ++ .../menu/lib/Drupal/menu/MenuSettingsForm.php | 7 ++ .../lib/Drupal/menu_link/Entity/MenuLink.php | 2 + core/modules/node/lib/Drupal/node/Entity/Node.php | 2 + .../node/Tests/Config/NodeImportChangeTest.php | 2 +- .../node/Tests/Config/NodeImportCreateTest.php | 2 +- .../lib/Drupal/node/Tests/Views/NodeTestBase.php | 2 +- .../node/Tests/Views/RevisionRelationships.php | 2 +- .../rest/lib/Drupal/rest/Tests/AuthTest.php | 2 +- .../rest/Tests/Views/StyleSerializerTest.php | 2 +- .../lib/Drupal/search/Form/SearchSettingsForm.php | 7 ++ .../simpletest/Form/SimpletestSettingsForm.php | 7 ++ .../simpletest/Tests/DrupalUnitTestBaseTest.php | 6 +- .../Drupal/statistics/StatisticsSettingsForm.php | 7 ++ .../statistics/Tests/Views/IntegrationTest.php | 2 +- .../system/lib/Drupal/system/Form/CronForm.php | 7 ++ .../lib/Drupal/system/Form/FileSystemForm.php | 7 ++ .../lib/Drupal/system/Form/ImageToolkitForm.php | 7 ++ .../system/lib/Drupal/system/Form/LoggingForm.php | 7 ++ .../lib/Drupal/system/Form/PerformanceForm.php | 7 ++ .../system/lib/Drupal/system/Form/RegionalForm.php | 7 ++ .../system/lib/Drupal/system/Form/RssFeedsForm.php | 7 ++ .../lib/Drupal/system/Form/SiteInformationForm.php | 7 ++ .../Drupal/system/Form/SiteMaintenanceModeForm.php | 7 ++ .../lib/Drupal/system/Form/ThemeSettingsForm.php | 14 ++++ .../system/Tests/Authentication/HttpBasicTest.php | 96 ++++++++++++++++++++++ .../Tests/Entity/EntityQueryAggregateTest.php | 3 + .../Tests/Entity/EntityQueryRelationshipTest.php | 2 +- .../Drupal/system/Tests/Entity/FieldAccessTest.php | 2 +- .../system/Tests/Entity/FieldSqlStorageTest.php | 31 +------ .../Tests/Installer/InstallerTranslationTest.php | 4 +- .../tests/modules/entity_test/entity_test.module | 6 +- .../Drupal/form_test/SystemConfigFormTestForm.php | 7 ++ .../Tests/Views/TaxonomyIndexTidUiTest.php | 2 +- .../taxonomy/Tests/Views/TaxonomyTestBase.php | 2 +- .../Drupal/tracker/Tests/Views/TrackerTestBase.php | 2 +- .../lib/Drupal/update/UpdateSettingsForm.php | 7 ++ .../user/lib/Drupal/user/AccountSettingsForm.php | 7 ++ core/modules/user/lib/Drupal/user/Entity/Role.php | 2 + core/modules/user/lib/Drupal/user/Entity/User.php | 2 + .../user/Tests/Views/HandlerFilterUserNameTest.php | 2 +- .../lib/Drupal/user/Tests/Views/UserTestBase.php | 2 +- .../Drupal/user/Tests/Views/UserUnitTestBase.php | 2 +- .../modules/views/lib/Drupal/views/Entity/View.php | 2 + .../Drupal/views/Plugin/views/row/EntityRow.php | 1 + .../views/Plugin/views/style/DefaultStyle.php | 3 + .../lib/Drupal/views/Tests/Plugin/AccessTest.php | 2 +- .../Drupal/views/Tests/Plugin/ViewsBlockTest.php | 2 +- .../views/lib/Drupal/views/Tests/ViewTestBase.php | 2 +- .../Drupal/views/Tests/ViewTestConfigInstaller.php | 27 ++++++ .../views/lib/Drupal/views/Tests/ViewTestData.php | 34 ++++++-- .../lib/Drupal/views/Tests/ViewUnitTestBase.php | 2 +- core/modules/views_ui/js/views_ui.listing.js | 44 ---------- .../Drupal/views_ui/Form/AdvancedSettingsForm.php | 7 ++ .../lib/Drupal/views_ui/Form/BasicSettingsForm.php | 7 ++ .../lib/Drupal/views_ui/ViewListController.php | 28 +------ .../templates/views-ui-view-info.html.twig | 2 +- core/modules/views_ui/views_ui.module | 8 -- core/themes/seven/install-page.css | 9 +- 98 files changed, 655 insertions(+), 468 deletions(-) diff --git a/core/core.services.yml b/core/core.services.yml index cd3ac50..0350e7e 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -606,6 +606,11 @@ services: class: Drupal\Core\Authentication\Provider\Cookie tags: - { name: authentication_provider, priority: 0 } + authentication.http_basic: + class: Drupal\Core\Authentication\Provider\HttpBasic + arguments: ['@config.factory'] + tags: + - { name: authentication_provider, priority: 100 } authentication_subscriber: class: Drupal\Core\EventSubscriber\AuthenticationSubscriber tags: diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 64c7c1e..5580e16 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -799,7 +799,7 @@ function install_tasks($install_state) { $profile = $install_state['parameters']['profile']; $profile_install_file = dirname($install_state['profiles'][$profile]->uri) . '/' . $profile . '.install'; if (file_exists($profile_install_file)) { - include_once DRUPAL_ROOT . '/' . $profile_install_file; + include_once $profile_install_file; } $function = $install_state['parameters']['profile'] . '_install_tasks'; if (function_exists($function)) { @@ -834,7 +834,7 @@ function install_tasks($install_state) { $profile = $install_state['parameters']['profile']; $profile_file = $install_state['profiles'][$profile]->uri; if (file_exists($profile_file)) { - include_once DRUPAL_ROOT . '/' . $profile_file; + include_once $profile_file; $function = $install_state['parameters']['profile'] . '_install_tasks_alter'; if (function_exists($function)) { $function($tasks, $install_state); @@ -1751,7 +1751,7 @@ function install_load_profile(&$install_state) { $profile = $install_state['parameters']['profile']; $profile_file = $install_state['profiles'][$profile]->uri; if (file_exists($profile_file)) { - include_once DRUPAL_ROOT . '/' . $profile_file; + include_once $profile_file; $install_state['profile_info'] = install_profile_info($install_state['parameters']['profile'], $install_state['parameters']['langcode']); } else { diff --git a/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php b/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php index 5648b0d..d9c1bc3 100644 --- a/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php +++ b/core/lib/Drupal/Component/Plugin/Discovery/AnnotatedClassDiscovery.php @@ -7,8 +7,9 @@ namespace Drupal\Component\Plugin\Discovery; -use Doctrine\Common\Annotations\SimpleAnnotationReader; +use Drupal\Component\Plugin\Discovery\DiscoveryInterface; use Drupal\Component\Reflection\MockFileFinder; +use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Annotations\AnnotationRegistry; use Doctrine\Common\Reflection\StaticReflectionParser; @@ -35,13 +36,6 @@ class AnnotatedClassDiscovery implements DiscoveryInterface { protected $pluginDefinitionAnnotationName; /** - * The doctrine annotation reader. - * - * @var \Doctrine\Common\Annotations\Reader - */ - protected $annotationReader; - - /** * Constructs an AnnotatedClassDiscovery object. * * @param array $plugin_namespaces @@ -57,23 +51,6 @@ function __construct($plugin_namespaces = array(), $plugin_definition_annotation } /** - * Returns the used doctrine annotation reader. - * - * @return \Doctrine\Common\Annotations\Reader - * The annotation reader. - */ - protected function getAnnotationReader() { - if (!isset($this->annotationReader)) { - $this->annotationReader = new SimpleAnnotationReader(); - - // Add the namespaces from the main plugin annotation, like @EntityType. - $namespace = substr($this->pluginDefinitionAnnotationName, 0, strrpos($this->pluginDefinitionAnnotationName, '\\')); - $this->annotationReader->addNamespace($namespace); - } - return $this->annotationReader; - } - - /** * Implements Drupal\Component\Plugin\Discovery\DiscoveryInterface::getDefinition(). */ public function getDefinition($plugin_id) { @@ -86,8 +63,10 @@ public function getDefinition($plugin_id) { */ public function getDefinitions() { $definitions = array(); - - $reader = $this->getAnnotationReader(); + $reader = new AnnotationReader(); + // Prevent @endlink from being parsed as an annotation. + $reader->addGlobalIgnoredName('endlink'); + $reader->addGlobalIgnoredName('file'); // Clear the annotation loaders of any previous annotation classes. AnnotationRegistry::reset(); diff --git a/core/lib/Drupal/Core/Action/ConfigurableActionBase.php b/core/lib/Drupal/Core/Action/ConfigurableActionBase.php index 9a398b6..5eab50a 100644 --- a/core/lib/Drupal/Core/Action/ConfigurableActionBase.php +++ b/core/lib/Drupal/Core/Action/ConfigurableActionBase.php @@ -52,4 +52,10 @@ public function setConfiguration(array $configuration) { public function validateConfigurationForm(array &$form, array &$form_state) { } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array(); + } } diff --git a/core/lib/Drupal/Core/Authentication/Provider/HttpBasic.php b/core/lib/Drupal/Core/Authentication/Provider/HttpBasic.php new file mode 100644 index 0000000..5a0fefe --- /dev/null +++ b/core/lib/Drupal/Core/Authentication/Provider/HttpBasic.php @@ -0,0 +1,86 @@ +configFactory = $config_factory; + } + + /** + * {@inheritdoc} + */ + public function applies(Request $request) { + $username = $request->headers->get('PHP_AUTH_USER'); + $password = $request->headers->get('PHP_AUTH_PW'); + return isset($username) && isset($password); + } + + /** + * {@inheritdoc} + */ + public function authenticate(Request $request) { + $username = $request->headers->get('PHP_AUTH_USER'); + $password = $request->headers->get('PHP_AUTH_PW'); + $uid = user_authenticate($username, $password); + if ($uid) { + return user_load($uid); + } + return NULL; + } + + /** + * {@inheritdoc} + */ + public function cleanup(Request $request) {} + + /** + * {@inheritdoc} + */ + public function handleException(GetResponseForExceptionEvent $event) { + $exception = $event->getException(); + if (user_is_anonymous() && $exception instanceof AccessDeniedHttpException) { + if (!$this->applies($event->getRequest())) { + $site_name = $this->configFactory->get('system.site')->get('name'); + global $base_url; + $challenge = String::format('Basic realm="@realm"', array( + '@realm' => !empty($site_name) ? $site_name : $base_url, + )); + $event->setException(new UnauthorizedHttpException($challenge, 'No authentication credentials provided.', $exception)); + } + return TRUE; + } + return FALSE; + } +} diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php index e69d2f6..2bed3f6 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php @@ -653,9 +653,11 @@ protected function doSaveFieldItems(EntityInterface $entity, $update) { $langcodes = $field['translatable'] ? array_keys($entity->getTranslationLanguages()) : array(Language::LANGCODE_NOT_SPECIFIED); foreach ($langcodes as $langcode) { + $items = $entity->getTranslation($langcode)->{$field_name}->getValue(); + if (!isset($items)) { + continue; + } $delta_count = 0; - $items = $entity->getTranslation($langcode)->get($field_name); - $items->filterEmptyValues(); foreach ($items as $delta => $item) { // We now know we have someting to insert. $do_insert = TRUE; @@ -668,8 +670,9 @@ protected function doSaveFieldItems(EntityInterface $entity, $update) { ); foreach ($field['columns'] as $column => $attributes) { $column_name = static::_fieldColumnName($field, $column); + $value = isset($item[$column]) ? $item[$column] : NULL; // Serialize the value if specified in the column schema. - $record[$column_name] = !empty($attributes['serialize']) ? serialize($item->$column) : $item->$column; + $record[$column_name] = (!empty($attributes['serialize'])) ? serialize($value) : $value; } $query->values($record); $revision_query->values($record); @@ -864,22 +867,22 @@ public function onInstanceDelete(FieldInstanceInterface $instance) { * {@inheritdoc} */ public function onBundleRename($bundle, $bundle_new) { - // We need to account for deleted or inactive fields and instances. The - // method runs before the instance definitions are updated, so we need to - // fetch them using the old bundle name. - $instances = field_read_instances(array('entity_type' => $this->entityType, 'bundle' => $bundle), array('include_deleted' => TRUE, 'include_inactive' => TRUE)); + // We need to account for deleted or inactive fields and instances. + $instances = field_read_instances(array('entity_type' => $this->entityType, 'bundle' => $bundle_new), array('include_deleted' => TRUE, 'include_inactive' => TRUE)); foreach ($instances as $instance) { $field = $instance->getField(); - $table_name = static::_fieldTableName($field); - $revision_name = static::_fieldRevisionTableName($field); - $this->database->update($table_name) - ->fields(array('bundle' => $bundle_new)) - ->condition('bundle', $bundle) - ->execute(); - $this->database->update($revision_name) - ->fields(array('bundle' => $bundle_new)) - ->condition('bundle', $bundle) - ->execute(); + if ($field['storage']['type'] == 'field_sql_storage') { + $table_name = static::_fieldTableName($field); + $revision_name = static::_fieldRevisionTableName($field); + $this->database->update($table_name) + ->fields(array('bundle' => $bundle_new)) + ->condition('bundle', $bundle) + ->execute(); + $this->database->update($revision_name) + ->fields(array('bundle' => $bundle_new)) + ->condition('bundle', $bundle) + ->execute(); + } } } diff --git a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerInterface.php b/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerInterface.php index a52a5ad..31d59ab 100644 --- a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerInterface.php +++ b/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerInterface.php @@ -81,9 +81,6 @@ public function onBundleCreate($bundle); /** * Allows reaction to a bundle being renamed. * - * This method runs before field instance definitions are updated with the new - * bundle name. - * * @param string $bundle * The name of the bundle being renamed. * @param string $bundle_new @@ -94,8 +91,6 @@ public function onBundleRename($bundle, $bundle_new); /** * Allows reaction to a bundle being deleted. * - * This method runs before field and instance definitions are deleted. - * * @param string $bundle * The name of the bundle being deleted. */ diff --git a/core/lib/Drupal/Core/Form/ConfigFormBase.php b/core/lib/Drupal/Core/Form/ConfigFormBase.php index 5c69835..8f4b912 100644 --- a/core/lib/Drupal/Core/Form/ConfigFormBase.php +++ b/core/lib/Drupal/Core/Form/ConfigFormBase.php @@ -15,7 +15,7 @@ /** * Base class for implementing system configuration forms. */ -abstract class ConfigFormBase extends FormBase { +abstract class ConfigFormBase extends FormBase implements ConfigFormInterface { /** * Stores the configuration factory. diff --git a/core/lib/Drupal/Core/Form/ConfigFormInterface.php b/core/lib/Drupal/Core/Form/ConfigFormInterface.php new file mode 100644 index 0000000..3e75f6f --- /dev/null +++ b/core/lib/Drupal/Core/Form/ConfigFormInterface.php @@ -0,0 +1,23 @@ +annotationReader)) { - $reader = parent::getAnnotationReader(); - - // Add the Core annotation classes like @Translation. - $reader->addNamespace('Drupal\Core\Annotation', array(DRUPAL_ROOT . '/core/lib/Drupal/Core/Annotation')); - $this->annotationReader = $reader; - } - return $this->annotationReader; - } - - /** - * {@inheritdoc} - */ public function getDefinitions() { $definitions = parent::getDefinitions(); foreach ($definitions as &$definition) { diff --git a/core/lib/Drupal/Core/Plugin/PluginFormInterface.php b/core/lib/Drupal/Core/Plugin/PluginFormInterface.php index e029bba..42112e2 100644 --- a/core/lib/Drupal/Core/Plugin/PluginFormInterface.php +++ b/core/lib/Drupal/Core/Plugin/PluginFormInterface.php @@ -50,4 +50,12 @@ public function validateConfigurationForm(array &$form, array &$form_state); */ public function submitConfigurationForm(array &$form, array &$form_state); + /** + * Returns an array of configuration names associated with the form. + * + * @return array + * An array of configuration names + */ + public function getConfigNames(); + } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php index 85e96e0..81e1b39 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/SettingsForm.php @@ -33,7 +33,7 @@ class SettingsForm extends ConfigFormBase { * * @var \Drupal\Core\Plugin\PluginFormInterface[] */ - protected $configurableInstances = array(); + protected $configurableInstances; /** * The aggregator plugin definitions. @@ -100,6 +100,47 @@ public function getFormID() { } /** + * Collect configurable instances of this form's plugins. + */ + protected function getConfigurableInstances() { + if (!isset($this->configurableInstances)) { + $this->configurableInstances = array(); + + $config = $this->configFactory->get('aggregator.settings'); + + // Parse fetchers and parsers and collect their PluginFormInterface + // instances. + foreach (array('fetcher', 'parser') as $type) { + $active = $config->get($type); + if (array_key_exists($active, $this->definitions[$type])) { + $instance = $this->managers[$type]->createInstance($active); + if ($instance instanceof PluginFormInterface) { + // Store the instance for validate and submit handlers. + // Keying by ID would bring conflicts, because two instances of a + // different type could have the same ID. + $this->configurableInstances[] = $instance; + } + } + } + + // Parse processors and collect their PluginFormInterface instances. + foreach ($this->definitions['processor'] as $id => $definition) { + if (in_array($id, $config->get('processors'))) { + $instance = $this->managers['processor']->createInstance($id); + if ($instance instanceof PluginFormInterface) { + // Store the instance for validate and submit handlers. + // Keying by ID would bring conflicts, because two instances of a + // different type could have the same ID. + $this->configurableInstances[] = $instance; + } + } + } + } + + return $this->configurableInstances; + } + + /** * {@inheritdoc} */ public function buildForm(array $form, array &$form_state) { @@ -154,35 +195,9 @@ public function buildForm(array $form, array &$form_state) { $form['basic_conf'] += $basic_conf; } - // Call buildConfigurationForm() on the active fetcher and parser. - foreach (array('fetcher', 'parser') as $type) { - $active = $config->get($type); - if (array_key_exists($active, $this->definitions[$type])) { - $instance = $this->managers[$type]->createInstance($active); - if ($instance instanceof PluginFormInterface) { - $form = $instance->buildConfigurationForm($form, $form_state); - // Store the instance for validate and submit handlers. - // Keying by ID would bring conflicts, because two instances of a - // different type could have the same ID. - $this->configurableInstances[] = $instance; - } - } - } - - // Implementing processor plugins will expect an array at $form['processors']. $form['processors'] = array(); - // Call buildConfigurationForm() for each active processor. - foreach ($this->definitions['processor'] as $id => $definition) { - if (in_array($id, $config->get('processors'))) { - $instance = $this->managers['processor']->createInstance($id); - if ($instance instanceof PluginFormInterface) { - $form = $instance->buildConfigurationForm($form, $form_state); - // Store the instance for validate and submit handlers. - // Keying by ID would bring conflicts, because two instances of a - // different type could have the same ID. - $this->configurableInstances[] = $instance; - } - } + foreach ($this->getConfigurableInstances() as $instance) { + $form = $instance->buildConfigurationForm($form, $form_state); } return parent::buildForm($form, $form_state); @@ -194,7 +209,7 @@ public function buildForm(array $form, array &$form_state) { public function validateForm(array &$form, array &$form_state) { parent::validateForm($form, $form_state); // Let active plugins validate their settings. - foreach ($this->configurableInstances as $instance) { + foreach ($this->getConfigurableInstances() as $instance) { $instance->validateConfigurationForm($form, $form_state); } } @@ -206,7 +221,7 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); $config = $this->configFactory->get('aggregator.settings'); // Let active plugins save their settings. - foreach ($this->configurableInstances as $instance) { + foreach ($this->getConfigurableInstances() as $instance) { $instance->submitConfigurationForm($form, $form_state); } @@ -223,4 +238,17 @@ public function submitForm(array &$form, array &$form_state) { $config->save(); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + $config_names = array('aggregator.settings'); + + foreach ($this->getConfigurableInstances() as $instance) { + $config_names[] = $instance->getConfigNames(); + } + + return array_unique($config_names); + } + } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginSettingsBase.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginSettingsBase.php index 9ca7c79..288e3c6 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginSettingsBase.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/AggregatorPluginSettingsBase.php @@ -29,4 +29,10 @@ public function defaultConfiguration() { public function validateConfigurationForm(array &$form, array &$form_state) { } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array(); + } } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php index ec7d193..23f333b 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/processor/DefaultProcessor.php @@ -239,6 +239,13 @@ public function setConfiguration(array $configuration) { } /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('aggregator.settings'); + } + + /** * Helper function for drupal_map_assoc. * * @param int $count diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php index 8738aa4..77393d6 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/Views/IntegrationTest.php @@ -56,7 +56,7 @@ protected function setUp() { $this->installSchema('aggregator', array('aggregator_item', 'aggregator_feed', 'aggregator_category_feed', 'aggregator_category', 'aggregator_category_item')); - ViewTestData::createTestViews(get_class($this), array('aggregator_test_views')); + ViewTestData::importTestViews(get_class($this), array('aggregator_test_views')); $this->itemStorageController = $this->container->get('entity.manager')->getStorageController('aggregator_item'); $this->feedStorageController = $this->container->get('entity.manager')->getStorageController('aggregator_feed'); diff --git a/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php b/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php index 04a5c5a..7c8e54e 100644 --- a/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php +++ b/core/modules/aggregator/tests/modules/aggregator_test/lib/Drupal/aggregator_test/Plugin/aggregator/processor/TestProcessor.php @@ -142,4 +142,11 @@ public function setConfiguration(array $configuration) { $config->save(); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('aggregator_test.settings'); + } + } diff --git a/core/modules/basic_auth/basic_auth.info.yml b/core/modules/basic_auth/basic_auth.info.yml deleted file mode 100644 index 38bb7b2..0000000 --- a/core/modules/basic_auth/basic_auth.info.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: 'HTTP Basic Authentication' -type: module -description: 'Provides the HTTP Basic authentication provider' -package: Web services -version: VERSION -core: 8.x diff --git a/core/modules/basic_auth/basic_auth.module b/core/modules/basic_auth/basic_auth.module deleted file mode 100644 index a67c6f2..0000000 --- a/core/modules/basic_auth/basic_auth.module +++ /dev/null @@ -1,19 +0,0 @@ -' . t('About') . ''; - $output .= '

' . t('The basic auth module implements basic user authentication using the HTTP Basic authentication provider.') . '

'; - return $output; - } -} diff --git a/core/modules/basic_auth/basic_auth.services.yml b/core/modules/basic_auth/basic_auth.services.yml deleted file mode 100644 index 441cc6b..0000000 --- a/core/modules/basic_auth/basic_auth.services.yml +++ /dev/null @@ -1,6 +0,0 @@ -services: - authentication.http_basic: - class: Drupal\basic_auth\Authentication\Provider\HttpBasic - arguments: ['@config.factory'] - tags: - - { name: authentication_provider, priority: 100 } diff --git a/core/modules/basic_auth/lib/Drupal/basic_auth/Authentication/Provider/HttpBasic.php b/core/modules/basic_auth/lib/Drupal/basic_auth/Authentication/Provider/HttpBasic.php deleted file mode 100644 index a15253f..0000000 --- a/core/modules/basic_auth/lib/Drupal/basic_auth/Authentication/Provider/HttpBasic.php +++ /dev/null @@ -1,86 +0,0 @@ -configFactory = $config_factory; - } - - /** - * {@inheritdoc} - */ - public function applies(Request $request) { - $username = $request->headers->get('PHP_AUTH_USER'); - $password = $request->headers->get('PHP_AUTH_PW'); - return isset($username) && isset($password); - } - - /** - * {@inheritdoc} - */ - public function authenticate(Request $request) { - $username = $request->headers->get('PHP_AUTH_USER'); - $password = $request->headers->get('PHP_AUTH_PW'); - $uid = user_authenticate($username, $password); - if ($uid) { - return user_load($uid); - } - return NULL; - } - - /** - * {@inheritdoc} - */ - public function cleanup(Request $request) {} - - /** - * {@inheritdoc} - */ - public function handleException(GetResponseForExceptionEvent $event) { - $exception = $event->getException(); - if (user_is_anonymous() && $exception instanceof AccessDeniedHttpException) { - if (!$this->applies($event->getRequest())) { - $site_name = $this->configFactory->get('system.site')->get('name'); - global $base_url; - $challenge = String::format('Basic realm="@realm"', array( - '@realm' => !empty($site_name) ? $site_name : $base_url, - )); - $event->setException(new UnauthorizedHttpException($challenge, 'No authentication credentials provided.', $exception)); - } - return TRUE; - } - return FALSE; - } -} diff --git a/core/modules/basic_auth/lib/Drupal/basic_auth/Tests/Authentication/HttpBasicTest.php b/core/modules/basic_auth/lib/Drupal/basic_auth/Tests/Authentication/HttpBasicTest.php deleted file mode 100644 index 41d56d0..0000000 --- a/core/modules/basic_auth/lib/Drupal/basic_auth/Tests/Authentication/HttpBasicTest.php +++ /dev/null @@ -1,96 +0,0 @@ - 'HttpBasic authentication', - 'description' => 'Tests for HttpBasic authentication provider.', - 'group' => 'Authentication', - ); - } - - /** - * Test http basic authentication. - */ - public function testHttpBasic() { - $account = $this->drupalCreateUser(); - - $this->basicAuthGet('router_test/test11', $account->getUsername(), $account->pass_raw); - $this->assertText($account->getUsername(), 'Account name is displayed.'); - $this->assertResponse('200', 'HTTP response is OK'); - $this->curlClose(); - - $this->basicAuthGet('router_test/test11', $account->getUsername(), $this->randomName()); - $this->assertNoText($account->getUsername(), 'Bad basic auth credentials do not authenticate the user.'); - $this->assertResponse('403', 'Access is not granted.'); - $this->curlClose(); - - $this->drupalGet('router_test/test11'); - $this->assertResponse('401', 'Not authenticated on the route that allows only http_basic. Prompt to authenticate received.'); - - $this->drupalGet('admin'); - $this->assertResponse('403', 'No authentication prompt for routes not explicitly defining authentication providers.'); - - $account = $this->drupalCreateUser(array('access administration pages')); - - $this->basicAuthGet('admin', $account->getUsername(), $account->pass_raw); - $this->assertNoLink('Log out', 0, 'User is not logged in'); - $this->assertResponse('403', 'No basic authentication for routes not explicitly defining authentication providers.'); - $this->curlClose(); - } - - /** - * Does HTTP basic auth request. - * - * We do not use \Drupal\simpletest\WebTestBase::drupalGet because we need to - * set curl settings for basic authentication. - * - * @param string $path - * The request path. - * @param string $username - * The user name to authenticate with. - * @param string $password - * The password. - * - * @return string - * Curl output. - */ - protected function basicAuthGet($path, $username, $password) { - $out = $this->curlExec( - array( - CURLOPT_HTTPGET => TRUE, - CURLOPT_URL => url($path, array('absolute' => TRUE)), - CURLOPT_NOBODY => FALSE, - CURLOPT_HTTPAUTH => CURLAUTH_BASIC, - CURLOPT_USERPWD => $username . ':' . $password, - ) - ); - - $this->verbose('GET request to: ' . $path . - '
' . $out); - - return $out; - } -} diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index 579e841..9894263 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -182,4 +182,11 @@ public function getMachineNameSuggestion() { return $transliterated; } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array(); + } + } diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php index 463bcd5..1e07586 100644 --- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php @@ -43,7 +43,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('block_test_views')); + ViewTestData::importTestViews(get_class($this), array('block_test_views')); $this->enableViewsTestModule(); } diff --git a/core/modules/book/lib/Drupal/book/Form/BookSettingsForm.php b/core/modules/book/lib/Drupal/book/Form/BookSettingsForm.php index e5c48b1..7643c57 100644 --- a/core/modules/book/lib/Drupal/book/Form/BookSettingsForm.php +++ b/core/modules/book/lib/Drupal/book/Form/BookSettingsForm.php @@ -77,5 +77,12 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('book.settings'); + } + } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php index adba6b8..7027ef4 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/Views/CommentTestBase.php @@ -32,7 +32,7 @@ function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('comment_test_views')); + ViewTestData::importTestViews(get_class($this), array('comment_test_views')); // Add two users, create a node with the user1 as author and another node // with user2 as author. For the second node add a comment from user1. diff --git a/core/modules/contact/lib/Drupal/contact/Entity/Message.php b/core/modules/contact/lib/Drupal/contact/Entity/Message.php index f81b456..0c3c622 100644 --- a/core/modules/contact/lib/Drupal/contact/Entity/Message.php +++ b/core/modules/contact/lib/Drupal/contact/Entity/Message.php @@ -7,6 +7,8 @@ namespace Drupal\contact\Entity; +use Drupal\Core\Entity\Annotation\EntityType; +use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityNG; use Drupal\contact\MessageInterface; diff --git a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php index 064ac2d..c2f6a21 100644 --- a/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php +++ b/core/modules/contact/lib/Drupal/contact/Tests/Views/ContactLinkTest.php @@ -52,7 +52,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('contact_test_views')); + ViewTestData::importTestViews(get_class($this), array('contact_test_views')); $this->userData = $this->container->get('user.data'); } diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php index fe45379..b26b0a5 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php @@ -51,7 +51,7 @@ function setUp() { $user->langcode = 'en'; $user->save(); - ViewTestData::createTestViews(get_class($this), array('content_translation_test_views')); + ViewTestData::importTestViews(get_class($this), array('content_translation_test_views')); } /** diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php index dce1106..d548480 100644 --- a/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php +++ b/core/modules/dblog/lib/Drupal/dblog/Tests/Views/ViewsIntegrationTest.php @@ -48,7 +48,7 @@ protected function setUp() { $this->enableModules(array('system', 'dblog')); $this->installSchema('dblog', array('watchdog')); - ViewTestData::createTestViews(get_class($this), array('dblog_test_views')); + ViewTestData::importTestViews(get_class($this), array('dblog_test_views')); } /** diff --git a/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php b/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php index 947ec87..2f8e5a6 100644 --- a/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php +++ b/core/modules/field/lib/Drupal/field/Tests/Views/FieldTestBase.php @@ -51,7 +51,7 @@ protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('field_test_views')); + ViewTestData::importTestViews(get_class($this), array('field_test_views')); } function setUpFields($amount = 3) { diff --git a/core/modules/file/lib/Drupal/file/Tests/Views/ExtensionViewsFieldTest.php b/core/modules/file/lib/Drupal/file/Tests/Views/ExtensionViewsFieldTest.php index 87ab5f8..3406a6b 100644 --- a/core/modules/file/lib/Drupal/file/Tests/Views/ExtensionViewsFieldTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/Views/ExtensionViewsFieldTest.php @@ -40,7 +40,7 @@ public static function getInfo() { */ protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('file_test_views')); + ViewTestData::importTestViews(get_class($this), array('file_test_views')); } /** diff --git a/core/modules/forum/lib/Drupal/forum/ForumSettingsForm.php b/core/modules/forum/lib/Drupal/forum/ForumSettingsForm.php index 9fe4931..d7ace97 100644 --- a/core/modules/forum/lib/Drupal/forum/ForumSettingsForm.php +++ b/core/modules/forum/lib/Drupal/forum/ForumSettingsForm.php @@ -73,4 +73,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('forum.settings'); + } + } diff --git a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php index 48552af..2a04b4c 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/Views/ForumIntegrationTest.php @@ -40,7 +40,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('forum_test_views')); + ViewTestData::importTestViews(get_class($this), array('forum_test_views')); } diff --git a/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php b/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php index 414a284..145ca53 100644 --- a/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php +++ b/core/modules/hal/lib/Drupal/hal/Tests/NormalizerTestBase.php @@ -30,7 +30,7 @@ * * @var array */ - public static $modules = array('entity', 'entity_test', 'entity_reference', 'field', 'hal', 'language', 'rest', 'serialization', 'system', 'text', 'user', 'filter'); + public static $modules = array('entity', 'entity_test', 'entity_reference', 'field', 'field_sql_storage', 'hal', 'language', 'rest', 'serialization', 'system', 'text', 'user', 'filter'); /** * The mock serializer. diff --git a/core/modules/language/lib/Drupal/language/Form/ContentLanguageSettingsForm.php b/core/modules/language/lib/Drupal/language/Form/ContentLanguageSettingsForm.php index f4d7c54..e194c32 100644 --- a/core/modules/language/lib/Drupal/language/Form/ContentLanguageSettingsForm.php +++ b/core/modules/language/lib/Drupal/language/Form/ContentLanguageSettingsForm.php @@ -179,4 +179,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('language.settings'); + } + } diff --git a/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php b/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php index b801b2b..09cec08 100644 --- a/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php +++ b/core/modules/language/lib/Drupal/language/Form/NegotiationBrowserForm.php @@ -197,4 +197,11 @@ protected function language_get_browser_drupal_langcode_mappings() { return $config->get(); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('language.mappings'); + } + } diff --git a/core/modules/language/lib/Drupal/language/Form/NegotiationSelectedForm.php b/core/modules/language/lib/Drupal/language/Form/NegotiationSelectedForm.php index 4271861..57e287c 100644 --- a/core/modules/language/lib/Drupal/language/Form/NegotiationSelectedForm.php +++ b/core/modules/language/lib/Drupal/language/Form/NegotiationSelectedForm.php @@ -48,4 +48,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('language.negotiation'); + } + } diff --git a/core/modules/language/lib/Drupal/language/Form/NegotiationSessionForm.php b/core/modules/language/lib/Drupal/language/Form/NegotiationSessionForm.php index 1c73492..e2372ca 100644 --- a/core/modules/language/lib/Drupal/language/Form/NegotiationSessionForm.php +++ b/core/modules/language/lib/Drupal/language/Form/NegotiationSessionForm.php @@ -49,4 +49,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('language.negotiation'); + } + } diff --git a/core/modules/language/lib/Drupal/language/Form/NegotiationUrlForm.php b/core/modules/language/lib/Drupal/language/Form/NegotiationUrlForm.php index 6855a24..8898076 100644 --- a/core/modules/language/lib/Drupal/language/Form/NegotiationUrlForm.php +++ b/core/modules/language/lib/Drupal/language/Form/NegotiationUrlForm.php @@ -171,4 +171,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('language.negotiation'); + } + } diff --git a/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php b/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php index 2791646..1f80726 100644 --- a/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php +++ b/core/modules/locale/lib/Drupal/locale/Form/LocaleSettingsForm.php @@ -139,4 +139,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('locale.settings'); + } + } diff --git a/core/modules/menu/lib/Drupal/menu/MenuSettingsForm.php b/core/modules/menu/lib/Drupal/menu/MenuSettingsForm.php index a354184..16998b3 100644 --- a/core/modules/menu/lib/Drupal/menu/MenuSettingsForm.php +++ b/core/modules/menu/lib/Drupal/menu/MenuSettingsForm.php @@ -69,4 +69,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('menu.settings'); + } + } diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php index 0fc739a..f27d051 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Entity/MenuLink.php @@ -11,6 +11,8 @@ use Symfony\Component\Routing\Route; use Symfony\Component\HttpFoundation\Request; +use Drupal\Core\Entity\Annotation\EntityType; +use Drupal\Core\Annotation\Translation; use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityStorageControllerInterface; diff --git a/core/modules/node/lib/Drupal/node/Entity/Node.php b/core/modules/node/lib/Drupal/node/Entity/Node.php index 9071cac..8367e16 100644 --- a/core/modules/node/lib/Drupal/node/Entity/Node.php +++ b/core/modules/node/lib/Drupal/node/Entity/Node.php @@ -9,6 +9,8 @@ use Drupal\Core\Entity\EntityNG; use Drupal\Core\Entity\EntityStorageControllerInterface; +use Drupal\Core\Entity\Annotation\EntityType; +use Drupal\Core\Annotation\Translation; use Drupal\Core\Language\Language; use Drupal\Core\Session\AccountInterface; use Drupal\node\NodeInterface; diff --git a/core/modules/node/lib/Drupal/node/Tests/Config/NodeImportChangeTest.php b/core/modules/node/lib/Drupal/node/Tests/Config/NodeImportChangeTest.php index d50d6ce..8f162e0 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Config/NodeImportChangeTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/Config/NodeImportChangeTest.php @@ -19,7 +19,7 @@ class NodeImportChangeTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('node', 'entity', 'field', 'text', 'system', 'node_test_config'); + public static $modules = array('node', 'entity', 'field', 'text', 'field_sql_storage', 'system', 'node_test_config'); /** * Set the default field storage backend for fields created during tests. diff --git a/core/modules/node/lib/Drupal/node/Tests/Config/NodeImportCreateTest.php b/core/modules/node/lib/Drupal/node/Tests/Config/NodeImportCreateTest.php index 0a1db9c..cd117bb 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Config/NodeImportCreateTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/Config/NodeImportCreateTest.php @@ -19,7 +19,7 @@ class NodeImportCreateTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('node', 'entity', 'field', 'text', 'system'); + public static $modules = array('node', 'entity', 'field', 'text', 'field_sql_storage', 'system'); /** * Set the default field storage backend for fields created during tests. diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/NodeTestBase.php b/core/modules/node/lib/Drupal/node/Tests/Views/NodeTestBase.php index 1c634bb..d30f528 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/NodeTestBase.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/NodeTestBase.php @@ -25,7 +25,7 @@ protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('node_test_views')); + ViewTestData::importTestViews(get_class($this), array('node_test_views')); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php index 4e44069..edb40d0 100644 --- a/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php +++ b/core/modules/node/lib/Drupal/node/Tests/Views/RevisionRelationships.php @@ -24,7 +24,7 @@ class RevisionRelationships extends ViewTestBase { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('node_test_views')); + ViewTestData::importTestViews(get_class($this), array('node_test_views')); } /** diff --git a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php index 7c40096..4d1fc8a 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/AuthTest.php @@ -19,7 +19,7 @@ class AuthTest extends RESTTestBase { * * @var array */ - public static $modules = array('basic_auth', 'hal', 'rest', 'entity_test'); + public static $modules = array('hal', 'rest', 'entity_test'); /** * {@inheritdoc} diff --git a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php index 6594cfd..dcc4ac6 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php @@ -50,7 +50,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('rest_test_views')); + ViewTestData::importTestViews(get_class($this), array('rest_test_views')); $this->adminUser = $this->drupalCreateUser(array('administer views', 'administer entity_test content', 'access user profiles', 'view test entity')); diff --git a/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php b/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php index bf37009..db1e1c6 100644 --- a/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php +++ b/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php @@ -265,4 +265,11 @@ public function searchAdminReindexSubmit(array $form, array &$form_state) { $form_state['redirect'] = 'admin/config/search/settings/reindex'; } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('search.settings'); + } + } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php index ed65884..f2fa16b 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Form/SimpletestSettingsForm.php @@ -118,4 +118,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('simpletest.settings'); + } + } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php index 4e598bf..4fbdffd 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php @@ -108,7 +108,7 @@ function testEnableModulesInstall() { */ function testEnableModulesInstallContainer() { // Install Node module. - $this->enableModules(array('field', 'node')); + $this->enableModules(array('field_sql_storage', 'field', 'node')); $this->installSchema('node', array('node', 'node_field_data')); // Perform an entity query against node. @@ -206,12 +206,12 @@ function testEnableModulesFixedList() { $this->assertTrue(TRUE == entity_get_info('entity_test')); // Load some additional modules; entity_test should still exist. - $this->enableModules(array('entity', 'field', 'text', 'entity_test')); + $this->enableModules(array('entity', 'field', 'field_sql_storage', 'text', 'entity_test')); $this->assertEqual($this->container->get('module_handler')->moduleExists('entity_test'), TRUE); $this->assertTrue(TRUE == entity_get_info('entity_test')); // Install some other modules; entity_test should still exist. - $this->container->get('module_handler')->install(array('field', 'field_test'), FALSE); + $this->container->get('module_handler')->install(array('field', 'field_sql_storage', 'field_test'), FALSE); $this->assertEqual($this->container->get('module_handler')->moduleExists('entity_test'), TRUE); $this->assertTrue(TRUE == entity_get_info('entity_test')); diff --git a/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php index 437946f..7722996 100644 --- a/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php +++ b/core/modules/statistics/lib/Drupal/statistics/StatisticsSettingsForm.php @@ -96,4 +96,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('statistics.settings'); + } + } diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php index fd447d1..a16f824 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php @@ -57,7 +57,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('statistics_test_views')); + ViewTestData::importTestViews(get_class($this), array('statistics_test_views')); // Create a new user for viewing nodes. $this->webUser = $this->drupalCreateUser(array('access content')); diff --git a/core/modules/system/lib/Drupal/system/Form/CronForm.php b/core/modules/system/lib/Drupal/system/Form/CronForm.php index 12802e4..a79f74b 100644 --- a/core/modules/system/lib/Drupal/system/Form/CronForm.php +++ b/core/modules/system/lib/Drupal/system/Form/CronForm.php @@ -124,4 +124,11 @@ public function submitCron(array &$form, array &$form_state) { return new RedirectResponse(url('admin/config/system/cron', array('absolute' => TRUE))); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.cron'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php b/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php index 100c921..e891306 100644 --- a/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php +++ b/core/modules/system/lib/Drupal/system/Form/FileSystemForm.php @@ -87,4 +87,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.file'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php b/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php index dcdb2cc..63931eb 100644 --- a/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ImageToolkitForm.php @@ -109,4 +109,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.image'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/LoggingForm.php b/core/modules/system/lib/Drupal/system/Form/LoggingForm.php index f4860cf..8140dc5 100644 --- a/core/modules/system/lib/Drupal/system/Form/LoggingForm.php +++ b/core/modules/system/lib/Drupal/system/Form/LoggingForm.php @@ -53,4 +53,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.logging'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php index 8ae0382..d663b5b 100644 --- a/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php +++ b/core/modules/system/lib/Drupal/system/Form/PerformanceForm.php @@ -169,4 +169,11 @@ public function submitCacheClear(array &$form, array &$form_state) { drupal_set_message(t('Caches cleared.')); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.performance'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php index 569a5c6..d013bfe 100644 --- a/core/modules/system/lib/Drupal/system/Form/RegionalForm.php +++ b/core/modules/system/lib/Drupal/system/Form/RegionalForm.php @@ -156,4 +156,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.date'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/RssFeedsForm.php b/core/modules/system/lib/Drupal/system/Form/RssFeedsForm.php index b3ef82b..445cf15 100644 --- a/core/modules/system/lib/Drupal/system/Form/RssFeedsForm.php +++ b/core/modules/system/lib/Drupal/system/Form/RssFeedsForm.php @@ -67,4 +67,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.rss'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php b/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php index 1b5029b..38ebeb9 100644 --- a/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php +++ b/core/modules/system/lib/Drupal/system/Form/SiteInformationForm.php @@ -181,4 +181,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.site'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php b/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php index 131af5b..c28a023 100644 --- a/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php +++ b/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php @@ -89,4 +89,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('system.maintenance'); + } + } diff --git a/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php b/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php index 44b34fe..23a419b 100644 --- a/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ThemeSettingsForm.php @@ -454,4 +454,18 @@ protected function validatePath($path) { return FALSE; } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + $configNames = array('system.theme.global'); + + $themes = list_themes(); + foreach ($themes as $theme_name => $theme) { + $configNames[] = $theme_name . '.settings'; + } + + return $configNames; + } + } diff --git a/core/modules/system/lib/Drupal/system/Tests/Authentication/HttpBasicTest.php b/core/modules/system/lib/Drupal/system/Tests/Authentication/HttpBasicTest.php new file mode 100644 index 0000000..15f3801 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Tests/Authentication/HttpBasicTest.php @@ -0,0 +1,96 @@ + 'HttpBasic authentication', + 'description' => 'Tests for HttpBasic authentication provider.', + 'group' => 'Authentication', + ); + } + + /** + * Test http basic authentication. + */ + public function testHttpBasic() { + $account = $this->drupalCreateUser(); + + $this->basicAuthGet('router_test/test11', $account->getUsername(), $account->pass_raw); + $this->assertText($account->getUsername(), 'Account name is displayed.'); + $this->assertResponse('200', 'HTTP response is OK'); + $this->curlClose(); + + $this->basicAuthGet('router_test/test11', $account->getUsername(), $this->randomName()); + $this->assertNoText($account->getUsername(), 'Bad basic auth credentials do not authenticate the user.'); + $this->assertResponse('403', 'Access is not granted.'); + $this->curlClose(); + + $this->drupalGet('router_test/test11'); + $this->assertResponse('401', 'Not authenticated on the route that allows only http_basic. Prompt to authenticate received.'); + + $this->drupalGet('admin'); + $this->assertResponse('403', 'No authentication prompt for routes not explicitly defining authentication providers.'); + + $account = $this->drupalCreateUser(array('access administration pages')); + + $this->basicAuthGet('admin', $account->getUsername(), $account->pass_raw); + $this->assertNoLink('Log out', 0, 'User is not logged in'); + $this->assertResponse('403', 'No basic authentication for routes not explicitly defining authentication providers.'); + $this->curlClose(); + } + + /** + * Does HTTP basic auth request. + * + * We do not use \Drupal\simpletest\WebTestBase::drupalGet because we need to + * set curl settings for basic authentication. + * + * @param string $path + * The request path. + * @param string $username + * The user name to authenticate with. + * @param string $password + * The password. + * + * @return string + * Curl output. + */ + protected function basicAuthGet($path, $username, $password) { + $out = $this->curlExec( + array( + CURLOPT_HTTPGET => TRUE, + CURLOPT_URL => url($path, array('absolute' => TRUE)), + CURLOPT_NOBODY => FALSE, + CURLOPT_HTTPAUTH => CURLAUTH_BASIC, + CURLOPT_USERPWD => $username . ':' . $password, + ) + ); + + $this->verbose('GET request to: ' . $path . + '
' . $out); + + return $out; + } +} diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php index 7f7d2c4..9349484 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryAggregateTest.php @@ -6,6 +6,9 @@ */ namespace Drupal\system\Tests\Entity; +use Drupal\field_sql_storage\Entity\ConditionAggregate; +use Drupal\simpletest\DrupalUnitTestBase; + /** * Defines a test for testing aggregation support for entity query. * diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php index 4a417f8..9f95373 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryRelationshipTest.php @@ -20,7 +20,7 @@ class EntityQueryRelationshipTest extends EntityUnitTestBase { public static $modules = array('taxonomy', 'options'); /** - * @var \Drupal\Core\Entity\Query\QueryFactory + * @var \Drupal\field_sql_storage\Entity\QueryFactory */ protected $factory; diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldAccessTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldAccessTest.php index 7395dfa..384c815 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldAccessTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldAccessTest.php @@ -19,7 +19,7 @@ class FieldAccessTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('entity', 'entity_test', 'field', 'system', 'text', 'filter', 'user'); + public static $modules = array('entity', 'entity_test', 'field', 'field_sql_storage', 'system', 'text', 'filter', 'user'); /** * Holds the currently active global user ID that initiated the test run. diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php index 34818e0..4988b49 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/FieldSqlStorageTest.php @@ -26,7 +26,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase { * * @var array */ - public static $modules = array('system', 'field', 'field_test', 'text', 'number', 'entity_test'); + public static $modules = array('field', 'field_test', 'text', 'number', 'entity_test'); /** * The name of the created field. @@ -67,7 +67,6 @@ public static function getInfo() { function setUp() { parent::setUp(); $this->installSchema('entity_test', array('entity_test_rev', 'entity_test_rev_revision')); - $this->installSchema('system', array('variable')); $entity_type = 'entity_test_rev'; $this->field_name = strtolower($this->randomName()); @@ -460,34 +459,6 @@ function testFieldSqlStorageForeignKeys() { } /** - * Tests reacting to a bundle being renamed. - */ - function testFieldSqlStorageBundleRename() { - $entity_type = $bundle = 'entity_test_rev'; - - // Create an entity. - $value = mt_rand(1, 127); - $entity = entity_create($entity_type, array( - 'type' => $bundle, - $this->field->name => $value, - )); - $entity->save(); - - // Rename the bundle. - $bundle_new = $bundle . '_renamed'; - entity_test_rename_bundle($bundle, $bundle_new, $entity_type); - - // Check that the 'bundle' column has been updated in storage. - $row = db_select($this->table, 't') - ->fields('t', array('bundle', $this->field->name . '_value')) - ->condition('entity_id', $entity->id()) - ->execute() - ->fetch(); - $this->assertEqual($row->bundle, $bundle_new); - $this->assertEqual($row->{$this->field->name . '_value'}, $value); - } - - /** * Tests table name generation. */ public function testTableNames() { diff --git a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php index 3efe397..d7433ee 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerTranslationTest.php @@ -98,8 +98,8 @@ protected function setUp() { // translated interface. $submit_value = (string) current($this->xpath('//input[@type="submit"]/@value')); - // Submit the standard profile installation. - $this->drupalPostForm(NULL, array('profile' => 'standard'), $submit_value); + // Submit the minimal profile installation. + $this->drupalPostForm(NULL, array('profile' => 'minimal'), $submit_value); // Submit the next step. $this->drupalPostForm(NULL, array(), $submit_value); diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module index 9ca18e7..4ef754d 100644 --- a/core/modules/system/tests/modules/entity_test/entity_test.module +++ b/core/modules/system/tests/modules/entity_test/entity_test.module @@ -80,7 +80,7 @@ function entity_test_entity_info_alter(&$info) { * 'entity_test'. */ function entity_test_create_bundle($bundle, $text = NULL, $entity_type = 'entity_test') { - $bundles = \Drupal::state()->get($entity_type . '.bundles') ?: array($entity_type => array('label' => 'Entity Test Bundle')); + $bundles = \Drupal::state()->get($entity_type . '.bundles') ?: array('entity_test' => array('label' => 'Entity Test Bundle')); $bundles += array($bundle => array('label' => $text ? $text : $bundle)); \Drupal::state()->set($entity_type . '.bundles', $bundles); @@ -99,7 +99,7 @@ function entity_test_create_bundle($bundle, $text = NULL, $entity_type = 'entity * 'entity_test'. */ function entity_test_rename_bundle($bundle_old, $bundle_new, $entity_type = 'entity_test') { - $bundles = \Drupal::state()->get($entity_type . '.bundles') ?: array($entity_type => array('label' => 'Entity Test Bundle')); + $bundles = \Drupal::state()->get($entity_type . '.bundles') ?: array('entity_test' => array('label' => 'Entity Test Bundle')); $bundles[$bundle_new] = $bundles[$bundle_old]; unset($bundles[$bundle_old]); \Drupal::state()->set($entity_type . '.bundles', $bundles); @@ -117,7 +117,7 @@ function entity_test_rename_bundle($bundle_old, $bundle_new, $entity_type = 'ent * 'entity_test'. */ function entity_test_delete_bundle($bundle, $entity_type = 'entity_test') { - $bundles = \Drupal::state()->get($entity_type . '.bundles') ?: array($entity_type => array('label' => 'Entity Test Bundle')); + $bundles = \Drupal::state()->get($entity_type . '.bundles') ?: array('entity_test' => array('label' => 'Entity Test Bundle')); unset($bundles[$bundle]); \Drupal::state()->set($entity_type . '.bundles', $bundles); diff --git a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/SystemConfigFormTestForm.php b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/SystemConfigFormTestForm.php index 9330682..30a891d 100644 --- a/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/SystemConfigFormTestForm.php +++ b/core/modules/system/tests/modules/form_test/lib/Drupal/form_test/SystemConfigFormTestForm.php @@ -21,4 +21,11 @@ public function getFormID() { return 'form_test_system_config_test_form'; } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array(); + } + } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php index b95759d..17c8829 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyIndexTidUiTest.php @@ -45,7 +45,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views')); + ViewTestData::importTestViews(get_class($this), array('taxonomy_test_views')); } /** diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php index 3209d33..6e5e7ff 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/Views/TaxonomyTestBase.php @@ -48,7 +48,7 @@ function setUp() { parent::setUp(); $this->mockStandardInstall(); - ViewTestData::createTestViews(get_class($this), array('taxonomy_test_views')); + ViewTestData::importTestViews(get_class($this), array('taxonomy_test_views')); $this->term1 = $this->createTerm(); $this->term2 = $this->createTerm(); diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerTestBase.php b/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerTestBase.php index 2b2ffc7..1ae4ba6 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerTestBase.php +++ b/core/modules/tracker/lib/Drupal/tracker/Tests/Views/TrackerTestBase.php @@ -26,7 +26,7 @@ protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('tracker_test_views')); + ViewTestData::importTestViews(get_class($this), array('tracker_test_views')); $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page')); diff --git a/core/modules/update/lib/Drupal/update/UpdateSettingsForm.php b/core/modules/update/lib/Drupal/update/UpdateSettingsForm.php index d2f80d1..7a92eae 100644 --- a/core/modules/update/lib/Drupal/update/UpdateSettingsForm.php +++ b/core/modules/update/lib/Drupal/update/UpdateSettingsForm.php @@ -121,4 +121,11 @@ public function submitForm(array &$form, array &$form_state) { parent::submitForm($form, $form_state); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('update.settings'); + } + } diff --git a/core/modules/user/lib/Drupal/user/AccountSettingsForm.php b/core/modules/user/lib/Drupal/user/AccountSettingsForm.php index e8077d3..fbf2e65 100644 --- a/core/modules/user/lib/Drupal/user/AccountSettingsForm.php +++ b/core/modules/user/lib/Drupal/user/AccountSettingsForm.php @@ -445,4 +445,11 @@ public function submitForm(array &$form, array &$form_state) { ->save(); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('user.settings', 'user.mail', 'system.site'); + } + } diff --git a/core/modules/user/lib/Drupal/user/Entity/Role.php b/core/modules/user/lib/Drupal/user/Entity/Role.php index 0f8e90e..83e4e5e 100644 --- a/core/modules/user/lib/Drupal/user/Entity/Role.php +++ b/core/modules/user/lib/Drupal/user/Entity/Role.php @@ -7,6 +7,8 @@ namespace Drupal\user\Entity; +use Drupal\Core\Entity\Annotation\EntityType; +use Drupal\Core\Annotation\Translation; use Drupal\Core\Config\Entity\ConfigEntityBase; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\user\RoleInterface; diff --git a/core/modules/user/lib/Drupal/user/Entity/User.php b/core/modules/user/lib/Drupal/user/Entity/User.php index d975177..748c8f1 100644 --- a/core/modules/user/lib/Drupal/user/Entity/User.php +++ b/core/modules/user/lib/Drupal/user/Entity/User.php @@ -10,6 +10,8 @@ use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\Core\Entity\EntityMalformedException; use Drupal\Core\Entity\EntityNG; +use Drupal\Core\Entity\Annotation\EntityType; +use Drupal\Core\Annotation\Translation; use Drupal\user\UserInterface; /** diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php index 91c45ef..5910726 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFilterUserNameTest.php @@ -65,7 +65,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('user_test_views')); + ViewTestData::importTestViews(get_class($this), array('user_test_views')); $this->enableViewsTestModule(); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php b/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php index 0b4df3d..88b1c78 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/UserTestBase.php @@ -39,7 +39,7 @@ protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('user_test_views')); + ViewTestData::importTestViews(get_class($this), array('user_test_views')); $this->users[] = $this->drupalCreateUser(); $this->users[] = user_load(1); diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php b/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php index bec7c5a..9446f66 100644 --- a/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php +++ b/core/modules/user/lib/Drupal/user/Tests/Views/UserUnitTestBase.php @@ -46,7 +46,7 @@ protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('user_test_views')); + ViewTestData::importTestViews(get_class($this), array('user_test_views')); $this->installSchema('user', array('users', 'users_roles')); $this->installSchema('system', 'sequences'); diff --git a/core/modules/views/lib/Drupal/views/Entity/View.php b/core/modules/views/lib/Drupal/views/Entity/View.php index f5507e6..e1f9873 100644 --- a/core/modules/views/lib/Drupal/views/Entity/View.php +++ b/core/modules/views/lib/Drupal/views/Entity/View.php @@ -13,6 +13,8 @@ use Drupal\views_ui\ViewUI; use Drupal\views\ViewStorageInterface; use Drupal\views\ViewExecutable; +use Drupal\Core\Entity\Annotation\EntityType; +use Drupal\Core\Annotation\Translation; /** * Defines a View configuration entity class. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/row/EntityRow.php b/core/modules/views/lib/Drupal/views/Plugin/views/row/EntityRow.php index 8acef0b..293d6f6 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/row/EntityRow.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/row/EntityRow.php @@ -10,6 +10,7 @@ use Drupal\Core\Entity\EntityManager; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\ViewExecutable; +use Drupal\views\Annotation\ViewsRow; use Symfony\Component\DependencyInjection\ContainerInterface; /** diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/style/DefaultStyle.php b/core/modules/views/lib/Drupal/views/Plugin/views/style/DefaultStyle.php index e315c1c..d379cde 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/style/DefaultStyle.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/style/DefaultStyle.php @@ -7,6 +7,9 @@ namespace Drupal\views\Plugin\views\style; +use Drupal\views\Annotation\ViewsStyle; +use Drupal\Core\Annotation\Translation; + /** * Unformatted style plugin to render rows one after another with no * decorations. diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php index b86ca28..09eaaf8 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php @@ -37,7 +37,7 @@ protected function setUp() { $this->enableViewsTestModule(); - ViewTestData::createTestViews(get_class($this), array('views_test_data')); + ViewTestData::importTestViews(get_class($this), array('views_test_data')); $this->admin_user = $this->drupalCreateUser(array('access all views')); $this->web_user = $this->drupalCreateUser(); diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/ViewsBlockTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/ViewsBlockTest.php index bd5f252..f1a0563 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/ViewsBlockTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/ViewsBlockTest.php @@ -45,7 +45,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - ViewTestData::createTestViews(get_class($this), array('block_test_views')); + ViewTestData::importTestViews(get_class($this), array('block_test_views')); } /** diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php b/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php index db703fe..67e84a6 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewTestBase.php @@ -38,7 +38,7 @@ protected function setUp() { foreach (ViewExecutable::getPluginTypes() as $plugin_type) { $this->container->get("plugin.manager.views.$plugin_type")->clearCachedDefinitions(); } - ViewTestData::createTestViews(get_class($this), array('views_test_config')); + ViewTestData::importTestViews(get_class($this), array('views_test_config')); } /** diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewTestConfigInstaller.php b/core/modules/views/lib/Drupal/views/Tests/ViewTestConfigInstaller.php new file mode 100644 index 0000000..c514ebd --- /dev/null +++ b/core/modules/views/lib/Drupal/views/Tests/ViewTestConfigInstaller.php @@ -0,0 +1,27 @@ +getStorageController('view'); $module_handler = \Drupal::moduleHandler(); foreach ($modules as $module) { $config_dir = drupal_get_path('module', $module) . '/test_views'; @@ -44,15 +47,28 @@ public static function createTestViews($class, array $modules) { continue; } - $file_storage = new FileStorage($config_dir); - foreach ($file_storage->listAll('views.view.') as $config_name) { + $source_storage = new FileStorage($config_dir); + // Only import views used by test. + $views_to_import = array(); + foreach ($source_storage->listAll('views.view.') as $config_name) { $id = str_replace('views.view.', '', $config_name); if (in_array($id, $views)) { - $storage_controller - ->create($file_storage->read($config_name)) - ->save(); + $views_to_import[] = $config_name; } } + $storage_comparer = new StorageComparer( + $source_storage, + \Drupal::service('config.storage') + ); + $storage_comparer->addChangelist('create', $views_to_import); + $installer = new ViewTestConfigInstaller( + $storage_comparer, + \Drupal::service('event_dispatcher'), + \Drupal::service('config.factory'), + \Drupal::entityManager(), + \Drupal::lock() + ); + $installer->import(); } } } diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php b/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php index e5ec825..ab8173a 100644 --- a/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php +++ b/core/modules/views/lib/Drupal/views/Tests/ViewUnitTestBase.php @@ -66,7 +66,7 @@ protected function setUpFixtures() { // Tests implementing ViewUnitTestBase depend on the theme system being // properly configured. $this->installConfig(array('system')); - ViewTestData::createTestViews(get_class($this), array('views_test_config')); + ViewTestData::importTestViews(get_class($this), array('views_test_config')); } /** diff --git a/core/modules/views_ui/js/views_ui.listing.js b/core/modules/views_ui/js/views_ui.listing.js deleted file mode 100644 index 1b6f554..0000000 --- a/core/modules/views_ui/js/views_ui.listing.js +++ /dev/null @@ -1,44 +0,0 @@ -(function ($, Drupal) { - - "use strict"; - - /** - * Filters the view listing tables by a text input search string. - * - * Text search input: input.views-filter-text - * Target table: input.views-filter-text[data-table] - * Source text: .views-table-filter-text-source - */ - Drupal.behaviors.viewTableFilterByText = { - attach: function (context, settings) { - var $input = $('input.views-filter-text').once('views-filter-text'); - var $table = $($input.attr('data-table')); - var $rows; - - function filterViewList (e) { - var query = $(e.target).val().toLowerCase(); - - function showViewRow (index, row) { - var $row = $(row); - var $sources = $row.find('.views-table-filter-text-source'); - var textMatch = $sources.text().toLowerCase().indexOf(query) !== -1; - $row.closest('tr').toggle(textMatch); - } - - // Filter if the length of the query is at least 2 characters. - if (query.length >= 2) { - $rows.each(showViewRow); - } - else { - $rows.show(); - } - } - - if ($table.length) { - $rows = $table.find('tbody tr'); - $input.on('keyup', filterViewList); - } - } - }; - -}(jQuery, Drupal)); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/AdvancedSettingsForm.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/AdvancedSettingsForm.php index fd77d5e..5fd7506 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/AdvancedSettingsForm.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/AdvancedSettingsForm.php @@ -103,4 +103,11 @@ public function cacheSubmit() { drupal_set_message($this->t('The cache has been cleared.')); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('views.settings'); + } + } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Form/BasicSettingsForm.php b/core/modules/views_ui/lib/Drupal/views_ui/Form/BasicSettingsForm.php index d1206d5..dfc83ca 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/Form/BasicSettingsForm.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/Form/BasicSettingsForm.php @@ -142,4 +142,11 @@ public function submitForm(array &$form, array &$form_state) { ->save(); } + /** + * {@inheritdoc} + */ + public function getConfigNames() { + return array('views.settings'); + } + } diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php index d040df1..33ac4de 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php @@ -94,12 +94,7 @@ public function buildRow(EntityInterface $view) { '#displays' => $this->getDisplaysList($view) ), ), - 'description' => array( - 'data' => array( - '#markup' => String::checkPlain($view->get('description')), - ), - 'class' => array('views-table-filter-text-source'), - ), + 'description' => $view->get('description'), 'tag' => $view->get('tag'), 'path' => implode(', ', $this->getDisplayPaths($view)), 'operations' => $row['operations'], @@ -184,25 +179,9 @@ public function buildOperations(EntityInterface $entity) { public function render() { $entities = $this->load(); $list['#type'] = 'container'; - $list['#attributes']['id'] = 'views-entity-list'; - $list['#attached']['css'] = ViewFormControllerBase::getAdminCSS(); $list['#attached']['library'][] = array('system', 'drupal.ajax'); - $list['#attached']['library'][] = array('views_ui', 'views_ui.listing'); - - $list['search'] = array( - '#type' => 'search', - '#title' => $this->t('Search'), - '#size' => 30, - '#placeholder' => $this->t('Enter view name'), - '#attributes' => array( - 'class' => array('views-filter-text'), - 'data-table' => '.views-listing-table', - 'autocomplete' => 'off', - 'title' => $this->t('Enter a part of the view name or description to filter by.'), - ), - ); - + $list['#attributes']['id'] = 'views-entity-list'; $list['enabled']['heading']['#markup'] = '

' . t('Enabled') . '

'; $list['disabled']['heading']['#markup'] = '

' . t('Disabled') . '

'; foreach (array('enabled', 'disabled') as $status) { @@ -210,9 +189,6 @@ public function render() { $list[$status]['#attributes'] = array('class' => array('views-list-section', $status)); $list[$status]['table'] = array( '#theme' => 'table', - '#attributes' => array( - 'class' => array('views-listing-table'), - ), '#header' => $this->buildHeader(), '#rows' => array(), ); diff --git a/core/modules/views_ui/templates/views-ui-view-info.html.twig b/core/modules/views_ui/templates/views-ui-view-info.html.twig index a0f286c..e773cd2 100644 --- a/core/modules/views_ui/templates/views-ui-view-info.html.twig +++ b/core/modules/views_ui/templates/views-ui-view-info.html.twig @@ -12,5 +12,5 @@ * @ingroup themeable */ #} -

{{ title }}

+

{{ title }}

{{ displays }}
diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index a884a79..3d09c2c 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -210,14 +210,6 @@ function views_ui_library_info() { ), ); - $libraries['views_ui.listing'] = array( - 'title' => 'Views UI listing', - 'version' => Drupal::VERSION, - 'js' => array( - $path . 'views_ui.listing.js' => array('group' => JS_DEFAULT), - ), - ); - return $libraries; } diff --git a/core/themes/seven/install-page.css b/core/themes/seven/install-page.css index 0d223f0..f76e3b1 100644 --- a/core/themes/seven/install-page.css +++ b/core/themes/seven/install-page.css @@ -50,6 +50,10 @@ body.install-page { width: 75%; max-width: 770px; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); + padding: 1em 2em 1em 0; /* LTR */ + } + [dir="rtl"] body.install-page #page { + padding: 1em 0 1em 2em; } body.install-page #content { -webkit-box-sizing: border-box; @@ -57,12 +61,13 @@ body.install-page { box-sizing: border-box; clear: none; float: left; - padding-left: 50px; - padding-right: 50px; + padding-left: 50px; /* LTR */ width: 65%; } [dir="rtl"] body.install-page #content { float: right; + padding-left: 0; + padding-right: 50px; } ul{ padding: 15px;