' . t('The Admin Toolbar module enhances the Toolbar module by providing fast access to all the administrative links at the top of your site. Admin Toolbar remains a very "lightweight" module by closely integrating with all Toolbar functionality. It can be used in conjunction with all the sub modules included on Admin Toolbar, for quick access to system commands such as Flush all caches, Run cron, Run Updates, etc.', $variables) . '
';
- $output .= '
' . t('Uses') . '
';
- $output .= '
' . t('The Admin Toolbar greatly improves the user experience for those who regularly interact with the site Toolbar by providing fast, full access to all links in the site Toolbar without having to click to get there.') . '
';
-
- return $output;
- }
-}
-
-/**
- * Renders the toolbar's administration tray.
- *
- * This is a clone of core's toolbar_prerender_toolbar_administration_tray()
- * function, which uses setMaxDepth(4) instead of setTopLevelOnly().
- *
- * @param array $element
- * A renderable array.
- *
- * @return array
- * The updated renderable array.
- *
- * @see toolbar_prerender_toolbar_administration_tray()
- */
-function admin_toolbar_prerender_toolbar_administration_tray(array $element) {
- $menu_tree = \Drupal::service('toolbar.menu_tree');
- $parameters = new MenuTreeParameters();
- $parameters->setRoot('system.admin')->excludeRoot()->setMaxDepth(4)->onlyEnabledLinks();
- $tree = $menu_tree->load(NULL, $parameters);
- $manipulators = [
- ['callable' => 'menu.default_tree_manipulators:checkAccess'],
- ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
- ['callable' => 'toolbar_tools_menu_navigation_links'],
- ];
- $tree = $menu_tree->transform($tree, $manipulators);
- $element['administration_menu'] = $menu_tree->build($tree);
-
- return $element;
-}
-
-/**
- * Adds toolbar-specific attributes to the menu link tree.
- *
- * @param \Drupal\Core\Menu\MenuLinkTreeElement[] $tree
- * The menu link tree to manipulate.
- *
- * @return \Drupal\Core\Menu\MenuLinkTreeElement[]
- * The manipulated menu link tree.
- */
-function toolbar_tools_menu_navigation_links(array $tree) {
- foreach ($tree as $element) {
- if ($element->subtree) {
- toolbar_tools_menu_navigation_links($element->subtree);
- }
- $link = $element->link;
-
- // Get the non-localized title to make the icon class.
- $definition = $link->getPluginDefinition();
-
- $element->options['attributes']['class'][] = 'toolbar-icon';
- $string = strtolower(str_replace(['.', ' ', '_'], ['-', '-', '-'], $definition['id']));
- $element->options['attributes']['class'][] = Html::cleanCssIdentifier('toolbar-icon-' . $string);
- $element->options['attributes']['title'] = $link->getDescription();
- }
- return $tree;
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/README.txt b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/README.txt
deleted file mode 100644
index 37670cf49..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/README.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-CONTENTS OF THIS FILE
----------------------
-
- * Introduction
- * Requirements
- * Installation
- * Configuration
- * Maintainers
-
-
-INTRODUCTION
-------------
-
-The Admin Toolbar Links Access Filter module Provides a workaround for the
-common problem that users with 'Use the administration pages and help'
-permission see menu links they don't have access permission for. Once the issue
-https://www.drupal.org/node/296693 be solved, this module will be deprecated.
-
- * To know why we create this module check this issue:
- https://www.drupal.org/node/2917704
-
- * To submit bug reports and feature suggestions, or to track changes:
- https://www.drupal.org/project/issues/search/admin_toolbar
-
-
-REQUIREMENTS
-------------
-
-This module requires the following modules:
-
- * Admin Toolbar (https://www.drupal.org/project/admin_toolbar)
-
-
-INSTALLATION
-------------
-
- * Install as you would normally install a contributed Drupal module.
- See: https://www.drupal.org/node/895232 for further information.
-
-
-CONFIGURATION
--------------
-
-No configuration is needed.
-
-
-MAINTAINERS
------------
-
-Current maintainers:
- * Wilfrid Roze (eme) - https://www.drupal.org/u/eme
- * Romain Jarraud (romainj) - https://www.drupal.org/u/romainj
- * Adrian Cid Almaguer (adriancid) - https://www.drupal.org/u/adriancid
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml
deleted file mode 100644
index 7e743e26c..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.info.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: Admin Toolbar Links Access Filter
-description: Provides a workaround for the common problem that users with 'Use the administration pages and help' permission see menu links they don't have access permission for. Once the issue https://www.drupal.org/node/296693 be solved, this module will be deprecated.
-package: Administration
-
-type: module
-# core: 8.x
-
-dependencies:
- - admin_toolbar:admin_toolbar
-
-# Information added by Drupal.org packaging script on 2019-02-03
-version: '8.x-1.26'
-core: '8.x'
-project: 'admin_toolbar'
-datestamp: 1549218484
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module
deleted file mode 100644
index d9930e07b..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/admin_toolbar_links_access_filter.module
+++ /dev/null
@@ -1,200 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('The Admin Toolbar Links Access Filter module provides a workaround for the common problem that users with Use the administration pages and help permission see menu links they done not have access permission for.') . '
';
-
- return $output;
- }
-}
-
-/**
- * Implements hook_preprocess_menu().
- *
- * Hides links from admin menu, if user doesn't have access rights.
- */
-function admin_toolbar_links_access_filter_preprocess_menu(&$variables) {
- if (empty($variables['items'])) {
- // Additional empty check to prevent exotic situations, where the preprocess
- // function is entered even without items.
- // @see https://www.drupal.org/node/2833885
- return;
- }
- // Ensure that menu_name exists.
- if (!isset($variables['menu_name'])) {
- // In rare cases (for unknown reasons) menu_name may not be set.
- // As fallback, we can fetch it from the first menu item.
- $first_link = reset($variables['items']);
- /** @var Drupal\Core\Menu\MenuLinkDefault $original_link */
- // Fetch the menu_name from the original link.
- $original_link = $first_link['original_link'];
- $variables['menu_name'] = $original_link->getMenuName();
- }
- if ($variables['menu_name'] == 'admin') {
- if (!admin_toolbar_links_access_filter_user_has_admin_role($variables['user'])) {
- admin_toolbar_links_access_filter_filter_non_accessible_links($variables['items']);
- }
- }
-}
-
-/**
- * Hides links from admin menu, if user doesn't have access rights.
- */
-function admin_toolbar_links_access_filter_filter_non_accessible_links(array &$items) {
- foreach ($items as $route => &$item) {
- $route_name = $route;
- $route_params = [];
- if (!empty($item['original_link'])) {
- /** @var \Drupal\Core\Menu\MenuLinkBase $original_link */
- $original_link = $item['original_link'];
- if ($original_link->getUrlObject()->isExternal()) {
- // Do not filter external URL at all.
- continue;
- }
- $route_name = $original_link->getRouteName();
- $route_params = $original_link->getRouteParameters();
- }
-
- // Check, if user has access rights to the route.
- if (!\Drupal::accessManager()->checkNamedRoute($route_name, $route_params)) {
- unset($items[$route]);
- }
- else {
- if (!empty($items[$route]['below'])) {
- // Recursively call this function for the child items.
- admin_toolbar_links_access_filter_filter_non_accessible_links($items[$route]['below']);
- }
- if (empty($items[$route]['below']) && \Drupal::moduleHandler()->moduleExists('admin_toolbar')) {
-
- // Every child item has been cleared out.
- // Now check, if the given route represents an overview page only,
- // without having functionality on its own. In this case, we can safely
- // unset this item, as there aren't any children left.
- // This assumption is only valid, when the admin_toolbar module is
- // installed because otherwise we won't have child items at all.
- if (admin_toolbar_links_access_filter_is_overview_page($route)) {
- unset($items[$route]);
- }
- else {
- // Let's remove the expanded flag.
- $items[$route]['is_expanded'] = FALSE;
- }
- }
- }
- }
-}
-
-/**
- * Implements template_preprocess_admin_block_content().
- */
-function admin_toolbar_links_access_filter_admin_block_content(&$variables) {
- if (!admin_toolbar_links_access_filter_user_has_admin_role($variables['user'])) {
- foreach ($variables['content'] as $key => &$item) {
- if (isset($item['url']) && $item['url'] instanceof Url) {
- /* @var \Drupal\Core\Url $url */
- $url = $item['url'];
- if ($url->access()) {
- continue;
- }
- unset($variables['content'][$key]);
- }
-
- // The key is structured in the form: "ID title route",
- // concatenated with spaces.
- $key_parts = explode(' ', $key);
- $route = end($key_parts);
-
- // Special handling for Views pages, as they are not defined
- // system routes.
- // @TODO check the permission for Views + find a generic way for similar
- // cases. Best way would be to get the link entity somehow to properly
- // check permissions.
- if (strpos($route, 'views_view:') === 0) {
- continue;
- }
-
- // Check, if user has access rights to the route.
- if (!\Drupal::accessManager()->checkNamedRoute($route)) {
- unset($variables['content'][$key]);
- }
- }
- }
-}
-
-/**
- * Checks if the given route name is an overview page.
- *
- * Checks if the given route name matches a pure (admin) overview page that can
- * be skipped, if there are no child items set. The typical example are routes
- * having the SystemController::systemAdminMenuBlockPage() function as their
- * controller callback set.
- *
- * @param string $route_name
- * The route name to check.
- *
- * @return bool
- * TRUE, if the given route name matches a pure admin overview page route,
- * FALSE otherwise.
- */
-function admin_toolbar_links_access_filter_is_overview_page($route_name) {
- // @var \Drupal\Core\Routing\RouteProviderInterface $route_provider.
- $route_provider = \Drupal::service('router.route_provider');
- $overview_page_controllers = [
- '\Drupal\system\Controller\AdminController::index',
- '\Drupal\system\Controller\SystemController::overview',
- '\Drupal\system\Controller\SystemController::systemAdminMenuBlockPage',
- ];
- try {
- $route = $route_provider->getRouteByName($route_name);
- $controller = $route->getDefault('_controller');
- return !empty($controller) && in_array($controller, $overview_page_controllers);
- }
- catch (RouteNotFoundException $ex) {
-
- }
- return FALSE;
-}
-
-/**
- * Checks, if the given user has admin rights.
- *
- * @param \Drupal\Core\Session\AccountInterface $account
- * The account to check.
- *
- * @return bool
- * TRUE, if the given user account has at least one role with admin rights
- * assigned, FALSE otherwise.
- */
-function admin_toolbar_links_access_filter_user_has_admin_role(AccountInterface $account) {
- static $user_has_admin_role = [];
- $uid = $account->id();
- if (!isset($user_has_admin_role[$uid])) {
- $roles = Role::loadMultiple($account->getRoles());
- foreach ($roles as $role) {
- if ($role->isAdmin()) {
- $user_has_admin_role[$uid] = TRUE;
- break;
- }
- $user_has_admin_role[$uid] = FALSE;
- }
- }
- return $user_has_admin_role[$uid];
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/composer.json b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/composer.json
deleted file mode 100644
index d75f3b0c6..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_links_access_filter/composer.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "drupal/admin_toolbar_links_access_filter",
- "description": "Provides a workaround for the common problem that users with 'Use the administration pages and help' permission see menu links they don't have access permission for. Once the issue https://www.drupal.org/node/296693 be solved, this module will be deprecated.",
- "type": "drupal-module",
- "keywords": ["Drupal", "Toolbar"],
- "homepage": "http://drupal.org/project/admin_toolbar",
- "license": "GPL-2.0+",
- "authors": [
- {
- "name": "Wilfrid Roze (eme)",
- "homepage": "https://www.drupal.org/u/eme",
- "role": "Maintainer"
- },
- {
- "name": "Romain Jarraud (romainj)",
- "homepage": "https://www.drupal.org/u/romainj",
- "role": "Maintainer"
- },
- {
- "name": "Adrian Cid Almaguer (adriancid)",
- "email": "adriancid@gmail.com",
- "homepage": "https://www.drupal.org/u/adriancid",
- "role": "Maintainer"
- },
- {
- "name": "Mohamed Anis Taktak (matio89)",
- "homepage": "https://www.drupal.org/u/matio89",
- "role": "Maintainer"
- }
- ],
- "support": {
- "issues": "https://www.drupal.org/project/issues/admin_toolbar",
- "source": "http://cgit.drupalcode.org/admin_toolbar"
- },
- "require": {
- "drupal/admin_toolbar": "^1"
- }
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/README.txt b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/README.txt
deleted file mode 100644
index 263cde93c..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/README.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-CONTENTS OF THIS FILE
----------------------
-
- * Introduction
- * Requirements
- * Recommended modules
- * Installation
- * Configuration
- * Maintainers
-
-
-INTRODUCTION
-------------
-
-Admin Toolbar Extra Tools provides menu links to administration pages or actions
-(eg. Flushing caches) that are not generated by Drupal core. It adds menu items
-that are not generated by Drupal core. For example there are no menu items for
-each content type by default or menu links to Manage fields on each entity
-types. That's the purpose of Admin Toolbar Extra Tools to add them.
-
- * For a full description of the module, visit the project page:
- https://www.drupal.org/project/admin_toolbar
-
- * To submit bug reports and feature suggestions, or to track changes:
- https://www.drupal.org/project/issues/search/admin_toolbar
-
-
-REQUIREMENTS
-------------
-
-This module requires the following modules:
-
- * Admin Toolbar (https://www.drupal.org/project/admin_toolbar)
-
-
-INSTALLATION
-------------
-
- * Install as you would normally install a contributed Drupal module.
- See: https://www.drupal.org/node/895232 for further information.
-
-
-CONFIGURATION
--------------
-
-No configuration is needed.
-
-
-MAINTAINERS
------------
-
-Current maintainers:
- * Wilfrid Roze (eme) - https://www.drupal.org/u/eme
- * Romain Jarraud (romainj) - https://www.drupal.org/u/romainj
- * Adrian Cid Almaguer (adriancid) - https://www.drupal.org/u/adriancid
- * Mohamed Anis Taktak (matio89) - https://www.drupal.org/u/matio89
-
-This project has been sponsored by:
- * emerya
- Founded in 2009, emerya is a human-sized company, dedicated to the design and
- implementation of web interfaces. Visit: http://http://emerya.fr/ for more
- information.
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml
deleted file mode 100644
index d94726473..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.info.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Admin Toolbar Extra Tools
-description: Adds menu links to the Admin Toolbar.
-package: Administration
-
-type: module
-# core: 8.x
-
-dependencies:
- - admin_toolbar:admin_toolbar
- - drupal:system (>=8.5)
-
-# Information added by Drupal.org packaging script on 2019-02-03
-version: '8.x-1.26'
-core: '8.x'
-project: 'admin_toolbar'
-datestamp: 1549218484
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.libraries.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.libraries.yml
deleted file mode 100644
index 94afa9f57..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.libraries.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-toolbar.icon:
- css:
- theme:
- css/tools.css: {}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.links.menu.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.links.menu.yml
deleted file mode 100644
index e39dbe940..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.links.menu.yml
+++ /dev/null
@@ -1,76 +0,0 @@
-admin_toolbar_tools.help:
- title: 'Tools'
- route_name:
- menu_name: admin
- parent: system.admin
- weight: -100
-
-system.admin_index:
- title: 'Index'
- route_name: system.admin_index
- menu_name: admin
- parent: admin_toolbar_tools.help
- weight: -100
-
-system.run_cron:
- title: 'Run cron'
- route_name: admin_toolbar.run.cron
- menu_name: admin
- parent: admin_toolbar_tools.help
- weight: -8
-
-system.db_update:
- title: 'Run updates'
- route_name: system.db_update
- menu_name: admin
- parent: admin_toolbar_tools.help
- weight: -6
-
-system.modules_uninstall:
- title: 'Uninstall module'
- route_name: system.modules_uninstall
- menu_name: admin
- parent: system.modules_list
-
-admin_toolbar_tools.flush:
- title: 'Flush all caches'
- route_name: admin_toolbar_tools.flush
- weight: -9
- parent: admin_toolbar_tools.help
- menu_name: admin
-
-admin_toolbar_tools.cssjs:
- title: 'Flush CSS and Javascript'
- route_name: admin_toolbar_tools.cssjs
- parent: admin_toolbar_tools.flush
- menu_name: admin
-
-admin_toolbar_tools.plugin:
- title: 'Flush plugins cache'
- route_name: admin_toolbar_tools.plugin
- parent: admin_toolbar_tools.flush
- menu_name: admin
-
-admin_toolbar_tools.flush_static:
- title: 'Flush static cache'
- route_name: admin_toolbar_tools.flush_static
- parent: admin_toolbar_tools.flush
- menu_name: admin
-
-admin_toolbar_tools.flush_menu:
- title: 'Flush routing and links cache'
- route_name: admin_toolbar_tools.flush_menu
- parent: admin_toolbar_tools.flush
- menu_name: admin
-
-admin_toolbar_tools.flush_twig:
- title: 'Flush twig cache'
- route_name: admin_toolbar_tools.flush_twig
- parent: admin_toolbar_tools.flush
- menu_name: admin
-
-admin_toolbar_tools.flush_rendercache:
- title: 'Flush render cache'
- route_name: admin_toolbar_tools.flush_rendercache
- parent: admin_toolbar_tools.flush
- menu_name: admin
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module
deleted file mode 100644
index cd56261ec..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.module
+++ /dev/null
@@ -1,702 +0,0 @@
- 'toolbar_item',
- 'tab' => [
- '#type' => 'link',
- '#attributes' => [
- 'class' => ['toolbar-icon', 'toolbar-icon-admin-toolbar-tools-help'],
- ],
- ],
- '#attached' => ['library' => ['admin_toolbar_tools/toolbar.icon']],
- ];
-
- return $items;
-}
-
-/**
- * Implements hook_help().
- */
-function admin_toolbar_tools_help($route_name, RouteMatchInterface $route_match) {
- switch ($route_name) {
- case 'help.page.admin_toolbar_tools':
- $output = '';
- $output .= '
';
- $output .= t('The Admin Toolbar Extra Tools module comes packaged with the Admin Toolbar module and adds functionality to it. The additional functionality is accessed thru extra links on the main administration Toolbar. Some links to Admin Toolbar Extra Tools administration pages are located at the bottom of this page.', [':admin-toolbar' => Url::fromRoute('help.page', ['name' => 'admin_toolbar'])->toString()]);
- $output .= '
';
- $output .= '
' . t('Uses') . '
';
- $output .= '
' . t('To use Admin Toolbar Extra Tools just install it like any other module. There is no other configuration required.') . '
';
-
- return $output;
- }
-}
-
-/**
- * Implements hook_menu_links_discovered_alter().
- */
-function admin_toolbar_tools_menu_links_discovered_alter(&$links) {
- $languageManager = \Drupal::languageManager();
- $config_override_language = $languageManager->getConfigOverrideLanguage();
- $languageManager->setConfigOverrideLanguage($languageManager->getLanguage('en'));
-
- $moduleHandler = \Drupal::moduleHandler();
- $entityTypeManager = \Drupal::entityTypeManager();
- $routeProvider = \Drupal::service('router.route_provider');
-
- /**
- * Determine if a route exists by name.
- *
- * @param $routeName
- * The name of the route to check.
- *
- * @return bool
- * Whether a route with that route name exists.
- */
- $routeExists = function ($routeName) use ($routeProvider) {
- return (count($routeProvider->getRoutesByNames([$routeName])) === 1);
- };
-
- $entityTypes = $entityTypeManager->getDefinitions();
- $content_entities = [];
- foreach ($entityTypes as $key => $entityType) {
- if ($entityType->getBundleEntityType() && ($entityType->get('field_ui_base_route') != '')) {
- $content_entities[$key] = [
- 'content_entity' => $key,
- 'content_entity_bundle' => $entityType->getBundleEntityType(),
- ];
- }
- }
-
- // Adding a menu link to clean the Views cache.
- if ($moduleHandler->moduleExists('views')) {
- $links['admin_toolbar_tools.flush_views'] = [
- 'title' => t('Flush views cache'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'admin_toolbar_tools.flush_views',
- 'menu_name' => 'admin',
- 'parent' => 'admin_toolbar_tools.flush',
- ];
- // Adding a menu link to Files.
- if ($moduleHandler->moduleExists('file') && $routeExists('view.files.page_1')) {
- $links['admin_toolbar_tools.view.files'] = [
- 'title' => t('Files'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'view.files.page_1',
- 'menu_name' => 'admin',
- 'parent' => 'system.admin_content',
- ];
- }
- }
-
- // Adds common links to entities.
- foreach ($content_entities as $entities) {
- $content_entity_bundle = $entities['content_entity_bundle'];
- $content_entity = $entities['content_entity'];
- foreach ($entityTypeManager->getStorage($content_entity_bundle)->loadMultiple() as $machine_name => $bundle) {
- // Normally, the edit form for the bundle would be its root link.
- $content_entity_bundle_root = NULL;
- if ($routeExists('entity.' . $content_entity_bundle . '.overview_form')) {
- // Some bundles have an overview/list form that make a better root link.
- $content_entity_bundle_root = 'entity.' . $content_entity_bundle . '.overview_form.' . $machine_name;
- $links[$content_entity_bundle_root] = [
- 'title' => t($bundle->label()),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.' . $content_entity_bundle . '.overview_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.' . $content_entity_bundle . '.collection',
- 'route_parameters' => [$content_entity_bundle => $machine_name],
- ];
- }
- if ($routeExists('entity.' . $content_entity_bundle . '.edit_form')) {
- $key = 'entity.' . $content_entity_bundle . '.edit_form.' . $machine_name;
- $links[$key] = [
- 'title' => t($bundle->label()),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.' . $content_entity_bundle . '.edit_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.' . $content_entity_bundle . '.collection',
- 'route_parameters' => [$content_entity_bundle => $machine_name],
- ];
- if (empty($content_entity_bundle_root)) {
- $content_entity_bundle_root = $key;
- }
- else {
- $links[$key]['parent'] = $content_entity_bundle_root;
- $links[$key]['title'] = t('Edit');
- }
- }
- if ($moduleHandler->moduleExists('field_ui')) {
- if ($routeExists('entity.' . $content_entity . '.field_ui_fields')) {
- $links['entity.' . $content_entity . '.field_ui_fields' . $machine_name] = [
- 'title' => t('Manage fields'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.' . $content_entity . '.field_ui_fields',
- 'menu_name' => 'admin',
- 'parent' => $content_entity_bundle_root,
- 'route_parameters' => [$content_entity_bundle => $machine_name],
- 'weight' => 1,
- ];
- }
- if ($routeExists('entity.entity_form_display.' . $content_entity . '.default')) {
- $links['entity.entity_form_display.' . $content_entity . '.default' . $machine_name] = [
- 'title' => t('Manage form display'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.entity_form_display.' . $content_entity . '.default',
- 'menu_name' => 'admin',
- 'parent' => $content_entity_bundle_root,
- 'route_parameters' => [$content_entity_bundle => $machine_name],
- 'weight' => 2,
- ];
- }
- if ($routeExists('entity.entity_view_display.' . $content_entity . '.default')) {
- $links['entity.entity_view_display.' . $content_entity . '.default.' . $machine_name] = [
- 'title' => t('Manage display'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.entity_view_display.' . $content_entity . '.default',
- 'menu_name' => 'admin',
- 'parent' => $content_entity_bundle_root,
- 'route_parameters' => [$content_entity_bundle => $machine_name],
- 'weight' => 3,
- ];
- }
- }
- if ($moduleHandler->moduleExists('devel') && $routeExists('entity.' . $content_entity_bundle . '.devel_load')) {
- $links['entity.' . $content_entity_bundle . '.devel_load.' . $machine_name] = [
- 'title' => t('Devel'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.' . $content_entity_bundle . '.devel_load',
- 'menu_name' => 'admin',
- 'parent' => $content_entity_bundle_root,
- 'route_parameters' => [$content_entity_bundle => $machine_name],
- 'weight' => 4,
- ];
- }
- if ($routeExists('entity.' . $content_entity_bundle . '.delete_form')) {
- $links['entity.' . $content_entity_bundle . '.delete_form.' . $machine_name] = [
- 'title' => t('Delete'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.' . $content_entity_bundle . '.delete_form',
- 'menu_name' => 'admin',
- 'parent' => $content_entity_bundle_root,
- 'route_parameters' => [$content_entity_bundle => $machine_name],
- 'weight' => 5,
- ];
- }
- }
- }
-
- // Add user links.
- $links['user.admin_create'] = [
- 'title' => t('Add a new user'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'user.admin_create',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user.collection',
- ];
- $links['user.admin_permissions'] = [
- 'title' => t('Permissions'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'user.admin_permissions',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user.collection',
- ];
- $links['entity.user_role.collection'] = [
- 'title' => t('Roles'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.user_role.collection',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user.collection',
- ];
- $links['admin_toolbar_tools.user.logout'] = [
- 'title' => t('Logout'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'user.logout',
- 'parent' => 'admin_toolbar_tools.help',
- 'weight' => 10,
- ];
- $links['user.role_add'] = [
- 'title' => t('Add a new role'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'user.role_add',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user_role.collection',
- 'weight' => -5,
- ];
- if ($moduleHandler->moduleExists('field_ui')) {
- $links['entity.user.field_ui_fields_'] = [
- 'title' => t('Manage fields'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.user.field_ui_fields',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user.admin_form',
- ];
- $links['entity.entity_form_display.user.default_'] = [
- 'title' => t('Manage form display'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.entity_form_display.user.default',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user.admin_form',
- ];
- $links['entity.entity_view_display.user.default_'] = [
- 'title' => t('Manage display'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.entity_view_display.user.default',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user.admin_form',
- ];
- }
- foreach (user_roles() as $role) {
- $links['entity.user_role.edit_form.' . $role->id()] = [
- 'title' => t($role->label()),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.user_role.edit_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user_role.collection',
- 'route_parameters' => ['user_role' => $role->id()],
- ];
- $links['entity.user_role.edit_permissions_form.' . $role->id()] = [
- 'title' => t('Edit permissions'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.user_role.edit_permissions_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user_role.edit_form.' . $role->id(),
- 'route_parameters' => ['user_role' => $role->id()],
- ];
- $links['entity.user_role.delete_form.' . $role->id()] = [
- 'title' => t('Delete'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.user_role.delete_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user_role.edit_form.' . $role->id(),
- 'route_parameters' => ['user_role' => $role->id()],
- ];
- if ($moduleHandler->moduleExists('devel')) {
- $links['entity.user_role.devel_load.' . $role->id()] = [
- 'title' => t('Devel'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.user_role.devel_load',
- 'menu_name' => 'admin',
- 'parent' => 'entity.user_role.edit_form.' . $role->id(),
- 'route_parameters' => ['user_role' => $role->id()],
- ];
- }
- }
-
- if ($moduleHandler->moduleExists('node')) {
- $links['admin_toolbar_tools.add_content'] = $links['node.add_page'];
- $links['admin_toolbar_tools.add_content']['parent'] = 'system.admin_content';
- $links['node.type_add'] = [
- 'title' => t('Add content type'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'node.type_add',
- 'menu_name' => 'admin',
- 'parent' => 'entity.node_type.collection',
- 'weight' => -5,
- ];
- // Add node links for each content type.
- foreach ($entityTypeManager->getStorage('node_type')->loadMultiple() as $type) {
- $links['node.add.' . $type->id()] = [
- 'title' => t($type->label()),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'node.add',
- 'parent' => 'admin_toolbar_tools.add_content',
- 'route_parameters' => ['node_type' => $type->id()],
- ];
- }
- }
-
- if ($moduleHandler->moduleExists('field_ui')) {
- $links['field_ui.entity_form_mode_add'] = [
- 'title' => t('Add new form mode'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'field_ui.entity_form_mode_add',
- 'menu_name' => 'admin',
- 'parent' => 'entity.entity_form_mode.collection',
- ];
- $links['field_ui.entity_view_mode_add'] = [
- 'title' => t('Add new view mode'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'field_ui.entity_view_mode_add',
- 'menu_name' => 'admin',
- 'parent' => 'entity.entity_view_mode.collection',
- ];
- }
-
- if ($moduleHandler->moduleExists('taxonomy')) {
- $links['entity.taxonomy_vocabulary.add_form'] = [
- 'title' => t('Add vocabulary'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.taxonomy_vocabulary.add_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.taxonomy_vocabulary.collection',
- 'weight' => -5,
- ];
- }
-
- if ($moduleHandler->moduleExists('menu_ui')) {
- $links['entity.menu.add_form'] = [
- 'title' => t('Add menu'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.menu.add_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.menu.collection',
- 'weight' => -50,
- ];
- // Adds links to /admin/structure/menu.
- foreach (menu_ui_get_menus() as $machine_name => $label) {
- $links['entity.menu.edit_form.' . $machine_name] = [
- 'title' => t($label),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.menu.edit_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.menu.collection',
- 'route_parameters' => ['menu' => $machine_name],
- ];
- $links['entity.menu.delete_form.' . $machine_name] = [
- 'title' => t('Delete'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.menu.delete_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.menu.edit_form.' . $machine_name,
- 'route_parameters' => ['menu' => $machine_name],
- ];
- if ($moduleHandler->moduleExists('devel') && $routeExists('entity.menu.devel_load')) {
- $links['entity.menu.devel_load.' . $machine_name] = [
- 'title' => t('Devel'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.menu.devel_load',
- 'menu_name' => 'admin',
- 'parent' => 'entity.menu.edit_form.' . $machine_name,
- 'route_parameters' => ['menu' => $machine_name],
- ];
- }
- $links['entity.menu.add_link_form.' . $machine_name] = [
- 'title' => t('Add link'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.menu.add_link_form',
- 'menu_name' => 'admin',
- 'parent' => 'entity.menu.edit_form.' . $machine_name,
- 'route_parameters' => ['menu' => $machine_name],
- ];
- }
- }
-
- // If module block_content is enabled.
- if ($moduleHandler->moduleExists('block_content')) {
- $links['block_content.add_page'] = [
- 'title' => t('Add custom block'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'block_content.add_page',
- 'menu_name' => 'admin',
- 'parent' => 'block.admin_display',
- 'weight' => -100,
- ];
- $links['entity.block_content.collection'] = [
- 'title' => t('Custom block library'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.block_content.collection',
- 'menu_name' => 'admin',
- 'parent' => 'block.admin_display',
- ];
- $links['entity.block_content_type.collection'] = [
- 'title' => t('Types'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.block_content_type.collection',
- 'menu_name' => 'admin',
- 'parent' => 'block.admin_display',
- ];
- }
-
- // If module Contact is enabled.
- if ($moduleHandler->moduleExists('contact')) {
- $links['contact.form_add'] = [
- 'title' => t('Add contact form'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'contact.form_add',
- 'menu_name' => 'admin',
- 'parent' => 'entity.contact_form.collection',
- 'weight' => -5,
- ];
- }
-
- // If module Update Manager is enabled.
- if ($moduleHandler->moduleExists('update')) {
- $links['update.module_update'] = [
- 'title' => t('Update'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'update.module_update',
- 'menu_name' => 'admin',
- 'parent' => 'system.modules_list',
- ];
- $links['update.module_install'] = [
- 'title' => t('Install new module'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'update.module_install',
- 'menu_name' => 'admin',
- 'parent' => 'system.modules_list',
- ];
- }
-
- // If module Devel is enabled.
- if ($moduleHandler->moduleExists('devel')) {
- $links['admin_development'] = [
- 'title' => t('Development'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'system.admin_config_development',
- 'menu_name' => 'admin',
- 'parent' => 'admin_toolbar_tools.help',
- 'weight' => '-8',
- ];
- $links['admin_toolbar_tools.devel.admin_settings'] = [
- 'title' => t('Devel settings'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.admin_settings',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- 'weight' => '-1',
- ];
- if ($moduleHandler->moduleExists('webprofiler')) {
- $links['admin_toolbar_tools.devel.webprofiler'] = [
- 'title' => t('Web Profiler settings'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'webprofiler.settings',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- }
- $links['admin_toolbar_tools.devel.configs_list'] = [
- 'title' => t('Config editor'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.configs_list',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- $links['admin_toolbar_tools.devel.reinstall'] = [
- 'title' => t('Reinstall modules'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.reinstall',
- 'parent' => 'admin_development',
- ];
- $links['admin_toolbar_tools.devel.menu_rebuild'] = [
- 'title' => t('Rebuild menu'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.menu_rebuild',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- $links['admin_toolbar_tools.devel.state_system_page'] = [
- 'title' => t('State editor'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.state_system_page',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- $links['admin_toolbar_tools.devel.theme_registry'] = [
- 'title' => t('Theme registry'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.theme_registry',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- $links['admin_toolbar_tools.devel.entity_info_page'] = [
- 'title' => t('Entity Info'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.entity_info_page',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- $links['admin_toolbar_tools.devel.session'] = [
- 'title' => t('Session viewer'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.session',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- $links['admin_toolbar_tools.devel.elements_page'] = [
- 'title' => t('Form API field types'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.elements_page',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- // Menu link for the Toolbar module.
- $links['admin_toolbar_tools.toolbar.settings'] = [
- 'title' => t('Toolbar settings'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.toolbar.settings_form',
- 'menu_name' => 'admin',
- 'parent' => 'devel.admin_settings',
- ];
- }
- // If module Devel PHP is enabled.
- if ($moduleHandler->moduleExists('devel_php') && $routeExists('devel_php.execute_php')) {
- $links['admin_toolbar_tools.devel_php.execute_php'] = [
- 'title' => t('Execute PHP Code'),
- 'route_name' => 'devel_php.execute_php',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- }
- elseif ($moduleHandler->moduleExists('devel') && $routeExists('devel.execute_php')) {
- $links['admin_toolbar_tools.devel.execute_php'] = [
- 'title' => t('Execute PHP Code'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'devel.execute_php',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- }
- // If module Views Ui enabled.
- if ($moduleHandler->moduleExists('views_ui')) {
- $links['admin_toolbar_tools.views_ui.add'] = [
- 'title' => t('Add new view'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'views_ui.add',
- 'menu_name' => 'admin',
- 'parent' => 'entity.view.collection',
- 'weight' => -5,
- ];
- $links['admin_toolbar_tools.views_ui.field_list'] = [
- 'title' => t('Used in views'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'views_ui.reports_fields',
- 'menu_name' => 'admin',
- 'parent' => 'entity.field_storage_config.collection',
- ];
- }
-
- $links['admin_toolbar_tools.system.theme_settings'] = [
- 'title' => t('Settings'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'system.theme_settings',
- 'menu_name' => 'admin',
- 'parent' => 'system.themes_page',
- ];
-
- if ($moduleHandler->moduleExists('webprofiler')) {
- $links['admin_toolbar_tools.devel.webprofiler'] = [
- 'title' => t('Webprofiler settings'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'webprofiler.settings',
- 'menu_name' => 'admin',
- 'parent' => 'admin_development',
- ];
- }
-
- if ($moduleHandler->moduleExists('update')) {
- $links['update.theme_install_'] = [
- 'title' => t('Install new theme'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'update.theme_install',
- 'menu_name' => 'admin',
- 'parent' => 'system.themes_page',
- ];
- $links['update.theme_update_'] = [
- 'title' => t('Update'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'update.theme_update',
- 'menu_name' => 'admin',
- 'parent' => 'system.themes_page',
- ];
- // Lists installed themes.
- $installed_themes = admin_toolbar_tools_installed_themes();
- foreach ($installed_themes as $key_theme => $label_theme) {
- $links['system.theme_settings_theme.' . $key_theme] = [
- 'title' => t($label_theme),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'system.theme_settings_theme',
- 'menu_name' => 'admin',
- 'parent' => 'system.theme_settings_',
- 'route_parameters' => [
- 'theme' => $key_theme,
- ],
- ];
- }
- }
-
- // If module Language enabled.
- if ($moduleHandler->moduleExists('language')) {
- $links['admin_toolbar_tools.language.negotiation'] = [
- 'title' => t('Detection and selection'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'language.negotiation',
- 'menu_name' => 'admin',
- 'parent' => 'entity.configurable_language.collection',
- ];
- }
-
- // If module Media enabled.
- if ($moduleHandler->moduleExists('media')) {
- $links['admin_toolbar_tools.add_media'] = [
- 'title' => t('Add media'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.media.add_page',
- 'menu_name' => 'admin',
- 'parent' => 'system.admin_content',
- ];
- // Add node links for each media type.
- foreach ($entityTypeManager->getStorage('media_type')->loadMultiple() as $type) {
- $links['media.add.' . $type->id()] = [
- 'title' => t($type->label()),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'entity.media.add_form',
- 'parent' => 'admin_toolbar_tools.add_media',
- 'route_parameters' => ['media_type' => $type->id()],
- ];
- }
- }
-
- // If module Config enabled.
- if ($moduleHandler->moduleExists('config')) {
- $links['admin_toolbar_tools.config.import'] = [
- 'title' => t('Import'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'config.import_full',
- 'menu_name' => 'admin',
- 'parent' => 'config.sync',
- 'weight' => 1,
- ];
- $links['admin_toolbar_tools.config.export'] = [
- 'title' => t('Export'),
- 'provider' => 'admin_toolbar_tools',
- 'route_name' => 'config.export_full',
- 'menu_name' => 'admin',
- 'parent' => 'config.sync',
- 'weight' => 2,
- ];
- }
-
- $languageManager->setConfigOverrideLanguage($config_override_language);
-}
-
-/**
- * Return installed themes.
- *
- * @return array
- * An array of friendly theme names, keyed by the machine name.
- */
-function admin_toolbar_tools_installed_themes() {
- $themeHandler = \Drupal::service('theme_handler');
- $all_themes = $themeHandler->listInfo();
- $themes_installed = [];
- foreach ($all_themes as $key_theme => $theme) {
- if ($themeHandler->hasUi($key_theme)) {
- $themes_installed[$key_theme] = $themeHandler->getName($key_theme);
- }
- }
-
- return $themes_installed;
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.routing.yml b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.routing.yml
deleted file mode 100644
index dc081c860..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/admin_toolbar_tools.routing.yml
+++ /dev/null
@@ -1,80 +0,0 @@
-admin_toolbar_tools.flush:
- path: '/admin/flush'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushAll'
- _title: 'Flush all caches'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
-
-admin_toolbar_tools.cssjs:
- path: '/admin/flush/cssjs'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushJsCss'
- _title: 'Flush Css and Javascript'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
-
-admin_toolbar_tools.plugin:
- path: '/admin/flush/plugin'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushPlugins'
- _title: 'Plugin'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
-
-admin_toolbar_tools.flush_static:
- path: '/admin/flush/static-caches'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushStatic'
- _title: 'Static caches'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
-
-admin_toolbar_tools.flush_menu:
- path: '/admin/flush/menu'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushMenu'
- _title: 'Menu'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
-
-admin_toolbar_tools.flush_rendercache:
- path: '/admin/flush/rendercache'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::cacheRender'
- _title: 'Render cache'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
-
-admin_toolbar_tools.flush_views:
- path: '/admin/flush/views'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushViews'
- _title: 'Views'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
-
-admin_toolbar_tools.flush_twig:
- path: '/admin/flush/twig'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::flushTwig'
- _title: 'Twig'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
-
-admin_toolbar.run.cron:
- path: '/run-cron'
- defaults:
- _controller: '\Drupal\admin_toolbar_tools\Controller\ToolbarController::runCron'
- _title: 'Run cron'
- requirements:
- _permission: 'administer site configuration'
- _csrf_token: 'TRUE'
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/composer.json b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/composer.json
deleted file mode 100644
index 41366480f..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/composer.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "name": "drupal/admin_toolbar_tools",
- "description": "Adds menu links to the Admin Toolbar.",
- "type": "drupal-module",
- "keywords": ["Drupal", "Toolbar"],
- "homepage": "http://drupal.org/project/admin_toolbar",
- "license": "GPL-2.0+",
- "authors": [
- {
- "name": "Wilfrid Roze (eme)",
- "homepage": "https://www.drupal.org/u/eme",
- "role": "Maintainer"
- },
- {
- "name": "Romain Jarraud (romainj)",
- "homepage": "https://www.drupal.org/u/romainj",
- "role": "Maintainer"
- },
- {
- "name": "Adrian Cid Almaguer (adriancid)",
- "email": "adriancid@gmail.com",
- "homepage": "https://www.drupal.org/u/adriancid",
- "role": "Maintainer"
- },
- {
- "name": "Mohamed Anis Taktak (matio89)",
- "homepage": "https://www.drupal.org/u/matio89",
- "role": "Maintainer"
- }
- ],
- "support": {
- "issues": "https://www.drupal.org/project/issues/admin_toolbar",
- "source": "http://cgit.drupalcode.org/admin_toolbar"
- },
- "require": {
- "drupal/admin_toolbar": "^1",
- "drupal/core": "~8.5"
- }
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/css/tools.css b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/css/tools.css
deleted file mode 100644
index a40a8a4f3..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/css/tools.css
+++ /dev/null
@@ -1,16 +0,0 @@
-.toolbar-icon-admin-toolbar-tools-help {
- text-indent: -9999px;
-}
-
-.toolbar-icon-admin-toolbar-tools-help:before {
- background-image: url(../misc/icons/ffffff/d8-item.svg);
- padding-bottom: 0;
- padding-left: 4px;
- padding-right: 8px;
- padding-top: 2px;
-}
-
-.toolbar-icon-admin-toolbar-tools-help:active:before,
-.toolbar-icon-admin-toolbar-tools-help.active:before {
- background-image: url(../misc/icons/ffffff/d8-item.svg);
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg
deleted file mode 100644
index 40ffae371..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/misc/icons/ffffff/d8-item.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php
deleted file mode 100644
index a8758628a..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/src/Controller/ToolbarController.php
+++ /dev/null
@@ -1,249 +0,0 @@
-cron = $cron;
- $this->menuLinkManager = $menuLinkManager;
- $this->contextualLinkManager = $contextualLinkManager;
- $this->localTaskLinkManager = $localTaskLinkManager;
- $this->localActionLinkManager = $localActionLinkManager;
- $this->cacheRender = $cacheRender;
- $this->time = $time;
- $this->requestStack = $request_stack;
- $this->pluginCacheClearer = $plugin_cache_clearer;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('cron'),
- $container->get('plugin.manager.menu.link'),
- $container->get('plugin.manager.menu.contextual_link'),
- $container->get('plugin.manager.menu.local_task'),
- $container->get('plugin.manager.menu.local_action'),
- $container->get('cache.render'),
- $container->get('datetime.time'),
- $container->get('request_stack'),
- $container->get('plugin.cache_clearer')
- );
- }
-
- /**
- * Reload the previous page.
- */
- public function reloadPage() {
- $request = $this->requestStack->getCurrentRequest();
- if ($request->server->get('HTTP_REFERER')) {
- return $request->server->get('HTTP_REFERER');
- }
- else {
- return '/';
- }
- }
-
- /**
- * Flushes all caches.
- */
- public function flushAll() {
- $this->messenger()->addMessage($this->t('All caches cleared.'));
- drupal_flush_all_caches();
- return new RedirectResponse($this->reloadPage());
- }
-
- /**
- * Flushes css and javascript caches.
- */
- public function flushJsCss() {
- $this->state()
- ->set('system.css_js_query_string', base_convert($this->time->getCurrentTime(), 10, 36));
- $this->messenger()->addMessage($this->t('CSS and JavaScript cache cleared.'));
- return new RedirectResponse($this->reloadPage());
- }
-
- /**
- * Flushes plugins caches.
- */
- public function flushPlugins() {
- $this->pluginCacheClearer->clearCachedDefinitions();
- $this->messenger()->addMessage($this->t('Plugins cache cleared.'));
- return new RedirectResponse($this->reloadPage());
- }
-
- /**
- * Resets all static caches.
- */
- public function flushStatic() {
- drupal_static_reset();
- $this->messenger()->addMessage($this->t('Static cache cleared.'));
- return new RedirectResponse($this->reloadPage());
- }
-
- /**
- * Clears all cached menu data.
- */
- public function flushMenu() {
- menu_cache_clear_all();
- $this->menuLinkManager->rebuild();
- $this->contextualLinkManager->clearCachedDefinitions();
- $this->localTaskLinkManager->clearCachedDefinitions();
- $this->localActionLinkManager->clearCachedDefinitions();
- $this->messenger()->addMessage($this->t('Routing and links cache cleared.'));
- return new RedirectResponse($this->reloadPage());
- }
-
- /**
- * Clears all cached views data.
- */
- public function flushViews() {
- views_invalidate_cache();
- $this->messenger()->addMessage($this->t('Views cache cleared.'));
- return new RedirectResponse($this->reloadPage());
- }
-
- /**
- * Clears the twig cache.
- */
- public function flushTwig() {
- // @todo Update once Drupal 8.6 will be released.
- // @see https://www.drupal.org/node/2908461
- PhpStorageFactory::get('twig')->deleteAll();
- $this->messenger()->addMessage($this->t('Twig cache cleared.'));
- return new RedirectResponse($this->reloadPage());
- }
-
- /**
- * Run the cron.
- */
- public function runCron() {
- $this->cron->run();
- $this->messenger()->addMessage($this->t('Cron ran successfully.'));
- return new RedirectResponse($this->reloadPage());
- }
-
- /**
- * Clear the rendered cache.
- */
- public function cacheRender() {
- $this->cacheRender->invalidateAll();
- $this->messenger()->addMessage($this->t('Render cache cleared.'));
- return new RedirectResponse($this->reloadPage());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/tests/src/Functional/AdminToolbarToolsAlterTest.php b/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/tests/src/Functional/AdminToolbarToolsAlterTest.php
deleted file mode 100644
index f61329c63..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/admin_toolbar_tools/tests/src/Functional/AdminToolbarToolsAlterTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-adminUser = $this->drupalCreateUser([
- 'access toolbar',
- 'access administration pages',
- 'administer site configuration',
- ]);
- $this->drupalLogin($this->adminUser);
- }
-
- /**
- * Tests for the hover of sub menus.
- */
- public function testAdminToolbarTools() {
- // Assert that special menu items are present in the HTML.
- $this->assertRaw('class="toolbar-icon toolbar-icon-admin-toolbar-tools-flush"');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/composer.json b/sites/all/modules/contrib/admin/admin_toolbar/composer.json
deleted file mode 100644
index a97caac9b..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/composer.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "name": "drupal/admin_toolbar",
- "description": "Provides a drop-down menu interface to the core Drupal Toolbar.",
- "type": "drupal-module",
- "keywords": ["Drupal", "Toolbar"],
- "homepage": "http://drupal.org/project/admin_toolbar",
- "license": "GPL-2.0+",
- "authors": [
- {
- "name": "Wilfrid Roze (eme)",
- "homepage": "https://www.drupal.org/u/eme",
- "role": "Maintainer"
- },
- {
- "name": "Romain Jarraud (romainj)",
- "homepage": "https://www.drupal.org/u/romainj",
- "role": "Maintainer"
- },
- {
- "name": "Adrian Cid Almaguer (adriancid)",
- "email": "adriancid@gmail.com",
- "homepage": "https://www.drupal.org/u/adriancid",
- "role": "Maintainer"
- },
- {
- "name": "Mohamed Anis Taktak (matio89)",
- "homepage": "https://www.drupal.org/u/matio89",
- "role": "Maintainer"
- }
- ],
- "support": {
- "issues": "https://www.drupal.org/project/issues/admin_toolbar",
- "source": "http://cgit.drupalcode.org/admin_toolbar"
- }
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/css/admin.toolbar.css b/sites/all/modules/contrib/admin/admin_toolbar/css/admin.toolbar.css
deleted file mode 100644
index d848b90ef..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/css/admin.toolbar.css
+++ /dev/null
@@ -1,211 +0,0 @@
-.toolbar-tray-horizontal .menu-item:hover {
- background: #fff;
-}
-
-.toolbar-tray-horizontal .menu-item a:focus {
- background: #abeae4;
-}
-
-.toolbar-tray-horizontal .toolbar-menu:not(:first-child) li.menu-item--expanded > a:focus {
- background-position: center right;
- background-image: url('../misc/icons/0074bd/chevron-right.svg');
- background-repeat: no-repeat;
-}
-
-.toolbar-tray-horizontal .menu-item--expanded .menu {
- background: #fff;
- width: auto;
- height: auto;
-}
-
-.toolbar-tray-horizontal .menu-item--expanded {
- background-color: #f5f5f2;
-}
-
-.toolbar-tray-horizontal ul li li.menu-item {
- border-top: none transparent;
- border-right: 1px solid #dddddd;
- border-bottom: 1px solid #dddddd;
- border-left: 1px solid #dddddd;
-}
-
-.toolbar .toolbar-tray-horizontal .menu-item:last-child {
- border-left: 1px solid #dddddd;
- border-right: 1px solid #dddddd;
-}
-
-.toolbar .toolbar-tray-horizontal ul ul li.menu-item:first-child {
- border-top: 1px solid #dddddd;
-}
-
-.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul,
-.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul,
-.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul ul,
-.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul ul ul {
- display: none;
- left: -999em; /* LTR */
-}
-
-/* Lists nested under hovered list items */
-.toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul,
-.toolbar-tray-horizontal li li.menu-item--expanded.hover-intent ul,
-.toolbar-tray-horizontal li li li.menu-item--expanded.hover-intent ul,
-.toolbar-tray-horizontal li li li li.menu-item--expanded.hover-intent ul,
-.toolbar-tray-horizontal li li li li li.menu-item--expanded.hover-intent ul {
- display: block;
- left: auto; /* LTR */
-}
-
-.toolbar-tray-horizontal .menu ul li a,
-.toolbar-tray-horizontal .menu ul .toolbar-icon {
- padding: 12px 15px 12px 12px;
-}
-
-.toolbar-tray-horizontal ul li.menu-item--expanded.hover-intent ul {
- display: block;
- position: absolute;
- width: 200px;
- box-shadow: 2px 2px 3px hsla(0, 0%, 0%, 0.4);
- z-index: 1;
-}
-
-.toolbar-tray-horizontal ul li.menu-item--expanded .menu-item > ul {
- display: none;
-}
-
-.toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded {
- background-position: center right;
- background-image: url('../misc/icons/0074bd/chevron-right.svg');
- background-repeat: no-repeat;
-}
-
-.toolbar-tray-horizontal ul li.menu-item--expanded .menu-item.hover-intent ul {
- display: block;
- margin: -40px 0 0 197px;
-}
-
-.toolbar-tray-horizontal li:hover ul li {
- float: none;
-}
-
-.toolbar-tray-horizontal li.hover-intent ul li {
- float: none;
-}
-
-.toolbar-tray-horizontal .toolbar .level-2 > ul {
- position: absolute;
- padding-top: 0;
- top: 0;
- left: 200px;
- width: 200px;
-}
-
-.toolbar .toolbar-tray-vertical li.open > ul.toolbar-menu.clearfix {
- display: block;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal .menu-item:hover {
- background: #fff;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal .menu-item a:focus {
- background: #abeae4;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal .toolbar-menu:not(:first-child) li.menu-item--expanded > a:focus {
- background-position: center right;
- background-image: url('../misc/icons/0074bd/chevron-right.svg');
- background-repeat: no-repeat;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal .menu-item--expanded .menu {
- background: #fff;
- width: auto;
- height: auto;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal .menu-item--expanded {
- background-color: #f5f5f2;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal ul li li.menu-item {
- border-top: none transparent;
- border-right: 1px solid #dddddd;
- border-bottom: 1px solid #dddddd;
- border-left: 1px solid #dddddd;
-}
-
-[dir="rtl"] .toolbar .toolbar-tray-horizontal .menu-item:last-child {
- border-left: 1px solid #dddddd;
- border-right: 1px solid #dddddd;
-}
-
-[dir="rtl"] .toolbar .toolbar-tray-horizontal ul ul li.menu-item:first-child {
- border-top: 1px solid #dddddd;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul,
-[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul,
-[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul ul,
-[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul ul ul ul ul {
- display: none;
- left: -999em; /* LTR */
-}
-
-/* Lists nested under hovered list items */
-[dir="rtl"] .toolbar-tray-horizontal li.menu-item--expanded.hover-intent ul,
-[dir="rtl"] .toolbar-tray-horizontal li li.menu-item--expanded.hover-intent ul,
-[dir="rtl"] .toolbar-tray-horizontal li li li.menu-item--expanded.hover-intent ul,
-[dir="rtl"] .toolbar-tray-horizontal li li li li.menu-item--expanded.hover-intent ul,
-[dir="rtl"] .toolbar-tray-horizontal li li li li li.menu-item--expanded.hover-intent ul {
- display: block;
- left: auto; /* LTR */
-}
-
-[dir="rtl"] .toolbar-tray-horizontal .menu ul li a,
-[dir="rtl"] .toolbar-tray-horizontal .menu ul .toolbar-icon {
- padding: 12px 15px 12px 12px;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal ul li.menu-item--expanded.hover-intent ul {
- display: block;
- position: absolute;
- width: 200px;
- box-shadow: 2px 2px 3px hsla(0, 0%, 0%, 0.4);
- z-index: 1;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal ul li.menu-item--expanded .menu-item > ul {
- display: none;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded {
- background-position: center left;
- background-image: url('../misc/icons/0074bd/chevron-left.svg');
- background-repeat: no-repeat;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal ul li.menu-item--expanded .menu-item.hover-intent ul {
- display: block;
- margin: -40px 197px 0 0;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal li:hover ul li {
- float: none;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal li.hover-intent ul li {
- float: none;
-}
-
-[dir="rtl"] .toolbar-tray-horizontal .toolbar .level-2 > ul {
- position: absolute;
- padding-top: 0;
- top: 0;
- left: 200px;
- width: 200px;
-}
-
-[dir="rtl"] .toolbar .toolbar-tray-vertical li.open > ul.toolbar-menu.clearfix {
- display: block;
-}
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/js/admin_toolbar.js b/sites/all/modules/contrib/admin/admin_toolbar/js/admin_toolbar.js
deleted file mode 100644
index 96dfa829a..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/js/admin_toolbar.js
+++ /dev/null
@@ -1,53 +0,0 @@
-(function ($, Drupal) {
- Drupal.behaviors.adminToolbar = {
- attach: function (context, settings) {
-
- $('a.toolbar-icon', context).removeAttr('title');
-
- $('.toolbar-tray li.menu-item--expanded, .toolbar-tray ul li.menu-item--expanded .menu-item', context).hoverIntent({
- over: function () {
- // At the current depth, we should delete all "hover-intent" classes.
- // Other wise we get unwanted behaviour where menu items are expanded while already in hovering other ones.
- $(this).parent().find('li').removeClass('hover-intent');
- $(this).addClass('hover-intent');
- },
- out: function () {
- $(this).removeClass('hover-intent');
- },
- timeout: 250
- });
-
- // Make the toolbar menu navigable with keyboard.
- $('ul.toolbar-menu li.menu-item--expanded a', context).on('focusin', function () {
- $('li.menu-item--expanded', context).removeClass('hover-intent');
- $(this).parents('li.menu-item--expanded').addClass('hover-intent');
- });
-
- $('ul.toolbar-menu li.menu-item a', context).keydown(function (e) {
- if ((e.shiftKey && (e.keyCode || e.which) == 9)) {
- if ($(this).parent('.menu-item').prev().hasClass('menu-item--expanded')) {
- $(this).parent('.menu-item').prev().addClass('hover-intent');
- }
- }
- });
-
- $('.toolbar-menu:first-child > .menu-item:not(.menu-item--expanded) a, .toolbar-tab > a', context).on('focusin', function () {
- $('.menu-item--expanded').removeClass('hover-intent');
- });
-
- $('.toolbar-menu:first-child > .menu-item', context).on('hover', function () {
- $(this, 'a').css("background: #fff;");
- });
-
- $('ul:not(.toolbar-menu)', context).on({
- mousemove: function () {
- $('li.menu-item--expanded').removeClass('hover-intent');
- },
- hover: function () {
- $('li.menu-item--expanded').removeClass('hover-intent');
- }
- });
-
- }
- };
-})(jQuery, Drupal);
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/js/jquery.hoverIntent.js b/sites/all/modules/contrib/admin/admin_toolbar/js/jquery.hoverIntent.js
deleted file mode 100644
index 1afc5e605..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/js/jquery.hoverIntent.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/*!
- * hoverIntent v1.8.1 // 2014.08.11 // jQuery v1.9.1+
- * http://briancherne.github.io/jquery-hoverIntent/
- *
- * You may use hoverIntent under the terms of the MIT license. Basically that
- * means you are free to use hoverIntent as long as this header is left intact.
- * Copyright 2007, 2014 Brian Cherne
- */
-
-/* hoverIntent is similar to jQuery's built-in "hover" method except that
- * instead of firing the handlerIn function immediately, hoverIntent checks
- * to see if the user's mouse has slowed down (beneath the sensitivity
- * threshold) before firing the event. The handlerOut function is only
- * called after a matching handlerIn.
- *
- * // basic usage ... just like .hover()
- * .hoverIntent( handlerIn, handlerOut )
- * .hoverIntent( handlerInOut )
- *
- * // basic usage ... with event delegation!
- * .hoverIntent( handlerIn, handlerOut, selector )
- * .hoverIntent( handlerInOut, selector )
- *
- * // using a basic configuration object
- * .hoverIntent( config )
- *
- * @param handlerIn function OR configuration object
- * @param handlerOut function OR selector for delegation OR undefined
- * @param selector selector OR undefined
- * @author Brian Cherne
- */
-
-;(function(factory) {
- 'use strict';
- if (typeof define === 'function' && define.amd) {
- define(['jquery'], factory);
- } else if (jQuery && !jQuery.fn.hoverIntent) {
- factory(jQuery);
- }
-})(function($) {
- 'use strict';
-
- // default configuration values
- var _cfg = {
- interval: 100,
- sensitivity: 6,
- timeout: 0
- };
-
- // counter used to generate an ID for each instance
- var INSTANCE_COUNT = 0;
-
- // current X and Y position of mouse, updated during mousemove tracking (shared across instances)
- var cX, cY;
-
- // saves the current pointer position coordinates based on the given mousemove event
- var track = function(ev) {
- cX = ev.pageX;
- cY = ev.pageY;
- };
-
- // compares current and previous mouse positions
- var compare = function(ev,$el,s,cfg) {
- // compare mouse positions to see if pointer has slowed enough to trigger `over` function
- if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) {
- $el.off(s.event,track);
- delete s.timeoutId;
- // set hoverIntent state as active for this element (permits `out` handler to trigger)
- s.isActive = true;
- // overwrite old mouseenter event coordinates with most recent pointer position
- ev.pageX = cX; ev.pageY = cY;
- // clear coordinate data from state object
- delete s.pX; delete s.pY;
- return cfg.over.apply($el[0],[ev]);
- } else {
- // set previous coordinates for next comparison
- s.pX = cX; s.pY = cY;
- // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
- s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval );
- }
- };
-
- // triggers given `out` function at configured `timeout` after a mouseleave and clears state
- var delay = function(ev,$el,s,out) {
- delete $el.data('hoverIntent')[s.id];
- return out.apply($el[0],[ev]);
- };
-
- $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
- // instance ID, used as a key to store and retrieve state information on an element
- var instanceId = INSTANCE_COUNT++;
-
- // extend the default configuration and parse parameters
- var cfg = $.extend({}, _cfg);
- if ( $.isPlainObject(handlerIn) ) {
- cfg = $.extend(cfg, handlerIn);
- if ( !$.isFunction(cfg.out) ) {
- cfg.out = cfg.over;
- }
- } else if ( $.isFunction(handlerOut) ) {
- cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
- } else {
- cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
- }
-
- // A private function for handling mouse 'hovering'
- var handleHover = function(e) {
- // cloned event to pass to handlers (copy required for event object to be passed in IE)
- var ev = $.extend({},e);
-
- // the current target of the mouse event, wrapped in a jQuery object
- var $el = $(this);
-
- // read hoverIntent data from element (or initialize if not present)
- var hoverIntentData = $el.data('hoverIntent');
- if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); }
-
- // read per-instance state from element (or initialize if not present)
- var state = hoverIntentData[instanceId];
- if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; }
-
- // state properties:
- // id = instance ID, used to clean up data
- // timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler
- // isActive = plugin state, true after `over` is called just until `out` is called
- // pX, pY = previously-measured pointer coordinates, updated at each polling interval
- // event = string representing the namespaced event used for mouse tracking
-
- // clear any existing timeout
- if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); }
-
- // namespaced event used to register and unregister mousemove tracking
- var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId;
-
- // handle the event, based on its type
- if (e.type === 'mouseenter') {
- // do nothing if already active
- if (state.isActive) { return; }
- // set "previous" X and Y position based on initial entry point
- state.pX = ev.pageX; state.pY = ev.pageY;
- // update "current" X and Y position based on mousemove
- $el.off(mousemove,track).on(mousemove,track);
- // start polling interval (self-calling timeout) to compare mouse coordinates over time
- state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval );
- } else { // "mouseleave"
- // do nothing if not already active
- if (!state.isActive) { return; }
- // unbind expensive mousemove event
- $el.off(mousemove,track);
- // if hoverIntent state is true, then call the mouseOut function after the specified delay
- state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout );
- }
- };
-
- // listen for mouseenter and mouseleave
- return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
- };
-});
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-left.svg b/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-left.svg
deleted file mode 100644
index 122e1c099..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-left.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-right.svg b/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-right.svg
deleted file mode 100644
index b16a8ce89..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/0074bd/chevron-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/ffffff/chevron-right.svg b/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/ffffff/chevron-right.svg
deleted file mode 100644
index b16a8ce89..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/misc/icons/ffffff/chevron-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/admin_toolbar/tests/src/Functional/AdminToolbarAlterTest.php b/sites/all/modules/contrib/admin/admin_toolbar/tests/src/Functional/AdminToolbarAlterTest.php
deleted file mode 100644
index 1403688d3..000000000
--- a/sites/all/modules/contrib/admin/admin_toolbar/tests/src/Functional/AdminToolbarAlterTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-adminUser = $this->drupalCreateUser([
- 'access toolbar',
- 'access administration pages',
- ]);
- $this->drupalLogin($this->adminUser);
- }
-
- /**
- * Tests for a the hover of sub menus.
- */
- public function testAdminToolbar() {
- // Assert that expanded links are present in the HTML.
- $this->assertRaw('class="toolbar-icon toolbar-icon-user-admin-index"');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/LICENSE.txt b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/README.txt b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/README.txt
deleted file mode 100644
index cdec2ca9d..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/README.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-This module is inspired by "Adminimal Administration Menu". It provides a
-minimalist style to the "Admin Toolbar" module.
-
-Although "Adminimal" provides menu styling, there some conflicts with Admin
-toolbar and styling will only be present when the admin theme is present.
-
-For this reason it makes the most sense to put this styling in a module rather
-than the theme.
-
-
-Installation
-------------
-
-By downloading and enabling this module styling will be applied.
-
-
-Dependencies
-------------
-
-- admin_toolbar
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.info.yml b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.info.yml
deleted file mode 100644
index 71b40e1d2..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: Adminimal Admin Toolbar
-# core: 8.x
-description: Adminimal styling brought to admin toolbar.
-package: Administration
-type: module
-dependencies:
- - admin_toolbar
-
-# Information added by Drupal.org packaging script on 2017-07-25
-version: '8.x-1.5'
-core: '8.x'
-project: 'adminimal_admin_toolbar'
-datestamp: 1500955448
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.libraries.yml b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.libraries.yml
deleted file mode 100644
index c7bbc00ae..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.libraries.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-adminimal-admin-toolbar:
- version: VERSION
- css:
- theme:
- css/adminimal_admin_toolbar.css: {}
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.module b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.module
deleted file mode 100644
index 526951bf8..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/adminimal_admin_toolbar.module
+++ /dev/null
@@ -1,48 +0,0 @@
-hasPermission('access toolbar');
-}
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/composer.json b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/composer.json
deleted file mode 100644
index f8fd7cdab..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/composer.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "drupal/adminimal_admin_toolbar",
- "description": "Adminimal styling brought to admin toolbar.",
- "type": "drupal-module",
- "homepage": "https://www.drupal.org/project/adminimal_admin_toolbar",
- "authors": [{
- "name": "Ted Slesinski",
- "homepage": "https://www.drupal.org/u/energee"
- }],
- "support": {
- "issues": "https://www.drupal.org/project/issues/adminimal_admin_toolbar"
- },
- "license": "GPL-2.0+",
- "repositories": [{
- "type": "package",
- "package": {
- "name": "drupal/adminimal_admin_toolbar",
- "version": "8.0.0",
- "type": "drupal-module",
- "source": {
- "url": "https://git.drupal.org/project/adminimal_admin_toolbar.git",
- "type": "git",
- "reference": "refs/heads/8.x-1.x"
- }
- }
- }]
-}
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/css/adminimal_admin_toolbar.css b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/css/adminimal_admin_toolbar.css
deleted file mode 100644
index 0e6b7230b..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/css/adminimal_admin_toolbar.css
+++ /dev/null
@@ -1,440 +0,0 @@
-/* Import the Open Sans webfont from Google CDN */
-@font-face {
- font-family: 'Open Sans';
- font-style: normal;
- font-weight: 300;
- src: local('Open Sans Light'), local('OpenSans-Light'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTRsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
-}
-@font-face {
- font-family: 'Open Sans';
- font-style: normal;
- font-weight: 400;
- src: local('Open Sans'), local('OpenSans'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/uYKcPVoh6c5R0NpdEY5A-Q.woff) format('woff');
-}
-@font-face {
- font-family: 'Open Sans';
- font-style: normal;
- font-weight: 600;
- src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/MTP_ySUJH_bn48VBG8sNShsxEYwM7FgeyaSgU71cLG0.woff) format('woff');
-}
-
-.adminimal-admin-toolbar .toolbar {
- font-family: "Open Sans";
-}
-
-.adminimal-admin-toolbar .toolbar a {
- transition: all, 0.2s;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-bar {
- box-shadow: none;
- background-color: #2d2d2d;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-menu {
- background: #333;
-}
-
-.adminimal-admin-toolbar .toolbar-tray .toolbar-menu a {
- background: transparent;
- color: #ccc;
-}
-
-.adminimal-admin-toolbar .toolbar-tray .toolbar-menu li {
- background: #333;
-}
-
-.adminimal-admin-toolbar .toolbar-tray ul li.menu-item {
- border: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal ul ul li.menu-item:first-child {
- border: none;
-}
-
-.adminimal-admin-toolbar .toolbar-oriented .user-toolbar-tab {
- float: right;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical {
- border: none;
- box-shadow: none;
-}
-
-.adminimal-admin-toolbar .toolbar-tray a {
- background: #2d2d2d;
- color: #bbb;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal a:hover,
-.adminimal-admin-toolbar .toolbar-tray-horizontal a:active,
-.adminimal-admin-toolbar .toolbar-tray-horizontal a:focus {
- background: #0084d7;
- color: #fff;
- text-decoration: none;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover > a,
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover > .toolbar-box > a {
- background: #0084d7;
- color: #fff !important;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-tab > .toolbar-item {
- font-weight: 600;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-item {
- color: #bebebe;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-tab > .toolbar-item:hover {
- background-image: none;
- background-color: #2d2d2d;
- color: #fff;
- text-decoration: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-tab > .toolbar-item.is-active,
-.adminimal-admin-toolbar .toolbar .toolbar-bar .toolbar-tab > .toolbar-item:focus {
- background-image: none;
- background-color: #333;
- text-decoration: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .menu-item + .menu-item,
-[dir="rtl"] .adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .menu-item + .menu-item,
-.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .menu-item:last-child {
- border-left: none; /* LTR */
- border-right: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray .menu-item--active-trail > .toolbar-box a,
-.adminimal-admin-toolbar .toolbar .toolbar-tray a.is-active {
- color: inherit;
- text-decoration: none;
- font-weight: bold;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .menu-item + .menu-item {
- border: 0 none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray {
- background-color: #333;
- box-shadow: -2px 2px 12px rgba(0,0,0,0.85);
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal {
- border-bottom: 1px solid #333;
- box-shadow: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-toggle-orientation {
- background-color: #333;
-}
-
-.toolbar .toolbar-icon:before {
- transition: .25s;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-icon.toolbar-handle:focus {
- background-color: transparent;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-icon.toolbar-handle:before {
- background-image: url(../images/acacac/chevron-outline-disc-down.svg);
- transition: .25s;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-icon.toolbar-handle.open:before {
- background-image: url(../images/ffcfcf/chevron-outline-disc-close.svg) !important;
- transform: rotate(180deg);
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle:before {
- background-image: url(../images/acacac/chevron-outline-disc-down.svg);
- background-size: 100%;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-icon.toolbar-handle:hover:before,
-.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle:hover:before,
-.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-box:hover .toolbar-icon.toolbar-handle:before {
- background-image: url(../images/ffffff/chevron-outline-disc-down.svg);
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu .toolbar-icon.toolbar-handle.open:before,
-.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-box:hover .toolbar-icon.toolbar-handle.open:before {
- background-image: url(../images/ffffff/chevron-outline-disc-close.svg);
- background-size: 100%;
-}
-
-.adminimal-admin-toolbar .level-1 .toolbar-handle.open,
-.adminimal-admin-toolbar .toolbar-tray-vertical .level-2 {
- background: #3b3b3b !important;
-}
-
-.adminimal-admin-toolbar .level-2 .toolbar-handle.open,
-.adminimal-admin-toolbar .toolbar-tray-vertical .level-3 {
- background: #434343 !important;
-}
-
-.adminimal-admin-toolbar .level-3 .toolbar-handle.open,
-.adminimal-admin-toolbar .toolbar-tray-vertical .level-4 {
- background: #4c4c4c !important;
-}
-
-.adminimal-admin-toolbar .level-4 .toolbar-handle.open,
-.adminimal-admin-toolbar .toolbar-tray-vertical .level-5 {
- background: #545454 !important;
-}
-
-/* For WCAG, we are lightening the text on this tier. */
-.adminimal-admin-toolbar .toolbar .level-3 a,
-.adminimal-admin-toolbar .toolbar .level-4 a {
- color: #d5d5d5 !important;
-}
-
-.adminimal-admin-toolbar .toolbar-handle.open {
- border-top-left-radius: 10px;
-}
-
-.toolbar .toolbar-tray-vertical .level-3 ul {
- margin-left: 0 !important;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-vertical .level-3 a {
- padding-left: 2.75em !important;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal a:focus,
-.adminimal-admin-toolbar .toolbar-box a:focus {
- background: #333;
- text-decoration: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .toolbar-menu a {
- color: #bbb;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .toolbar-menu a:hover,
-.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .toolbar-menu a:focus {
- color: #fff;
- background: #0084d7;
- text-decoration: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-vertical .toolbar-menu ul ul {
- border: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .toolbar-toggle-orientation {
- border: none;
-}
-
-.adminimal-admin-toolbar .toolbar .menu-item:hover {
- background-color: #333;
-}
-
-.adminimal-admin-toolbar .toolbar .menu-item:focus {
- background: #abeae4;
-}
-
-.adminimal-admin-toolbar .toolbar .menu-item--expanded {
- background-color: #333;
-}
-.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded,
-[dir="rtl"] .adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded {
- background-image: none;
- position: relative;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .toolbar-menu ul .toolbar-icon {
- padding: 1em 12px;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded .menu-item:hover ul {
- margin: -39px 0 0 200px;
-}
-[dir="rtl"] .adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded .menu-item:hover ul {
- margin: -39px 200px 0 0;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded:after {
- color: #8eacc0;
- content: url(../images/0084d7/chevron-right.svg);
- font-size: 16px;
- pointer-events: none;
- position: absolute;
- right: 5px;
- top: 50%;
- transform: translateY(-8px);
- transition: all .2s;
-}
-
-[dir="rtl"] .adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded:after {
- right: auto;
- left: 5px;
- top: 30%;
- -moz-transform: scaleX(-1);
- -o-transform: scaleX(-1);
- -webkit-transform: scaleX(-1);
- transform: scaleX(-1);
- filter: FlipH;
- -ms-filter: "FlipH";
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded:hover:after {
- content: url(../images/ffffff/chevron-right.svg);
- transform: translate(6px, -8px);
-}
-
-[dir="rtl"] .adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item--expanded ul li.menu-item--expanded:hover:after {
- transform-origin: 40% top;
- -moz-transform: scaleX(-1);
- -o-transform: scaleX(-1);
- -webkit-transform: scaleX(-1);
- transform: scaleX(-1);
- filter: FlipH;
- -ms-filter: "FlipH";
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu a {
- color: #bbb;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-menu .toolbar-menu a:hover {
- color: #fff;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal ul li.menu-item {
- border-top: none transparent;
- border-right: none;
- border-bottom: none;
- border-left: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal .menu-item:last-child {
- border-left: none;
- border-right: none;
-}
-
-.adminimal-admin-toolbar .toolbar .toolbar-tray-horizontal ul ul li.menu-item:first-child {
- border-top: 1px solid #0084d7;
-}
-
-/* Removes border top on next consecutive lists after first */
-.adminimal-admin-toolbar .toolbar-tray-horizontal ul ul li li.menu-item:first-child {
- border-top: none !important;
-}
-
-/* Main menu icons. */
-.adminimal-admin-toolbar .toolbar-icon-admin-toolbar-tools-help:before {
- background-image: url(../images/acacac/drupal-8.svg);
- margin-left: 7px;
- padding: 0px;
-}
-
-.adminimal-admin-toolbar .toolbar-tray-vertical .toolbar-icon-admin-toolbar-tools-help:before {
- margin-left: 0;
-}
-
-.adminimal-admin-toolbar .toolbar-icon-system-admin-content:before {
- background-image: url(../images/acacac/file.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-icon-system-admin-structure:before {
- background-image: url(../images/acacac/orgchart.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-icon-system-themes-page:before {
- background-image: url(../images/acacac/paintbrush.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-icon-entity-user-collection:before {
- background-image: url(../images/acacac/people.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-icon-system-modules-list:before {
- background-image: url(../images/acacac/puzzlepiece.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-icon-system-admin-config:before {
- background-image: url(../images/acacac/wrench.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-icon-system-admin-reports:before {
- background-image: url(../images/acacac/barchart.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-icon-help-main:before {
- background-image: url(../images/acacac/questionmark-disc.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-admin-toolbar-tools-help:before,
-.adminimal-admin-toolbar .toolbar-icon-admin-toolbar-tools-help:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-admin-toolbar-tools-help:active:before,
-.adminimal-admin-toolbar .toolbar-icon-admin-toolbar-tools-help.is-active:before {
- background-image: url(../images/ffffff/drupal-8.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-admin-content:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-content:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-content:active:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-content.is-active:before {
- background-image: url(../images/ffffff/file.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-admin-structure:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-structure:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-structure:active:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-structure.is-active:before {
- background-image: url(../images/ffffff/orgchart.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-themes-page:before,
-.adminimal-admin-toolbar .toolbar-icon-system-themes-page:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-system-themes-page:active:before,
-.adminimal-admin-toolbar .toolbar-icon-system-themes-page.is-active:before {
- background-image: url(../images/ffffff/paintbrush.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-entity-user-collection:before,
-.adminimal-admin-toolbar .toolbar-icon-entity-user-collection:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-entity-user-collection:active:before,
-.adminimal-admin-toolbar .toolbar-icon-entity-user-collection.is-active:before {
- background-image: url(../images/ffffff/people.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-modules-list:before,
-.adminimal-admin-toolbar .toolbar-icon-system-modules-list:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-system-modules-list:active:before,
-.adminimal-admin-toolbar .toolbar-icon-system-modules-list.is-active:before {
- background-image: url(../images/ffffff/puzzlepiece.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-admin-config:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-config:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-config:active:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-config.is-active:before {
- background-image: url(../images/ffffff/wrench.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-horizontal .menu-item--expanded:hover .toolbar-icon-system-admin-reports:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-reports:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-reports:active:before,
-.adminimal-admin-toolbar .toolbar-icon-system-admin-reports.is-active:before {
- background-image: url(../images/ffffff/barchart.svg);
-}
-
-.adminimal-admin-toolbar .menu-item--expanded:hover .toolbar-icon-help-main:before,
-.adminimal-admin-toolbar .toolbar-icon-help-main:hover:before,
-.adminimal-admin-toolbar .toolbar-icon-help-main:active:before,
-.adminimal-admin-toolbar .toolbar-icon-help-main.is-active:before {
- background-image: url(../images/ffffff/questionmark-disc.svg);
-}
-
-.adminimal-admin-toolbar .toolbar-tray-vertical .toolbar-icon-admin-toolbar-tools-help {
- text-indent: 0;
- transition: none;
-}
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/0084d7/chevron-right.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/0084d7/chevron-right.svg
deleted file mode 100644
index ae77eece2..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/0084d7/chevron-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/barchart.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/barchart.svg
deleted file mode 100644
index 826bbdce6..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/barchart.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-disc-down.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-disc-down.svg
deleted file mode 100644
index d87dae10a..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-disc-down.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close.svg
deleted file mode 100644
index 2c2d2e70d..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close0.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close0.svg
deleted file mode 100644
index 2c2d2e70d..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-close0.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down.svg
deleted file mode 100644
index 785450dbb..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down.svg
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down0.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down0.svg
deleted file mode 100644
index 785450dbb..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-outline-disc-down0.svg
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-right.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-right.svg
deleted file mode 100644
index 6b940d9fc..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/chevron-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/drupal-8.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/drupal-8.svg
deleted file mode 100644
index 832eba876..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/drupal-8.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/file.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/file.svg
deleted file mode 100644
index 6d6771448..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/file.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/orgchart.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/orgchart.svg
deleted file mode 100644
index ddea4e13f..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/orgchart.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/paintbrush.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/paintbrush.svg
deleted file mode 100644
index 445b3e0a7..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/paintbrush.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/pencil.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/pencil.svg
deleted file mode 100644
index a8040c41c..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/pencil.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/people.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/people.svg
deleted file mode 100644
index 09ad8f382..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/people.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/puzzlepiece.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/puzzlepiece.svg
deleted file mode 100644
index 56b2e6f02..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/puzzlepiece.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/questionmark-disc.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/questionmark-disc.svg
deleted file mode 100644
index a9b524445..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/questionmark-disc.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/wrench.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/wrench.svg
deleted file mode 100644
index 0e953b0b3..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/acacac/wrench.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffcfcf/chevron-outline-disc-close.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffcfcf/chevron-outline-disc-close.svg
deleted file mode 100644
index 20417c416..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffcfcf/chevron-outline-disc-close.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/barchart.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/barchart.svg
deleted file mode 100644
index 9c1555424..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/barchart.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-disc-down.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-disc-down.svg
deleted file mode 100644
index 17aeeb350..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-disc-down.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-close.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-close.svg
deleted file mode 100644
index 7ba4e0802..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-close.svg
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-down.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-down.svg
deleted file mode 100644
index ec9f71cdd..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-outline-disc-down.svg
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-right.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-right.svg
deleted file mode 100644
index f962b5cd1..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/chevron-right.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/drupal-8.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/drupal-8.svg
deleted file mode 100644
index 936bc6308..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/drupal-8.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/file.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/file.svg
deleted file mode 100644
index f157b9eac..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/file.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/orgchart.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/orgchart.svg
deleted file mode 100644
index 677f49857..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/orgchart.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/paintbrush.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/paintbrush.svg
deleted file mode 100644
index 117828eaa..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/paintbrush.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/pencil.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/pencil.svg
deleted file mode 100644
index 4e8c4af13..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/pencil.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/people.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/people.svg
deleted file mode 100644
index cea0beb75..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/people.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/puzzlepiece.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/puzzlepiece.svg
deleted file mode 100644
index a8f2f0df9..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/puzzlepiece.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/questionmark-disc.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/questionmark-disc.svg
deleted file mode 100644
index 8dda7dc29..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/questionmark-disc.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/wrench.svg b/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/wrench.svg
deleted file mode 100644
index 5c45e8033..000000000
--- a/sites/all/modules/contrib/admin/adminimal_admin_toolbar/images/ffffff/wrench.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sites/all/modules/contrib/admin/better_messages/LICENSE.txt b/sites/all/modules/contrib/admin/better_messages/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/better_messages/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.info.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.info.yml
deleted file mode 100644
index 6a8218fce..000000000
--- a/sites/all/modules/contrib/admin/better_messages/better_messages.info.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: Better Messages
-type: module
-description: This module adds simple functions to make Drupal messages look and act better.
-package: User interface
-# core: 8.x
-configure: better_messages.settings_form
-
-# Information added by Drupal.org packaging script on 2018-02-03
-version: '8.x-1.0-alpha2'
-core: '8.x'
-project: 'better_messages'
-datestamp: 1517663884
diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.libraries.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.libraries.yml
deleted file mode 100644
index 51abc8f89..000000000
--- a/sites/all/modules/contrib/admin/better_messages/better_messages.libraries.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-better_messages:
- version: 1.x
- css:
- theme:
- css/better_messages.css: {}
- js:
- js/better_messages.js: {}
- dependencies:
- - core/jquery
- - core/jquery.once
- - core/jquery.ui.draggable
- - core/jquery.ui.resizable
- - core/drupal
- - core/drupalSettings
diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.links.menu.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.links.menu.yml
deleted file mode 100644
index 0a7ca4f0b..000000000
--- a/sites/all/modules/contrib/admin/better_messages/better_messages.links.menu.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-better_messages.settings_form:
- title: 'Better Messages settings'
- description: 'Better handling of Drupal messages UI'
- route_name: better_messages.settings_form
- parent: system.admin_config_ui
diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.module b/sites/all/modules/contrib/admin/better_messages/better_messages.module
deleted file mode 100644
index 8d8290a4b..000000000
--- a/sites/all/modules/contrib/admin/better_messages/better_messages.module
+++ /dev/null
@@ -1,138 +0,0 @@
- [
- 'render element' => 'element',
- 'variables' => [
- 'children' => '',
- 'message_list' => [],
- ],
- ],
- ];
-}
-
-/**
- * Implements hook_element_info_alter().
- */
-function better_messages_element_info_alter(array &$info) {
- // Replace the default pre_render for status_messages with our custom one.
- $info['status_messages']['#pre_render'][0] = 'better_messages_status_messages_pre_render';
-}
-
-/**
- * Pre render callback for 'status_messages' render element.
- */
-function better_messages_status_messages_pre_render(array $element) {
- // The code below is heavily copied from StatusMessages::renderMessages().
- $element = [
- '#lazy_builder' => ['better_messages_status_messages_lazy_builder', [$element['#display']]],
- '#create_placeholder' => TRUE,
- ];
-
- // Directly create a placeholder as we need this to be placeholdered
- // regardless if this is a POST or GET request.
- // @todo remove this when https://www.drupal.org/node/2367555 lands.
- return \Drupal::service('render_placeholder_generator')->createPlaceholder($element);
-}
-
-/**
- * Lazy builder for 'status_messages'.
- *
- * Improved version of StatusMessages::renderMessages() that additionally wraps
- * the output into an overlay markup whenever necessary.
- *
- * @param string|null $type
- * Limit the messages returned by type. Defaults to NULL, meaning all types.
- * Passed on to drupal_get_messages(). These values are supported:
- * - NULL
- * - 'status'
- * - 'warning'
- * - 'error'
- *
- * @return array
- * A renderable array containing the messages.
- */
-function better_messages_status_messages_lazy_builder($type) {
- $render = \Drupal\Core\Render\Element\StatusMessages::renderMessages($type);
- if (!empty($render)) {
- $render['#theme_wrappers'][] = 'better_messages_wrapper';
- $render['#attached']['library'][] = 'better_messages/better_messages';
- $render['#attached']['drupalSettings']['better_messages'] = \Drupal::config('better_messages.settings')->get();
- }
-
- return $render;
-}
-
-/**
- * Preprocess for 'better_messages_wrapper' theme hook.
- */
-function template_preprocess_better_messages_wrapper(&$variables) {
- $settings = \Drupal::config('better_messages.settings');
- $cache = \Drupal\Core\Cache\CacheableMetadata::createFromRenderArray($variables);
- $cache->addCacheTags($settings->getCacheTags());
- $cache->addCacheContexts($settings->getCacheContexts());
- $cache->mergeCacheMaxAge($settings->getCacheMaxAge());
-
- // Inject the messages from $variables into our "better_messages" context
- // since now we have crossed beyond the point where "current" messages are
- // retrievable via drupal_get_messages().
- \Drupal::service('better_messages.context')->setMessages($variables['message_list']);
-
- /** @var \Drupal\Core\Condition\ConditionManager $condition_manager */
- $condition_manager = \Drupal::service('plugin.manager.condition');
- /** @var \Drupal\Core\Plugin\Context\ContextRepositoryInterface $context_repository */
- $context_repository = \Drupal::service('context.repository');
- /** @var \Drupal\Core\Plugin\Context\ContextHandlerInterface $context_handler */
- $context_handler = \Drupal::service('context.handler');
-
- $pass = TRUE;
- foreach ($settings->get('visibility') as $condition_id => $condition) {
- $condition = $condition_manager->createInstance($condition_id, $condition);
- if ($condition instanceof \Drupal\Core\Plugin\ContextAwarePluginInterface) {
- try {
- $contexts = $context_repository->getRuntimeContexts(array_values($condition->getContextMapping()));
- $context_handler->applyContextMapping($condition, $contexts);
- }
- catch (\Drupal\Component\Plugin\Exception\ContextException $e) {
- // We couldn't initialize the condition, so it just cannot participate.
- continue;
- }
- }
-
- try {
- $pass = $condition->execute();
- }
- catch (\Drupal\Component\Plugin\Exception\ContextException $e) {
- // Condition couldn't evaluate itself. Let's skip it.
- continue;
- }
-
- if ($condition instanceof \Drupal\Core\Cache\CacheableDependencyInterface) {
- $cache->addCacheTags($condition->getCacheTags());
- $cache->addCacheContexts($condition->getCacheContexts());
- $cache->mergeCacheMaxAge($condition->getCacheMaxAge());
- }
-
- if (!$pass) {
- break;
- }
- }
-
- $cache->applyTo($variables);
-
- if ($pass && !empty($variables['message_list'])) {
- $variables['attributes']['class'][] = 'better-messages-overlay';
-
- if (\Drupal::config('better_messages.settings')->get('fixed')) {
- $variables['attributes']['class'][] = 'better-messages-position-fixed';
- }
-
- if (isset($variables['message_list']['error'])) {
- $variables['attributes']['class'][] = 'better-messages-has-errors';
- }
- }
-}
diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.permissions.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.permissions.yml
deleted file mode 100644
index d7d927598..000000000
--- a/sites/all/modules/contrib/admin/better_messages/better_messages.permissions.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-configure better messages:
- title: 'Configure better messages'
- description: 'Configure settings of the Better Messages module.'
diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.routing.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.routing.yml
deleted file mode 100644
index da060b0fc..000000000
--- a/sites/all/modules/contrib/admin/better_messages/better_messages.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-better_messages.settings_form:
- path: /admin/config/user-interface/better-messages
- defaults:
- _form: 'Drupal\better_messages\Form\BetterMessagesSettingsForm'
- _title: 'Better Message settings'
- requirements:
- _permission: 'configure better messages'
diff --git a/sites/all/modules/contrib/admin/better_messages/better_messages.services.yml b/sites/all/modules/contrib/admin/better_messages/better_messages.services.yml
deleted file mode 100644
index a56936485..000000000
--- a/sites/all/modules/contrib/admin/better_messages/better_messages.services.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-services:
- better_messages.context:
- class: Drupal\better_messages\ContextProvider\MessagesContext
- tags:
- - { name: 'context_provider' }
diff --git a/sites/all/modules/contrib/admin/better_messages/composer.json b/sites/all/modules/contrib/admin/better_messages/composer.json
deleted file mode 100644
index 06d655411..000000000
--- a/sites/all/modules/contrib/admin/better_messages/composer.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "name": "drupal/better_messages",
- "description": "Better Messages module for Drupal 8.",
- "type": "drupal-module"
-}
\ No newline at end of file
diff --git a/sites/all/modules/contrib/admin/better_messages/config/install/better_messages.settings.yml b/sites/all/modules/contrib/admin/better_messages/config/install/better_messages.settings.yml
deleted file mode 100644
index d0f1c3683..000000000
--- a/sites/all/modules/contrib/admin/better_messages/config/install/better_messages.settings.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-position: 'center'
-vertical: 0
-horizontal: 10
-fixed: 1
-width: '400px'
-autoclose: 0
-opendelay: 0.3
-disable_autoclose: 0
-show_countdown: 1
-hover_autoclose: 1
-popin:
- effect: 'fadeIn'
- duration: 'slow'
-popout:
- effect: 'fadeOut'
- duration: 'slow'
-jquery_ui:
- draggable: 1
- resizable: 0
-visibility: []
diff --git a/sites/all/modules/contrib/admin/better_messages/config/schema/better_messages.schema.yml b/sites/all/modules/contrib/admin/better_messages/config/schema/better_messages.schema.yml
deleted file mode 100644
index 7786f6d8c..000000000
--- a/sites/all/modules/contrib/admin/better_messages/config/schema/better_messages.schema.yml
+++ /dev/null
@@ -1,70 +0,0 @@
-better_messages.settings:
- type: config_entity
- label: 'Better Messages settings'
- mapping:
- position:
- type: string
- label: 'Position'
- vertical:
- type: integer
- label: 'Vertical'
- horizontal:
- type: integer
- label: 'Horizontal'
- fixed:
- type: integer
- label: 'Fixed'
- width:
- type: string
- label: 'Width'
- autoclose:
- type: integer
- label: 'autoclose'
- opendelay:
- type: float
- label: 'Opendelay'
- disable_autoclose:
- type: integer
- label: 'Disable autoclose'
- show_countdown:
- type: integer
- label: 'Show countdown'
- hover_autoclose:
- type: integer
- label: 'Hover autoclose'
- popin:
- type: mapping
- label: 'Popin effect'
- mapping:
- effect:
- type: string
- label: 'Effect'
- duration:
- type: string
- label: 'Duration'
- popout:
- type: mapping
- label: 'Popout effect'
- mapping:
- effect:
- type: string
- label: 'Effect'
- duration:
- type: string
- label: 'Duration'
- jquery_ui:
- type: mapping
- label: 'jQuery UI enhancement'
- mapping:
- draggable:
- type: integer
- label: 'Draggable'
- resizable :
- type: integer
- label: 'Resizable'
- visibility:
- type: sequence
- label: 'Visibility Conditions'
- sequence:
- type: condition.plugin.[id]
- label: 'Visibility Condition'
diff --git a/sites/all/modules/contrib/admin/better_messages/config/schema/condition.plugin.message_type.schema.yml b/sites/all/modules/contrib/admin/better_messages/config/schema/condition.plugin.message_type.schema.yml
deleted file mode 100644
index c5dd93a53..000000000
--- a/sites/all/modules/contrib/admin/better_messages/config/schema/condition.plugin.message_type.schema.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-condition.plugin.message_type:
- type: condition.plugin
- mapping:
- message_types:
- type: sequence
- label: 'Allowed message types'
- sequence:
- type: string
- label: 'Message type'
diff --git a/sites/all/modules/contrib/admin/better_messages/css/better_messages-rtl.css b/sites/all/modules/contrib/admin/better_messages/css/better_messages-rtl.css
deleted file mode 100644
index 585261ec7..000000000
--- a/sites/all/modules/contrib/admin/better_messages/css/better_messages-rtl.css
+++ /dev/null
@@ -1,7 +0,0 @@
-#better-messages-default .better-messages-close {
- float: left;
-}
-
-#better-messages-default .better-messages-timer {
- float: right;
-}
diff --git a/sites/all/modules/contrib/admin/better_messages/css/better_messages.css b/sites/all/modules/contrib/admin/better_messages/css/better_messages.css
deleted file mode 100644
index b9557026f..000000000
--- a/sites/all/modules/contrib/admin/better_messages/css/better_messages.css
+++ /dev/null
@@ -1,54 +0,0 @@
-/** We want the admin toolbar to be on top of our overlay when it's
-horizontal. */
-.toolbar-horizontal #toolbar-administration {
- z-index: 520;
-}
-
-/** Hide the messages if we have JS support */
-.js #better-messages-default.better-messages-overlay {
- display: none;
-}
-
-#better-messages-default.better-messages-overlay {
- z-index: 510;
- position: absolute;
- background: #FFFFFF;
- padding: 1em;
- -webkit-box-shadow: 0 2px 10px #000000;
- -moz-box-shadow: 0 2px 10px #000000;
- box-shadow: 0 2px 10px #000000;
- -webkit-border-radius: 1em;
- -moz-border-radius: 1em;
- border-radius: 1em;
-}
-
-#better-messages-default.better-messages-overlay.better-messages-position-fixed {
- position: fixed;
-}
-
-#better-messages-default.better-messages-overlay .better-messages-footer {
- border-top: 1px solid #DDDDDD;
- margin-top: 10px;
- padding-top: 5px;
- text-align: right;
-}
-
-#better-messages-default.better-messages-overlay .better-messages-close {
- display: block;
- float: right;
- color: #676767;
- text-transform: uppercase;
-}
-
-#better-messages-default.better-messages-overlay .better-messages-close span {
- background: transparent url(../images/closelabel.gif) no-repeat;
- display: block;
- float: right;
- height: 22px;
- width: 22px;
-}
-
-#better-messages-default.better-messages-overlay .better-messages-timer {
- float: left;
- line-height: 22px;
-}
diff --git a/sites/all/modules/contrib/admin/better_messages/images/closelabel.gif b/sites/all/modules/contrib/admin/better_messages/images/closelabel.gif
deleted file mode 100644
index fa6c9ab008ead1b1175e39da8ae68f2f11c6e974..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 687
zcmZ?wbhEHb6k`x$I2OZj;J|@{2M^AjJ2x^i^3tVC&CSj0*RTKj_3M)-PXYo0cI?>E
z)6+9$%9N0hkg%|@J9q8`1qGcvc``6CFd`x%G&JWG1!QZ}p`}_Crt5>gn{ra_R
z*|PBP@I{Lj`S|$w`}?P*rG5YY{qEhnXU?2SNJyxzu3ors;h#T$K79Ca@7}$foSdy&
zxBmY9d+OAwXV0EJb?Q__MaApauf4s!A3S&vA0NMS=g#~0?{C?%rLC>4pr9Z*Ir-_+
zr;{d4>gecLxpHM*Uf%TS)ARH5uU@^{*Vp&5E2E;KQc_ZUeSM3Ii__E7r%jvI-roNB@nb(fzs$_c+qZ95RaO1}
z|Nq~=e?XEBK=CIFBNszGgAM}_fZ~LK{a-^&Q*%peTYE=mt9n;kY=4Z7yHia6wAdJB
zCaIQbiVkvtN>eAq=$XiciZ@U2HDVTXjao8Og_l{*Zp{qIXnAJN5VIy_6EWrp3ys}-
zR5_V>wT$()F$aYy&Ycz`s=8mqW1BFi?dlm#(`OiZ3NZ7@Fbg=}T)Jd>jE0*CvoNph
zoZAgop7MBxkq}<4vR#Fhlj=H
xeh-WAn2fQQYzkc5i9ll`){3^EO-zY}az<@MB`mo2?P?(XjIJ6M<)tO4qJe_#Lr
diff --git a/sites/all/modules/contrib/admin/better_messages/js/better_messages.js b/sites/all/modules/contrib/admin/better_messages/js/better_messages.js
deleted file mode 100644
index 5e06b9e37..000000000
--- a/sites/all/modules/contrib/admin/better_messages/js/better_messages.js
+++ /dev/null
@@ -1,124 +0,0 @@
-
-(function ($) {
-
- 'use strict';
-
- Drupal.behaviors.betterMessages = {
- attach: function (context, settings) {
-
- var betterMessages = settings.better_messages;
- var message_box = $('#better-messages-default.better-messages-overlay', context).once('better-messages');
-
- if (message_box.length > 0) {
- /* jQuery UI Enhancements */
- if (betterMessages.jquery_ui.draggable == '1') {
- message_box.draggable();
- }
- if (betterMessages.jquery_ui.resizable == '1') {
- message_box.resizable();
- }
-
- /* Functions to determine the popin/popout animation */
- betterMessages.open = function () {
- var method = 'fadeIn';
- switch (betterMessages.popin.effect) {
- case 'fadeIn':
- case 'slideDown':
- method = betterMessages.popin.effect;
- break;
- }
- message_box[method](betterMessages.popin.duration);
- };
- betterMessages.close = function () {
- var method = 'fadeOut';
- switch (betterMessages.popout.effect) {
- case 'fadeOut':
- break;
- case 'slideUp':
- method = betterMessages.popout.effect;
- break;
- }
- message_box[method](betterMessages.popout.duration);
- };
-
- /* Function to determine closing count */
- betterMessages.countDownClose = function (seconds) {
- if (!message_box.hasClass('better-messages-has-errors') || !betterMessages.disable_autoclose) {
- if (seconds > 0) {
- seconds--;
- if (betterMessages.show_countdown == '1') {
- $('.better-messages-timer', message_box).text(Drupal.t('Closing in !seconds seconds', {'!seconds': seconds}));
- }
- if (seconds > 0) {
- betterMessages.countDown = setTimeout(function () {
- betterMessages.countDownClose(seconds);
- }, 1000);
- }
- else {
- betterMessages.close();
- }
- }
- }
- };
-
- if (betterMessages.width) {
- message_box.css('width', betterMessages.width);
- }
-
- /* Determine Popup Message position */
- var vertical = betterMessages.vertical;
- var horizontal = betterMessages.horizontal;
- var cssPosition = {};
- switch (betterMessages.position) {
- case 'center':
- vertical = ($(window).height() - message_box.height()) / 2;
- horizontal = ($(window).width() - message_box.width()) / 2;
- cssPosition = {top: vertical + 'px', left: horizontal + 'px'};
- break;
- case 'tl':
- cssPosition = {top: vertical + 'px', left: horizontal + 'px'};
- break;
- case 'tr':
- cssPosition = {top: vertical + 'px', right: horizontal + 'px'};
- break;
- case 'bl':
- cssPosition = {bottom: vertical + 'px', left: horizontal + 'px'};
- break;
- case 'br':
- cssPosition = {bottom: vertical + 'px', right: horizontal + 'px'};
- break;
- }
- message_box.css(cssPosition);
-
- /* Here we control closing and opening effects and controls */
- setTimeout(function () {
- betterMessages.open();
- }, betterMessages.opendelay * 1000);
-
- if (betterMessages.autoclose != 0) {
- betterMessages.countDownClose(betterMessages.autoclose);
- }
- if (betterMessages.hover_autoclose == '1') {
- message_box.hover(function () {
- clearTimeout(betterMessages.countDown);
- $('.better-messages-timer', message_box).fadeOut('slow');
- });
- }
- $('.better-messages-close', message_box).click(function (event) {
- betterMessages.close();
- event.preventDefault();
- });
-
- /* Esc key handler for closing the message. This doesn't work on Safari or Chrome
- See the issue here: http://code.google.com/p/chromium/issues/detail?id=14635
- */
- $(document).keypress(function (e) {
- if (e.keyCode == 27) {
- betterMessages.close();
- return e.preventDefault();
- }
- });
- }
- }
- };
-})(jQuery);
diff --git a/sites/all/modules/contrib/admin/better_messages/src/ContextProvider/MessagesContext.php b/sites/all/modules/contrib/admin/better_messages/src/ContextProvider/MessagesContext.php
deleted file mode 100644
index b7069941c..000000000
--- a/sites/all/modules/contrib/admin/better_messages/src/ContextProvider/MessagesContext.php
+++ /dev/null
@@ -1,82 +0,0 @@
-getMessages());
-
- $cacheability = new CacheableMetadata();
- // We cannot cache this context as literally a few lines below some message
- // might be added.
- $cacheability->setCacheMaxAge(0);
- // Since messages are stored in session, we must vary by it.
- $cacheability->addCacheContexts(['session']);
- $context->addCacheableDependency($cacheability);
-
- $result['better_messages'] = $context;
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAvailableContexts() {
- $context = new Context(new ContextDefinition('map', $this->t('Current status messages')));
- return ['better_messages' => $context];
- }
-
- /**
- * Store currently rendered status messages.
- *
- * @param array $messages
- * Messages array to store (supposedly it should be the currently rendered
- * ones)
- */
- public function setMessages(array $messages) {
- $this->messages = $messages;
- }
-
- /**
- * Retrieve current status messages.
- *
- * @return array
- * Array of current messages. It will either be a result of
- * drupal_get_messages() or $this->messages should we already be beyond the
- * phase of rendering status messages on the current page request
- */
- protected function getMessages() {
- return is_null($this->messages) ? drupal_get_messages(NULL, FALSE) : $this->messages;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/better_messages/src/Form/BetterMessagesSettingsForm.php b/sites/all/modules/contrib/admin/better_messages/src/Form/BetterMessagesSettingsForm.php
deleted file mode 100644
index c6044046c..000000000
--- a/sites/all/modules/contrib/admin/better_messages/src/Form/BetterMessagesSettingsForm.php
+++ /dev/null
@@ -1,356 +0,0 @@
-get('config.factory'),
- $container->get('plugin.manager.condition'),
- $container->get('context.repository')
- );
- }
-
- /**
- * BetterMessagesSettingsForm constructor.
- */
- public function __construct(ConfigFactoryInterface $config_factory, ConditionManager $condition_manager, ContextRepositoryInterface $context_repository) {
- parent::__construct($config_factory);
-
- $this->conditionManager = $condition_manager;
- $this->contextRepository = $context_repository;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'better_messages_settings_form';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getEditableConfigNames() {
- return ['better_messages.settings'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $config = $this->config('better_messages.settings');
-
- $form_state->setTemporaryValue('gathered_contexts', $this->contextRepository->getAvailableContexts());
-
- $settings = $config->get();
-
- $form['position'] = array(
- '#type' => 'details',
- '#title' => $this->t('Messages positions and basic properties'),
- '#weight' => -5,
- '#open' => TRUE
- );
-
- $form['position']['pos'] = array(
- '#type' => 'radios',
- '#title' => $this->t('Set position of Message'),
- '#default_value' => $settings['position'],
- '#description' => $this->t('Position of message relative to screen'),
- '#attributes' => array('class' => array('better-messages-admin-radios')),
- '#options' => array(
- 'center' => $this->t('Center screen'),
- 'tl' => $this->t('Top left'),
- 'tr' => $this->t('Top right'),
- 'bl' => $this->t('Bottom left'),
- 'br' => $this->t('Bottom right'),
- ),
- );
-
- $form['position']['fixed'] = array(
- '#type' => 'checkbox',
- '#default_value' => $settings['fixed'],
- '#title' => $this->t('Keep fixed position of message as you scroll.'),
- );
-
- $form['position']['width'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Custom width'),
- '#description' => $this->t('Width in pixel (e.g. 400px) or percentage (e.g. 100%). Leave empty if you prefer your theme to control the width.'),
- '#default_value' => $settings['width'],
- '#size' => 20,
- '#maxlength' => 20,
- );
-
- $form['position']['horizontal'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Left/Right spacing'),
- '#default_value' => $settings['horizontal'],
- '#size' => 20,
- '#maxlength' => 20,
- '#required' => TRUE,
- '#field_suffix' => $this->t('px'),
- '#states' => [
- 'invisible' => [
- ':input[name="pos"]' => ['value' => 'center'],
- ],
- ],
- );
-
- $form['position']['vertical'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Top/Down spacing'),
- '#default_value' => $settings['vertical'],
- '#size' => 20,
- '#maxlength' => 20,
- '#required' => TRUE,
- '#field_suffix' => $this->t('px'),
- '#states' => [
- 'invisible' => [
- ':input[name="pos"]' => ['value' => 'center'],
- ],
- ],
- );
-
- $form['animation'] = array(
- '#type' => 'details',
- '#title' => $this->t('Messages animation settings'),
- '#weight' => -3,
- '#open' => TRUE,
- );
-
- $form['animation']['popin_effect'] = array(
- '#type' => 'select',
- '#title' => $this->t('Pop-in (show) message box effect'),
- '#default_value' => $settings['popin']['effect'],
- '#options' => array(
- 'fadeIn' => $this->t('Fade in'),
- 'slideDown' => $this->t('Slide down'),
- ),
- );
-
- $form['animation']['popin_duration'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Duration of (show) effect'),
- '#description' => $this->t('A string representing one of the three predefined speeds ("slow", "normal", or "fast"). Or the number of milliseconds to run the animation (e.g. 1000).'),
- '#default_value' => $settings['popin']['duration'],
- '#size' => 20,
- '#maxlength' => 20,
- );
-
- $form['animation']['popout_effect'] = array(
- '#type' => 'select',
- '#title' => $this->t('Pop-out (close) message box effect'),
- '#default_value' => $settings['popout']['effect'],
- '#options' => array(
- 'fadeIn' => $this->t('Fade out'),
- 'slideUp' => $this->t('Slide Up'),
- ),
- );
-
- $form['animation']['popout_duration'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Duration of (close) effect'),
- '#description' => $this->t('A string representing one of the three predefined speeds ("slow", "normal", or "fast"). Or the number of milliseconds to run the animation (e.g. 1000).'),
- '#default_value' => $settings['popout']['duration'],
- '#size' => 20,
- '#maxlength' => 20,
- );
-
- $form['animation']['autoclose'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Number of seconds to auto close after the page has loaded'),
- '#description' => $this->t('0 for never. You can set it as 0.25 for quarter second'),
- '#default_value' => $settings['autoclose'],
- '#size' => 20,
- '#maxlength' => 20,
- );
-
- $form['animation']['disable_autoclose'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Disable auto close if messages include an error message'),
- '#default_value' => $settings['disable_autoclose'],
- );
-
- $form['animation']['show_countdown'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Show countdown timer'),
- '#default_value' => $settings['show_countdown'],
- );
-
- $form['animation']['hover_autoclose'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Stop auto close timer when hover'),
- '#default_value' => $settings['hover_autoclose'],
- );
-
- $form['animation']['open_delay'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Number of seconds to delay message after the page has loaded'),
- '#description' => $this->t('0 for never. You can set it as 0.25 for quarter second'),
- '#default_value' => $settings['opendelay'],
- '#size' => 20,
- '#maxlength' => 20,
- );
-
- $form['jquery_ui'] = array(
- '#type' => 'details',
- '#title' => $this->t('jQuery UI enhancements'),
- '#weight' => 10,
- '#description' => $this->t('These settings require jQuery UI.'),
- '#open' => TRUE,
- );
-
- $form['jquery_ui']['draggable'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Make Better Messages draggable'),
- '#default_value' => $settings['jquery_ui']['draggable'],
- );
- $form['jquery_ui']['resizable'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Make Better Messages resizable'),
- '#default_value' => $settings['jquery_ui']['resizable'],
- );
-
- $form['visibility'] = $this->buildVisibility([], $form_state);
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- parent::validateForm($form, $form_state);
-
- foreach ($form_state->getValue('visibility') as $condition_id => $values) {
- // All condition plugins use 'negate' as a Boolean in their schema.
- // However, certain form elements may return it as 0/1. Cast here to
- // ensure the data is in the expected type.
- if (array_key_exists('negate', $values)) {
- $form_state->setValue(['visibility', $condition_id, 'negate'], (bool) $values['negate']);
- }
-
- // Allow the condition to validate the form.
- $condition = $form_state->get(['conditions', $condition_id]);
- $condition->validateConfigurationForm($form['visibility'][$condition_id], SubformState::createForSubform($form['visibility'][$condition_id], $form, $form_state));
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $config = $this->config('better_messages.settings');
- $config->set('position', $form_state->getValue('pos'))
- ->set('fixed', $form_state->getValue('fixed'))
- ->set('width', $form_state->getValue('width'))
- ->set('horizontal', intval($form_state->getValue('horizontal')))
- ->set('vertical', intval($form_state->getValue('vertical')))
- ->set('popin.effect', $form_state->getValue('popin_effect'))
- ->set('popin.duration', $form_state->getValue('popin_duration'))
- ->set('popout.effect', $form_state->getValue('popout_effect'))
- ->set('popout.duration', $form_state->getValue('popout_duration'))
- ->set('autoclose', $form_state->getValue('autoclose'))
- ->set('disable_autoclose', $form_state->getValue('disable_autoclose'))
- ->set('show_countdown', $form_state->getValue('show_countdown'))
- ->set('hover_autoclose', $form_state->getValue('hover_autoclose'))
- ->set('opendelay', $form_state->getValue('open_delay'))
- ->set('jquery_ui.draggable', $form_state->getValue('draggable'))
- ->set('jquery_ui.resizable', $form_state->getValue('resizable'))
- ->set('visibility', []);
-
- foreach ($form_state->getValue('visibility') as $condition_id => $values) {
- // Allow the condition to submit the form.
- $condition = $form_state->get(['conditions', $condition_id]);
- $condition->submitConfigurationForm($form['visibility'][$condition_id], SubformState::createForSubform($form['visibility'][$condition_id], $form, $form_state));
- $config->set('visibility.' . $condition_id, $condition->getConfiguration());
- }
-
- $config->save();
-
- parent::submitForm($form, $form_state);
- }
-
- /**
- * Generate form elements for visibility controls.
- *
- * @param array $form
- * Form array chunk where the genreated visibility controls will be embedded
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * Form state that corresponds to $form
- *
- * @return array
- * Form elements for visibility controls
- */
- protected function buildVisibility($form, FormStateInterface $form_state) {
- $form['#tree'] = TRUE;
-
- $form['visibility_tabs'] = [
- '#type' => 'vertical_tabs',
- '#title' => $this->t('Visibility'),
- '#parents' => ['visibility_tabs'],
- ];
-
- $visibility = $this->config($this->getEditableConfigNames()[0])->get('visibility');
- foreach ($this->conditionManager->getDefinitionsForContexts($form_state->getTemporaryValue('gathered_contexts')) as $condition_id => $definition) {
- /** @var \Drupal\Core\Condition\ConditionInterface $condition */
- $condition = $this->conditionManager->createInstance($condition_id, isset($visibility[$condition_id]) ? $visibility[$condition_id] : []);
- $form_state->set(['conditions', $condition_id], $condition);
- $condition_form = $condition->buildConfigurationForm([], $form_state);
- $condition_form['#type'] = 'details';
- $condition_form['#title'] = $condition->getPluginDefinition()['label'];
- $condition_form['#group'] = 'visibility_tabs';
- $form[$condition_id] = $condition_form;
- }
-
- // The "current_theme" condition is very raw, and has bugs:
- // https://www.drupal.org/node/2787529 and
- // https://www.drupal.org/node/2787529
- // so we prefer to ditch it.
- unset($form['current_theme']);
-
- if (isset($form['request_path'])) {
- $form['request_path']['#title'] = $this->t('Pages');
- $form['request_path']['negate']['#type'] = 'radios';
- $form['request_path']['negate']['#default_value'] = (int) $form['request_path']['negate']['#default_value'];
- $form['request_path']['negate']['#title_display'] = 'invisible';
- $form['request_path']['negate']['#options'] = [
- $this->t('Show for the listed pages'),
- $this->t('Hide for the listed pages'),
- ];
- }
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/better_messages/src/Plugin/Condition/MessageType.php b/sites/all/modules/contrib/admin/better_messages/src/Plugin/Condition/MessageType.php
deleted file mode 100644
index 340bc3a8b..000000000
--- a/sites/all/modules/contrib/admin/better_messages/src/Plugin/Condition/MessageType.php
+++ /dev/null
@@ -1,92 +0,0 @@
- []] + parent::defaultConfiguration();
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
- $form['message_types'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('Message types'),
- '#default_value' => $this->configuration['message_types'],
- '#options' => $this->messageTypeOptions(),
- '#description' => $this->t('Specify for which message types to active the condition. Leaving empty means for all message types.'),
- ];
- return parent::buildConfigurationForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $this->configuration['message_types'] = array_values(array_filter($form_state->getValue('message_types')));
- parent::submitConfigurationForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function summary() {
- $message_labels = array_intersect_key($this->messageTypeOptions(), array_combine($this->configuration['message_types'], $this->configuration['message_types']));
- return implode(', ', $message_labels);
- }
-
- /**
- * {@inheritdoc}
- */
- public function evaluate() {
- $messages = $this->getContextValue('better_messages');
- $intersect = array_intersect($this->configuration['message_types'], array_keys($messages));
- return empty($this->configuration['message_types']) || !empty($intersect);
- }
-
- /**
- * Retrieve a list of known message types.
- *
- * @return array
- * Array of known message types. Keys are their machine names whereas values
- * are the corresponding human friendly labels
- */
- protected function messageTypeOptions() {
- return [
- 'status' => $this->t('Status'),
- 'warning' => $this->t('Warning'),
- 'error' => $this->t('Error'),
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/better_messages/templates/better-messages-wrapper.html.twig b/sites/all/modules/contrib/admin/better_messages/templates/better-messages-wrapper.html.twig
deleted file mode 100644
index 69c8a10a4..000000000
--- a/sites/all/modules/contrib/admin/better_messages/templates/better-messages-wrapper.html.twig
+++ /dev/null
@@ -1,24 +0,0 @@
-{#
-/**
- * @file
- * Default theme for better_messages_wrapper theme hook.
- *
- * Wrap the system messages into additional markup required for presenting the
- * messages in an overlay.
- *
- * Available variables:
- * - children: The system messages
- */
-#}
-
diff --git a/sites/all/modules/contrib/admin/bulkdelete/LICENSE.txt b/sites/all/modules/contrib/admin/bulkdelete/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/bulkdelete/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/bulkdelete/README.txt b/sites/all/modules/contrib/admin/bulkdelete/README.txt
deleted file mode 100644
index 9f6d53424..000000000
--- a/sites/all/modules/contrib/admin/bulkdelete/README.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-CONTENTS OF THIS FILE
----------------------
-
- * Introduction
- * Installation
- * Configuration
-
-
-INTRODUCTION
-------------
-
-This module will delete any nodes of a certain node-type using the batch api.
-It is advised to use the Views Batch Operations module (VBO) for a small number
-of nodes. But if you have to delete 10.000 nodes this module might be a better
-option.
-
-
-INSTALLATION
-------------
-
-The bulkdelete.module is very similar to other Drupal modules. For installation
-of the bulkdelete module please follow the below mentioned steps:
-
-• Install as usual
-• Enable the bulkdelete module.
-
-
-CONFIGURATION
--------------
-
-• There is no configuration for this module.
diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.info.yml b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.info.yml
deleted file mode 100644
index 1a512112b..000000000
--- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.info.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: Bulk Delete
-type: module
-description: 'Adds an administrative option to bulk delete nodes by content type using the batch API.'
-# core: 8.x
-configure: bulkdelete.admin
-
-# Information added by Drupal.org packaging script on 2017-05-23
-version: '8.x-1.x-dev'
-core: '8.x'
-project: 'bulkdelete'
-datestamp: 1495565589
diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.links.task.yml b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.links.task.yml
deleted file mode 100644
index 680b8450a..000000000
--- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.links.task.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-# bulkdelete.links.task.yml snippet
-bulkdelete.admin:
- route_name: bulkdelete.admin
- title: Bulk delete nodes
- base_route: system.admin_content
- weight: 11
diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.module b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.module
deleted file mode 100644
index 21feba4e3..000000000
--- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.module
+++ /dev/null
@@ -1,24 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('This module will delete any nodes of a certain node-type
- using the batch api. It is advised to use the Views Batch Operations module (VBO)
- for a small number of nodes. But if you have to delete 10.000 nodes this module
- might be a better option.') . '
';
- return $output;
- }
-}
diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.permissions.yml b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.permissions.yml
deleted file mode 100644
index 9507f61b6..000000000
--- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.permissions.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-bulkdelete nodes:
- title: 'Access bulk delete nodes'
- description: 'Access bulkdelete.'
- restrict access: true
diff --git a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.routing.yml b/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.routing.yml
deleted file mode 100644
index d320bff97..000000000
--- a/sites/all/modules/contrib/admin/bulkdelete/bulkdelete.routing.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# bulkdelete.routing.yml snippet
-bulkdelete.admin:
- path: '/admin/content/bulkdelete'
- defaults:
- _form: '\Drupal\bulkdelete\Form\BulkDeleteForm'
- _title: 'Bulk delete nodes'
- requirements:
- _permission: 'bulkdelete nodes'
diff --git a/sites/all/modules/contrib/admin/bulkdelete/src/Form/BulkDeleteForm.php b/sites/all/modules/contrib/admin/bulkdelete/src/Form/BulkDeleteForm.php
deleted file mode 100644
index a5fa35ac7..000000000
--- a/sites/all/modules/contrib/admin/bulkdelete/src/Form/BulkDeleteForm.php
+++ /dev/null
@@ -1,154 +0,0 @@
- $values) {
- $query = \Drupal::entityQuery('node')
- // Filter by content type.
- ->condition('type', $key)
- // Count.
- ->count();
- $count = $query->execute();
- if ($count > 0) {
- $options[$key] = $values->get('name') . " ($count)";
- }
- }
- if (empty($options)) {
- $form['default_msg'] = [
- '#type' => 'item',
- '#markup' => $this->t('Node not available.'),
- ];
- }
- else {
- $form['types'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('Content types for deletion'),
- '#options' => $options,
- '#description' => $this->t('All nodes of these types will be deleted using the batch API.'),
- ];
-
- $form['actions']['#type'] = 'actions';
- $form['submit'] = [
- '#type' => 'submit',
- '#value' => $this->t('Delete'),
- '#button_type' => 'primary',
- ];
- }
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $values = $form_state->getValues();
- $types = array_filter($values['types']);
- if (count($types) > 0) {
- try {
- foreach ($types as $bundle) {
- $result = db_select('node');
- $query = $result->fields('node', ['nid']);
- $query = $result->condition('type', $bundle);
- $query = $result->execute()->fetchAll();
- $last_row = count($query);
- $operations = [];
- if (!empty($last_row)) {
- $message = t('All nodes of type @content mark for deletion', ['@content' => $bundle]);
- \Drupal::logger('bulkdelete')->notice($message);
- // Create batch of 20 nodes.
- $count = 1;
- foreach ($query as $row) {
- $nids[] = $row->nid;
- if ($count % 20 === 0 || $count === $last_row) {
- $operations[] = [
- [get_class($this),
- 'processBatch',
- ],
- [$nids],
- ];
- $nids = [];
- }
- ++$count;
- }
- // Set up the Batch API.
- $batch = [
- 'operations' => $operations,
- 'finished' => [get_class($this), 'bulkDeleteFinishedBatch'],
- 'title' => $this->t('Node bulk delete'),
- 'init_message' => $this->t('Starting nodes deletion.'),
- 'progress_message' => $this->t('Completed @current step of @total.'),
- 'error_message' => $this->t('Bulk node deletion has encountered an error.'),
- ];
- batch_set($batch);
- }
- }
- }
- catch (Exception $e) {
- foreach ($e->getErrors() as $error_message) {
- drupal_set_message($error_message, 'error');
- }
- }
- }
- }
-
- /**
- * Processes the bulk node deletion.
- *
- * @param array $nids
- * Node nid.
- * @param array $context
- * The batch context.
- */
- public static function processBatch(array $nids, array &$context) {
- entity_delete_multiple('node', $nids);
- }
-
- /**
- * Batch finish function.
- *
- * This function is called by the batch 'finished' parameter.
- * The cache must not be cleared as the last batch operation,
- * but after the batch is finished.
- *
- * @param bool $success
- * Indicates if the batch was successfully finished.
- * @param array $results
- * The value of the results item from the context variable used in the batch
- * processing.
- * @param array $operations
- * If the success parameter is false then this is a list of the operations
- * that haven't completed yet.
- */
- public static function bulkDeleteFinishedBatch($success, array $results, array $operations) {
- drupal_flush_all_caches();
- $message = $success ? t('Bulkdelete performed successfully.') : t('Bulkdelete has not been finished successfully.');
- \Drupal::logger('bulkdelete')->notice($message);
- drupal_set_message($message);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/LICENSE.txt b/sites/all/modules/contrib/admin/config_update/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/config_update/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/config_update/README.txt b/sites/all/modules/contrib/admin/config_update/README.txt
deleted file mode 100644
index c493d6b1f..000000000
--- a/sites/all/modules/contrib/admin/config_update/README.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Configuration Update Manager project
-------------------------------------
-
-The Configuration Update Manager project consists of two modules:
-
-Configuration Update Base: A base module providing functionality related to
- updating and computing differences between configuration versions. No
- user interface; used by other modules such as Features.
-
-Configuration Update Reports (in the config_update_ui sub-directory of this
- project): Adds an updates report and revert functionality to configuration
- management. Depends on Configuration Update Base. For more information, see
- the README.txt file in the subdirectory.
diff --git a/sites/all/modules/contrib/admin/config_update/config_update.info.yml b/sites/all/modules/contrib/admin/config_update/config_update.info.yml
deleted file mode 100644
index fbd94845c..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update.info.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: Configuration Update Base
-type: module
-description: 'Provides basic revert and update functionality for other modules'
-# core: 8.x
-dependencies:
- - drupal:config
-
-# Information added by Drupal.org packaging script on 2018-12-17
-version: '8.x-1.6'
-core: '8.x'
-project: 'config_update'
-datestamp: 1545090489
diff --git a/sites/all/modules/contrib/admin/config_update/config_update.module b/sites/all/modules/contrib/admin/config_update/config_update.module
deleted file mode 100644
index df775d320..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update.module
+++ /dev/null
@@ -1,21 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('The Configuration Update Base module provides functionality that other modules can use, related to updating and computing differences between configuration versions. This module does not provide any end-user functionality itself.') . '
';
- return $output;
- }
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update.services.yml b/sites/all/modules/contrib/admin/config_update/config_update.services.yml
deleted file mode 100644
index 2a2586086..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update.services.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-services:
- config_update.config_diff:
- class: Drupal\config_update\ConfigDiffer
- arguments: ['@string_translation']
-
- config_update.config_list:
- class: Drupal\config_update\ConfigListerWithProviders
- arguments: ['@entity.manager', '@config.storage', '@config_update.extension_storage', '@config_update.extension_optional_storage', '@module_handler', '@theme_handler']
-
- config_update.config_update:
- class: Drupal\config_update\ConfigReverter
- arguments: ['@entity.manager', '@config.storage', '@config_update.extension_storage', '@config_update.extension_optional_storage', '@config.factory', '@event_dispatcher']
-
- config_update.extension_storage:
- class: Drupal\Core\Config\ExtensionInstallStorage
- arguments: ['@config.storage']
-
- config_update.extension_optional_storage:
- class: Drupal\Core\Config\ExtensionInstallStorage
- arguments: ['@config.storage', 'config/optional']
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt b/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt
deleted file mode 100644
index 5773062e6..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/README.txt
+++ /dev/null
@@ -1,173 +0,0 @@
-Configuration Update Reports module
------------------------------------
-
-CONTENTS OF THIS README FILE
-- Introduction
-- Installation
-- Generating reports in the user interface
-- Generating reports using Drush commands
-- Important notes *** Be sure to read this section ***
-
-
-INTRODUCTION
-
-This module provides a report that allows you to see the differences between the
-default configuration items provided by the current versions of your installed
-modules, themes, and install profile, and the active configuration of your
-site. From this report, you can also import new configuration provided by
-updates, and revert your site configuration to the provided values.
-
-The main use case is: You update a module, and it has either changed default
-configuration that it provides, or added new default configuration items that
-you didn't get when you first installed the module. You want to be able to
-import the new items, view the differences between the active site configuration
-and the changed configuration, and possibly "revert" (or it may be an update) to
-the newly-provided default configuration.
-
-
-INSTALLATION
-
-Install the module in the normal way for Drupal modules. The only dependencies
-are the Configuration Manager module (Drupal core), and the Configuration Update
-Base module (part of this same project download).
-
-
-GENERATING REPORTS IN THE USER INTERFACE
-
-You can generate configuration reports at Administration >> Configuration >>
-Development >> Configuration management >> Update report (path:
-admin/config/development/configuration/report ).
-
-You can generate a report for a particular type of configuration object, such as
-Actions, Tours, Views, etc. Or, you can generate a report for an installed
-module, theme, or install profile. Finally, you can generate a report that
-contains all configuration in one report.
-
-The report has three sections, depending on what type you choose:
-
-1. Missing configuration items: Configuration items that are provided as
- defaults by your currently-installed modules, themes, and install profile
- that are missing from your active site configuration.
-
- Any items listed here can be imported into your site.
-
-2. Added configuration items: Configuration items that you added to the site
- (not provided by a currently-installed module, theme, or install
- profile). This section is only shown when you are running the report based on
- a configuration type.
-
- Items listed here can be exported, which is useful for developers or if you
- want to keep your site configuration in a version control system.
-
-3. Changed configuration items: Configuration items that are in your active site
- configuration that differ from the same item currently being provided by an
- installed module, theme, or install profile.
-
- You can export these items, see the differences between what is on your site
- and what the module/theme/profile is currently providing, or "revert" to the
- version currently being provided by the module/theme/profile in its default
- configuration.
-
- Note that the differences may be a bit hard to read, but hopefully they'll
- give you the general idea of what has changed.
-
-
-GENERATING REPORTS USING DRUSH COMMANDS
-
-The reports detailed in the previous section can also be generated, in pieces,
-using Drush commands (https://drupal.org/project/drush):
-
-drush config-list-types (clt)
- Lists all the config types on your system. Reports can be run for
- 'system.simple' (simple configuration), and 'system.all' (all types), in
- addition to the types listed by this command.
-
-drush config-added-report (cra)
-drush config-missing-report (crm)
-drush config-different-report (crd)
-drush config-inactive-report (cri)
- Run config reports (see below).
-
-drush config-diff (cfd)
- Show config differences for one item between active and imported (see below).
-
-The report commands run reports that tell what config has been added, is
-missing, is inactive, or is different between your active site configuration and
-the imported default configuration from config/install directories of your
-installed profile, modules, and themes.
-
-For each report except "added", the first argument is one of:
-- type: Runs the report for a configuration type; use drush config-list-types to
- list them.
-- module: Runs the report for an installed module.
-- theme: Runs the report for an installed theme.
-- profile: Runs the report for the install profile.
-
-The second argument for reports is the machine name of the configuration type,
-module, theme, or install profile you want to run the report for. For the
-"added" report, this is the only argument, as the added report is always by
-configuration type.
-
-These are the same as the reports you get in the UI, which is described above;
-the difference is that in Drush the report is separated into pieces, and the
-UI report sections have more columns giving information about each config item.
-
-Once you have found a configuration item with differences, you can view the
-differences using the config-diff command. This is a normalized/formatted diff
-like in the UI of this module, so see above for details.
-
-Drush examples:
-
-drush clt
-drush crm module node
-drush cra block
-drush crd theme bartik
-drush crd type system.all
-drush crd type system.simple
-drush crd profile standard
-drush cfd block.block.bartik_search
-
-Once you have figured out which configuration items are added, missing, or
-different, you can:
-
-- Export them - see drush config-export.
-
-- Import missing configuration or revert to provided default values. There are
-Drush commands to do this:
-
-drush config-revert (cfr)
- Revert a config item found in a "different" report to the current version in
- the module, theme, or install profile that provides it.
-
-drush config-revert-multiple (cfrm)
- Revert all config items of one type or from one module, theme, or install
- profile to the provided versions.
-
-drush config-import-missing (cfi)
- Import a config item found in a "missing" or "inactive" report from the
- current version in the module, theme, or install profile that provides it.
-
-You can also to use the drush config-import command to import/update multiple
-configuration items. But this requires that you locate the files containing the
-configuration you want to import, and copy them to your configuration staging
-directory.
-
-
-IMPORTANT NOTES
-
-Here are some notes about how this module functions:
-
-* This module is always looking at the base configuration items, without
- overrides (from settings.php, for example) or translations.
-
-* It is possible for an install profile on a site to provide configuration that
- overrides configuration from a module or theme. The install profile version
- always takes precedence. As an example, consider the case where module Foo
- provides a configuration item called foo.settings, and install profile Bar
- overrides this with its own file. Any reports that include foo.settings will
- be based on the differences between your site's active configuration and the
- version in the install profile. This is not usually a problem, but it can be
- confusing if you're looking at the Foo module report. The foo.settings item
- will be present, but the differences reported will be between the install
- profile's version and your site's active configuration, not the differences
- between the Foo module version and your site's active configuration.
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc
deleted file mode 100644
index e4d77bd41..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush.inc
+++ /dev/null
@@ -1,356 +0,0 @@
- 'List config types',
- 'aliases' => ['clt'],
- 'core' => ['8+'],
- 'outputformat' => [
- 'default' => 'list',
- ],
- ];
-
- $items['config-added-report'] = [
- 'description' => 'Display a list of config items that did not come from your installed modules, themes, or install profile',
- 'arguments' => [
- 'name' => 'The type of config to report on. See config-list-types to list them. You can also use system.all for all types, or system.simple for simple config.',
- ],
- 'required-arguments' => 1,
- 'examples' => [
- 'drush config-added-report action' => 'Displays the added config report for action config.',
- ],
- 'aliases' => ['cra'],
- 'core' => ['8+'],
- 'outputformat' => [
- 'default' => 'list',
- ],
- ];
-
- $items['config-missing-report'] = [
- 'description' => 'Display a list of config items from your installed modules, themes, or install profile that are not currently in your active config',
- 'arguments' => [
- 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.',
- 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.',
- ],
- 'required-arguments' => 2,
- 'examples' => [
- 'drush config-missing-report type action' => 'Displays the missing config report for action config.',
- ],
- 'aliases' => ['crm'],
- 'core' => ['8+'],
- 'outputformat' => [
- 'default' => 'list',
- ],
- ];
-
- $items['config-inactive-report'] = [
- 'description' => 'Display a list of optional config items from your installed modules, themes, or install profile that are not currently in your active config',
- 'arguments' => [
- 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.',
- 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.',
- ],
- 'required-arguments' => 2,
- 'examples' => [
- 'drush config-inactive-report type action' => 'Displays the inactive config report for action config.',
- ],
- 'aliases' => ['cri'],
- 'core' => ['8+'],
- 'outputformat' => [
- 'default' => 'list',
- ],
- ];
-
- $items['config-different-report'] = [
- 'description' => 'Display a list of config items that differ from the versions provided by your installed modules, themes, or install profile. See config-diff to show what the differences are.',
- 'arguments' => [
- 'type' => 'Run the report for: module, theme, profile, or "type" for config entity type.',
- 'name' => 'The machine name of the module, theme, etc. to report on. See config-list-types to list types for config entities; you can also use system.all for all types, or system.simple for simple config.',
- ],
- 'required-arguments' => 2,
- 'examples' => [
- 'drush config-different-report type action' => 'Displays the differing config report for action config.',
- ],
- 'aliases' => ['crd'],
- 'core' => ['8+'],
- 'outputformat' => [
- 'default' => 'list',
- ],
- ];
-
- $items['config-diff'] = [
- 'description' => 'Display line-by-line differences for one config item between your active config and the version currently being provided by an installed module, theme, or install profile',
- 'arguments' => [
- 'name' => 'The config item to diff. See config-different-report to list config items that are different.',
- ],
- 'required-arguments' => 1,
- 'examples' => [
- 'drush config-diff block.block.bartik_search' => 'Displays the config differences for the search block in the Bartik theme.',
- ],
- 'aliases' => ['cfd'],
- 'core' => ['8+'],
- ];
-
- $items['config-revert'] = [
- 'description' => 'Revert one config item in active storage to the version provided by an installed module, theme, or install profile.',
- 'arguments' => [
- 'name' => 'The config item to revert. See config-different-report to list config items that are different.',
- ],
- 'required-arguments' => 1,
- 'examples' => [
- 'drush config-revert block.block.bartik_search' => 'Revert the config for the search block in the Bartik theme to the version provided by the install profile.',
- ],
- 'aliases' => ['cfr'],
- 'core' => ['8+'],
- ];
-
- $items['config-import-missing'] = [
- 'description' => 'Import a missing or inactive config item provided by an installed module, theme, or install profile. Be sure that requirements are met.',
- 'arguments' => [
- 'name' => 'The name of the config item to import (usually the ID you would see in the user interface). See config-missing-report to list config items that are missing, and config-inactive-report to list config items that are inactive.',
- ],
- 'required-arguments' => 1,
- 'examples' => [
- 'drush config-import-missing block.block.bartik_search' => 'Import the config for the search block in the Bartik theme from the version provided by the install profile.',
- ],
- 'aliases' => ['cfi'],
- 'core' => ['8+'],
- ];
-
- $items['config-revert-multiple'] = [
- 'description' => 'Revert a set of config items to the versions provided by installed modules, themes, or install profiles. A set is all differing items from one extension, or one type of configuration.',
- 'arguments' => [
- 'type' => 'Type of set to revert: "module" for all items from a module, "theme" for all items from a theme, "profile" for all items from the install profile, or "type" for all items of one config entity type. See config-different-report to list config items that are different.',
- 'name' => 'The machine name of the module, theme, etc. to revert items of. All items in the corresponding config-different-report will be reverted.',
- ],
- 'required-arguments' => 2,
- 'examples' => [
- 'drush config-revert-multiple type action' => 'Revert all differing config items of type action.',
- ],
- 'aliases' => ['cfrm'],
- 'core' => ['8+'],
- ];
-
- return $items;
-}
-
-/**
- * Lists available config types.
- */
-function drush_config_update_ui_config_list_types() {
- $list = [];
-
- $definitions = \Drupal::service('config_update.config_list')->listTypes();
- return array_keys($definitions);
-}
-
-/**
- * Runs the config added report.
- *
- * @param string $name
- * Type of config to report on.
- */
-function drush_config_update_ui_config_added_report($name) {
- list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig('type', $name);
-
- $added = array_diff($active_list, $install_list, $optional_list);
-
- if (!count($added)) {
- drush_print(dt('No added config'), 0, STDERR);
- }
-
- sort($added);
- return $added;
-}
-
-/**
- * Runs the config missing report.
- *
- * @param string $type
- * Type of report to run: 'type', 'module', 'theme', or 'profile'.
- * @param string $name
- * Machine name of item to report on.
- */
-function drush_config_update_ui_config_missing_report($type, $name) {
- list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name);
-
- $missing = array_diff($install_list, $active_list);
- if (!count($missing)) {
- drush_print(dt('No missing config'), 0, STDERR);
- }
-
- sort($missing);
- return $missing;
-}
-
-/**
- * Runs the config inactive report.
- *
- * @param string $type
- * Type of report to run: 'type', 'module', 'theme', or 'profile'.
- * @param string $name
- * Machine name of item to report on.
- */
-function drush_config_update_ui_config_inactive_report($type, $name) {
- list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name);
-
- $missing = array_diff($optional_list, $active_list);
- if (!count($missing)) {
- drush_print(dt('No inactive config'), 0, STDERR);
- }
-
- sort($missing);
- return $missing;
-}
-
-/**
- * Runs the config different report.
- *
- * @param string $type
- * Type of report to run: 'type', 'module', 'theme', or 'profile'.
- * @param string $name
- * Machine name of item to report on.
- */
-function drush_config_update_ui_config_different_report($type, $name) {
- list($active_list, $install_list, $optional_list) = \Drupal::service('config_update.config_list')->listConfig($type, $name);
-
- $reverter = \Drupal::service('config_update.config_update');
- $differ = \Drupal::service('config_update.config_diff');
-
- $added = array_diff($active_list, $install_list, $optional_list);
- $both = array_diff($active_list, $added);
- $different = [];
- foreach ($both as $name) {
- $active = $reverter->getFromActive('', $name);
- $extension = $reverter->getFromExtension('', $name);
- if (!$differ->same($active, $extension)) {
- $different[] = $name;
- }
- }
-
- if (!count($different)) {
- drush_print(dt('No different config'), 0, STDERR);
- }
-
- sort($different);
- return $different;
-}
-
-/**
- * Runs the drush config-diff command.
- *
- * @param string $name
- * Config item to diff.
- */
-function drush_config_update_ui_config_diff($name) {
- $reverter = \Drupal::service('config_update.config_update');
- $differ = \Drupal::service('config_update.config_diff');
- $formatter = new DiffFormatter();
-
- $extension = $reverter->getFromExtension('', $name);
- $active = $reverter->getFromActive('', $name);
- if ($extension && $active) {
- $diff = $differ->diff($extension, $active);
- $output = $formatter->format($diff);
- return $output;
- }
- else {
- drush_print(dt('Config is missing, cannot diff'), 0, STDERR);
- return '';
- }
-}
-
-/**
- * Runs the drush config-revert command.
- *
- * @param string $name
- * Config item to revert.
- */
-function drush_config_update_ui_config_revert($name) {
- $lister = \Drupal::service('config_update.config_list');
- $reverter = \Drupal::service('config_update.config_update');
- $manager = \Drupal::service('entity.manager');
-
- // The revert command needs the type and the unprefixed name.
- $type = $lister->getTypeNameByConfigName($name);
- // The lister gives NULL if simple configuration, but the reverter expects
- // 'system.simple' so we convert it.
- if ($type === NULL) {
- $type = 'system.simple';
- }
- $shortname = $name;
- if ($type != 'system.simple') {
- $definition = $manager->getDefinition($type);
- $prefix = $definition->getConfigPrefix() . '.';
- if (strpos($name, $prefix) === 0) {
- $shortname = substr($name, strlen($prefix));
- }
- }
-
- if ($reverter->revert($type, $shortname)) {
- drush_print(dt('The configuration item @name was reverted to its source.', ['@name' => $name]));
- }
- else {
- drush_print(dt('There was an error and the configuration item @name was not reverted.', ['@name' => $name]), 0, STDERR);
- }
-}
-
-/**
- * Runs the drush config-import-missing command.
- *
- * @param string $name
- * Name of config item to import, without prefix.
- */
-function drush_config_update_ui_config_import_missing($name) {
- $lister = \Drupal::service('config_update.config_list');
- $reverter = \Drupal::service('config_update.config_update');
- $manager = \Drupal::service('entity.manager');
-
- // The import command needs the type and the unprefixed name.
- $type = $lister->getTypeNameByConfigName($name);
- $shortname = $name;
- if ($type && $type != 'system.simple') {
- $definition = $manager->getDefinition($type);
- $prefix = $definition->getConfigPrefix() . '.';
- if (strpos($name, $prefix) === 0) {
- $shortname = substr($name, strlen($prefix));
- }
- }
-
- if ($reverter->import($type, $shortname)) {
- drush_print(dt('The configuration item @name was imported from its source.', ['@name' => $name]));
- }
- else {
- drush_print(dt('There was an error and the configuration item @name was not imported.', ['@name' => $name]), 0, STDERR);
- drush_print(dt('The configuration was imported from its source.'));
- }
-}
-
-/**
- * Runs the drush config-revert-multiple command.
- *
- * @param string $type
- * Type of config to revert: 'type', 'module', 'theme', or 'profile'.
- * @param string $name
- * Machine name of type to revert.
- */
-function drush_config_update_ui_config_revert_multiple($type, $name) {
- // This command will print an error if there are no items to revert.
- $different = drush_config_update_ui_config_different_report($type, $name);
- foreach ($different as $name) {
- // This command will print a message if it succeeds or fails for each item.
- drush_config_update_ui_config_revert($name);
- }
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush_testing.inc b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush_testing.inc
deleted file mode 100644
index 2c11acde9..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.drush_testing.inc
+++ /dev/null
@@ -1,31 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('The Configuration Update Reports module provides a report that allows you to see the differences between the default configuration provided by the current versions of your installed modules, themes, and install profile, and the active configuration of your site. From this report, you can also import new configuration provided by updates, and revert your active configuration to the provided default values.') . '
' . t('The Updates report shows you configuration that differs between your site\'s active configuration and the installed modules, themes, and install profile. Choose a particular configuration type (or All), or run the report for a particular module, theme, or your install profile.', [':report' => Url::fromRoute('config_update_ui.report')->toString()]) . '
' . t('This report shows which default configuration items provided by the current versions of your installed modules, themes, and install profile differ from the active configuration of your site. You can generate the report for all configuration of a certain type; for a particular installed module, theme, or your install profile (only modules, themes, and install profiles that actually provide configuration are listed); or for all configuration.') . '
';
- $output .= '
' . t('Some configuration provided by modules has dependencies, and is only added to your system when all the dependencies are satisfied. This is known as optional configuration.') . '
';
- $output .= '
' . t('Differences, including missing and added configuration, can be due to either an updated module or theme providing different configuration from when you installed it, or to changes made by site administrators. This report does not differentiate between these two sources for differences, and note that an install profile can also silently override module/theme configuration. Overrides (such as those in your settings.php file) and translations are not considered when looking at differences.') . '
' . t('Most configuration is organized into a hierarchy of settings; at a minimum, it is a one-level hierarchy where each setting has a name and a value, and the hierarchy comes in when some of the settings have multiple components.') . '
' . t('Configuration items are normalized and formatted before computing differences. The normalization step alphabetizes the components at each level of the hierarchy, and removes a few components whose differences should be ignored, such as the UUID. The formatting step shows the full hierarchy of each configuration value with :: separators for the hierarchy levels, and a : separator between the lowest-level setting name and the value, so that in a line-by-line diff you can always see which values are actually different. Green lines with + signs have been added, and yellow lines with - signs have been removed.') . '
' . t('Note that differences are considering the base configuration, without overrides from your settings.php file, or translations.') . '
';
- }
-}
-
-/**
- * Implements hook_menu_links_discovered_alter().
- */
-function config_update_ui_menu_links_discovered_alter(&$links) {
- if (\Drupal::moduleHandler()->moduleExists('admin_toolbar_tools')) {
- // Add the Updates report link to the Tools menu, but only if the
- // Admin Toolbar Extra Tools module is present.
- $links['admin_toolbar_tools.config.update'] = [
- 'title' => t('Updates report'),
- 'route_name' => 'config_update_ui.report',
- 'menu_name' => 'admin',
- 'parent' => 'config.sync',
- 'weight' => 3,
- ];
- }
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml
deleted file mode 100644
index bedd4a938..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.permissions.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-view config updates report:
- title: 'View configuration updates report'
-revert configuration:
- title: 'Revert any configuration'
- restrict access: true
-delete configuration:
- title: 'Delete any configuration'
- restrict access: true
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml b/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml
deleted file mode 100644
index 9f2f35585..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/config_update_ui.routing.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-config_update_ui.report:
- path: '/admin/config/development/configuration/report/{report_type}/{name}'
- defaults:
- _controller: '\Drupal\config_update_ui\Controller\ConfigUpdateController::report'
- _title: 'Updates report'
- report_type: NULL
- name: NULL
- requirements:
- _permission: 'view config updates report'
-
-config_update_ui.import:
- path: '/admin/config/development/configuration/report/import/{config_type}/{config_name}'
- defaults:
- _title: 'Import'
- _form: '\Drupal\config_update_ui\Form\ConfigImportConfirmForm'
- requirements:
- _permission: 'import configuration'
-
-config_update_ui.diff:
- path: '/admin/config/development/configuration/report/diff/{config_type}/{config_name}'
- defaults:
- _title: 'Differences'
- _controller: '\Drupal\config_update_ui\Controller\ConfigUpdateController::diff'
- config_type: NULL
- config_name: NULL
- requirements:
- _permission: 'view config updates report'
-
-config_update_ui.revert:
- path: '/admin/config/development/configuration/report/revert/{config_type}/{config_name}'
- defaults:
- _title: 'Revert'
- _form: '\Drupal\config_update_ui\Form\ConfigRevertConfirmForm'
- requirements:
- _permission: 'revert configuration'
-
-config_update_ui.delete:
- path: '/admin/config/development/configuration/report/delete/{config_type}/{config_name}'
- defaults:
- _title: 'Delete'
- _form: '\Drupal\config_update_ui\Form\ConfigDeleteConfirmForm'
- requirements:
- _permission: 'delete configuration'
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css b/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css
deleted file mode 100644
index 77b8d10b3..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/css/config_update_ui.report.css
+++ /dev/null
@@ -1,13 +0,0 @@
-/**
- * @file
- * Styling for the Config Updates report.
- */
-
-table.config-update-report {
- margin-top: 2em;
-}
-
-table.config-update-report caption {
- font-weight: bold;
- font-size: 1.1em;
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php
deleted file mode 100644
index 31ed06d7a..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Controller/ConfigUpdateController.php
+++ /dev/null
@@ -1,656 +0,0 @@
-configDiff = $config_diff;
- $this->configList = $config_list;
- $this->configRevert = $config_update;
- $this->diffFormatter = $diff_formatter;
- $this->diffFormatter->show_header = FALSE;
- $this->moduleHandler = $module_handler;
- $this->themeHandler = $theme_handler;
- $this->configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('config_update.config_diff'),
- $container->get('config_update.config_list'),
- $container->get('config_update.config_update'),
- $container->get('diff.formatter'),
- $container->get('module_handler'),
- $container->get('theme_handler'),
- $container->get('config.factory')
- );
- }
-
- /**
- * Shows the diff between active and provided configuration.
- *
- * @param string $config_type
- * The type of configuration.
- * @param string $config_name
- * The name of the config item, without the prefix.
- *
- * @return array
- * Render array for page showing differences between them.
- */
- public function diff($config_type, $config_name) {
- $diff = $this->configDiff->diff(
- $this->configRevert->getFromExtension($config_type, $config_name),
- $this->configRevert->getFromActive($config_type, $config_name)
- );
-
- $build = [];
- $definition = $this->configList->getType($config_type);
- $config_type_label = ($definition) ? $definition->getLabel() : $this->t('Simple configuration');
- $build['#title'] = $this->t('Config difference for @type @name', ['@type' => $config_type_label, '@name' => $config_name]);
- $build['#attached']['library'][] = 'system/diff';
-
- $build['diff'] = [
- '#type' => 'table',
- '#header' => [
- ['data' => $this->t('Source config'), 'colspan' => '2'],
- ['data' => $this->t('Site config'), 'colspan' => '2'],
- ],
- '#rows' => $this->diffFormatter->format($diff),
- '#attributes' => ['class' => ['diff']],
- ];
-
- $url = new Url('config_update_ui.report');
-
- $build['back'] = [
- '#type' => 'link',
- '#attributes' => [
- 'class' => [
- 'dialog-cancel',
- ],
- ],
- '#title' => $this->t("Back to 'Updates report' page."),
- '#url' => $url,
- ];
-
- return $build;
- }
-
- /**
- * Generates the config updates report.
- *
- * @param string $report_type
- * (optional) Type of report to run:
- * - type: Configuration entity type.
- * - module: Module.
- * - theme: Theme.
- * - profile: Install profile.
- * @param string $name
- * (optional) Name of specific item to run report for (config entity type
- * ID, module machine name, etc.). Ignored for profile.
- *
- * @return array
- * Render array for report, with section at the top for selecting another
- * report to run. If either $report_type or $name is missing, the report
- * itself is not generated.
- */
- public function report($report_type = NULL, $name = NULL) {
- $links = $this->generateReportLinks();
-
- $report = $this->generateReport($report_type, $name);
- if (!$report) {
- return $links;
- }
-
- // If there is a report, extract the title, put table of links in a
- // details element, and add report to build.
- $build = [];
- $build['#title'] = $report['#title'];
- unset($report['#title']);
-
- $build['links_wrapper'] = [
- '#type' => 'details',
- '#title' => $this->t('Generate new report'),
- '#children' => $links,
- ];
-
- $build['report'] = $report;
-
- $build['#attached']['library'][] = 'config_update/report_css';
-
- return $build;
- }
-
- /**
- * Generates the operations links for running individual reports.
- *
- * @return array
- * Render array for the operations links for running reports.
- */
- protected function generateReportLinks() {
-
- // These links are put into an 'operations' render array element. They do
- // not look good outside of tables. Also note that the array index in
- // operations links is used as a class on the LI element. Some classes are
- // special in the Seven CSS, such as "contextual", so avoid hitting these
- // accidentally by prefixing.
- $build = [];
-
- $build['links'] = [
- '#type' => 'table',
- '#header' => [
- $this->t('Report type'),
- $this->t('Report on'),
- ],
- '#rows' => [],
- ];
-
- // Full report of all configuration.
- $links['report_full'] = [
- 'title' => $this->t('Everything'),
- 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => 'system.all']),
- ];
- $build['links']['#rows'][] = [
- $this->t('Full report'),
- [
- 'data' => [
- '#type' => 'operations',
- '#links' => $links,
- ],
- ],
- ];
-
- // Reports by configuration type.
- $definitions = $this->configList->listTypes();
- $links = [];
- foreach ($definitions as $entity_type => $definition) {
- $links['report_type_' . $entity_type] = [
- 'title' => $definition->getLabel(),
- 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => $entity_type]),
- ];
- }
-
- uasort($links, [$this, 'sortLinks']);
-
- $links = [
- 'report_type_system.simple' => [
- 'title' => $this->t('Simple configuration'),
- 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'type', 'name' => 'system.simple']),
- ],
- ] + $links;
-
- $build['links']['#rows'][] = [
- $this->t('Single configuration type'),
- [
- 'data' => [
- '#type' => 'operations',
- '#links' => $links,
- ],
- ],
- ];
-
- // Make a list of installed modules.
- $profile = $this->getProfileName();
- $modules = $this->moduleHandler->getModuleList();
- $links = [];
- foreach ($modules as $machine_name => $module) {
- if ($machine_name != $profile && $this->configList->providerHasConfig('module', $machine_name)) {
- $links['report_module_' . $machine_name] = [
- 'title' => $this->moduleHandler->getName($machine_name),
- 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'module', 'name' => $machine_name]),
- ];
- }
- }
- uasort($links, [$this, 'sortLinks']);
-
- $build['links']['#rows'][] = [
- $this->t('Single module'),
- [
- 'data' => [
- '#type' => 'operations',
- '#links' => $links,
- ],
- ],
- ];
-
- // Make a list of installed themes.
- $themes = $this->themeHandler->listInfo();
- $links = [];
- foreach ($themes as $machine_name => $theme) {
- if ($this->configList->providerHasConfig('theme', $machine_name)) {
- $links['report_theme_' . $machine_name] = [
- 'title' => $this->themeHandler->getName($machine_name),
- 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'theme', 'name' => $machine_name]),
- ];
- }
- }
- uasort($links, [$this, 'sortLinks']);
-
- $build['links']['#rows'][] = [
- $this->t('Single theme'),
- [
- 'data' => [
- '#type' => 'operations',
- '#links' => $links,
- ],
- ],
- ];
-
- $links = [];
-
- // Profile is just one option.
- if ($this->configList->providerHasConfig('profile', $profile)) {
- $links['report_profile_' . $profile] = [
- 'title' => $this->moduleHandler->getName($profile),
- 'url' => Url::fromRoute('config_update_ui.report', ['report_type' => 'profile']),
- ];
- $build['links']['#rows'][] = [
- $this->t('Installation profile'),
- [
- 'data' => [
- '#type' => 'operations',
- '#links' => $links,
- ],
- ],
- ];
- }
-
- return $build;
- }
-
- /**
- * Generates a report about config updates.
- *
- * @param string $report_type
- * Type of report to generate: 'type', 'module', 'theme', or 'profile'.
- * @param string $value
- * Machine name of a configuration type, module, or theme to generate the
- * report for. Ignored for profile, since that uses the active profile.
- *
- * @return array
- * Render array for the updates report. Empty if invalid or missing
- * report type or value.
- */
- protected function generateReport($report_type, $value) {
- // Figure out what to name the report, and incidentally, validate that
- // $value exists for this type of report.
- switch ($report_type) {
- case 'type':
- if ($value == 'system.all') {
- $label = $this->t('All configuration');
- }
- elseif ($value == 'system.simple') {
- $label = $this->t('Simple configuration');
- }
- else {
- $definition = $this->configList->getType($value);
- if (!$definition) {
- return NULL;
- }
-
- $label = $this->t('@name configuration', ['@name' => $definition->getLabel()]);
- }
-
- break;
-
- case 'module':
- $list = $this->moduleHandler->getModuleList();
- if (!isset($list[$value])) {
- return NULL;
- }
-
- $label = $this->t('@name module', ['@name' => $this->moduleHandler->getName($value)]);
- break;
-
- case 'theme':
- $list = $this->themeHandler->listInfo();
- if (!isset($list[$value])) {
- return NULL;
- }
-
- $label = $this->t('@name theme', ['@name' => $this->themeHandler->getName($value)]);
- break;
-
- case 'profile':
- $profile = $this->getProfileName();
- $label = $this->t('@name profile', ['@name' => $this->moduleHandler->getName($profile)]);
- break;
-
- default:
- return NULL;
- }
-
- // List the active and extension-provided config.
- list($active_list, $install_list, $optional_list) = $this->configList->listConfig($report_type, $value);
-
- // Build the report.
- $build = [];
-
- $build['#title'] = $this->t('Configuration updates report for @label', ['@label' => $label]);
- $build['report_header'] = ['#markup' => '
' . $this->t('Updates report') . '
'];
-
- // List items missing from site.
- $removed = array_diff($install_list, $active_list);
- $build['removed'] = [
- '#caption' => $this->t('Missing configuration items'),
- '#empty' => $this->t('None: all provided configuration items are in your active configuration.'),
- ] + $this->makeReportTable($removed, 'extension', ['import']);
-
- // List optional items that are not installed.
- $inactive = array_diff($optional_list, $active_list);
- $build['inactive'] = [
- '#caption' => $this->t('Inactive optional items'),
- '#empty' => $this->t('None: all optional configuration items are in your active configuration.'),
- ] + $this->makeReportTable($inactive, 'extension', ['import']);
-
- // List items added to site, which only makes sense in the report for a
- // config type.
- $added = array_diff($active_list, $install_list, $optional_list);
- if ($report_type == 'type') {
- $build['added'] = [
- '#caption' => $this->t('Added configuration items'),
- '#empty' => $this->t('None: all active configuration items of this type were provided by modules, themes, or install profile.'),
- ] + $this->makeReportTable($added, 'active', ['export', 'delete']);
- }
-
- // For differences, we need to go through the array of config in both
- // and see if each config item is the same or not.
- $both = array_diff($active_list, $added);
- $different = [];
- foreach ($both as $name) {
- if (!$this->configDiff->same(
- $this->configRevert->getFromExtension('', $name),
- $this->configRevert->getFromActive('', $name)
- )) {
- $different[] = $name;
- }
- }
- $build['different'] = [
- '#caption' => $this->t('Changed configuration items'),
- '#empty' => $this->t('None: no active configuration items differ from their current provided versions.'),
- ] + $this->makeReportTable($different, 'active',
- ['diff', 'export', 'revert']);
-
- return $build;
- }
-
- /**
- * Builds a table for the report.
- *
- * @param string[] $names
- * List of machine names of config items for the table.
- * @param string $storage
- * Config storage the items can be loaded from, either 'active' or
- * 'extension'.
- * @param string[] $actions
- * Action links to include, one or more of:
- * - diff
- * - revert
- * - export
- * - import
- * - delete.
- *
- * @return array
- * Render array for the table, not including the #empty and #prefix
- * properties.
- */
- protected function makeReportTable(array $names, $storage, array $actions) {
- $build = [];
-
- $build['#type'] = 'table';
-
- $build['#attributes'] = ['class' => ['config-update-report']];
-
- $build['#header'] = [
- 'name' => [
- 'data' => $this->t('Machine name'),
- ],
- 'label' => [
- 'data' => $this->t('Label (if any)'),
- 'class' => [RESPONSIVE_PRIORITY_LOW],
- ],
- 'type' => [
- 'data' => $this->t('Type'),
- 'class' => [RESPONSIVE_PRIORITY_MEDIUM],
- ],
- 'provider' => [
- 'data' => $this->t('Provider'),
- 'class' => [RESPONSIVE_PRIORITY_LOW],
- ],
- 'operations' => [
- 'data' => $this->t('Operations'),
- ],
- ];
-
- $build['#rows'] = [];
-
- foreach ($names as $name) {
- $row = [];
- if ($storage == 'active') {
- $config = $this->configRevert->getFromActive('', $name);
- }
- else {
- $config = $this->configRevert->getFromExtension('', $name);
- }
-
- // Figure out what type of config it is, and get the ID.
- $entity_type = $this->configList->getTypeNameByConfigName($name);
-
- if (!$entity_type) {
- // This is simple config.
- $id = $name;
- $label = '';
- $type_label = $this->t('Simple configuration');
- $entity_type = 'system.simple';
- }
- else {
- $definition = $this->configList->getType($entity_type);
- $id_key = $definition->getKey('id');
- $id = $config[$id_key];
- // The label key is not required.
- if ($label_key = $definition->getKey('label')) {
- $label = $config[$label_key];
- }
- else {
- $label = '';
- }
-
- $type_label = $definition->getLabel();
- }
-
- $row[] = $name;
- $row[] = $label;
- $row[] = $type_label;
- $provider = $this->configList->getConfigProvider($name);
- $provider_name = '';
- if (!empty($provider)) {
- switch ($provider[0]) {
- case 'profile':
- $provider_name = $this->moduleHandler->getName($provider[1]);
- if ($provider_name) {
- $provider_name = $this->t('@name profile', ['@name' => $provider_name]);
- }
- else {
- $provider_name = '';
- }
- break;
-
- case 'module':
- $provider_name = $this->moduleHandler->getName($provider[1]);
- if ($provider_name) {
- $provider_name = $this->t('@name module', ['@name' => $provider_name]);
- }
- else {
- $provider_name = '';
- }
- break;
-
- case 'theme':
- $provider_name = $this->themeHandler->getName($provider[1]);
- if ($provider_name) {
- $provider_name = $this->t('@name theme', ['@name' => $provider_name]);
- }
- else {
- $provider_name = '';
- }
- break;
- }
- }
- $row[] = $provider_name;
-
- $links = [];
- $routes = [
- 'export' => 'config.export_single',
- 'import' => 'config_update_ui.import',
- 'diff' => 'config_update_ui.diff',
- 'revert' => 'config_update_ui.revert',
- 'delete' => 'config_update_ui.delete',
- ];
- $titles = [
- 'export' => $this->t('Export'),
- 'import' => $this->t('Import from source'),
- 'diff' => $this->t('Show differences'),
- 'revert' => $this->t('Revert to source'),
- 'delete' => $this->t('Delete'),
- ];
-
- foreach ($actions as $action) {
- $links[$action] = [
- 'url' => Url::fromRoute($routes[$action], ['config_type' => $entity_type, 'config_name' => $id]),
- 'title' => $titles[$action],
- ];
- }
-
- $row[] = [
- 'data' => [
- '#type' => 'operations',
- '#links' => $links,
- ],
- ];
-
- $build['#rows'][] = $row;
- }
-
- return $build;
- }
-
- /**
- * Compares links for uasort(), to sort by displayed link title.
- */
- protected static function sortLinks($link1, $link2) {
- $title1 = $link1['title'];
- $title2 = $link2['title'];
- if ($title1 == $title2) {
- return 0;
- }
- return ($title1 < $title2) ? -1 : 1;
- }
-
- /**
- * Returns the name of the install profile.
- *
- * For backwards compatibility with pre/post 8.3.x, tries to get it from
- * either configuration or settings.
- *
- * @return string
- * The name of the install profile.
- */
- protected function getProfileName() {
- // Code adapted from DrupalKernel::getInstalProfile() in Core.
- // In Core 8.3.x or later, read from config.
- $profile = $this->configFactory->get('core.extension')->get('profile');
- if (!empty($profile)) {
- return $profile;
- }
- else {
- // If system_update_8300() has not yet run, use settings.
- return Settings::get('install_profile');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php
deleted file mode 100644
index c11e9ba94..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigDeleteConfirmForm.php
+++ /dev/null
@@ -1,144 +0,0 @@
-configList = $config_list;
- $this->configRevert = $config_update;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('config_update.config_list'),
- $container->get('config_update.config_update')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'config_delete_confirm';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getQuestion() {
- if ($this->type == 'system.simple') {
- $type_label = $this->t('Simple configuration');
- }
- else {
- $definition = $this->configList->getType($this->type);
- if (!$definition) {
- // Make a 404 error if the type doesn't exist.
- throw new NotFoundHttpException();
- }
- $type_label = $definition->get('label');
- }
-
- // To delete, the configuration item must exist in active storage. Check
- // that and make a 404 error if not.
- $active = $this->configRevert->getFromActive($this->type, $this->name);
- if (!$active) {
- throw new NotFoundHttpException();
- }
-
- return $this->t('Are you sure you want to delete the %type config %item?', ['%type' => $type_label, '%item' => $this->name]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('config_update_ui.report');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return $this->t('This action cannot be undone. Manually deleting configuration from this page can cause problems on your site due to missing dependencies, and should only be done if there is no other way to delete a problematic piece of configuration.');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Delete');
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) {
- $this->type = $config_type;
- $this->name = $config_name;
-
- $form = parent::buildForm($form, $form_state);
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->configRevert->delete($this->type, $this->name);
-
- $this->messenger()->addMessage($this->t('The configuration %item has been deleted.', ['%item' => $this->name]));
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigImportConfirmForm.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigImportConfirmForm.php
deleted file mode 100644
index 2d064f6e2..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigImportConfirmForm.php
+++ /dev/null
@@ -1,146 +0,0 @@
-configList = $config_list;
- $this->configRevert = $config_update;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('config_update.config_list'),
- $container->get('config_update.config_update')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'config_import_confirm';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getQuestion() {
- if ($this->type == 'system.simple') {
- $type_label = $this->t('Simple configuration');
- }
- else {
- $definition = $this->configList->getType($this->type);
- if (!$definition) {
- // Make a 404 error if the type doesn't exist.
- throw new NotFoundHttpException();
- }
- $type_label = $definition->get('label');
- }
-
- // To import (as opposed to revert), the configuration item must exist in
- // extension storage but not active storage, so check that, and make a 404
- // error if not.
- $extension = $this->configRevert->getFromExtension($this->type, $this->name);
- $active = $this->configRevert->getFromActive($this->type, $this->name);
- if (!$extension || $active) {
- throw new NotFoundHttpException();
- }
-
- return $this->t('Are you sure you want to import the %type config %item from its source configuration?', ['%type' => $type_label, '%item' => $this->name]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('config_update_ui.report');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return $this->t('Configuration will be added to your site. This action cannot be undone.');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Import');
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) {
- $this->type = $config_type;
- $this->name = $config_name;
-
- $form = parent::buildForm($form, $form_state);
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->configRevert->import($this->type, $this->name);
-
- $this->messenger()->addMessage($this->t('The configuration %item has been imported from its source.', ['%item' => $this->name]));
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php
deleted file mode 100644
index 8785d0fc5..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/src/Form/ConfigRevertConfirmForm.php
+++ /dev/null
@@ -1,146 +0,0 @@
-configList = $config_list;
- $this->configRevert = $config_update;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('config_update.config_list'),
- $container->get('config_update.config_update')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'config_update_confirm';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getQuestion() {
- if ($this->type == 'system.simple') {
- $type_label = $this->t('Simple configuration');
- }
- else {
- $definition = $this->configList->getType($this->type);
- if (!$definition) {
- // Make a 404 error if the type doesn't exist.
- throw new NotFoundHttpException();
- }
- $type_label = $definition->get('label');
- }
-
- // To revert (as opposed to import), the configuration item must exist in
- // both active storage and extension storage, so check that and make a 404
- // error if not.
- $extension = $this->configRevert->getFromExtension($this->type, $this->name);
- $active = $this->configRevert->getFromActive($this->type, $this->name);
- if (!$extension || !$active) {
- throw new NotFoundHttpException();
- }
-
- return $this->t('Are you sure you want to revert the %type config %item to its source configuration?', ['%type' => $type_label, '%item' => $this->name]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('config_update_ui.report');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return $this->t('Customizations will be lost. This action cannot be undone.');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Revert');
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state, $config_type = NULL, $config_name = NULL) {
- $this->type = $config_type;
- $this->name = $config_name;
-
- $form = parent::buildForm($form, $form_state);
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->configRevert->revert($this->type, $this->name);
-
- $this->messenger()->addMessage($this->t('The configuration %item has been reverted to its source.', ['%item' => $this->name]));
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigProfileOverridesTest.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigProfileOverridesTest.php
deleted file mode 100644
index f2ced76e1..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigProfileOverridesTest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-adminUser = $this->createUser([
- 'access administration pages',
- 'administer themes',
- 'view config updates report',
- 'synchronize configuration',
- 'export configuration',
- 'import configuration',
- 'revert configuration',
- 'delete configuration',
- ]);
- $this->drupalLogin($this->adminUser);
- }
-
- /**
- * Tests that config overrides work as expected.
- */
- public function testConfigOverrides() {
-
- // The Standard install profile contains a system.theme.yml file that
- // sets up bartik/seven as the default/admin theme. The default config
- // from the System module has no admin theme and stark as the default
- // theme. So first, run the report on simple configuration and verify
- // that system.theme is not shown (it should not be missing, or added,
- // or overridden).
- $this->drupalGet('admin/config/development/configuration/report/type/system.simple');
- $session = $this->assertSession();
- $session->responseNotContains('system.theme');
-
- // Go to the Appearance page and change the theme to whatever is currently
- // disabled. Return to the report and verify that system.theme is there,
- // since it is now overridden.
- $this->drupalGet('admin/appearance');
- $this->clickLink('Install and set as default');
- $this->drupalGet('admin/config/development/configuration/report/type/system.simple');
- $session = $this->assertSession();
- $session->pageTextContains('system.theme');
-
- // Look at the differences for system.theme and verify it's against
- // the standard profile version, not default version. The line for
- // default should show bartik as the source; if it's against the system
- // version, the word bartik would not be there.
- $this->drupalGet('admin/config/development/configuration/report/diff/system.simple/system.theme');
- $session = $this->assertSession();
- $session->pageTextContains('bartik');
-
- // Revert and verify that it reverted to the profile version, not the
- // system module version.
- $this->drupalGet('admin/config/development/configuration/report/revert/system.simple/system.theme');
- $this->drupalPostForm(NULL, [], 'Revert');
- $this->drupalGet('admin/config/development/configuration/single/export/system.simple/system.theme');
- $session = $this->assertSession();
- $session->pageTextContains('admin: seven');
- $session->pageTextContains('default: bartik');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigUpdateTest.php b/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigUpdateTest.php
deleted file mode 100644
index 4f2c943d1..000000000
--- a/sites/all/modules/contrib/admin/config_update/config_update_ui/tests/src/Functional/ConfigUpdateTest.php
+++ /dev/null
@@ -1,544 +0,0 @@
-adminUser = $this->createUser([
- 'access administration pages',
- 'administer search',
- 'view config updates report',
- 'synchronize configuration',
- 'export configuration',
- 'import configuration',
- 'revert configuration',
- 'delete configuration',
- 'administer filters',
- ]);
- $this->drupalLogin($this->adminUser);
-
- // Make sure local tasks and page title are showing.
- $this->placeBlock('local_tasks_block');
- $this->placeBlock('page_title_block');
-
- // Load the Drush include file so that its functions can be tested, plus
- // the Drush testing include file.
- module_load_include('inc', 'config_update_ui', 'config_update_ui.drush_testing');
- module_load_include('inc', 'config_update_ui', 'config_update_ui.drush');
- }
-
- /**
- * Tests the config report and its linked pages.
- */
- public function testConfigReport() {
- // Test links to report page.
- $this->drupalGet('admin/config/development/configuration');
- $this->clickLink('Updates report');
- $this->assertNoReport();
-
- // Verify the Drush list types command.
- $output = implode("\n", drush_config_update_ui_config_list_types());
- $this->assertTrue(strpos($output, 'search_page') !== FALSE);
- $this->assertTrue(strpos($output, 'node_type') !== FALSE);
- $this->assertTrue(strpos($output, 'user_role') !== FALSE);
- $this->assertTrue(strpos($output, 'block') !== FALSE);
-
- // Verify some empty reports.
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], []);
- $this->assertDrushReports('type', 'search_page', [], [], [], []);
-
- // Module, theme, and profile reports have no 'added' section.
- $this->drupalGet('admin/config/development/configuration/report/module/search');
- $this->assertReport('Search module', [], [], [], [], ['added']);
- $this->assertDrushReports('module', 'search', [], [], [], []);
- $this->drupalGet('admin/config/development/configuration/report/theme/classy');
- $this->assertReport('Classy theme', [], [], [], [], ['added']);
- $this->assertDrushReports('theme', 'classy', [], [], [], []);
-
- $inactive = ['locale.settings' => 'Simple configuration'];
- $this->drupalGet('admin/config/development/configuration/report/profile');
- $this->assertReport('Testing profile', [], [], [], $inactive, ['added']);
- // The locale.settings line should show that the Testing profile is the
- // provider.
- $session = $this->assertSession();
- $session->pageTextContains('Testing profile');
- $this->assertDrushReports('profile', '', [], [], [], array_keys($inactive));
-
- // Verify that the user search page cannot be imported (because it already
- // exists).
- $this->drupalGet('admin/config/development/configuration/report/import/search_page/user_search');
- $session = $this->assertSession();
- $session->statusCodeEquals(404);
-
- // Delete the user search page from the search UI and verify report for
- // both the search page config type and user module.
- $this->drupalGet('admin/config/search/pages');
- $this->clickLink('Delete');
- $this->drupalPostForm(NULL, [], 'Delete');
- $inactive = ['search.page.user_search' => 'Users'];
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], $inactive);
- // The search.page.user_search line should show that the User module is the
- // provider.
- $session = $this->assertSession();
- $session->pageTextContains('User module');
- $this->assertDrushReports('type', 'search_page', [], [], [], array_keys($inactive));
-
- $this->drupalGet('admin/config/development/configuration/report/module/user');
- $this->assertReport('User module', [], [], [], $inactive, ['added', 'changed']);
- $this->assertDrushReports('module', 'user', [], [], [],
- [
- 'rdf.mapping.user.user',
- 'search.page.user_search',
- 'views.view.user_admin_people',
- 'views.view.who_s_new',
- 'views.view.who_s_online',
- ], ['changed']);
-
- // Verify that the user search page cannot be reverted (because it does
- // not already exist).
- $this->drupalGet('admin/config/development/configuration/report/revert/search_page/user_search');
- $session = $this->assertSession();
- $session->statusCodeEquals(404);
- // Verify that the delete URL doesn't work either.
- $this->drupalGet('admin/config/development/configuration/report/delete/search_page/user_search');
- $session = $this->assertSession();
- $session->statusCodeEquals(404);
-
- // Use the import link to get it back. Do this from the search page
- // report to make sure we are importing the right config.
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->clickLink('Import from source');
- $this->drupalPostForm(NULL, [], 'Import');
- $session = $this->assertSession();
- $session->pageTextContains('has been imported');
- $this->assertNoReport();
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], []);
- $this->assertDrushReports('type', 'search_page', [], [], [], []);
-
- // Verify that after import, there is no config hash generated.
- $this->drupalGet('admin/config/development/configuration/single/export/search_page/user_search');
- $session = $this->assertSession();
- $session->pageTextContains('id: user_search');
- $session->pageTextNotContains('default_config_hash:');
-
- // Test importing again, this time using the Drush import command.
- $this->drupalGet('admin/config/search/pages');
- $this->clickLink('Delete');
- $this->drupalPostForm(NULL, [], 'Delete');
- $inactive = ['search.page.user_search' => 'Users'];
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], $inactive);
- drush_config_update_ui_config_import_missing('search.page.user_search');
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], []);
-
- // Edit the node search page from the search UI and verify report.
- $this->drupalGet('admin/config/search/pages');
- $this->clickLink('Edit');
- $this->drupalPostForm(NULL, [
- 'label' => 'New label',
- 'path' => 'new_path',
- ], 'Save search page');
- $changed = ['search.page.node_search' => 'New label'];
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], $changed, []);
- $this->assertDrushReports('type', 'search_page', [], [], array_keys($changed), []);
-
- // Test the show differences link.
- $this->clickLink('Show differences');
- $session = $this->assertSession();
- $session->pageTextContains('Content');
- $session->pageTextContains('New label');
- $session->pageTextContains('node');
- $session->pageTextContains('new_path');
-
- // Test the show differences Drush command.
- $output = drush_config_update_ui_config_diff('search.page.node_search');
- $this->assertTrue(strpos($output, 'Content') !== FALSE);
- $this->assertTrue(strpos($output, 'New label') !== FALSE);
- $this->assertTrue(strpos($output, 'node') !== FALSE);
- $this->assertTrue(strpos($output, 'new_path') !== FALSE);
-
- // Test the Back link.
- $this->clickLink("Back to 'Updates report' page.");
- $this->assertNoReport();
-
- // Test the export link.
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->clickLink('Export');
- $session = $this->assertSession();
- $session->pageTextContains('Here is your configuration:');
- $session->pageTextContains('id: node_search');
- $session->pageTextContains('New label');
- $session->pageTextContains('path: new_path');
- $session->pageTextContains('search.page.node_search.yml');
-
- // Grab the uuid and hash lines from the exported config for the next test.
- $text = strip_tags($this->getSession()->getPage()->find('css', 'textarea')->getHtml());
- $matches = [];
- preg_match('|^.*uuid:.*$|m', $text, $matches);
- $uuid_line = trim($matches[0]);
- preg_match('|^.*default_config_hash:.*$|m', $text, $matches);
- $hash_line = trim($matches[0]);
-
- // Test reverting.
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->clickLink('Revert to source');
- $session = $this->assertSession();
- $session->pageTextContains('Are you sure you want to revert');
- $session->pageTextContains('Search page');
- $session->pageTextContains('node_search');
- $session->pageTextContains('Customizations will be lost. This action cannot be undone');
- $this->drupalPostForm(NULL, [], 'Revert');
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], []);
-
- // Verify that the uuid and hash keys were retained in the revert.
- $this->drupalGet('admin/config/development/configuration/single/export/search_page/node_search');
- $session = $this->assertSession();
- $session->pageTextContains('id: node_search');
- $session->pageTextContains($uuid_line);
- $session->pageTextContains($hash_line);
-
- // Test reverting again, this time using Drush single revert command.
- $this->drupalGet('admin/config/search/pages');
- $this->clickLink('Edit');
- $this->drupalPostForm(NULL, [
- 'label' => 'New label',
- 'path' => 'new_path',
- ], 'Save search page');
- $changed = ['search.page.node_search' => 'New label'];
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], $changed, []);
- drush_config_update_ui_config_revert('search.page.node_search');
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], []);
-
- // Test reverting again, this time using Drush multiple revert command.
- $this->drupalGet('admin/config/search/pages');
- $this->clickLink('Edit');
- $this->drupalPostForm(NULL, [
- 'label' => 'New label',
- 'path' => 'new_path',
- ], 'Save search page');
- $changed = ['search.page.node_search' => 'New label'];
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], $changed, []);
- drush_config_update_ui_config_revert_multiple('type', 'search_page');
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], []);
-
- // Add a new search page from the search UI and verify report.
- $this->drupalPostForm('admin/config/search/pages', [
- 'search_type' => 'node_search',
- ], 'Add search page');
- $this->drupalPostForm(NULL, [
- 'label' => 'test',
- 'id' => 'test',
- 'path' => 'test',
- ], 'Save');
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $added = ['search.page.test' => 'test'];
- $this->assertReport('Search page', [], $added, [], []);
- $this->assertDrushReports('type', 'search_page', [], array_keys($added), [], []);
-
- // Test the export link.
- $this->clickLink('Export');
- $session = $this->assertSession();
- $session->pageTextContains('Here is your configuration:');
- $session->pageTextContains('id: test');
- $session->pageTextContains('label: test');
- $session->pageTextContains('path: test');
- $session->pageTextContains('search.page.test.yml');
-
- // Test the delete link.
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->clickLink('Delete');
- $session = $this->assertSession();
- $session->pageTextContains('Are you sure');
- $session->pageTextContains('cannot be undone');
- $this->drupalPostForm(NULL, [], 'Delete');
- $session = $this->assertSession();
- $session->pageTextContains('has been deleted');
-
- // And verify the report again.
- $this->drupalGet('admin/config/development/configuration/report/type/search_page');
- $this->assertReport('Search page', [], [], [], []);
-
- // Change the search module config and verify the actions work for
- // simple config.
- $this->drupalPostForm('admin/config/search/pages', [
- 'minimum_word_size' => 4,
- ], 'Save configuration');
- $changed = ['search.settings' => 'search.settings'];
- $this->drupalGet('admin/config/development/configuration/report/module/search');
- $this->assertReport('Search module', [], [], $changed, [], ['added']);
-
- $this->clickLink('Show differences');
- $session = $this->assertSession();
- $session->pageTextContains('Config difference for Simple configuration search.settings');
- $session->pageTextContains('index::minimum_word_size');
- $session->pageTextContains('4');
-
- $this->drupalGet('admin/config/development/configuration/report/module/search');
- $this->clickLink('Export');
- $session = $this->assertSession();
- $session->pageTextContains('minimum_word_size: 4');
- // Grab the hash line for the next test.
- $text = strip_tags($this->getSession()->getPage()->find('css', 'textarea')->getHtml());
- $matches = [];
- preg_match('|^.*default_config_hash:.*$|m', $text, $matches);
- $hash_line = trim($matches[0]);
-
- $this->drupalGet('admin/config/development/configuration/report/module/search');
- $this->clickLink('Revert to source');
- $this->drupalPostForm(NULL, [], 'Revert');
-
- // Verify that the hash was retained in the revert.
- $this->drupalGet('admin/config/development/configuration/single/export/system.simple/search.settings');
- $session = $this->assertSession();
- $session->pageTextContains($hash_line);
-
- $this->drupalGet('admin/config/development/configuration/report/module/search');
- $this->assertReport('Search module', [], [], [], [], ['added']);
-
- // Edit the plain_text filter from the filter UI and verify report.
- // The filter_format config type uses a label key other than 'label'.
- $this->drupalPostForm('admin/config/content/formats/manage/plain_text', [
- 'name' => 'New label',
- ], 'Save configuration');
- $changed = ['filter.format.plain_text' => 'New label'];
- $this->drupalGet('admin/config/development/configuration/report/type/filter_format');
- $this->assertReport('Text format', [], [], $changed, []);
-
- // Verify that we can revert non-entity configuration in Drush. Issue:
- // https://www.drupal.org/project/config_update/issues/2935395
- drush_config_update_ui_config_revert('system.date');
- }
-
- /**
- * Asserts that the report page has the correct content.
- *
- * Assumes you are already on the report page.
- *
- * @param string $title
- * Report title to check for.
- * @param string[] $missing
- * Array of items that should be listed as missing, name => label.
- * @param string[] $added
- * Array of items that should be listed as added, name => label.
- * @param string[] $changed
- * Array of items that should be listed as changed, name => label.
- * @param string[] $inactive
- * Array of items that should be listed as inactive, name => label.
- * @param string[] $skip
- * Array of report sections to skip checking.
- */
- protected function assertReport($title, array $missing, array $added, array $changed, array $inactive, array $skip = []) {
- $session = $this->assertSession();
- $session->pageTextContains('Configuration updates report for ' . $title);
- $session->pageTextContains('Generate new report');
-
- if (!in_array('missing', $skip)) {
- $session->pageTextContains('Missing configuration items');
- if (count($missing)) {
- foreach ($missing as $name => $label) {
- $session->pageTextContains($name);
- $session->pageTextContains($label);
- }
- $session->pageTextNotContains('None: all provided configuration items are in your active configuration.');
- }
- else {
- $session->pageTextContains('None: all provided configuration items are in your active configuration.');
- }
- }
-
- if (!in_array('inactive', $skip)) {
- $session->pageTextContains('Inactive optional items');
- if (count($inactive)) {
- foreach ($inactive as $name => $label) {
- $session->pageTextContains($name);
- $session->pageTextContains($label);
- }
- $session->pageTextNotContains('None: all optional configuration items are in your active configuration.');
- }
- else {
- $session->pageTextContains('None: all optional configuration items are in your active configuration.');
- }
- }
-
- if (!in_array('added', $skip)) {
- $session->pageTextContains('Added configuration items');
- if (count($added)) {
- foreach ($added as $name => $label) {
- $session->pageTextContains($name);
- $session->pageTextContains($label);
- }
- $session->pageTextNotContains('None: all active configuration items of this type were provided by modules, themes, or install profile.');
- }
- else {
- $session->pageTextContains('None: all active configuration items of this type were provided by modules, themes, or install profile.');
- }
- }
-
- if (!in_array('changed', $skip)) {
- $session->pageTextContains('Changed configuration items');
- if (count($changed)) {
- foreach ($changed as $name => $label) {
- $session->pageTextContains($name);
- $session->pageTextContains($label);
- }
- $session->pageTextNotContains('None: no active configuration items differ from their current provided versions.');
- }
- else {
- $session->pageTextContains('None: no active configuration items differ from their current provided versions.');
- }
- }
- }
-
- /**
- * Asserts that the Drush reports have the correct content.
- *
- * @param string $type
- * Type of report to run (type, module, theme, etc.).
- * @param string $name
- * Name of that type to run (e.g., module machine name).
- * @param string[] $missing
- * Array of config items that should be listed as missing.
- * @param string[] $added
- * Array of config items that should be listed as added.
- * @param string[] $changed
- * Array of config items that should be listed as changed.
- * @param string[] $inactive
- * Array of config items that should be listed as inactive.
- * @param string[] $skip
- * Array of report sections to skip checking.
- */
- protected function assertDrushReports($type, $name, array $missing, array $added, array $changed, array $inactive, array $skip = []) {
- if (!in_array('missing', $skip)) {
- $output = drush_config_update_ui_config_missing_report($type, $name);
- $this->assertEquals(count($output), count($missing), 'Drush missing report has correct number of items');
- if (count($missing)) {
- foreach ($missing as $item) {
- $this->assertTrue(in_array($item, $output), "Item $item is in the Drush missing report");
- }
- }
- }
-
- if (!in_array('added', $skip) && $type == 'type') {
- $output = drush_config_update_ui_config_added_report($name);
- $this->assertEquals(count($output), count($added), 'Drush added report has correct number of items');
- if (count($added)) {
- foreach ($added as $item) {
- $this->assertTrue(in_array($item, $output), "Item $item is in the Drush added report");
- }
- }
- }
-
- if (!in_array('changed', $skip)) {
- $output = drush_config_update_ui_config_different_report($type, $name);
- $this->assertEquals(count($output), count($changed), 'Drush changed report has correct number of items');
- if (count($changed)) {
- foreach ($changed as $item) {
- $this->assertTrue(in_array($item, $output), "Item $item is in the Drush changed report");
- }
- }
- }
-
- if (!in_array('inactive', $skip)) {
- $output = drush_config_update_ui_config_inactive_report($type, $name);
- $this->assertEquals(count($output), count($inactive), 'Drush inactive report has correct number of items');
- if (count($inactive)) {
- foreach ($inactive as $item) {
- $this->assertTrue(in_array($item, $output), "Item $item is in the Drush inactive report");
- }
- }
- }
- }
-
- /**
- * Asserts that the report is not shown.
- *
- * Assumes you are already on the report form page.
- */
- protected function assertNoReport() {
- $session = $this->assertSession();
- $session->pageTextContains('Report type');
- $session->pageTextContains('Full report');
- $session->pageTextContains('Single configuration type');
- $session->pageTextContains('Single module');
- $session->pageTextContains('Single theme');
- $session->pageTextContains('Installation profile');
- $session->pageTextContains('Updates report');
- $session->pageTextNotContains('Missing configuration items');
- $session->pageTextNotContains('Added configuration items');
- $session->pageTextNotContains('Changed configuration items');
- $session->pageTextNotContains('Unchanged configuration items');
-
- // Verify that certain report links are shown or not shown. For extensions,
- // only extensions that have configuration should be shown.
- // Modules.
- $session->linkExists('Search');
- $session->linkExists('Field');
- $session->linkNotExists('Configuration Update Base');
- $session->linkNotExists('Configuration Update Reports');
-
- // Themes.
- $session->linkNotExists('Stark');
- $session->linkNotExists('Classy');
-
- // Profiles.
- $session->linkExists('Testing');
-
- // Configuration types.
- $session->linkExists('Everything');
- $session->linkExists('Simple configuration');
- $session->linkExists('Search page');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/drupalci.yml b/sites/all/modules/contrib/admin/config_update/drupalci.yml
deleted file mode 100644
index 59a556b5e..000000000
--- a/sites/all/modules/contrib/admin/config_update/drupalci.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-# This is the DrupalCI testbot build file for Configuration Update Manager.
-# Learn to make one for your own drupal.org project:
-# https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-testing
-build:
- assessment:
- validate_codebase:
- phplint:
- phpcs:
- # phpcs will use core's specified version of Coder.
- sniff-all-files: true
- halt-on-fail: true
- testing:
- # run_tests task is executed several times in order of performance speeds.
- # halt-on-fail can be set on the run_tests tasks in order to fail fast.
- # suppress-deprecations is false in order to be alerted to usages of
- # deprecated code.
- run_tests.phpunit:
- types: 'PHPUnit-Unit'
- testgroups: '--all'
- suppress-deprecations: false
- halt-on-fail: false
- run_tests.kernel:
- types: 'PHPUnit-Kernel'
- testgroups: '--all'
- suppress-deprecations: false
- halt-on-fail: false
- run_tests.functional:
- types: 'PHPUnit-Functional'
- testgroups: '--all'
- suppress-deprecations: false
- halt-on-fail: false
- run_tests.javascript:
- concurrency: 15
- types: 'PHPUnit-FunctionalJavascript'
- testgroups: '--all'
- suppress-deprecations: false
- halt-on-fail: false
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php
deleted file mode 100644
index 670885097..000000000
--- a/sites/all/modules/contrib/admin/config_update/src/ConfigDeleteInterface.php
+++ /dev/null
@@ -1,37 +0,0 @@
-stringTranslation = $translation;
- $this->hierarchyPrefix = $hierarchy_prefix;
- $this->valuePrefix = $value_prefix;
- $this->ignore = $ignore;
- }
-
- /**
- * Normalizes config for comparison.
- *
- * Removes elements in the ignore list from the top level of configuration,
- * and at each level of the array, removes empty arrays and sorts by array
- * key, so that config from different storage can be compared meaningfully.
- *
- * @param array|null $config
- * Configuration array to normalize.
- *
- * @return array
- * Normalized configuration array.
- *
- * @see ConfigDiffer::format()
- * @see ConfigDiffer::$ignore
- */
- protected function normalize($config) {
- if (empty($config)) {
- return [];
- }
-
- // Remove "ignore" elements, only at the top level.
- foreach ($this->ignore as $element) {
- unset($config[$element]);
- }
-
- // Recursively normalize and return.
- return $this->normalizeArray($config);
- }
-
- /**
- * Recursively sorts an array by key, and removes empty arrays.
- *
- * @param array $array
- * An array to normalize.
- *
- * @return array
- * An array that is sorted by key, at each level of the array, with empty
- * arrays removed.
- */
- protected function normalizeArray(array $array) {
- foreach ($array as $key => $value) {
- if (is_array($value)) {
- $new = $this->normalizeArray($value);
- if (count($new)) {
- $array[$key] = $new;
- }
- else {
- unset($array[$key]);
- }
- }
- }
-
- ksort($array);
- return $array;
- }
-
- /**
- * {@inheritdoc}
- */
- public function same($source, $target) {
- $source = $this->normalize($source);
- $target = $this->normalize($target);
- return $source === $target;
- }
-
- /**
- * Formats config for showing differences.
- *
- * To compute differences, we need to separate the config into lines and use
- * line-by-line differencer. The obvious way to split into lines is:
- * @code
- * explode("\n", Yaml::encode($config))
- * @endcode
- * But this would highlight meaningless differences due to the often different
- * order of config files, and also loses the indentation and context of the
- * config hierarchy when differences are computed, making the difference
- * difficult to interpret.
- *
- * So, what we do instead is to take the YAML hierarchy and format it so that
- * the hierarchy is shown on each line. So, if you're in element
- * $config['foo']['bar'] and the value is 'value', you will see
- * 'foo::bar : value'.
- *
- * @param array $config
- * Config array to format. Normalize it first if you want to do diffs.
- * @param string $prefix
- * (optional) When called recursively, the prefix to put on each line. Omit
- * when initially calling this function.
- *
- * @return string[]
- * Array of config lines formatted so that a line-by-line diff will show the
- * context in each line, and meaningful differences will be computed.
- *
- * @see ConfigDiffer::normalize()
- * @see ConfigDiffer::$hierarchyPrefix
- * @see ConfigDiffer::$valuePrefix
- */
- protected function format(array $config, $prefix = '') {
- $lines = [];
-
- foreach ($config as $key => $value) {
- $section_prefix = ($prefix) ? $prefix . $this->hierarchyPrefix . $key : $key;
-
- if (is_array($value)) {
- $lines[] = $section_prefix;
- $newlines = $this->format($value, $section_prefix);
- foreach ($newlines as $line) {
- $lines[] = $line;
- }
- }
- else {
- $lines[] = $section_prefix . $this->valuePrefix . Yaml::encode($value);
- }
- }
-
- return $lines;
- }
-
- /**
- * {@inheritdoc}
- */
- public function diff($source, $target) {
- $source = $this->normalize($source);
- $target = $this->normalize($target);
-
- $source_lines = $this->format($source);
- $target_lines = $this->format($target);
-
- return new Diff($source_lines, $target_lines);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigListByProviderInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigListByProviderInterface.php
deleted file mode 100644
index 42ff515ed..000000000
--- a/sites/all/modules/contrib/admin/config_update/src/ConfigListByProviderInterface.php
+++ /dev/null
@@ -1,37 +0,0 @@
-entityManager = $entity_manager;
- $this->activeConfigStorage = $active_config_storage;
- $this->extensionConfigStorage = $extension_config_storage;
- $this->extensionOptionalConfigStorage = $extension_optional_config_storage;
- }
-
- /**
- * Sets up and returns the entity definitions list.
- */
- public function listTypes() {
- // Return list if it has already been calculated.
- if (count($this->definitions)) {
- return $this->definitions;
- }
-
- // Calculate and return the list.
- foreach ($this->entityManager->getDefinitions() as $entity_type => $definition) {
- if ($definition->entityClassImplements('Drupal\Core\Config\Entity\ConfigEntityInterface')) {
- $this->definitions[$entity_type] = $definition;
- $prefix = $definition->getConfigPrefix();
- $this->typesByPrefix[$prefix] = $entity_type;
- }
- }
-
- ksort($this->definitions);
-
- return $this->definitions;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getType($name) {
- $definitions = $this->listTypes();
- return isset($definitions[$name]) ? $definitions[$name] : NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getTypeByPrefix($prefix) {
- $definitions = $this->listTypes();
- return isset($this->typesByPrefix[$prefix]) ? $definitions[$this->typesByPrefix[$prefix]] : NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getTypeNameByConfigName($name) {
- $definitions = $this->listTypes();
- foreach ($this->typesByPrefix as $prefix => $entity_type) {
- if (strpos($name, $prefix . '.') === 0) {
- return $entity_type;
- }
- }
-
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function listConfig($list_type, $name) {
- $active_list = [];
- $install_list = [];
- $optional_list = [];
- $definitions = $this->listTypes();
-
- switch ($list_type) {
- case 'type':
- if ($name == 'system.all') {
- $active_list = $this->activeConfigStorage->listAll();
- $install_list = $this->extensionConfigStorage->listAll();
- $optional_list = $this->extensionOptionalConfigStorage->listAll();
- }
- elseif ($name == 'system.simple') {
- // Listing is done by prefixes, and simple config doesn't have one.
- // So list all and filter out all known prefixes.
- $active_list = $this->omitKnownPrefixes($this->activeConfigStorage->listAll());
- $install_list = $this->omitKnownPrefixes($this->extensionConfigStorage->listAll());
- $optional_list = $this->omitKnownPrefixes($this->extensionOptionalConfigStorage->listAll());
- }
- elseif (isset($this->definitions[$name])) {
- $definition = $this->definitions[$name];
- $prefix = $definition->getConfigPrefix();
- $active_list = $this->activeConfigStorage->listAll($prefix);
- $install_list = $this->extensionConfigStorage->listAll($prefix);
- $optional_list = $this->extensionOptionalConfigStorage->listAll($prefix);
- }
- break;
-
- case 'profile':
- $name = $this->getProfileName();
- // Intentional fall-through here to the 'module' or 'theme' case.
- case 'module':
- case 'theme':
- $active_list = $this->activeConfigStorage->listAll();
- $install_list = $this->listProvidedItems($list_type, $name);
- $optional_list = $this->listProvidedItems($list_type, $name, TRUE);
- break;
- }
-
- // This only seems to be a problem in unit tests, where a mock object
- // is returning NULL instead of an empy array for some reason.
- if (!is_array($optional_list)) {
- $optional_list = [];
- }
-
- return [$active_list, $install_list, $optional_list];
- }
-
- /**
- * Returns a list of the install storage items for an extension.
- *
- * @param string $type
- * Type of extension ('module', etc.).
- * @param string $name
- * Machine name of extension.
- * @param bool $do_optional
- * FALSE (default) to list config/install items, TRUE to list
- * config/optional items.
- *
- * @return string[]
- * List of config items provided by this extension.
- */
- protected function listProvidedItems($type, $name, $do_optional = FALSE) {
- $pathname = drupal_get_filename($type, $name);
- $component = new Extension(\Drupal::root(), $type, $pathname);
- if ($do_optional) {
- $names = $this->extensionOptionalConfigStorage->getComponentNames([$component]);
- }
- else {
- $names = $this->extensionConfigStorage->getComponentNames([$component]);
- }
- return array_keys($names);
- }
-
- /**
- * Omits config with known prefixes from a list of config names.
- */
- protected function omitKnownPrefixes($list) {
- $prefixes = array_keys($this->typesByPrefix);
- $list = array_combine($list, $list);
- foreach ($list as $name) {
- foreach ($prefixes as $prefix) {
- if (strpos($name, $prefix . '.') === 0) {
- unset($list[$name]);
- }
- }
- }
-
- return array_values($list);
- }
-
- /**
- * Returns the name of the install profile.
- *
- * For backwards compatibility with pre/post 8.3.x, tries to get it from
- * either configuration or settings.
- *
- * @return string
- * The name of the install profile.
- */
- protected function getProfileName() {
- // Code adapted from DrupalKernel::getInstalProfile() in Core.
- // In Core 8.3.x or later, read from config.
- $config = $this->activeConfigStorage->read('core.extension');
- if (!empty($config['profile'])) {
- return $config['profile'];
- }
- else {
- // If system_update_8300() has not yet run, use settings.
- return Settings::get('install_profile');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigListerWithProviders.php b/sites/all/modules/contrib/admin/config_update/src/ConfigListerWithProviders.php
deleted file mode 100644
index 5c50c9892..000000000
--- a/sites/all/modules/contrib/admin/config_update/src/ConfigListerWithProviders.php
+++ /dev/null
@@ -1,148 +0,0 @@
-entityManager = $entity_manager;
- $this->activeConfigStorage = $active_config_storage;
- $this->extensionConfigStorage = $extension_config_storage;
- $this->extensionOptionalConfigStorage = $extension_optional_config_storage;
- $this->moduleHandler = $module_handler;
- $this->themeHandler = $theme_handler;
- }
-
- /**
- * Sets up and returns the config providers list.
- */
- public function listProviders() {
- // Return the list if it has already been set up.
- if (count($this->providers)) {
- return $this->providers;
- }
-
- // Calculate if it hasn't been set up yet.
- // List all of the profile, modules, and themes.
- $extensionsToDo = [];
- $profile = $this->getProfileName();
- $extensionsToDo[] = ['profile', $profile];
- $modules = $this->moduleHandler->getModuleList();
- foreach ($modules as $machine_name => $module) {
- if ($machine_name != $profile) {
- $extensionsToDo[] = ['module', $machine_name];
- }
- }
-
- $themes = $this->themeHandler->listInfo();
- foreach ($themes as $machine_name => $theme) {
- $extensionsToDo[] = ['theme', $machine_name];
- }
-
- // For each extension, figure out if it has config, and make an index of
- // config item => provider.
- $this->extensionsWithConfig = [
- 'profile' => [],
- 'module' => [],
- 'theme' => [],
- ];
-
- foreach ($extensionsToDo as $item) {
- $type = $item[0];
- $name = $item[1];
- $configs = array_merge($this->listProvidedItems($type, $name),
- $this->listProvidedItems($type, $name, TRUE));
- if (!empty($configs)) {
- $this->extensionsWithConfig[$type][$name] = $name;
- foreach ($configs as $config) {
- $this->providers[$config] = [$type, $name];
- }
- }
- }
-
- return $this->providers;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfigProvider($name) {
- $providers = $this->listProviders();
-
- return (isset($providers[$name])) ? $providers[$name] : NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function providerHasConfig($type, $name) {
- // Make sure the list of extensions with configuration has been generated.
- $this->listProviders();
-
- return isset($this->extensionsWithConfig[$type][$name]);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php b/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php
deleted file mode 100644
index 90944a15f..000000000
--- a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertEvent.php
+++ /dev/null
@@ -1,66 +0,0 @@
-type = $type;
- $this->name = $name;
- }
-
- /**
- * Returns the type of configuration being imported or reverted.
- *
- * @return string
- * The type of configuration, either 'system.simple' or a config entity
- * type machine name.
- */
- public function getType() {
- return $this->type;
- }
-
- /**
- * Returns the name of the config item, without prefix.
- *
- * @return string
- * The name of the config item being imported/reverted/deleted, with the
- * prefix.
- */
- public function getName() {
- return $this->name;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php b/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php
deleted file mode 100644
index c0ef26d60..000000000
--- a/sites/all/modules/contrib/admin/config_update/src/ConfigRevertInterface.php
+++ /dev/null
@@ -1,96 +0,0 @@
-entityManager = $entity_manager;
- $this->activeConfigStorage = $active_config_storage;
- $this->extensionConfigStorage = $extension_config_storage;
- $this->extensionOptionalConfigStorage = $extension_optional_config_storage;
- $this->configFactory = $config_factory;
- $this->dispatcher = $dispatcher;
- }
-
- /**
- * {@inheritdoc}
- */
- public function import($type, $name) {
- // Read the config from the file. Note: Do not call getFromExtension() here
- // because we need $full_name below.
- $full_name = $this->getFullName($type, $name);
- $value = FALSE;
- if ($full_name) {
- $value = $this->extensionConfigStorage->read($full_name);
- if (!$value) {
- $value = $this->extensionOptionalConfigStorage->read($full_name);
- }
- }
- if (!$value) {
- return FALSE;
- }
-
- // Save it as a new config entity or simple config.
- if ($type == 'system.simple') {
- $this->configFactory->getEditable($full_name)->setData($value)->save();
- }
- else {
- $entity_storage = $this->entityManager->getStorage($type);
- $entity = $entity_storage->createFromStorageRecord($value);
- $entity->save();
- }
-
- // Trigger an event notifying of this change.
- $event = new ConfigRevertEvent($type, $name);
- $this->dispatcher->dispatch(ConfigRevertInterface::IMPORT, $event);
-
- return TRUE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function revert($type, $name) {
- // Read the config from the file. Note: Do not call getFromExtension() here
- // because we need $full_name below.
- $value = FALSE;
- $full_name = $this->getFullName($type, $name);
- if ($full_name) {
- $value = $this->extensionConfigStorage->read($full_name);
- if (!$value) {
- $value = $this->extensionOptionalConfigStorage->read($full_name);
- }
- }
- if (!$value) {
- return FALSE;
- }
-
- // Make sure the configuration exists currently in active storage.
- if (!$this->activeConfigStorage->read($full_name)) {
- return FALSE;
- }
-
- // Load the current config and replace the value, retaining the config
- // hash (which is part of the _core config key's value).
- if ($type == 'system.simple') {
- $config = $this->configFactory->getEditable($full_name);
- $core = $config->get('_core');
- $config
- ->setData($value)
- ->set('_core', $core)
- ->save();
- }
- else {
- $definition = $this->entityManager->getDefinition($type);
- $id_key = $definition->getKey('id');
- $id = $value[$id_key];
- $entity_storage = $this->entityManager->getStorage($type);
- $entity = $entity_storage->load($id);
- $core = $entity->get('_core');
- $entity = $entity_storage->updateFromStorageRecord($entity, $value);
- $entity->set('_core', $core);
- $entity->save();
- }
-
- // Trigger an event notifying of this change.
- $event = new ConfigRevertEvent($type, $name);
- $this->dispatcher->dispatch(ConfigRevertInterface::REVERT, $event);
-
- return TRUE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function delete($type, $name) {
- $config = FALSE;
- $full_name = $this->getFullName($type, $name);
- if ($full_name) {
- // Make sure the configuration exists currently in active storage.
- if (!$this->activeConfigStorage->read($full_name)) {
- return FALSE;
- }
- $config = $this->configFactory->getEditable($full_name);
- }
- if (!$config) {
- return FALSE;
- }
- $config->delete();
-
- // Trigger an event notifying of this change.
- $event = new ConfigRevertEvent($type, $name);
- $this->dispatcher->dispatch(ConfigDeleteInterface::DELETE, $event);
- return TRUE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFromActive($type, $name) {
- $full_name = $this->getFullName($type, $name);
- if ($full_name) {
- return $this->activeConfigStorage->read($full_name);
- }
- return FALSE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFromExtension($type, $name) {
- $value = FALSE;
- $full_name = $this->getFullName($type, $name);
- if ($full_name) {
- $value = $this->extensionConfigStorage->read($full_name);
- if (!$value) {
- $value = $this->extensionOptionalConfigStorage->read($full_name);
- }
- }
- return $value;
- }
-
- /**
- * Returns the full name of a config item.
- *
- * @param string $type
- * The config type, or '' to indicate $name is already prefixed.
- * @param string $name
- * The config name, without prefix.
- *
- * @return string
- * The config item's full name, or FALSE if there is an error.
- */
- protected function getFullName($type, $name) {
- if ($type == 'system.simple' || !$type) {
- return $name;
- }
-
- $definition = $this->entityManager->getDefinition($type);
- if ($definition) {
- $prefix = $definition->getConfigPrefix() . '.';
- return $prefix . $name;
- }
- else {
- return FALSE;
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigDifferTest.php b/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigDifferTest.php
deleted file mode 100644
index 085291091..000000000
--- a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigDifferTest.php
+++ /dev/null
@@ -1,362 +0,0 @@
-configDiffer = new ConfigDiffer($this->getTranslationMock());
- }
-
- /**
- * @covers \Drupal\config_update\ConfigDiffer::same
- * @dataProvider sameProvider
- */
- public function testSame($a, $b, $expected) {
- $this->assertEquals($expected, $this->configDiffer->same($a, $b));
- }
-
- /**
- * Data provider for self:testSame().
- */
- public function sameProvider() {
- $base = [
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => 0,
- 'c' => [
- 'd' => TRUE,
- 'e' => FALSE,
- 'empty' => [],
- ],
- ];
- return [
- [$base, $base, TRUE],
-
- // Add _core, omit uuid at top level. Should match, as both are removed
- // in normalization process.
- [
- $base,
- [
- '_core' => 'foo',
- 'a' => 'a',
- 'b' => 0,
- 'c' => [
- 'd' => TRUE,
- 'e' => FALSE,
- 'empty' => [],
- ],
- ],
- TRUE,
- ],
-
- // Change order in top and deep level. Should match.
- [
- $base,
- [
- 'uuid' => 'bar',
- 'b' => 0,
- 'a' => 'a',
- 'c' => [
- 'e' => FALSE,
- 'empty' => [],
- 'd' => TRUE,
- ],
- ],
- TRUE,
- ],
-
- // Add _core in deeper level. Should not match, as this is removed
- // only at the top level during normalization.
- [
- $base,
- [
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => 0,
- 'c' => [
- '_core' => 'do-not-use-this-key',
- 'd' => TRUE,
- 'e' => FALSE,
- 'empty' => [],
- ],
- ],
- FALSE,
- ],
-
- // Add uuid in deeper level. Should not match, as this is removed
- // only at the top level during normalization.
- [
- $base,
- [
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => 0,
- 'c' => [
- 'd' => TRUE,
- 'e' => FALSE,
- 'uuid' => 'important',
- 'empty' => [],
- ],
- ],
- FALSE,
- ],
-
- // Omit a component. Should not match.
- [
- $base,
- [
- 'uuid' => 'bar',
- 'a' => 'a',
- 'c' => [
- 'd' => TRUE,
- 'e' => FALSE,
- 'empty' => [],
- ],
- ],
- FALSE,
- ],
-
- // Add a component. Should not match.
- [
- $base,
- [
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => 0,
- 'c' => [
- 'd' => TRUE,
- 'e' => FALSE,
- 'empty' => [],
- ],
- 'f' => 'f',
- ],
- FALSE,
- ],
-
- // 0 should not match a string.
- [
- $base,
- [
- '_core' => 'foo',
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => 'b',
- 'c' => [
- 'd' => TRUE,
- 'e' => FALSE,
- 'empty' => [],
- ],
- ],
- FALSE,
- ],
-
- // 0 should not match NULL.
- [
- $base,
- [
- '_core' => 'foo',
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => NULL,
- 'c' => [
- 'd' => TRUE,
- 'e' => FALSE,
- 'empty' => [],
- ],
- ],
- FALSE,
- ],
-
- // FALSE should not match a string.
- [
- $base,
- [
- '_core' => 'foo',
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => 0,
- 'c' => [
- 'd' => TRUE,
- 'e' => 'e',
- 'empty' => [],
- ],
- ],
- FALSE,
- ],
-
- // TRUE should not match a string.
- [
- $base,
- [
- '_core' => 'foo',
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => 0,
- 'c' => [
- 'd' => 'd',
- 'e' => FALSE,
- 'empty' => [],
- ],
- ],
- FALSE,
- ],
-
- // Add an empty array at top, and remove at lower level. Should still
- // match.
- [
- $base,
- [
- '_core' => 'foo',
- 'uuid' => 'bar',
- 'a' => 'a',
- 'b' => 0,
- 'c' => [
- 'd' => TRUE,
- 'e' => FALSE,
- ],
- 'empty_two' => [],
- ],
- TRUE,
- ],
- ];
- }
-
- /**
- * @covers \Drupal\config_update\ConfigDiffer::diff
- */
- public function testDiff() {
- $configOne = [
- 'uuid' => '1234-5678-90',
- 'id' => 'test.config.id',
- 'id_to_remove' => 'test.remove.id',
- 'type' => 'old_type',
- 'true_value' => TRUE,
- 'null_value' => NULL,
- 'nested_array' => [
- 'flat_array' => [
- 'value2',
- 'value1',
- 'value3',
- ],
- 'custom_key' => 'value',
- ],
- ];
-
- $configTwo = [
- 'uuid' => '09-8765-4321',
- 'id' => 'test.config.id',
- 'type' => 'new_type',
- 'true_value' => FALSE,
- 'null_value' => FALSE,
- 'nested_array' => [
- 'flat_array' => [
- 'value2',
- 'value3',
- ],
- 'custom_key' => 'value',
- 'custom_key_2' => 'value2',
- ],
- ];
-
- $edits = $this->configDiffer->diff($configOne, $configTwo)->getEdits();
-
- $expectedEdits = [
- [
- 'copy' => [
- 'orig' => [
- 'id : test.config.id',
- ],
- 'closing' => [
- 'id : test.config.id',
- ],
- ],
- ],
- [
- 'delete' => [
- 'orig' => [
- 'id_to_remove : test.remove.id',
- ],
- 'closing' => FALSE,
- ],
- ],
- [
- 'copy' => [
- 'orig' => [
- 'nested_array',
- 'nested_array::custom_key : value',
- ],
- 'closing' => [
- 'nested_array',
- 'nested_array::custom_key : value',
- ],
- ],
- ],
- [
- 'add' => [
- 'orig' => FALSE,
- 'closing' => [
- 'nested_array::custom_key_2 : value2',
- ],
- ],
- ],
- [
- 'copy' => [
- 'orig' => [
- 'nested_array::flat_array',
- 'nested_array::flat_array::0 : value2',
- ],
- 'closing' => [
- 'nested_array::flat_array',
- 'nested_array::flat_array::0 : value2',
- ],
- ],
- ],
- [
- 'change' => [
- 'orig' => [
- 'nested_array::flat_array::1 : value1',
- 'nested_array::flat_array::2 : value3',
- 'null_value : null',
- 'true_value : true',
- 'type : old_type',
- ],
- 'closing' => [
- 'nested_array::flat_array::1 : value3',
- 'null_value : false',
- 'true_value : false',
- 'type : new_type',
- ],
- ],
- ],
- ];
-
- $this->assertEquals(count($expectedEdits), count($edits));
-
- /** @var \Drupal\Component\Diff\Engine\DiffOp $diffOp */
- foreach ($edits as $index => $diffOp) {
- $this->assertEquals($expectedEdits[$index][$diffOp->type]['orig'], $diffOp->orig);
- $this->assertEquals($expectedEdits[$index][$diffOp->type]['closing'], $diffOp->closing);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigListerTest.php b/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigListerTest.php
deleted file mode 100644
index 668e8b929..000000000
--- a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigListerTest.php
+++ /dev/null
@@ -1,293 +0,0 @@
- ['module', 'foo.barbaz.one', 'foo.barbaz.two'],
- 'foo_theme' => ['theme', 'foo.bar.one', 'foo.bar.two'],
- 'standard' => ['profile', 'baz.bar.one', 'baz.bar.two'],
- ];
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- $lister = $this->getMockBuilder('Drupal\config_update\ConfigListerWithProviders')
- ->setConstructorArgs([
- $this->getEntityManagerMock(),
- $this->getConfigStorageMock('active'),
- $this->getConfigStorageMock('extension'),
- $this->getConfigStorageMock('optional'),
- $this->getModuleHandlerMock(),
- $this->getThemeHandlerMock(),
- ])
- ->setMethods(['listProvidedItems', 'getProfileName'])
- ->getMock();
-
- $lister->method('getProfileName')
- ->willReturn('standard');
-
- $map = [];
- foreach ($this->configProviderList as $provider => $info) {
- // Info has: [type, install storage item, optional storage item].
- // Map needs: [type, provider name, isOptional, [config items]].
- $map[] = [$info[0], $provider, FALSE, [$info[1]]];
- $map[] = [$info[0], $provider, TRUE, [$info[2]]];
- }
- $lister->method('listProvidedItems')
- ->will($this->returnValueMap($map));
-
- $this->configLister = $lister;
- }
-
- /**
- * @covers \Drupal\config_update\ConfigListerWithProviders::listConfig
- * @dataProvider listConfigProvider
- */
- public function testListConfig($a, $b, $expected) {
- $this->assertEquals($expected, $this->configLister->listConfig($a, $b));
- }
-
- /**
- * Data provider for self:testListConfig().
- */
- public function listConfigProvider() {
- return [
- // Arguments are $list_type, $name, and return value is that list of
- // configuration in active, extension, and optional storage.
- ['type', 'system.all',
- [
- [
- 'foo.bar.one',
- 'foo.bar.two',
- 'foo.bar.three',
- 'foo.barbaz.four',
- 'foo.barbaz.five',
- 'foo.barbaz.six',
- 'something.else',
- 'another.one',
- ],
- [
- 'foo.bar.one',
- 'foo.bar.two',
- 'foo.bar.seven',
- 'foo.barbaz.four',
- 'foo.barnot.three',
- 'something.else',
- ],
- ['foo.barbaz.four'],
- ],
- ],
- ['type', 'system.simple',
- [
- ['something.else', 'another.one'],
- ['foo.barnot.three', 'something.else'],
- [],
- ],
- ],
- ['type', 'foo',
- [
- ['foo.bar.one', 'foo.bar.two', 'foo.bar.three'],
- ['foo.bar.one', 'foo.bar.two', 'foo.bar.seven'],
- [],
- ],
- ],
- ['type', 'unknown.type', [[], [], []]],
- ['profile', 'dummy',
- [
- [
- 'foo.bar.one',
- 'foo.bar.two',
- 'foo.bar.three',
- 'foo.barbaz.four',
- 'foo.barbaz.five',
- 'foo.barbaz.six',
- 'something.else',
- 'another.one',
- ],
- ['baz.bar.one'],
- ['baz.bar.two'],
- ],
- ],
- ['module', 'foo_module',
- [
- [
- 'foo.bar.one',
- 'foo.bar.two',
- 'foo.bar.three',
- 'foo.barbaz.four',
- 'foo.barbaz.five',
- 'foo.barbaz.six',
- 'something.else',
- 'another.one',
- ],
- ['foo.barbaz.one'],
- ['foo.barbaz.two'],
- ],
- ],
- ['theme', 'foo_theme',
- [
- [
- 'foo.bar.one',
- 'foo.bar.two',
- 'foo.bar.three',
- 'foo.barbaz.four',
- 'foo.barbaz.five',
- 'foo.barbaz.six',
- 'something.else',
- 'another.one',
- ],
- ['foo.bar.one'],
- ['foo.bar.two'],
- ],
- ],
- ];
- }
-
- /**
- * @covers \Drupal\config_update\ConfigListerWithProviders::getType
- */
- public function testGetType() {
- $return = $this->configLister->getType('not_in_list');
- $this->assertNull($return);
-
- foreach ($this->entityDefinitionInformation as $info) {
- $return = $this->configLister->getType($info['type']);
- $this->assertEquals($return->getConfigPrefix(), $info['prefix']);
- }
- }
-
- /**
- * @covers \Drupal\config_update\ConfigListerWithProviders::getTypeByPrefix
- */
- public function testGetTypeByPrefix() {
- $return = $this->configLister->getTypeByPrefix('not_in_list');
- $this->assertNull($return);
-
- foreach ($this->entityDefinitionInformation as $info) {
- $return = $this->configLister->getTypeByPrefix($info['prefix']);
- $this->assertEquals($return->getConfigPrefix(), $info['prefix']);
- }
- }
-
- /**
- * @covers \Drupal\config_update\ConfigListerWithProviders::getTypeNameByConfigName
- */
- public function testGetTypeNameByConfigName() {
- $return = $this->configLister->getTypeNameByConfigName('not_in_list');
- $this->assertNull($return);
-
- foreach ($this->entityDefinitionInformation as $info) {
- $return = $this->configLister->getTypeNameByConfigName($info['prefix'] . '.something');
- $this->assertEquals($return, $info['type']);
- }
- }
-
- /**
- * @covers \Drupal\config_update\ConfigListerWithProviders::listTypes
- */
- public function testListTypes() {
- $return = $this->configLister->listTypes();
- // Should return an array in sorted order, of just the config entities
- // that $this->getEntityManagerMock() set up.
- $expected = ['bar' => 'foo.barbaz', 'baz' => 'baz.foo', 'foo' => 'foo.bar'];
- $this->assertEquals(array_keys($return), array_keys($expected));
- foreach ($return as $key => $definition) {
- $this->assertTrue($definition->entityClassImplements('Drupal\Core\Config\Entity\ConfigEntityInterface'));
- $this->assertEquals($definition->getConfigPrefix(), $expected[$key]);
- }
- }
-
- /**
- * @covers \Drupal\config_update\ConfigListerWithProviders::listProviders
- */
- public function testListProviders() {
- // This method's return value is not sorted in any particular way.
- $return = $this->configLister->listProviders();
- $expected = [];
- foreach ($this->configProviderList as $provider => $info) {
- // Info has: [type, install storage item, optional storage item].
- // Expected needs: key is item name, value is [type, provider name].
- $expected[$info[1]] = [$info[0], $provider];
- $expected[$info[2]] = [$info[0], $provider];
- }
- ksort($return);
- ksort($expected);
- $this->assertEquals($return, $expected);
- }
-
- /**
- * @covers \Drupal\config_update\ConfigListerWithProviders::getConfigProvider
- * @dataProvider getConfigProviderProvider
- */
- public function testGetConfigProvider($a, $expected) {
- $this->assertEquals($expected, $this->configLister->getConfigProvider($a));
- }
-
- /**
- * Data provider for self:testGetConfigProvider().
- */
- public function getConfigProviderProvider() {
- $values = [];
- foreach ($this->configProviderList as $provider => $info) {
- // Info has: [type, install storage item, optional storage item].
- // Values needs: [item, [type, provider name]].
- $values[] = [$info[1], [$info[0], $provider]];
- $values[] = [$info[2], [$info[0], $provider]];
- }
- $values[] = ['not.a.config.item', NULL];
- return $values;
- }
-
- /**
- * @covers \Drupal\config_update\ConfigListerWithProviders::providerHasConfig
- * @dataProvider providerHasConfigProvider
- */
- public function testProviderHasConfig($a, $b, $expected) {
- $this->assertEquals($expected, $this->configLister->providerHasConfig($a, $b));
- }
-
- /**
- * Data provider for self:testProviderHasConfig().
- */
- public function providerHasConfigProvider() {
- $values = [];
- foreach ($this->configProviderList as $provider => $info) {
- // Info has: [type, install storage item, optional storage item].
- // Values needs: [type, provider name, TRUE] for valid providers,
- // change the last to FALSE for invalid providers.
- $values[] = [$info[0], $provider, TRUE];
- $values[] = [$info[0], $provider . '_suffix', FALSE];
- }
- $values[] = ['invalid_type', 'foo_module', FALSE];
- return $values;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigReverterTest.php b/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigReverterTest.php
deleted file mode 100644
index 6c35cd72c..000000000
--- a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigReverterTest.php
+++ /dev/null
@@ -1,356 +0,0 @@
-configReverter = new ConfigReverter(
- $this->getEntityManagerMock(),
- $this->getConfigStorageMock('active'),
- $this->getConfigStorageMock('extension'),
- $this->getConfigStorageMock('optional'),
- $this->getConfigFactoryMock(),
- $this->getEventDispatcherMock());
- }
-
- /**
- * @covers \Drupal\config_update\ConfigReverter::getFromActive
- * @dataProvider getFromActiveProvider
- */
- public function testGetFromActive($a, $b, $expected) {
- $this->assertEquals($expected, $this->configReverter->getFromActive($a, $b));
- }
-
- /**
- * Data provider for self:testGetFromActive().
- */
- public function getFromActiveProvider() {
- return [
- // Arguments are $type, $name, and return value is the config.
- // Some config items that are already prefixed.
- ['', 'foo.bar.one', ['foo.bar.one' => 'active', 'id' => 'one']],
- ['system.simple', 'foo.bar.one',
- ['foo.bar.one' => 'active', 'id' => 'one'],
- ],
- // Config item with a defined entity definition prefix. Entity type 'foo'
- // has prefix 'foo.bar'.
- ['foo', 'one', ['foo.bar.one' => 'active', 'id' => 'one']],
- // Unknown type. This should not generate a call into the config read,
- // so should not return the known value.
- ['unknown', 'foo.bar.one', FALSE],
- // Missing configuration. Config mock is configured to return FALSE for
- // this particular config name.
- ['system.simple', 'missing', FALSE],
- ];
- }
-
- /**
- * @covers \Drupal\config_update\ConfigReverter::getFromExtension
- * @dataProvider getFromExtensionProvider
- */
- public function testGetFromExtension($a, $b, $expected) {
- $this->assertEquals($expected, $this->configReverter->getFromExtension($a, $b));
- }
-
- /**
- * Data provider for self:testGetFromExtension().
- */
- public function getFromExtensionProvider() {
- return [
- // Arguments are $type, $name, and return value is the config.
- // Some config items that are already prefixed, and exist in the mock
- // extension storage.
- ['', 'in.extension', ['in.extension' => 'extension']],
- ['system.simple', 'in.extension', ['in.extension' => 'extension']],
- // Config item with a defined entity definition prefix. Entity type 'foo'
- // has prefix 'foo.bar'.
- ['foo', 'one', ['foo.bar.one' => 'extension', 'id' => 'one']],
- // One that exists in both extension and optional storage.
- ['system.simple', 'in.both', ['in.both' => 'extension']],
- // One that exists only in optional storage.
- ['system.simple', 'in.optional', ['in.optional' => 'optional']],
- // Unknown type. This should not generate a call into the config read,
- // so should not return the known value.
- ['unknown', 'in.extension', FALSE],
- // Missing configuration. Storage mock is configured to return FALSE for
- // this particular config name.
- ['system.simple', 'missing2', FALSE],
- ];
- }
-
- /**
- * @covers \Drupal\config_update\ConfigReverter::import
- * @dataProvider importProvider
- */
- public function testImport($type, $name, $config_name, $expected, $config_before, $config_after) {
- // Clear dispatch log and set pre-config.
- $this->dispatchedEvents = [];
- if ($config_name) {
- $this->configStorage[$config_name] = $config_before;
- }
- $save_config = $this->configStorage;
-
- // Call the importer and test the Boolean result.
- $result = $this->configReverter->import($type, $name);
- $this->assertEquals($result, $expected);
-
- if ($result) {
- // Verify that the config is correct after import, and logging worked.
- $this->assertEquals($this->configStorage[$config_name], $config_after);
- $this->assertEquals(count($this->dispatchedEvents), 1);
- $this->assertEquals($this->dispatchedEvents[0][0], ConfigRevertInterface::IMPORT);
- }
- else {
- // Verify that the config didn't change and no events were logged.
- $this->assertEquals($this->configStorage, $save_config);
- $this->assertEquals(count($this->dispatchedEvents), 0);
- }
- }
-
- /**
- * Data provider for self:testImport().
- */
- public function importProvider() {
- return [
- // Elements: type, name, config name, return value,
- // config to set up before, config expected after. See also
- // getFromExtensionProvider().
- [
- 'system.simple',
- 'in.extension',
- 'in.extension',
- TRUE,
- ['in.extension' => 'before'],
- ['in.extension' => 'extension', '_core' => 'core_for_in.extension'],
- ],
- [
- 'foo',
- 'one',
- 'foo.bar.one',
- TRUE,
- ['foo.bar.one' => 'before', 'id' => 'one'],
- [
- 'foo.bar.one' => 'extension',
- 'id' => 'one',
- '_core' => 'core_for_foo.bar.one',
- ],
- ],
- [
- 'system.simple',
- 'in.both',
- 'in.both',
- TRUE,
- ['in.both' => 'before'],
- ['in.both' => 'extension', '_core' => 'core_for_in.both'],
- ],
- [
- 'system.simple',
- 'in.optional',
- 'in.optional',
- TRUE,
- ['in.optional' => 'before'],
- ['in.optional' => 'optional', '_core' => 'core_for_in.optional'],
- ],
- [
- 'unknown',
- 'in.extension',
- FALSE,
- FALSE,
- FALSE,
- FALSE,
- ],
- [
- 'system.simple',
- 'missing2',
- 'missing2',
- FALSE,
- FALSE,
- FALSE,
- ],
- ];
- }
-
- /**
- * @covers \Drupal\config_update\ConfigReverter::revert
- * @dataProvider revertProvider
- */
- public function testRevert($type, $name, $config_name, $expected, $config_before, $config_after) {
- // Clear dispatch log and set pre-config.
- $this->dispatchedEvents = [];
- if ($config_name) {
- $this->configStorage[$config_name] = $config_before;
- }
- $save_config = $this->configStorage;
-
- // Call the reverter and test the Boolean result.
- $result = $this->configReverter->revert($type, $name);
- $this->assertEquals($result, $expected);
-
- if ($result) {
- // Verify that the config is correct after revert, and logging worked.
- $this->assertEquals($this->configStorage[$config_name], $config_after);
- $this->assertEquals(count($this->dispatchedEvents), 1);
- $this->assertEquals($this->dispatchedEvents[0][0], ConfigRevertInterface::REVERT);
- }
- else {
- // Verify that the config didn't change and no events were logged.
- $this->assertEquals($this->configStorage, $save_config);
- $this->assertEquals(count($this->dispatchedEvents), 0);
- }
- }
-
- /**
- * Data provider for self:testRevert().
- */
- public function revertProvider() {
- return [
- // Elements: type, name, config name, return value,
- // config to set up before, config expected after. See also
- // getFromExtensionProvider().
- [
- 'system.simple',
- 'in.extension',
- 'in.extension',
- TRUE,
- ['in.extension' => 'active'],
- ['in.extension' => 'extension', '_core' => 'core_for_in.extension'],
- ],
- [
- 'foo',
- 'one',
- 'foo.bar.one',
- TRUE,
- ['foo.bar.one' => 'active', 'id' => 'one'],
- [
- 'foo.bar.one' => 'extension',
- 'id' => 'one',
- '_core' => 'core_for_foo.bar.one',
- ],
- ],
- [
- 'system.simple',
- 'in.both',
- 'in.both',
- TRUE,
- ['in.both' => 'active'],
- ['in.both' => 'extension', '_core' => 'core_for_in.both'],
- ],
- [
- 'system.simple',
- 'in.optional',
- 'in.optional',
- TRUE,
- ['in.optional' => 'active'],
- ['in.optional' => 'optional', '_core' => 'core_for_in.optional'],
- ],
- [
- 'unknown',
- 'in.extension',
- FALSE,
- FALSE,
- FALSE,
- FALSE,
- ],
- // Missing from extension storage.
- [
- 'system.simple',
- 'missing2',
- 'missing2',
- FALSE,
- FALSE,
- FALSE,
- ],
- // Present in extension storage but missing from active storage.
- [
- 'system.simple',
- 'another',
- 'another',
- FALSE,
- FALSE,
- FALSE,
- ],
- ];
- }
-
- /**
- * @covers \Drupal\config_update\ConfigReverter::delete
- * @dataProvider deleteProvider
- */
- public function testDelete($type, $name, $config_name, $expected) {
- // Clear dispatch log.
- $this->dispatchedEvents = [];
- $save_config = $this->configStorage;
-
- // Call the deleteer and test the Boolean result.
- $result = $this->configReverter->delete($type, $name);
- $this->assertEquals($result, $expected);
-
- if ($result) {
- // Verify that the config is missing after delete, and logging worked.
- $this->assertTrue(!isset($this->configStorage[$config_name]));
- $this->assertEquals(count($this->dispatchedEvents), 1);
- $this->assertEquals($this->dispatchedEvents[0][0], ConfigDeleteInterface::DELETE);
- }
- else {
- // Verify that the config didn't change and no events were logged.
- $this->assertEquals($this->configStorage, $save_config);
- $this->assertEquals(count($this->dispatchedEvents), 0);
- }
- }
-
- /**
- * Data provider for self:testDelete().
- */
- public function deleteProvider() {
- return [
- // Elements: type, name, config name, return value.
- [
- 'system.simple',
- 'in.extension',
- 'in.extension',
- TRUE,
- ],
- [
- 'foo',
- 'one',
- 'foo.bar.one',
- TRUE,
- ],
- [
- 'unknown',
- 'in.extension',
- FALSE,
- FALSE,
- ],
- [
- 'system.simple',
- 'missing2',
- 'missing2',
- FALSE,
- ],
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigUpdateUnitTestBase.php b/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigUpdateUnitTestBase.php
deleted file mode 100644
index 519474484..000000000
--- a/sites/all/modules/contrib/admin/config_update/tests/src/Unit/ConfigUpdateUnitTestBase.php
+++ /dev/null
@@ -1,547 +0,0 @@
- 'foo.bar', 'type' => 'foo'],
- ['prefix' => 'foo.barbaz', 'type' => 'bar'],
- ['prefix' => 'baz.foo', 'type' => 'baz'],
- ];
-
- /**
- * Creates a mock entity manager for the test.
- *
- * @see ConfigUpdateUnitTestBase::entityDefinitionInformation
- */
- protected function getEntityManagerMock() {
- $definitions = [];
- $map = [];
- foreach ($this->entityDefinitionInformation as $info) {
- $def = $this->getMockBuilder('Drupal\Core\Config\Entity\ConfigEntityTypeInterface')->getMock();
- $def
- ->expects($this->any())
- ->method('getConfigPrefix')
- ->willReturn($info['prefix']);
- $def
- ->expects($this->any())
- ->method('entityClassImplements')
- ->willReturn(TRUE);
-
- $def
- ->method('getKey')
- ->willReturn('id');
-
- $def->getConfigPrefix();
-
- $definitions[$info['type']] = $def;
- $map[] = [$info['type'], FALSE, $def];
- $map[] = [$info['type'], TRUE, $def];
- }
-
- // Add in a content entity definition, which shouldn't be recognized by the
- // config lister class.
- $def = $this->getMockBuilder('Drupal\Core\Entity\ContentEntityTypeInterface')->getMock();
- $def
- ->expects($this->any())
- ->method('entityClassImplements')
- ->willReturn(FALSE);
- $definitions['content_entity'] = $def;
-
- $manager = $this->getMockBuilder('Drupal\Core\Entity\EntityTypeManagerInterface')->getMock();
- $manager
- ->method('getDefinitions')
- ->willReturn($definitions);
-
- $manager
- ->method('getDefinition')
- ->will($this->returnValueMap($map));
-
- $manager
- ->method('getStorage')
- ->will($this->returnCallback([$this, 'mockGetStorage']));
-
- return $manager;
- }
-
- /**
- * Mocks the getStorage() method for the entity manager.
- */
- public function mockGetStorage($entity_type) {
- // Figure out the config prefix for this entity type.
- $prefix = '';
- foreach ($this->entityDefinitionInformation as $info) {
- if ($info['type'] == $entity_type) {
- $prefix = $info['prefix'];
- }
- }
-
- // This is used in ConfigReverter::import(). Although it is supposed to
- // be entity storage, we'll use our mock config object instead.
- return new MockConfig('', $prefix, $this);
- }
-
- /**
- * Array of active configuration information for mocking.
- *
- * Array structure: Each element is an array whose first element is a
- * provider name, and second is an array of config items it provides.
- *
- * @var array
- *
- * @see ConfigUpdateUnitTestBase::getConfigStorageMock()
- */
- protected $configStorageActiveInfo = [
- ['foo.bar', ['foo.bar.one', 'foo.bar.two', 'foo.bar.three']],
- ['foo.barbaz', ['foo.barbaz.four', 'foo.barbaz.five', 'foo.barbaz.six']],
- ['baz.foo', []],
- ['',
- [
- 'foo.bar.one',
- 'foo.bar.two',
- 'foo.bar.three',
- 'foo.barbaz.four',
- 'foo.barbaz.five',
- 'foo.barbaz.six',
- 'something.else',
- 'another.one',
- ],
- ],
- ];
-
- /**
- * Array of extension configuration information for mocking.
- *
- * Array structure: Each element is an array whose first element is a
- * provider name, and second is an array of config items it provides.
- *
- * @var array
- *
- * @see ConfigUpdateUnitTestBase::getConfigStorageMock()
- */
- protected $configStorageExtensionInfo = [
- ['foo.bar', ['foo.bar.one', 'foo.bar.two', 'foo.bar.seven']],
- ['baz.foo', []],
- // This next item is assumed to be element 2 of the array. If not, you
- // will need to change ConfigUpdateUnitTestBase::getConfigStorageMock().
- ['',
- [
- 'foo.bar.one',
- 'foo.bar.two',
- 'foo.bar.seven',
- 'foo.barbaz.four',
- 'foo.barnot.three',
- 'something.else',
- ],
- ],
- ];
-
- /**
- * Array of optional configuration information for mocking.
- *
- * Array structure: Each element is an array whose first element is a
- * provider name, and second is an array of config items it provides.
- *
- * @var array
- *
- * @see ConfigUpdateUnitTestBase::getConfigStorageMock()
- */
- protected $configStorageOptionalInfo = [
- ['foo.bar', []],
- ['foo.barbaz', ['foo.barbaz.four']],
- // This next item is assumed to be element 2 of the array. If not, you
- // will need to change ConfigUpdateUnitTestBase::getConfigStorageMock().
- ['', ['foo.barbaz.four']],
- ];
-
- /**
- * Creates a mock config storage object for the test.
- *
- * @param string $type
- * Type of storage object to return: 'active', 'extension', or 'optional'.
- * In active storage, the read() method is mocked to assume you are reading
- * core.extension to get the profile name, so it returns that information.
- * For extension and optional storage, the getComponentNames() method is
- * mocked, and for all storages, the listAll() method is mocked.
- *
- * @see ConfigUpdateUnitTestBase::configStorageActiveInfo
- * @see ConfigUpdateUnitTestBase::configStorageExtensionInfo
- * @see ConfigUpdateUnitTestBase::configStorageOptionalInfo
- */
- protected function getConfigStorageMock($type) {
- if ($type == 'active') {
- $storage = $this->getMockBuilder('Drupal\Core\Config\StorageInterface')->getMock();
-
- // Various tests assume various values of configuration that need to be
- // read from active storage.
- $map = [
- ['core.extension', ['profile' => 'standard']],
- ['foo.bar.one', ['foo.bar.one' => 'active', 'id' => 'one']],
- ['missing', FALSE],
- ['in.extension',
- ['in.extension' => 'active', '_core' => 'core_for_in.extension'],
- ],
- ['in.both', ['in.both' => 'active']],
- ['in.optional', ['in.optional' => 'active']],
- ];
- $storage
- ->method('read')
- ->will($this->returnValueMap($map));
-
- $storage
- ->method('listAll')
- ->will($this->returnValueMap($this->configStorageActiveInfo));
- }
- elseif ($type == 'extension') {
- $storage = $this->getMockBuilder('Drupal\Core\Config\ExtensionInstallStorage')->disableOriginalConstructor()->getMock();
-
- $value = [];
- foreach ($this->configStorageExtensionInfo[2][1] as $item) {
- $value[$item] = 'ignored';
- }
- $storage
- ->method('getComponentNames')
- ->willReturn($value);
-
- $storage
- ->method('listAll')
- ->will($this->returnValueMap($this->configStorageExtensionInfo));
- $map = [
- ['in.extension', ['in.extension' => 'extension']],
- ['in.both', ['in.both' => 'extension']],
- ['in.optional', FALSE],
- ['foo.bar.one', ['foo.bar.one' => 'extension', 'id' => 'one']],
- ['another', ['another' => 'extension', 'id' => 'one']],
- ['missing2', FALSE],
- ];
- $storage
- ->method('read')
- ->will($this->returnValueMap($map));
-
- }
- else {
- $storage = $this->getMockBuilder('Drupal\Core\Config\ExtensionInstallStorage')->disableOriginalConstructor()->getMock();
-
- $value = [];
- foreach ($this->configStorageOptionalInfo[2][1] as $item) {
- $value[$item] = 'ignored';
- }
- $storage
- ->method('getComponentNames')
- ->willReturn($value);
-
- $storage
- ->method('listAll')
- ->will($this->returnValueMap($this->configStorageOptionalInfo));
-
- $map = [
- ['in.optional', ['in.optional' => 'optional']],
- ['in.both', ['in.both' => 'optional']],
- ['missing2', FALSE],
- ];
- $storage
- ->method('read')
- ->will($this->returnValueMap($map));
- }
- return $storage;
-
- }
-
- /**
- * Creates a mock module handler for the test.
- */
- protected function getModuleHandlerMock() {
- $manager = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandlerInterface')->getMock();
- $manager->method('getModuleList')
- ->willReturn(['foo_module' => '', 'standard' => '']);
-
- return $manager;
- }
-
- /**
- * Creates a mock theme handler for the test.
- */
- protected function getThemeHandlerMock() {
- $manager = $this->getMockBuilder('Drupal\Core\Extension\ThemeHandlerInterface')->getMock();
- $manager->method('listInfo')
- ->willReturn(['foo_theme' => '']);
- return $manager;
- }
-
- /**
- * Creates a mock string translation class for the test.
- */
- protected function getTranslationMock() {
- $translation = $this->getMockBuilder('Drupal\Core\StringTranslation\TranslationInterface')->getMock();
- $translation
- ->method('translateString')
- ->will($this->returnCallback([$this, 'mockTranslate']));
- return $translation;
- }
-
- /**
- * Mocks the translateString() method for the string translation mock object.
- *
- * @param \Drupal\Core\StringTranslation\TranslatableMarkup $input
- * Object to translate.
- *
- * @return string
- * The untranslated string from $input.
- */
- public function mockTranslate(TranslatableMarkup $input) {
- return $input->getUntranslatedString();
- }
-
- /**
- * List of mock-dispatched events.
- *
- * Each element of the array is the call parameters to dispatchEvent() in
- * the mocked dispatch class: name and event instance.
- *
- * @var array
- *
- * @see ConfigUpdateUnitTestBase::getEventDispatcherMock()
- */
- protected $dispatchedEvents = [];
-
- /**
- * Mocks the event dispatcher service.
- *
- * Stores dispatched events in ConfigUpdateUnitTestBase::dispatchedEvents.
- */
- protected function getEventDispatcherMock() {
- $event = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
- $event
- ->method('dispatch')
- ->will($this->returnCallback([$this, 'mockDispatch']));
-
- return $event;
- }
-
- /**
- * Mocks event dispatch.
- *
- * For \Symfony\Component\EventDispatcher\EventDispatchInterface::dispatch().
- */
- public function mockDispatch($name, Event $event = NULL) {
- $this->dispatchedEvents[] = [$name, $event];
- }
-
- /**
- * Mock config storage for the mock config factory.
- *
- * This is actually managed by the MockConfig class in this file.
- *
- * @var array
- */
- protected $configStorage = [];
-
- /**
- * Gets the value of the mocked config storage.
- */
- public function getConfigStorage() {
- return $this->configStorage;
- }
-
- /**
- * Sets the value of the mocked config storage.
- */
- public function setConfigStorage($values) {
- $this->configStorage = $values;
- }
-
- /**
- * Creates a mock config factory class for the test.
- */
- protected function getConfigFactoryMock() {
- $config = $this->getMockBuilder('Drupal\Core\Config\ConfigFactoryInterface')->getMock();
- $config
- ->method('getEditable')
- ->will($this->returnCallback([$this, 'mockGetEditable']));
-
- return $config;
- }
-
- /**
- * Mocks the getEditable() method for the mock config factory.
- *
- * @param string $name
- * Name of the config object to get an editable object for.
- *
- * @return MockConfig
- * Editable mock config object.
- */
- public function mockGetEditable($name) {
- return new MockConfig($name, '', $this);
- }
-
-}
-
-/**
- * Mock class for mutable configuration, config entity, and entity storage.
- */
-class MockConfig {
-
- /**
- * Name of the config.
- *
- * @var string
- */
- protected $name = '';
-
- /**
- * Prefix for the entity type being mocked, for entity storage mocking.
- *
- * @var string
- */
- protected $entityPrefix = '';
-
- /**
- * Test class this comes from.
- *
- * @var \Drupal\Tests\config_update\Unit\ConfigUpdateUnitTestBase
- */
- protected $test;
-
- /**
- * Current value of the configuration.
- *
- * @var array
- */
- protected $value = '';
-
- /**
- * Constructs a mock config object.
- *
- * @param string $name
- * Name of the config that is being mocked. Can be blank.
- * @param string $entity_prefix
- * Prefix for the entity type that is being mocked. Often blank.
- * @param \Drupal\Tests\config_update\Unit\ConfigUpdateUnitTestBase $test
- * Test class this comes from.
- */
- public function __construct($name, $entity_prefix, ConfigUpdateUnitTestBase $test) {
- $this->name = $name;
- $this->entityPrefix = $entity_prefix;
- $this->test = $test;
-
- $storage = $test->getConfigStorage();
- if ($name && isset($storage[$name])) {
- $value = $storage[$name];
- $value['is_new'] = FALSE;
- }
- else {
- $value['is_new'] = TRUE;
- }
- $value['_core'] = 'core_for_' . $name;
-
- $this->value = $value;
- }
-
- /**
- * Gets a component of the configuration value.
- */
- public function get($key) {
- return isset($this->value[$key]) ? $this->value[$key] : NULL;
- }
-
- /**
- * Sets a component of the configuration value.
- */
- public function set($key, $value) {
- $this->value[$key] = $value;
- return $this;
- }
-
- /**
- * Sets the entire configuration value.
- */
- public function setData($value) {
- // Retain the _core key.
- $core = isset($this->value['_core']) ? $this->value['_core'] : '';
- $this->value = $value;
- if ($core) {
- $this->value['_core'] = $core;
- }
- return $this;
- }
-
- /**
- * Saves the configuration.
- */
- public function save() {
- $config = $this->test->getConfigStorage();
- $config[$this->name] = $this->value;
- $this->test->setConfigStorage($config);
- return $this;
- }
-
- /**
- * Deletes the configuration.
- */
- public function delete() {
- $config = $this->test->getConfigStorage();
- unset($config[$this->name]);
- $this->test->setConfigStorage($config);
- return $this;
- }
-
- /**
- * Mocks the createFromStorageRecord() method from entity storage.
- */
- public function createFromStorageRecord($values) {
- if (!$this->entityPrefix) {
- return NULL;
- }
-
- // This is supposed to return an entity, but the only method we need is
- // save(), so instead set up and return this object.
- $this->name = $this->entityPrefix . '.' . $values['id'];
- $this->value = $values;
- $this->value['_core'] = 'core_for_' . $this->name;
- return $this;
- }
-
- /**
- * Mocks the updateFromStorageRecord() method from entity storage.
- */
- public function updateFromStorageRecord($object, $values) {
- return $object->createFromStorageRecord($values);
- }
-
- /**
- * Mocks the load() method for entity storage.
- */
- public function load($id) {
- $full_name = $this->entityPrefix . '.' . $id;
- $configs = $this->test->getConfigStorage();
- if (isset($configs[$full_name])) {
- $this->value = $configs[$full_name];
- $this->name = $full_name;
- $this->value['_core'] = 'core_for_' . $full_name;
- return $this;
- }
- return NULL;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/.editorconfig b/sites/all/modules/contrib/admin/context/.editorconfig
deleted file mode 100644
index 4a2c5c728..000000000
--- a/sites/all/modules/contrib/admin/context/.editorconfig
+++ /dev/null
@@ -1,17 +0,0 @@
-# This file is for unifying the coding style for various code editors and IDEs.
-# Make sure to have an editorconfig plug-in installed in your editor to have
-# the editor use this file.
-
-# Sets this config file to be the top-most one.
-root = true
-
-[*]
-charset = utf-8
-end_of_line = lf
-indent_style = space
-indent_size = 2
-insert_final_newline = true
-trim_trailing_whitespace = true
-
-[*.md]
-trim_trailing_whitespace = false
\ No newline at end of file
diff --git a/sites/all/modules/contrib/admin/context/.gitignore b/sites/all/modules/contrib/admin/context/.gitignore
deleted file mode 100644
index e43b0f988..000000000
--- a/sites/all/modules/contrib/admin/context/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-.DS_Store
diff --git a/sites/all/modules/contrib/admin/context/.travis.yml b/sites/all/modules/contrib/admin/context/.travis.yml
deleted file mode 100644
index 1d5f0e4c0..000000000
--- a/sites/all/modules/contrib/admin/context/.travis.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-language: php
-sudo: false
-
-php:
- - 5.5
- - 5.6
- - 7.0
- - hhvm
-
-matrix:
- allow_failures:
- - php: hhvm
- fast_finish: true
-
-mysql:
- database: context
- username: root
- encoding: utf8
-
-before_script:
- # Remember the current context test directory for later use in the Drupal
- # installation.
- - TESTDIR=$(pwd)
- # Navigate out of module directory to prevent blown stack by recursive module
- # lookup.
- - cd ..
-
- # Create database.
- - mysql -e 'create database context'
- # Export database variable for kernel tests.
- - export SIMPLETEST_DB=mysql://root:@127.0.0.1/context
- # Download Drupal 8 core.
- - travis_retry git clone --branch 8.0.x --depth 1 http://git.drupal.org/project/drupal.git
- - cd drupal
-
- # Reference rules in build site.
- - ln -s $TESTDIR modules/context
-
-script:
- # Run the PHPUnit tests which also include the kernel tests.
- - ./vendor/phpunit/phpunit/phpunit -c ./core/phpunit.xml.dist ./modules/context
diff --git a/sites/all/modules/contrib/admin/context/CHANGELOG.md b/sites/all/modules/contrib/admin/context/CHANGELOG.md
deleted file mode 100644
index bdf25ac63..000000000
--- a/sites/all/modules/contrib/admin/context/CHANGELOG.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Change log
-
-All notable changes to this project will be documented in this file.
-This project adheres to [Semantic Versioning](http://semver.org/).
diff --git a/sites/all/modules/contrib/admin/context/CONTRIBUTING.md b/sites/all/modules/contrib/admin/context/CONTRIBUTING.md
deleted file mode 100644
index a5be72119..000000000
--- a/sites/all/modules/contrib/admin/context/CONTRIBUTING.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Contributing
-
-This file will contain information on how you can contribute to the project.
diff --git a/sites/all/modules/contrib/admin/context/LICENSE b/sites/all/modules/contrib/admin/context/LICENSE
deleted file mode 100644
index 92f7edafb..000000000
--- a/sites/all/modules/contrib/admin/context/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Odd Hill
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
diff --git a/sites/all/modules/contrib/admin/context/LICENSE.txt b/sites/all/modules/contrib/admin/context/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/context/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/context/README.md b/sites/all/modules/contrib/admin/context/README.md
deleted file mode 100644
index 29304a480..000000000
--- a/sites/all/modules/contrib/admin/context/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# Context
-
-The context module lets you define conditions for when certain reactions should take place.
-
-An example of a condition could be when viewing a certain node type and blocks should be placed as a reaction when viewing a page with this node type.
-
-###Good resources
-
-- [Drupal 8 Plugin API](https://www.drupal.org/developing/api/8/plugins)
-
-Conditions
----
-
-Context for Drupal 8 uses the built in condition plugins supplied by Drupal through the [Plugin API](https://www.drupal.org/developing/api/8/plugins). So any conditional plug-ins supplied by other modules can also be used with context.
-
-Reactions
----
-
-Reactions for the context module are defined trough the new Drupal 8 [Plugin API](https://www.drupal.org/developing/api/8/plugins).
-
-The context module defines a plugin type named Context Reaction that you can extend when creating your own plugins.
-
-A context reaction requires a configuration form and execute method. The execution of the plugin is also something that will have to be handled by the author of the reaction.
\ No newline at end of file
diff --git a/sites/all/modules/contrib/admin/context/composer.json b/sites/all/modules/contrib/admin/context/composer.json
deleted file mode 100644
index fe4a77c2c..000000000
--- a/sites/all/modules/contrib/admin/context/composer.json
+++ /dev/null
@@ -1,21 +0,0 @@
-{
- "name": "drupal/context",
- "description": "Manage contextual conditions and reactions for different portions of your site.",
- "keywords": ["Drupal", "context", "block", "visibility", "conditions"],
- "type": "drupal-module",
- "license": "MIT",
- "homepage": "https://github.com/oddhill/context",
- "authors": [
- {
- "name": "Christoffer Palm",
- "email": "christoffer.palm@oddhill.se",
- "homepage": "http://www.oddhill.se/",
- "role": "Developer"
- }
- ],
- "support": {
- "issues": "https://github.com/oddhill/context/issues",
- "source": "https://github.com/oddhill/context",
- "docs": "https://github.com/oddhill/context"
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/context.info.yml b/sites/all/modules/contrib/admin/context/context.info.yml
deleted file mode 100644
index 2a7d63c1d..000000000
--- a/sites/all/modules/contrib/admin/context/context.info.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: Context
-description: 'Set conditions and configure reactions that should be implemented when conditions pass.'
-package: Context
-type: module
-# core: 8.x
-
-# Information added by Drupal.org packaging script on 2017-09-14
-version: '8.x-4.0-beta2'
-core: '8.x'
-project: 'context'
-datestamp: 1505379269
diff --git a/sites/all/modules/contrib/admin/context/context.install b/sites/all/modules/contrib/admin/context/context.install
deleted file mode 100644
index 62da5490a..000000000
--- a/sites/all/modules/contrib/admin/context/context.install
+++ /dev/null
@@ -1,43 +0,0 @@
-getContexts() as $context) {
- foreach ($context->getReactions() as $reaction) {
- if ($reaction instanceof Drupal\context\Plugin\ContextReaction\Blocks) {
- foreach ($reaction->getBlocks() as $block) {
- $config = $block->getConfiguration();
- if (!isset($config['context_id'])) {
- $config['context_id'] = $context->id();
- $block->setConfiguration($config);
- $context->save();
- }
- }
- }
- }
- }
-}
-
-/**
- * Update all blocks reaction configuration with additional "css_class" property.
- */
-function context_update_8002() {
- $context_manager = \Drupal::service('context.manager');
- foreach ($context_manager->getContexts() as $context) {
- foreach ($context->getReactions() as $reaction) {
- if ($reaction instanceof \Drupal\context\Plugin\ContextReaction\Blocks) {
- foreach ($reaction->getBlocks() as $block) {
- $configuration = $block->getConfiguration();
- if (!isset($configuration['css_class'])) {
- $configuration['css_class'] = '';
- // Update the block.
- $reaction->updateBlock($configuration['uuid'], $configuration);
- $context->save();
- }
- }
- }
- }
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/context.module b/sites/all/modules/contrib/admin/context/context.module
deleted file mode 100644
index 0cd01c9bc..000000000
--- a/sites/all/modules/contrib/admin/context/context.module
+++ /dev/null
@@ -1,75 +0,0 @@
-' . t('About') . '';
- $output .= '
'.t('The Context module lets users define conditions for when certain reactions should take place.').'
';
- $output .= '
'.t('An example of a condition could be when viewing a certain node type and blocks should be placed as a reaction when viewing a page with this node type.').'
';
- $output .= '
' . t('Uses') . '
';
- $output .= '
';
- $output .= '
' . t('Managing context') . '
';
- $output .= '
' . t('Users with Administer contexts permission can add contextual conditions and reactions for different portions of their site. For each context, they can choose the conditions that trigger this context to be active and choose different aspects of their site that should react to this active context.') . '
';
- $output .= '
' . t('Adding new custom reactions') . '
';
- $output .= '
' . t('Reactions for the context module are defined trough the new Drupal 8 Plugin API.', array(':link' =>'https://www.drupal.org/developing/api/8/plugins')) . '
';
- $output .= '
' . t('The Context module defines a plugin type named ContextReaction that users can extend when creating their own plugins.') . '
';
- $output .= '
' . t('A context reaction requires a configuration form and execute method. The execution of the plugin is also something that will have to be handled by the author of the reaction.') . '
';
- $output .= '
';
- return $output;
- }
-}
-
-/**
- * Run the body class context reactions if there are any and let them add
- * classes to the page body.
- *
- * Implements hook_preprocess_HOOK().
- */
-function context_preprocess_html(&$variables) {
- /** @var \Drupal\context\ContextManager $context_manager */
- $context_manager = \Drupal::service('context.manager');
-
- foreach ($context_manager->getActiveReactions('body_class') as $reaction) {
- $variables['attributes'] = NestedArray::mergeDeep($variables['attributes'], $reaction->execute());
- }
-}
-
-/**
- * Implements hook_theme_suggestions_page_alter().
- */
-function context_theme_suggestions_page_alter(array &$suggestions, array $variables) {
- $context_manager = \Drupal::service('context.manager');
- foreach ($context_manager->getActiveReactions('page_template_suggestions') as $reaction) {
- $template_suggestions = explode(PHP_EOL, $reaction->execute());
- $suggestions = array_merge($suggestions, $template_suggestions);
- }
-}
-
-/**
- * Implements hook_preprocess_page().
- */
-function context_preprocess_page(&$variables) {
- // Active theme for route.
- $current_theme = \Drupal::service('theme.negotiator')->determineActiveTheme(Drupal::routeMatch());
-
- // Context manager.
- $context_manager = \Drupal::service('context.manager');
-
- // Disable regions based on regions reaction.
- foreach ($context_manager->getActiveReactions('regions') as $region_reaction) {
- $configuration = $region_reaction->getConfiguration();
- if (isset($configuration['regions'][$current_theme])) {
- foreach ($configuration['regions'][$current_theme] as $region) {
- unset($variables['page'][$region]);
- }
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/context.routing.yml b/sites/all/modules/contrib/admin/context/context.routing.yml
deleted file mode 100644
index 261d3827e..000000000
--- a/sites/all/modules/contrib/admin/context/context.routing.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# Page to edit a context.
-entity.context.edit_form:
- path: '/admin/structure/context/{context}'
- defaults:
- _entity_form: 'context.edit'
- _title: 'Edit context'
- requirements:
- _permission: 'administer contexts'
diff --git a/sites/all/modules/contrib/admin/context/context.services.yml b/sites/all/modules/contrib/admin/context/context.services.yml
deleted file mode 100644
index 558325135..000000000
--- a/sites/all/modules/contrib/admin/context/context.services.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-services:
- context.manager:
- class: Drupal\context\ContextManager
- arguments: ['@entity.query', '@entity.manager', '@context.repository', '@context.handler', '@entity.form_builder', '@theme.manager']
- plugin.manager.context_reaction:
- class: Drupal\context\ContextReactionManager
- parent: default_plugin_manager
- context.block_page_display_variant_subscriber:
- class: Drupal\context\EventSubscriber\BlockPageDisplayVariantSubscriber
- arguments: ['@context.manager']
- tags:
- - { name: event_subscriber }
- theme.negotiator.context_themeswitcher:
- class: Drupal\context\Theme\ThemeSwitcherNegotiator
- tags:
- - { name: theme_negotiator, priority: 1000 }
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/assets/js/context_ui.admin.js b/sites/all/modules/contrib/admin/context/modules/context_ui/assets/js/context_ui.admin.js
deleted file mode 100644
index 25f202c3d..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/assets/js/context_ui.admin.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * @file
- * Context admin behaviors.
- */
-(function ($, Drupal) {
-
- 'use strict';
-
- /**
- * This is a generic table filter that works with any table formatted in the
- * correct way with classes and data attributes.
- *
- * @type {Drupal~behavior}
- *
- * @prop {Drupal~behaviorAttach} attach
- * Attaches the behavior for the block filtering.
- */
- Drupal.behaviors.contextTableFilter = {
- attach: function () {
- var $input = $('input.context-table-filter').once('.context-table-filter');
- var $table = $($input.attr('data-element'));
- var $filter_rows;
-
- // Only attach the filter listener if there is a table to filter.
- if ($table.length) {
- $filter_rows = $table.find('.context-table-filter-text-source');
- $input.on('keyup', filterTableRows);
- }
-
- /**
- * Filters the table rows.
- *
- * @param {jQuery.Event} e
- * The jQuery event for the keyup event that triggered the filter.
- */
- function filterTableRows(e) {
- var query = $(e.target).val().toLowerCase();
-
- /**
- * Shows or hides the Table rows based on the query.
- *
- * @param {number} index
- * The index in the loop, as provided by `jQuery.each`
- *
- * @param {HTMLElement} label
- * The label of the block.
- */
- function toggleTableRow(index, label) {
- var $label = $(label);
- var $row = $label.parent().parent();
- var textMatch = $label.text().toLowerCase().indexOf(query) !== -1;
-
- $row.toggle(textMatch);
- }
-
- // Filter if the length of the query is at least 2 characters.
- if (query.length >= 2) {
- $filter_rows.each(toggleTableRow);
- }
- else {
- $filter_rows.each(function () {
- $(this).parent().parent().show();
- });
- }
- }
- }
- };
-
-}(jQuery, Drupal));
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.info.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.info.yml
deleted file mode 100644
index f1a18a597..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.info.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Context UI
-description: 'Provides a simple UI for settings up a site structure using Context.'
-package: Context
-type: module
-# core: 8.x
-configure: entity.context.collection
-
-# Module dependencies.
-dependencies:
- - context
-
-# Information added by Drupal.org packaging script on 2017-09-14
-version: '8.x-4.0-beta2'
-core: '8.x'
-project: 'context'
-datestamp: 1505379269
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.libraries.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.libraries.yml
deleted file mode 100644
index bdd2aa4dc..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.libraries.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-admin:
- version: VERSION
- js:
- assets/js/context_ui.admin.js: {}
- dependencies:
- - core/jquery
- - core/drupal
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.action.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.action.yml
deleted file mode 100644
index 4e7830856..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-entity.context.add_form:
- title: 'Add context'
- route_name: entity.context.add_form
- appears_on:
- - entity.context.collection
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.contextual.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.contextual.yml
deleted file mode 100644
index d200da8ba..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.contextual.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-context_block_config:
- title: 'Configure block'
- route_name: 'context.reaction.blocks.block_edit'
- group: 'context_block'
\ No newline at end of file
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.menu.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.menu.yml
deleted file mode 100644
index e03719a44..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.links.menu.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-entity.context.collection:
- title: 'Context'
- parent: system.admin_structure
- description: 'Associate menus, views, blocks, etc. with different contexts to structure your site.'
- route_name: entity.context.collection
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.permissions.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.permissions.yml
deleted file mode 100644
index 65e0c34c2..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.permissions.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-administer contexts:
- title: 'Administer contexts'
- description: 'Associate menus, views, blocks, etc. with different contexts to structure your site.'
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.routing.yml b/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.routing.yml
deleted file mode 100644
index 397bbd5aa..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/context_ui.routing.yml
+++ /dev/null
@@ -1,137 +0,0 @@
-# Page to lists all contexts.
-entity.context.collection:
- path: '/admin/structure/context'
- defaults:
- _entity_list: 'context'
- _title: 'Context'
- requirements:
- _permission: 'administer contexts'
-
-# Page to add a context.
-entity.context.add_form:
- path: '/admin/structure/context/add'
- defaults:
- _entity_form: 'context.add'
- _title: 'Add context'
- requirements:
- _permission: 'administer contexts'
-
-# Page to remove a context.
-entity.context.delete_form:
- path: '/admin/structure/context/{context}/delete'
- defaults:
- _entity_form: 'context.delete'
- _title: 'Delete context'
- requirements:
- _permission: 'administer contexts'
-
-# Page to disable a context.
-entity.context.disable_form:
- path: '/admin/structure/context/{context}/disable'
- defaults:
- _entity_form: 'context.disable'
- _title: 'Disable context'
- requirements:
- _permission: 'administer contexts'
-
-# Route to get autocomplete results for context groups.
-context.groups.autocomplete:
- path: '/admin/structure/context/groups/autocomplete'
- defaults:
- _controller: '\Drupal\context_ui\Controller\ContextUIController::groupsAutocomplete'
- requirements:
- _permission: 'administer contexts'
-
-## Context conditions.
-
-context.conditions_library:
- path: '/admin/structure/context/{context}/conditions/library'
- defaults:
- _title: 'Add condition'
- _controller: '\Drupal\context_ui\Controller\ContextUIController::listConditions'
- requirements:
- _entity_access: 'context.update'
-
-context.condition_add:
- path: '/admin/structure/context/{context}/condition/add/{condition_id}'
- defaults:
- _controller: '\Drupal\context_ui\Controller\ContextUIController::addCondition'
- requirements:
- _entity_access: 'context.update'
-
-context.condition_delete:
- path: '/admin/structure/context/{context}/condition/delete/{condition_id}'
- defaults:
- _form: '\Drupal\context_ui\Form\ConditionDeleteForm'
- requirements:
- _entity_access: 'context.update'
-
-## Context reactions.
-
-context.reactions_library:
- path: '/admin/structure/context/{context}/reactions/library'
- defaults:
- _title: 'Add reaction'
- _controller: '\Drupal\context_ui\Controller\ContextUIController::listReactions'
- requirements:
- _entity_access: 'context.update'
-
-context.reaction_add:
- path: '/admin/structure/context/{context}/reaction/add/{reaction_id}'
- defaults:
- _controller: '\Drupal\context_ui\Controller\ContextUIController::addReaction'
- requirements:
- _entity_access: 'context.update'
-
-context.reaction_delete:
- path: '/admin/structure/context/{context}/reaction/delete/{reaction_id}'
- defaults:
- _form: '\Drupal\context_ui\Form\ReactionDeleteForm'
- requirements:
- _entity_access: 'context.update'
-
-## Context blocks reaction.
-
-# Callback handler for when the theme is changed in the blocks configuration form.
-context.reaction.blocks.regions:
- path: '/admin/structure/context/{context}/reaction/blocks/regions'
- defaults:
- _controller: '\Drupal\context\Reaction\Blocks\Controller\ContextReactionBlocksController::blocksFormThemeSelect'
- requirements:
- _entity_access: 'context.update'
-
-# Display a list of all blocks.
-context.reaction.blocks.library:
- path: '/admin/structure/context/{context}/reaction/blocks/{reaction_id}/library'
- defaults:
- _title: 'Add block'
- _controller: '\Drupal\context\Reaction\Blocks\Controller\ContextReactionBlocksController::blocksLibrary'
- requirements:
- _entity_access: 'context.update'
-
-# Display a form to deleta a block.
-context.reaction.blocks.block_delete:
- path: '/admin/structure/context/{context}/reaction/blocks/delete/{block_id}'
- defaults:
- _form: '\Drupal\context\Reaction\Blocks\Form\BlockDeleteForm'
- _title: 'Delete block'
- requirements:
- _entity_access: 'context.update'
-
-# Display a form to add a block.
-context.reaction.blocks.block_add:
- path: '/admin/structure/context/{context}/reaction/blocks/{reaction_id}/add/{block_id}'
- defaults:
- _form: '\Drupal\context\Reaction\Blocks\Form\BlockAddForm'
- _title: 'Add block'
- requirements:
- _entity_access: 'context.update'
-
-# Display a form to edit a block.
-context.reaction.blocks.block_edit:
- path: '/admin/structure/context/{context}/reaction/blocks/{reaction_id}/edit/{block_id}'
- defaults:
- _form: '\Drupal\context\Reaction\Blocks\Form\BlockEditForm'
- _title: 'Edit block'
- requirements:
- _entity_access: 'context.update'
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/ContextListBuilder.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/ContextListBuilder.php
deleted file mode 100644
index befaf21fa..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/ContextListBuilder.php
+++ /dev/null
@@ -1,263 +0,0 @@
-contextManager = $contextManager;
- $this->formBuilder = $formBuilder;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
- return new static(
- $entity_type,
- $container->get('entity.manager')->getStorage($entity_type->id()),
- $container->get('context.manager'),
- $container->get('form_builder')
- );
- }
-
- /**
- * Use a form instead of the entity list builder to display contexts.
- *
- * {@inheritdoc}
- */
- public function render() {
- return $this->formBuilder->getForm($this);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'context_ui_admin_display_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $groups = $this->contextManager->getContextsByGroup();
-
- $form['contexts'] = array(
- '#type' => 'table',
- '#header' => array(
- $this->t('Context'),
- $this->t('Description'),
- $this->t('Group'),
- $this->t('Weight'),
- $this->t('Operations'),
- ),
- '#empty' => $this->t('There are no contexts defined.'),
- '#attributes' => array(
- 'id' => 'contexts',
- ),
- );
-
- $group_options = [];
-
- // @todo Make this a bit prettier.
- foreach ($groups as $group => $contexts) {
- $group_options[$group] = ($group === 'not_grouped') ? $this->t('Not grouped') : $group;
- }
-
- // Count the number of entities to get a good delta for the weights.
- $weight_delta = round(count($this->getEntityIds()) / 2);
-
- foreach ($groups as $group => $contexts) {
- $group_class = Html::getClass($group);
-
- $form['contexts']['#tabledrag'][] = array(
- 'action' => 'match',
- 'relationship' => 'sibling',
- 'group' => 'context-group-select',
- 'subgroup' => 'context-group-' . $group_class,
- 'hidden' => FALSE,
- );
-
- $form['contexts']['#tabledrag'][] = array(
- 'action' => 'order',
- 'relationship' => 'sibling',
- 'group' => 'context-weight',
- 'subgroup' => 'context-weight-' . $group_class,
- );
-
- $form['contexts']['group-' . $group_class] = array(
- '#attributes' => array(
- 'class' => array('group-label', 'group-label-' . $group_class),
- 'no_striping' => TRUE,
- ),
- );
-
- $form['contexts']['group-' . $group_class] = [
- '#attributes' => [
- 'class' => ['region-title'],
- ],
- 'title' => [
- '#markup' => ($group === 'not_grouped') ? $this->t('Not grouped') : $group,
- '#wrapper_attributes' => [
- 'colspan' => 5,
- ],
- ],
- ];
-
- /** @var ContextInterface $context */
- foreach ($contexts as $context_id => $context) {
- $operations = [
- 'edit' => [
- 'title' => $this->t('Edit'),
- 'url' => $context->urlInfo('edit-form'),
- ],
- 'delete' => [
- 'title' => $this->t('Delete'),
- 'url' => $context->urlInfo('delete-form'),
- 'attributes' => $this->getAjaxAttributes(),
- ],
- 'disable' => [
- 'title' => $context->disabled() ? $this->t('Enable') : $this->t('Disable'),
- 'url' => $context->toUrl('disable-form'),
- 'attributes' => $this->getAjaxAttributes(),
- ]
- ];
-
- $form['contexts'][$context_id] = [
- '#attributes' => [
- 'class' => ['draggable'],
- ],
- 'label' => [
- '#markup' => $context->getLabel(),
- '#wrapper_attributes' => $context->disabled() ? ['style' => 'opacity:0.6'] : NULL,
- ],
- 'description' => [
- '#markup' => $context->getDescription(),
- ],
- 'group' => [
- '#type' => 'select',
- '#title' => $this->t('Group for @context context', ['@context' => $context->getLabel()]),
- '#title_display' => 'invisible',
- '#default_value' => $context->getGroup(),
- '#options' => $group_options,
- '#attributes' => [
- 'class' => ['context-group-select', 'context-group-' . $group_class],
- ],
- ],
- 'weight' => [
- '#type' => 'weight',
- '#title' => $this->t('Weight for @context context', ['@context' => $context->getLabel()]),
- '#default_value' => $context->getWeight(),
- '#delta' => $weight_delta,
- '#title_display' => 'invisible',
- '#attributes' => [
- 'class' => ['context-weight', 'context-weight-' . $group_class],
- ],
- ],
- 'operations' => [
- '#type' => 'operations',
- '#links' => $operations,
- ],
- ];
- }
- }
-
- $form['actions'] = array(
- '#type' => 'actions',
- );
-
- if (count($groups) > 0) {
- $form['actions']['submit'] = array(
- '#type' => 'submit',
- '#value' => $this->t('Save contexts'),
- '#button_type' => 'primary',
- );
- }
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- // No validation.
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $contexts = $this->storage->loadMultiple(array_keys($form_state->getValue('contexts')));
-
- /*** @var ContextInterface $context */
- foreach ($contexts as $context_id => $context) {
- $context_values = $form_state->getValue(['contexts', $context_id]);
-
- $context->setWeight($context_values['weight']);
-
- // Not grouped contexts needs a specific group value.
- if ($context_values['group'] === 'not_grouped') {
- $context->setGroup(Context::CONTEXT_GROUP_NONE);
- }
- else {
- $context->setGroup($context_values['group']);
- }
-
- $context->save();
- }
-
- drupal_set_message($this->t('The context settings have been updated.'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Controller/ContextUIController.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Controller/ContextUIController.php
deleted file mode 100644
index 1b49f3d5e..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Controller/ContextUIController.php
+++ /dev/null
@@ -1,395 +0,0 @@
-contextManager = $contextManager;
- $this->contextReactionManager = $contextReactionManager;
- $this->conditionManager = $conditionManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('context.manager'),
- $container->get('plugin.manager.context_reaction'),
- $container->get('plugin.manager.condition')
- );
- }
-
- /**
- * Retrieves group suggestions for a context.
- *
- * @param Request $request
- * The current request.
- *
- * @return JsonResponse
- * A JSON response with groups matching the query.
- */
- public function groupsAutocomplete(Request $request) {
- $query = $request->query->get('q');
-
- $matches = [];
-
- foreach ($this->contextManager->getContexts() as $context) {
- if (stripos($context->getGroup(), $query) === 0) {
- $matches[] = $context->getGroup();
- }
- }
-
- $response = [];
-
- // Format the unique matches to be used with the autocomplete field.
- foreach (array_unique($matches) as $match) {
- $response[] = [
- 'value' => $match,
- 'label' => Html::escape($match),
- ];
- }
-
- return new JsonResponse($response);
- }
-
- /**
- * Displays a list of conditions that can be added to the context.
- *
- * @param ContextInterface $context
- * The context to display available conditions for.
- *
- * @return array
- */
- public function listConditions(ContextInterface $context) {
-
- // Get a list of all available conditions.
- $conditions = $this->conditionManager->getDefinitions();
-
- $header = [
- $this->t('Condition')
- ];
-
- $build['filter'] = [
- '#type' => 'search',
- '#title' => $this->t('Filter'),
- '#title_display' => 'invisible',
- '#size' => 30,
- '#placeholder' => $this->t('Filter by condition name'),
- '#attributes' => [
- 'class' => ['context-table-filter'],
- 'data-element' => '.condition-add-table',
- 'title' => $this->t('Enter a part of the condition name to filter by.'),
- ],
- ];
-
- $rows = [];
-
- // Add a table row for each condition.
- foreach ($conditions as $condition_id => $condition) {
- // Only add the condition to the list of it's not already been added to
- // the context.
- if ($context->hasCondition($condition_id)) {
- continue;
- }
-
- $rows[] = [
- 'condition' => [
- 'data' => [
- '#type' => 'link',
- '#title' => $condition['label'] . ' (' . $condition['provider'] . ')',
- '#url' => Url::fromRoute('context.condition_add', [
- 'context' => $context->id(),
- 'condition_id' => $condition_id,
- ]),
- '#attributes' => [
- 'class' => ['use-ajax', 'context-table-filter-text-source'],
- ],
- '#options' => [
- 'html' => TRUE,
- ]
- ],
- ],
- ];
- }
-
- $build['conditions'] = [
- '#type' => 'table',
- '#header' => $header,
- '#rows' => $rows,
- '#empty' => $this->t('There are no conditions left that can be added to this context.'),
- '#attributes' => [
- 'class' => ['condition-add-table'],
- ],
- ];
-
- $build['#attached']['library'][] = 'context_ui/admin';
-
- return $build;
- }
-
- /**
- * Displays a list of reactions that can be added to the context.
- *
- * @param ContextInterface $context
- * The context to display available
- *
- * @return array
- */
- public function listReactions(ContextInterface $context) {
-
- // Get a list of all available conditions.
- $reactions = $this->contextReactionManager->getDefinitions();
-
- $header = [
- $this->t('Reactions')
- ];
-
- $build['filter'] = [
- '#type' => 'search',
- '#title' => $this->t('Filter'),
- '#title_display' => 'invisible',
- '#size' => 30,
- '#placeholder' => $this->t('Filter by reaction name'),
- '#attributes' => [
- 'class' => ['context-table-filter'],
- 'data-element' => '.reaction-add-table',
- 'title' => $this->t('Enter a part of the reaction name to filter by.'),
- ],
- ];
-
- $rows = [];
-
- // Add a table row for each context reaction.
- foreach ($reactions as $reaction_id => $reaction) {
- // Only add the reaction to the list of it's not already been added to
- // the context.
- if ($context->hasReaction($reaction_id)) {
- continue;
- }
-
- $rows[] = [
- 'reaction' => [
- 'data' => [
- '#type' => 'link',
- '#title' => $reaction['label'],
- '#url' => Url::fromRoute('context.reaction_add', [
- 'context' => $context->id(),
- 'reaction_id' => $reaction_id,
- ]),
- '#attributes' => [
- 'class' => ['use-ajax', 'context-table-filter-text-source'],
- ],
- '#options' => [
- 'html' => TRUE,
- ],
- '#ajax' => TRUE,
- ],
- ],
- ];
- }
-
- $build['reactions'] = [
- '#type' => 'table',
- '#header' => $header,
- '#rows' => $rows,
- '#empty' => $this->t('There are no reactions left that can be added to this context.'),
- '#attributes' => [
- 'class' => ['reaction-add-table'],
- ],
- ];
-
- $build['#attached']['library'][] = 'context_ui/admin';
-
- return $build;
- }
-
- /**
- * Add the specified reaction to the context.
- *
- * @param Request $request
- * The current request.
- *
- * @param ContextInterface $context
- * The context to add the reaction to.
- *
- * @param $reaction_id
- * The ID of the reaction to add.
- *
- * @return AjaxResponse|RedirectResponse
- */
- public function addReaction(Request $request, ContextInterface $context, $reaction_id) {
-
- if ($context->hasReaction($reaction_id)) {
- throw new HttpException(403, 'The specified reaction had already been added to the context.');
- }
-
- // Create an instance of the reaction and add it to the context.
- try {
- $reaction = $this->contextReactionManager->createInstance($reaction_id);
- }
- catch (PluginException $e) {
- throw new HttpException(400, $e->getMessage());
- }
-
- // If one of the condition is "Current theme", prevent adding Theme reaction.
- // Else this will cause an infinite loop when checking for active contexts.
- if ($reaction_id == 'theme') {
- $conditions = $context->getConditions();
- foreach ($conditions as $condition) {
- if ($condition->getPluginId() == 'current_theme') {
- if ($request->isXmlHttpRequest()) {
- $response = new AjaxResponse();
-
- $response->addCommand(new CloseModalDialogCommand());
- $response->addCommand(new OpenModalDialogCommand($this->t("Theme reaction"), $this->t("You can not place Theme reaction if Current theme condition is set."), ['width' => '700']));
- return $response;
- }
- }
- }
- }
-
- $context->addReaction($reaction->getConfiguration());
- $context->save();
-
- // If the request is an AJAX request then return an AJAX response with
- // commands to replace the content on the page.
- if ($request->isXmlHttpRequest()) {
- $response = new AjaxResponse();
-
- $contextForm = $this->contextManager->getForm($context, 'edit');
-
- $response->addCommand(new CloseModalDialogCommand());
- $response->addCommand(new ReplaceCommand('#context-reactions', $contextForm['reactions']));
-
- return $response;
- }
-
- $url = $context->urlInfo('edit-form');
-
- return $this->redirect($url->getRouteName(), $url->getRouteParameters());
- }
-
- /**
- * Add the specified condition to the context.
- *
- * @param Request $request
- * The current request.
- *
- * @param ContextInterface $context
- * The context to add the condition to.
- *
- * @param $condition_id
- * The ID of the condition to add.
- *
- * @return AjaxResponse|RedirectResponse
- */
- public function addCondition(Request $request, ContextInterface $context, $condition_id) {
-
- if ($context->hasCondition($condition_id)) {
- throw new HttpException(403, 'The specified condition had already been added to the context.');
- }
-
- // Create an instance of the condition and add it to the context.
- try {
- $condition = $this->conditionManager->createInstance($condition_id);
- }
- catch (PluginException $e) {
- throw new HttpException(400, $e->getMessage());
- }
-
- // Prevent adding "Current theme" condition, if "Theme" reaction is already set.
- // Else this will cause an infinite loop when checking for active contexts.
- if ($condition_id == 'current_theme') {
- $reactions = $context->getReactions();
- foreach ($reactions as $reaction) {
- if ($reaction->getPluginId() == 'theme') {
- if ($request->isXmlHttpRequest()) {
- $response = new AjaxResponse();
-
- $response->addCommand(new CloseModalDialogCommand());
- $response->addCommand(new OpenModalDialogCommand($this->t("Current theme condition"), $this->t("You can not set Current theme condition if Theme reaction is set."), ['width' => '700']));
- return $response;
- }
- }
- }
- }
-
- $context->addCondition($condition->getConfiguration());
- $context->save();
-
- // If the request is an AJAX request then return an AJAX response with
- // commands to replace the content on the page.
- if ($request->isXmlHttpRequest()) {
- $response = new AjaxResponse();
-
- $contextForm = $this->contextManager->getForm($context, 'edit');
-
- $response->addCommand(new CloseModalDialogCommand());
- $response->addCommand(new ReplaceCommand('#context-conditions', $contextForm['conditions']));
-
- return $response;
- }
-
- $url = $context->urlInfo('edit-form');
-
- return $this->redirect($url->getRouteName(), $url->getRouteParameters());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ConditionDeleteForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ConditionDeleteForm.php
deleted file mode 100644
index 9201e9366..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ConditionDeleteForm.php
+++ /dev/null
@@ -1,142 +0,0 @@
-contextManager = $contextManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static (
- $container->get('context.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'context_ui_condition_delete_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getQuestion() {
- return $this->t('Are you sure you want to delete the %label condition?', [
- '%label' => $this->condition->getPluginDefinition()['label'],
- ]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return $this->context->urlInfo('edit-form');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Delete');
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $condition_id = NULL) {
- $this->context = $context;
- $this->condition = $context->getCondition($condition_id);
-
- $form = parent::buildForm($form, $form_state);
-
- // Remove the cancel button if this is an AJAX request since Drupals built
- // in modal dialogues does not handle buttons that are not a primary
- // button very well.
- if ($this->getRequest()->isXmlHttpRequest()) {
- unset($form['actions']['cancel']);
- }
-
- // Submit the form with AJAX if possible.
- $form['actions']['submit']['#ajax'] = [
- 'callback' => '::submitFormAjax'
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- // Remove the condition and save the context.
- $this->context->removeCondition($this->condition->getConfiguration()['id'])->save();
-
- // If this is not an AJAX request then redirect and show a message.
- if (!$this->getRequest()->isXmlHttpRequest()) {
- drupal_set_message($this->t('The condition %name has been removed.', [
- '%name' => $this->condition->getPluginDefinition()['label']]
- ));
-
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
- }
-
- /**
- * Handle when the form is submitted trough AJAX.
- *
- * @return AjaxResponse
- */
- public function submitFormAjax() {
- $contextForm = $this->contextManager->getForm($this->context, 'edit');
-
- $response = new AjaxResponse();
-
- $response->addCommand(new CloseModalDialogCommand());
- $response->addCommand(new ReplaceCommand('#context-conditions', $contextForm['conditions']));
-
- return $response;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextAddForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextAddForm.php
deleted file mode 100644
index b105e26ac..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextAddForm.php
+++ /dev/null
@@ -1,30 +0,0 @@
-t('The context %label has been added.', [
- '%label' => $this->entity->getLabel(),
- ]));
- }
- else {
- drupal_set_message($this->t('The context was not saved.'));
- }
-
- $formState->setRedirect('entity.context.edit_form', [
- 'context' => $this->entity->id(),
- ]);
- }
-
-}
-
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDeleteForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDeleteForm.php
deleted file mode 100644
index 02403f785..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDeleteForm.php
+++ /dev/null
@@ -1,79 +0,0 @@
-contextManager = $contextManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('context.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getQuestion() {
- return $this->t('Are you sure you want to delete the %label context?', array(
- '%label' => $this->entity->getLabel(),
- ));
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('entity.context.collection');
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $form = parent::buildForm($form, $form_state);
-
- // Remove the cancel button if this is an AJAX request since Drupals built
- // in modal dialogues does not handle buttons that are not a primary
- // button very well.
- if ($this->getRequest()->isXmlHttpRequest()) {
- unset($form['actions']['cancel']);
- }
-
- return $form;
- }
-
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $formState) {
- $this->entity->delete();
-
- drupal_set_message($this->t('The context %title has been deleted.', array(
- '%title' => $this->entity->getLabel(),
- )));
-
- $formState->setRedirectUrl($this->getCancelUrl());
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDisableForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDisableForm.php
deleted file mode 100644
index 61e0fd673..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextDisableForm.php
+++ /dev/null
@@ -1,89 +0,0 @@
-contextManager = $contextManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('context.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getQuestion() {
- return $this->t('Are you sure you want to %status the %label context?', array(
- '%status' => $this->entity->disabled() ? "enable" : "disable",
- '%label' => $this->entity->getLabel(),
- ));
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return $this->t('This action will %status the %label context.', array(
- '%status' => $this->entity->disabled() ? "enable" : "disable",
- '%label' => $this->entity->getLabel(),
- ));
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('entity.context.collection');
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $form = parent::buildForm($form, $form_state);
-
- // Remove the cancel button if this is an AJAX request since Drupals built
- // in modal dialogues does not handle buttons that are not a primary
- // button very well.
- if ($this->getRequest()->isXmlHttpRequest()) {
- unset($form['actions']['cancel']);
- }
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $formState) {
- $this->entity->disable();
- drupal_set_message($this->t('The context %title has been %status.', array(
- '%title' => $this->entity->getLabel(),
- '%status' => $this->entity->disabled() ? "disabled" : "enabled",
- )));
-
- $formState->setRedirectUrl($this->getCancelUrl());
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextEditForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextEditForm.php
deleted file mode 100644
index 26dfdccd8..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextEditForm.php
+++ /dev/null
@@ -1,268 +0,0 @@
-setTemporaryValue('gathered_contexts', $this->contextRepository->getAvailableContexts());
-
- $form['require_all_conditions'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Require all conditions'),
- '#description' => $this->t('If checked, all conditions must be met for this context to be active. Otherwise, the first condition that is met will activate this context.'),
- '#default_value' => $this->entity->requiresAllConditions(),
- ];
-
- $form['conditions'] = [
- '#prefix' => '
',
- '#tree' => TRUE,
- '#process' => array(
- array($this, 'processReactions'),
- ),
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $form, FormStateInterface $formState) {
- $status = parent::save($form, $formState);
-
- if ($status) {
- drupal_set_message($this->t('The context %label has been saved.', [
- '%label' => $this->entity->getLabel(),
- ]));
- }
- else {
- drupal_set_message($this->t('The context was not saved.'));
- }
-
- }
-
- /**
- * Process function for the conditions.
- *
- * @param $element
- * The element to process.
- *
- * @param FormStateInterface $form_state
- * The current form state.
- *
- * @return array
- */
- public function processConditions(&$element, FormStateInterface $form_state) {
- $conditions = $this->entity->getConditions();
-
- $element['add_condition'] = array(
- '#type' => 'link',
- '#title' => $this->t('Add condition'),
- '#url' => Url::fromRoute('context.conditions_library', [
- 'context' => $this->entity->id(),
- ]),
- '#attributes' => [
- 'class' => [
- 'use-ajax', 'button', 'button--small'
- ],
- 'data-dialog-type' => 'modal',
- 'data-dialog-options' => Json::encode([
- 'width' => 700,
- ]),
- ],
- );
-
- if (!count($conditions)) {
- $element['reactions']['empty'] = [
- '#type' => 'container',
- '#markup' => $this->t('No conditions has been added. When there are no added conditions the context will be considered sitewide.'),
- ];
- }
-
- $element['condition_tabs'] = [
- '#type' => 'vertical_tabs',
- '#parents' => ['condition_tabs'],
- ];
-
- foreach ($conditions as $condition_id => $condition) {
- $element['condition-' . $condition_id] = [
- '#type' => 'details',
- '#title' => $condition->getPluginDefinition()['label'],
- '#group' => 'condition_tabs',
- ];
-
- $element['condition-' . $condition_id]['options'] = $condition->buildConfigurationForm([], $form_state);
- $element['condition-' . $condition_id]['options']['#parents'] = ['conditions', $condition_id];
-
- $element['condition-' . $condition_id]['remove'] = [
- '#type' => 'link',
- '#title' => $this->t('Remove condition'),
- '#url' => Url::fromRoute('context.condition_delete', [
- 'context' => $this->entity->id(),
- 'condition_id' => $condition_id,
- ]),
- '#attributes' => [
- 'class' => [
- 'use-ajax', 'button', 'button--small'
- ],
- 'data-dialog-type' => 'modal',
- 'data-dialog-options' => Json::encode([
- 'width' => 700,
- ]),
- ],
- ];
- }
-
- return $element;
- }
-
- /**
- * Process function for the reactions.
- *
- * @param $element
- * The element to process.
- *
- * @param FormStateInterface $form_state
- * The current form state.
- *
- * @return array
- */
- public function processReactions(&$element, FormStateInterface $form_state) {
- $reactions = $this->entity->getReactions();
-
- $element['add_reaction'] = [
- '#type' => 'link',
- '#title' => $this->t('Add reaction'),
- '#url' => Url::fromRoute('context.reactions_library', [
- 'context' => $this->entity->id(),
- ]),
- '#attributes' => [
- 'class' => [
- 'use-ajax', 'button', 'button--small'
- ],
- 'data-dialog-type' => 'modal',
- 'data-dialog-options' => Json::encode([
- 'width' => 700,
- ]),
- ],
- ];
-
- if (!count($reactions)) {
- $element['empty'] = [
- '#type' => 'container',
- '#markup' => $this->t('No reactions has been added.'),
- ];
- }
-
- $element['reaction_tabs'] = [
- '#type' => 'vertical_tabs',
- '#parents' => ['reaction_tabs'],
- ];
-
- foreach ($reactions as $reaction_id => $reaction) {
- $element['reaction-' . $reaction_id] = [
- '#type' => 'details',
- '#title' => $reaction->getPluginDefinition()['label'],
- '#group' => 'reaction_tabs',
- ];
-
- $reaction_values = $form_state->getValue(['reactions', $reaction_id], []);
- $reaction_state = (new FormState())->setValues($reaction_values);
-
- $element['reaction-' . $reaction_id]['options'] = $reaction->buildConfigurationForm([], $reaction_state, $this->entity);
- $element['reaction-' . $reaction_id]['options']['#parents'] = ['reactions', $reaction_id];
-
- $element['reaction-' . $reaction_id]['remove'] = [
- '#type' => 'link',
- '#title' => $this->t('Remove reaction'),
- '#url' => Url::fromRoute('context.reaction_delete', [
- 'context' => $this->entity->id(),
- 'reaction_id' => $reaction_id,
- ]),
- '#attributes' => [
- 'class' => [
- 'use-ajax', 'button', 'button--small'
- ],
- 'data-dialog-type' => 'modal',
- 'data-dialog-options' => Json::encode([
- 'width' => 700,
- ]),
- ],
- ];
- }
-
- return $element;
- }
-
- /**
- * Actions function.
- *
- * @param array $form
- * Form object.
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * Form state object.
- *
- * @return mixed
- * Return mixed object.
- */
- protected function actions(array $form, FormStateInterface $form_state) {
- $element = parent::actions($form, $form_state);
-
- $element['submit'] = [
- '#type' => 'submit',
- '#dropbutton' => 'save',
- '#value' => t('Save and continue'),
- '#submit' => ['::submitForm', '::save'],
- ];
- $element['submit_exit'] = [
- '#type' => 'submit',
- '#dropbutton' => 'save',
- '#value' => t('Save and exit'),
- '#submit' => ['::submitForm', '::save', '::collection'],
- ];
-
- return $element;
- }
-
- /**
- * Collection function makes redirection to route name.
- *
- * @param array $form
- * Form object.
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * From state object.
- */
- public function collection(array $form, FormStateInterface $form_state) {
- $form_state->setRedirect('entity.context.collection');
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextFormBase.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextFormBase.php
deleted file mode 100644
index 827c0d9da..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ContextFormBase.php
+++ /dev/null
@@ -1,230 +0,0 @@
-contextManager = $contextManager;
- $this->contextRepository = $contextRepository;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('context.manager'),
- $container->get('context.repository')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function form(array $form, FormStateInterface $formState) {
-
- $form['general'] = [
- '#type' => 'fieldset',
- '#title' => $this->t('General details'),
- ];
-
- $form['general']['label'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Label'),
- '#default_value' => $this->entity->getLabel(),
- '#required' => TRUE,
- '#description' => $this->t('Enter label for this context.'),
- ];
-
- $form['general']['name'] = [
- '#type' => 'machine_name',
- '#title' => $this->t('Machine name'),
- '#default_value' => $this->entity->getName(),
- '#machine_name' => [
- 'source' => ['general', 'label'],
- 'exists' => [$this, 'contextExists'],
- ],
- ];
-
- $form['general']['group'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Group'),
- '#default_value' => $this->entity->getGroup(),
- '#description' => $this->t('Enter name of the group this context should belong to.'),
- '#autocomplete_route_name' => 'context.groups.autocomplete',
- ];
-
- $form['general']['description'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Description'),
- '#default_value' => $this->entity->getDescription(),
- '#description' => $this->t('Enter a description for this context definition.'),
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- if ($form_state->hasValue('reactions')) {
- $this->validateReactions($form, $form_state);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- // Save entity values that the built in submit handler cant take care of.
- if ($form_state->hasValue('require_all_conditions')) {
- $this->entity->setRequireAllConditions($form_state->getValue('require_all_conditions'));
- }
-
- if ($form_state->hasValue('conditions')) {
- $this->handleConditions($form, $form_state);
- }
-
- if ($form_state->hasValue('reactions')) {
- $this->handleReactions($form, $form_state);
- }
-
- // If the group is empty set it to the context no group value,
- // otherwise Drupal will save it as an empty string instead.
- if ($form_state->hasValue('group') && empty($form_state->getValue('group'))) {
- $form_state->setValue('group', Context::CONTEXT_GROUP_NONE);
- }
-
- // Run the default submit method.
- parent::submitForm($form, $form_state);
- }
-
- /**
- * Handle submitting the condition plugins configuration forms.
- *
- * @param array $form
- * The rendered form.
- *
- * @param FormStateInterface $form_state
- * The current form state.
- */
- private function handleConditions(array &$form, FormStateInterface $form_state) {
- $conditions = $form_state->getValue('conditions', []);
-
- // Loop trough each condition and update the configuration values by
- // submitting the conditions form.
- foreach ($conditions as $condition_id => $configuration) {
- $condition = $this->entity->getCondition($condition_id);
-
- $condition_values = (new FormState())->setValues($configuration);
- $condition->submitConfigurationForm($form, $condition_values);
-
- // If the condition is context aware then add context mapping to
- // the condition.
- if ($condition instanceof ContextAwarePluginInterface) {
- $condition->setContextMapping($condition_values->getValue('context_mapping', []));
- }
- }
- }
-
- /**
- * Handle submitting the context reaction plugins configuration forms.
- *
- * @param array $form
- * The rendered form.
- *
- * @param FormStateInterface $form_state
- * The current form state.
- */
- private function handleReactions(array &$form, FormStateInterface $form_state) {
- $reactions = $form_state->getValue('reactions', []);
-
- // Loop trough each reaction and update the configuration values by
- // submitting the reactions form.
- foreach ($reactions as $reaction_id => $configuration) {
- $reaction = $this->entity->getReaction($reaction_id);
-
- $reaction_values = (new FormState())->setValues($configuration);
- $reaction->submitConfigurationForm($form, $reaction_values);
- }
- }
-
- /**
- * Validate the context reaction plugins configuration forms.
- *
- * @param array $form
- * The rendered form.
- *
- * @param FormStateInterface $form_state
- * The current form state.
- */
- private function validateReactions(array &$form, FormStateInterface $form_state) {
- $reactions = $form_state->getValue('reactions', []);
-
- // Loop trough each reaction and update the configuration values by
- // validating the reactions form.
- foreach ($reactions as $reaction_id => $configuration) {
- $reaction = $this->entity->getReaction($reaction_id);
-
- $reaction_values = (new FormState())->setValues($configuration);
- $reaction->validateConfigurationForm($form, $reaction_values);
- if ($reaction_values->hasAnyErrors()) {
- // In case of errors, copy them back from the dummy FormState to the
- // master form.
- foreach ($reaction_values->getErrors() as $element => $error) {
- $form_state->setErrorByName("reactions][$reaction_id][$element", $error);
- }
- }
- }
- }
-
- /**
- * Check to see if a context already exists with the specified name.
- *
- * @param string $name
- * The machine name to check for.
- *
- * @return bool
- */
- public function contextExists($name) {
- return $this->contextManager->contextExists($name);
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ReactionDeleteForm.php b/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ReactionDeleteForm.php
deleted file mode 100644
index f46b4d0a1..000000000
--- a/sites/all/modules/contrib/admin/context/modules/context_ui/src/Form/ReactionDeleteForm.php
+++ /dev/null
@@ -1,143 +0,0 @@
-contextManager = $contextManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('context.manager')
- );
- }
-
- /**
- * Returns the question to ask the user.
- *
- * @return string
- * The form question. The page title will be set to this value.
- */
- public function getQuestion() {
- return $this->t('Are you sure you want to remove the %reaction reaction.', [
- '%reaction' => $this->reaction->getPluginDefinition()['label'],
- ]);
- }
-
- /**
- * Returns the route to go to if the user cancels the action.
- *
- * @return \Drupal\Core\Url
- * A URL object.
- */
- public function getCancelUrl() {
- return $this->context->urlInfo();
- }
-
- /**
- * Returns a unique string identifying the form.
- *
- * @return string
- * The unique string identifying the form.
- */
- public function getFormId() {
- return 'context_reaction_delete_confirm';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $reaction_id = NULL) {
- $this->context = $context;
- $this->reaction = $this->context->getReaction($reaction_id);
-
- $form = parent::buildForm($form, $form_state);
-
- // Remove the cancel button if this is an AJAX request since Drupals built
- // in modal dialogues does not handle buttons that are not a primary
- // button very well.
- if ($this->getRequest()->isXmlHttpRequest()) {
- unset($form['actions']['cancel']);
- }
-
- $form['actions']['submit']['#ajax'] = [
- 'callback' => '::submitFormAjax',
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $definition = $this->reaction->getPluginDefinition();
-
- $this->context->removeReaction($this->reaction->getPluginId());
-
- $this->context->save();
-
- // If this is not an AJAX request then redirect and show a message.
- if (!$this->getRequest()->isXmlHttpRequest()) {
- drupal_set_message($this->t('The %label context reaction has been removed.', [
- '%label' => $definition['label']]
- ));
-
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
- }
-
- /**
- * Handle when the form is submitted through AJAX.
- *
- * @return AjaxResponse
- */
- public function submitFormAjax() {
- $response = new AjaxResponse();
-
- $contextForm = $this->contextManager->getForm($this->context, 'edit');
-
- $response->addCommand(new CloseModalDialogCommand());
- $response->addCommand(new ReplaceCommand('#context-reactions', $contextForm['reactions']));
-
- return $response;
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/ContextInterface.php b/sites/all/modules/contrib/admin/context/src/ContextInterface.php
deleted file mode 100644
index c0d6cb65f..000000000
--- a/sites/all/modules/contrib/admin/context/src/ContextInterface.php
+++ /dev/null
@@ -1,215 +0,0 @@
-entityQuery = $entityQuery;
- $this->entityManager = $entityManager;
- $this->contextRepository = $contextRepository;
- $this->contextHandler = $contextHandler;
- $this->entityFormBuilder = $entityFormBuilder;
- $this->themeManager = $themeManager;
- }
-
- /**
- * Get all contexts.
- *
- * @return Context[]
- */
- public function getContexts() {
- $contextIds = $this->entityQuery
- ->get('context')
- ->execute();
-
- $contexts = $this->entityManager
- ->getStorage('context')
- ->loadMultiple($contextIds);
-
- // Sort the contexts by their weight.
- uasort($contexts, [$this, 'sortContextsByWeight']);
-
- return $contexts;
- }
-
- /**
- * Get all contexts sorted by their group and sorted by their weight inside
- * of each group.
- *
- * @return array
- */
- public function getContextsByGroup() {
- $contexts = $this->getContexts();
-
- $groups = [];
-
- // Add each context to their respective groups.
- foreach ($contexts as $context_id => $context) {
- $group = $context->getGroup();
-
- if ($group === Context::CONTEXT_GROUP_NONE) {
- $group = 'not_grouped';
- }
-
- $groups[$group][$context_id] = $context;
- }
-
- return $groups;
- }
-
- /**
- * Check to validate that the context name does not already exist.
- *
- * @param string $name
- * The machine name of the context to validate.
- *
- * @return bool
- */
- public function contextExists($name) {
- $entity = $this->entityQuery->get('context')
- ->condition('name', $name)
- ->execute();
-
- return (bool) $entity;
- }
-
- /**
- * Check to see if context conditions has been evaluated.
- *
- * @return bool
- */
- public function conditionsHasBeenEvaluated() {
- return $this->contextConditionsEvaluated;
- }
-
- /**
- * Get the evaluated and active contexts.
- *
- * @return \Drupal\context\ContextInterface[]
- */
- public function getActiveContexts() {
- if ($this->conditionsHasBeenEvaluated()) {
- return $this->activeContexts;
- }
-
- $this->evaluateContexts();
-
- return $this->activeContexts;
- }
-
- /**
- * Evaluate all context conditions.
- */
- public function evaluateContexts() {
-
- /** @var \Drupal\context\ContextInterface $context */
- foreach ($this->getContexts() as $context) {
- if ($this->evaluateContextConditions($context) && !$context->disabled()) {
- $this->activeContexts[] = $context;
- }
- }
-
- $this->contextConditionsEvaluated = TRUE;
- }
-
- /**
- * Get all active reactions or reactions of a certain type.
- *
- * @param string $reactionType
- * Either the reaction class name or the id of the reaction type to get.
- *
- * @return ContextReactionInterface[]
- */
- public function getActiveReactions($reactionType = NULL) {
- $reactions = [];
-
- foreach ($this->getActiveContexts() as $context) {
-
- // If no reaction type has been specified then add all reactions and
- // continue to the next context.
- if (is_null($reactionType)) {
- foreach ($context->getReactions() as $reaction) {
- // Only return block reaction if there is a block applied to the current theme.
- if ($reaction instanceof Blocks) {
- $blocks = $reaction->getBlocks();
- $current_theme = $this->getCurrentTheme();
- foreach ($blocks as $block) {
- if ($block->getConfiguration()['theme'] == $current_theme) {
- $reactions[] = $reaction;
- break;
- }
- }
- }
- else {
- $reactions[] = $reaction;
- }
- }
- continue;
- }
-
- $contextReactions = $context->getReactions();
-
- // Filter the reactions based on the reaction type.
- foreach ($contextReactions as $reaction) {
-
- if (class_exists($reactionType) && $reaction instanceof $reactionType) {
- $reactions[] = $reaction;
- continue;
- }
-
- if ($reaction->getPluginId() === $reactionType) {
- $reactions[] = $reaction;
- continue;
- }
- }
- }
-
- return $reactions;
- }
-
- /**
- * Evaluate a contexts conditions.
- *
- * @param ContextInterface $context
- * The context to evaluate conditions for.
- *
- * @return bool
- */
- public function evaluateContextConditions(ContextInterface $context) {
- $conditions = $context->getConditions();
-
- // Apply context to any context aware conditions.
- $this->applyContexts($conditions);
-
- // Set the logic to use when validating the conditions.
- $logic = $context->requiresAllConditions()
- ? 'and'
- : 'or';
-
- // Of there are no conditions then the context will be
- // applied as a site wide context.
- if (!count($conditions)) {
- $logic = 'and';
- }
-
- return $this->resolveConditions($conditions, $logic);
- }
-
- /**
- * Apply context to all the context aware conditions in the collection.
- *
- * @param ConditionPluginCollection $conditions
- * A collection of conditions to apply context to.
- *
- * @return bool
- */
- protected function applyContexts(ConditionPluginCollection &$conditions) {
-
- foreach ($conditions as $condition) {
- if ($condition instanceof ContextAwarePluginInterface) {
- try {
- $contexts = $this->contextRepository->getRuntimeContexts(array_values($condition->getContextMapping()));
- $this->contextHandler->applyContextMapping($condition, $contexts);
- }
- catch (ContextException $e) {
- return FALSE;
- }
- }
- }
-
- return TRUE;
- }
-
- /**
- * Get a rendered form for the context.
- * @param \Drupal\context\ContextInterface $context
- * @param string $formType
- * @param array $form_state_additions
- * @return array
- */
- public function getForm(ContextInterface $context, $formType = 'edit', array $form_state_additions = array()) {
- return $this->entityFormBuilder->getForm($context, $formType, $form_state_additions);
- }
-
- /**
- * Sorts an array of context entities by their weight.
- *
- * Callback for uasort().
- *
- * @param ContextInterface $a
- * First item for comparison.
- *
- * @param ContextInterface $b
- * Second item for comparison.
- *
- * @return int
- * The comparison result for uasort().
- */
- public function sortContextsByWeight(ContextInterface $a, ContextInterface $b) {
- if ($a->getWeight() == $b->getWeight()) {
- return 0;
- }
-
- return ($a->getWeight() < $b->getWeight()) ? -1 : 1;
- }
-
- /**
- * Get current active theme.
- *
- * @return string
- * Current active theme name.
- */
- private function getCurrentTheme() {
- return $this->themeManager->getActiveTheme()->getName();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/ContextMenuActiveTrail.php b/sites/all/modules/contrib/admin/context/src/ContextMenuActiveTrail.php
deleted file mode 100644
index 0d58d438c..000000000
--- a/sites/all/modules/contrib/admin/context/src/ContextMenuActiveTrail.php
+++ /dev/null
@@ -1,51 +0,0 @@
-contextManager = $context_manager;
- }
-
-
- /**
- * {@inheritdoc}
- */
- public function getActiveLink($menu_name = NULL) {
- $found = parent::getActiveLink($menu_name);
-
- // Get active reaction of Menu type.
- foreach($this->contextManager->getActiveReactions('menu') as $reaction) {
- $menu_items = $reaction->execute();
- foreach ($menu_items as $menu_link_content) {
- $menu = strtok($menu_link_content, ':');
- if ($menu == $menu_name) {
- $plugin_id = substr($menu_link_content, strlen($menu) + 1);
- return $this->menuLinkManager->createInstance($plugin_id);
- }
- }
- }
- return $found;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/ContextReactionInterface.php b/sites/all/modules/contrib/admin/context/src/ContextReactionInterface.php
deleted file mode 100644
index 1010cdbe1..000000000
--- a/sites/all/modules/contrib/admin/context/src/ContextReactionInterface.php
+++ /dev/null
@@ -1,25 +0,0 @@
-alterInfo('context_condition_info');
- $this->setCacheBackend($cache_backend, 'context_condition_plugins');
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/ContextReactionPluginBase.php b/sites/all/modules/contrib/admin/context/src/ContextReactionPluginBase.php
deleted file mode 100644
index a8488f29d..000000000
--- a/sites/all/modules/contrib/admin/context/src/ContextReactionPluginBase.php
+++ /dev/null
@@ -1,68 +0,0 @@
-setConfiguration($configuration);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getId() {
- if (isset($this->getConfiguration()['id'])) {
- return $this->getConfiguration()['id'];
- }
-
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfiguration() {
- return [
- 'id' => $this->getPluginId(),
- ] + $this->configuration;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setConfiguration(array $configuration) {
- $this->configuration = $configuration + $this->defaultConfiguration();
- return $this;
- }
-
- /**
- * Form validation handler is optional.
- *
- * {@inheritdoc}
- */
- public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {}
-
- /**
- * {@inheritdoc}
- */
- public function defaultConfiguration() {
- return [
- 'saved' => FALSE,
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function calculateDependencies() {
- return [];
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/ContextServiceProvider.php b/sites/all/modules/contrib/admin/context/src/ContextServiceProvider.php
deleted file mode 100644
index 96aeebf80..000000000
--- a/sites/all/modules/contrib/admin/context/src/ContextServiceProvider.php
+++ /dev/null
@@ -1,23 +0,0 @@
-getDefinition('menu.active_trail');
- $definition->setClass('Drupal\context\ContextMenuActiveTrail');
- $definition->addArgument($container->getDefinition('context.manager'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Entity/Context.php b/sites/all/modules/contrib/admin/context/src/Entity/Context.php
deleted file mode 100644
index 15d2d9016..000000000
--- a/sites/all/modules/contrib/admin/context/src/Entity/Context.php
+++ /dev/null
@@ -1,376 +0,0 @@
-name;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getName() {
- return $this->name;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setName($name) {
-
- if (!is_string($name)) {
- throw new InvalidArgumentException('The context name must be a string.');
- }
-
- $this->name = $name;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getLabel() {
- return $this->label;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setLabel($label) {
-
- if (!is_string($label)) {
- throw new InvalidArgumentException('The context label must be a string.');
- }
-
- $this->label = $label;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return $this->description;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setDescription($description) {
-
- if (!is_string($description)) {
- throw new InvalidArgumentException('The context description must be a string.');
- }
-
- $this->description = $description;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getGroup() {
- return $this->group;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setGroup($group) {
- $this->group = (is_string($group) && !empty($group)) ? $group : self::CONTEXT_GROUP_NONE;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getWeight() {
- return $this->weight;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setWeight($weight) {
- $this->weight = (int) $weight;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function requiresAllConditions() {
- return $this->requireAllConditions;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setRequireAllConditions($require) {
- $this->requireAllConditions = (bool) $require;
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConditions() {
- if (!$this->conditionsCollection) {
- $conditionManager = Drupal::service('plugin.manager.condition');
- $this->conditionsCollection = new ConditionPluginCollection($conditionManager, $this->conditions);
- }
-
- return $this->conditionsCollection;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCondition($condition_id) {
- return $this->getConditions()->get($condition_id);
- }
-
- /**
- * {@inheritdoc}
- */
- public function addCondition(array $configuration) {
- // Add an UUID to the condition to make sure the configuration is saved
- // since the configuration export from the conditions collection wont
- // export configuration that has not been "configured".
- $configuration['uuid'] = $this->uuidGenerator()->generate();
-
- $this->getConditions()->addInstanceId($configuration['id'], $configuration);
-
- return $configuration['id'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function removeCondition($condition_id) {
- $this->getConditions()->removeInstanceId($condition_id);
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasCondition($condition_id) {
- return $this->getConditions()->has($condition_id);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getReactions() {
- if (!$this->reactionsCollection) {
- $reactionManager = Drupal::service('plugin.manager.context_reaction');
- $this->reactionsCollection = new ContextReactionPluginCollection($reactionManager, $this->reactions);
- }
-
- return $this->reactionsCollection;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getReaction($reaction_id) {
- return $this->getReactions()->get($reaction_id);
- }
-
- /**
- * {@inheritdoc}
- */
- public function addReaction(array $configuration) {
- // Add an UUID to the condition to make sure the configuration is saved
- // since the configuration export from the conditions collection wont
- // export configuration that has not been "configured".
- $configuration['uuid'] = $this->uuidGenerator()->generate();
-
- $this->getReactions()->addInstanceId($configuration['id'], $configuration);
-
- return $configuration['id'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function removeReaction($reaction_id) {
- $this->getReactions()->removeInstanceId($reaction_id);
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasReaction($reaction_id) {
- return $this->getReactions()->has($reaction_id);
- }
-
- /**
- * Gets the plugin collections used by this entity.
- *
- * @return \Drupal\Component\Plugin\LazyPluginCollection[]
- * An array of plugin collections, keyed by the property name they use to
- * store their configuration.
- */
- public function getPluginCollections() {
- return [
- 'reactions' => $this->getReactions(),
- 'conditions' => $this->getConditions(),
- ];
- }
-
- /**
- * Disable context.
- */
- public function disable() {
- $this->disabled = !$this->disabled();
- $this->save();
- }
-
- /**
- * {@inheritdoc}
- */
- public function disabled() {
- return $this->disabled;
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Entity/ContextAccess.php b/sites/all/modules/contrib/admin/context/src/Entity/ContextAccess.php
deleted file mode 100644
index 627ab27d8..000000000
--- a/sites/all/modules/contrib/admin/context/src/Entity/ContextAccess.php
+++ /dev/null
@@ -1,45 +0,0 @@
-contextManager = $contextManager;
- }
-
- /**
- * Selects the context block page display variant.
- *
- * @param \Drupal\Core\Render\PageDisplayVariantSelectionEvent $event
- * The event to process.
- */
- public function onSelectPageDisplayVariant(PageDisplayVariantSelectionEvent $event) {
- // Activate the context block page display variant if any of the reactions
- // is a blocks reaction.
- foreach ($this->contextManager->getActiveReactions() as $reaction) {
- if ($reaction instanceof Blocks) {
- $event->setPluginId('context_block_page');
- break;
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- static function getSubscribedEvents() {
- $events[RenderEvents::SELECT_PAGE_DISPLAY_VARIANT][] = array('onSelectPageDisplayVariant');
- return $events;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Form/AjaxFormTrait.php b/sites/all/modules/contrib/admin/context/src/Form/AjaxFormTrait.php
deleted file mode 100644
index d61af38c6..000000000
--- a/sites/all/modules/contrib/admin/context/src/Form/AjaxFormTrait.php
+++ /dev/null
@@ -1,49 +0,0 @@
- ['use-ajax'],
- 'data-dialog-type' => 'modal',
- 'data-dialog-options' => Json::encode([
- 'width' => 1000,
- ]),
- ];
- }
-
- /**
- * Gets attributes for use with an add button AJAX modal.
- *
- * @return array
- */
- public static function getAjaxButtonAttributes() {
- return NestedArray::mergeDeep(AjaxFormTrait::getAjaxAttributes(), [
- 'class' => [
- 'button',
- 'button--small',
- 'button-action',
- ],
- ]);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/Condition/RequestPathExclusion.php b/sites/all/modules/contrib/admin/context/src/Plugin/Condition/RequestPathExclusion.php
deleted file mode 100644
index 7796a3bd0..000000000
--- a/sites/all/modules/contrib/admin/context/src/Plugin/Condition/RequestPathExclusion.php
+++ /dev/null
@@ -1,36 +0,0 @@
-uuid = $uuid;
- $this->themeManager = $themeManager;
- $this->themeHandler = $themeHandler;
- $this->contextRepository = $contextRepository;
- $this->contextHandler = $contextHandler;
- $this->account = $account;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition) {
- return new static(
- $configuration,
- $pluginId,
- $pluginDefinition,
- $container->get('uuid'),
- $container->get('theme.manager'),
- $container->get('theme_handler'),
- $container->get('context.repository'),
- $container->get('context.handler'),
- $container->get('current_user')
- );
- }
-
- /**
- * Executes the plugin.
- *
- * @param array $build
- * The current build of the page.
- *
- * @param string|null $title
- * The page title.
- *
- * @param string|null $main_content
- * The main page content.
- *
- * @return array
- */
- public function execute(array $build = array(), $title = NULL, $main_content = NULL) {
-
- $cacheability = CacheableMetadata::createFromRenderArray($build);
-
- // Use the currently active theme to fetch blocks.
- $theme = $this->themeManager->getActiveTheme()->getName();
-
- $regions = $this->getBlocks()->getAllByRegion($theme);
-
- // Add each block to the page build.
- foreach ($regions as $region => $blocks) {
-
- /** @var $blocks BlockPluginInterface[] */
- foreach ($blocks as $block_id => $block) {
- $configuration = $block->getConfiguration();
-
- $block_placement_key = $this->blockShouldBePlacedUniquely($block)
- ? $block_id
- : $block->getConfiguration()['id'];
-
- if ($block instanceof MainContentBlockPluginInterface) {
- if (isset($build['content']['system_main'])) {
- unset($build['content']['system_main']);
- }
- $block->setMainContent($main_content);
- }
-
- // Make sure the user is allowed to view the block.
- $access = $block->access($this->account, TRUE);
- $cacheability->addCacheableDependency($access);
-
- // If the user is not allowed then do not render the block.
- if (!$access->isAllowed()) {
- continue;
- }
-
- if ($block instanceof TitleBlockPluginInterface) {
- if (isset($build['content']['messages'])) {
- unset($build['content']['messages']);
- }
- $block->setTitle($title);
- }
-
- // Inject runtime contexts.
- if ($block instanceof ContextAwarePluginInterface) {
- $contexts = $this->contextRepository->getRuntimeContexts($block->getContextMapping());
- $this->contextHandler->applyContextMapping($block, $contexts);
- }
-
- // Create the render array for the block as a whole.
- // @see template_preprocess_block().
- $blockBuild = [
- '#theme' => 'block',
- '#attributes' => [
- 'class' => [$block->getConfiguration()['css_class']]
- ],
- '#configuration' => $configuration,
- '#plugin_id' => $block->getPluginId(),
- '#base_plugin_id' => $block->getBaseId(),
- '#derivative_plugin_id' => $block->getDerivativeId(),
- '#block_plugin' => $block,
- '#pre_render' => [[$this, 'preRenderBlock']],
- '#cache' => [
- 'keys' => ['context_blocks_reaction', 'block', $block_placement_key],
- 'tags' => $block->getCacheTags(),
- 'contexts' => $block->getCacheContexts(),
- 'max-age' => $block->getCacheMaxAge(),
- ],
- ];
-
- // Add contextual links to block.
- $content = $block->build();
- if (isset($content['#contextual_links'])) {
- $blockBuild['#contextual_links'] = $content['#contextual_links'];
- }
-
- // Add additional contextual link, for editing block configuration.
- $blockBuild['#contextual_links']['context_block'] = [
- 'route_parameters' => [
- 'context' => $configuration['context_id'],
- 'reaction_id' => 'blocks',
- 'block_id' => $block->getConfiguration()['uuid'],
- ],
- ];
-
- if (array_key_exists('weight', $configuration)) {
- $blockBuild['#weight'] = $configuration['weight'];
- }
-
- $build[$region][$block_placement_key] = $blockBuild;
-
- // After merging with blocks from Block layout, we want to sort all of
- // them again.
- $build[$region]['#sorted'] = FALSE;
-
- // The main content block cannot be cached: it is a placeholder for the
- // render array returned by the controller. It should be rendered as-is,
- // with other placed blocks "decorating" it. Analogous reasoning for the
- // title block.
- if ($block instanceof MainContentBlockPluginInterface || $block instanceof TitleBlockPluginInterface) {
- unset($build[$region][$block_placement_key]['#cache']['keys']);
- }
-
- $cacheability->addCacheableDependency($block);
- }
- }
-
- $cacheability->applyTo($build);
-
- return $build;
- }
-
- /**
- * Renders the content using the provided block plugin.
- *
- * @param array $build
- * @return array
- */
- public function preRenderBlock($build) {
-
- $content = $build['#block_plugin']->build();
-
- unset($build['#block_plugin']);
-
- // Abort rendering: render as the empty string and ensure this block is
- // render cached, so we can avoid the work of having to repeatedly
- // determine whether the block is empty. E.g. modifying or adding entities
- // could cause the block to no longer be empty.
- if (is_null($content) || Element::isEmpty($content)) {
- $build = [
- '#markup' => '',
- '#cache' => $build['#cache'],
- ];
-
- // If $content is not empty, then it contains cacheability metadata, and
- // we must merge it with the existing cacheability metadata. This allows
- // blocks to be empty, yet still bubble cacheability metadata, to indicate
- // why they are empty.
- if (!empty($content)) {
- CacheableMetadata::createFromRenderArray($build)
- ->merge(CacheableMetadata::createFromRenderArray($content))
- ->applyTo($build);
- }
- }
- else {
- $build['content'] = $content;
- }
-
- return $build;
- }
-
- /**
- * {@inheritdoc}
- */
- public function defaultConfiguration() {
- return [
- 'blocks' => []
- ] + parent::defaultConfiguration();
- }
-
- /**
- * {@inheritdoc}
- */
- public function setConfiguration(array $configuration) {
- $this->configuration = $configuration + $this->defaultConfiguration();
-
- if (isset($configuration['blocks'])) {
- $this->blocks = $configuration['blocks'];
- }
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfiguration() {
- return [
- 'blocks' => $this->getBlocks()->getConfiguration(),
- ] + parent::getConfiguration();
- }
-
- /**
- * {@inheritdoc}
- */
- public function summary() {
- return $this->t('Lets you add blocks to the selected themes regions');
- }
-
- /**
- * Get all blocks as a collection.
- *
- * @return BlockPluginInterface[]|BlockCollection
- */
- public function getBlocks() {
- if (!$this->blocksCollection) {
- $blockManager = \Drupal::service('plugin.manager.block');
- $this->blocksCollection = new BlockCollection($blockManager, $this->blocks);
- }
-
- return $this->blocksCollection;
- }
-
- /**
- * Get a block by id.
- *
- * @param string $blockId
- * The ID of the block to get.
- *
- * @return BlockPluginInterface
- */
- public function getBlock($blockId) {
- return $this->getBlocks()->get($blockId);
- }
-
- /**
- * Add a new block.
- *
- * @param array $configuration
- */
- public function addBlock(array $configuration) {
- $configuration['uuid'] = $this->uuid->generate();
-
- $this->getBlocks()->addInstanceId($configuration['uuid'], $configuration);
-
- return $configuration['uuid'];
- }
-
- /**
- * Update an existing blocks configuration.
- *
- * @param string $blockId
- * The ID of the block to update.
- *
- * @param $configuration
- * The updated configuration for the block.
- *
- * @return $this
- */
- public function updateBlock($blockId, array $configuration) {
- $existingConfiguration = $this->getBlock($blockId)->getConfiguration();
-
- $this->getBlocks()->setInstanceConfiguration($blockId, $configuration + $existingConfiguration);
-
- return $this;
- }
-
- /**
- * @param $blockId
- * @return $this
- */
- public function removeBlock($blockId) {
- $this->getBlocks()->removeInstanceId($blockId);
-
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL) {
- $form['#attached']['library'][] = 'block/drupal.block';
-
- $themes = $this->themeHandler->listInfo();
-
- $default_theme = $this->themeHandler->getDefault();
-
- // Select list for changing themes.
- $form['theme'] = [
- '#type' => 'select',
- '#title' => $this->t('Theme'),
- '#options' => [],
- '#description' => $this->t('Select the theme you want to display regions for.'),
- '#default_value' => $form_state->getValue('theme', $default_theme),
- '#ajax' => [
- 'url' => Url::fromRoute('context.reaction.blocks.regions', [
- 'context' => $context->id(),
- ]),
- ],
- ];
-
- // Add each theme to the theme select.
- foreach ($themes as $theme_id => $theme) {
- if ($theme_id === $default_theme) {
- $form['theme']['#options'][$theme_id] = $this->t('%theme (Default)', [
- '%theme' => $theme->info['name'],
- ]);
- }
- else {
- $form['theme']['#options'][$theme_id] = $theme->info['name'];
- }
- }
-
- $form['blocks'] = [
- '#type' => 'container',
- '#attributes' => [
- 'id' => 'context-reaction-blocks-container',
- ],
- ];
-
- $form['blocks']['include_default_blocks'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Include blocks from Block layout'),
- '#description' => $this->t('if checked, all blocks from default Block layout will also be included in page build.'),
- '#weight' => -10,
- '#default_value' => isset($this->getConfiguration()['include_default_blocks']) ? $this->getConfiguration()['include_default_blocks'] : FALSE,
- ];
-
-
- $form['blocks']['block_add'] = [
- '#type' => 'link',
- '#title' => $this->t('Place block'),
- '#attributes' => [
- 'id' => 'context-reaction-blocks-region-add',
- ] + $this->getAjaxButtonAttributes(),
- '#url' => Url::fromRoute('context.reaction.blocks.library', [
- 'context' => $context->id(),
- 'reaction_id' => $this->getPluginId(),
- ], [
- 'query' => [
- 'theme' => $form_state->getValue('theme', $default_theme),
- ],
- ]),
- ];
-
- $form['blocks']['blocks'] = [
- '#type' => 'table',
- '#header' => [
- $this->t('Block'),
- $this->t('Category'),
- $this->t('Unique'),
- $this->t('Region'),
- $this->t('Weight'),
- $this->t('Operations'),
- ],
- '#empty' => $this->t('No regions available to place blocks in.'),
- '#attributes' => [
- 'id' => 'blocks',
- ],
- ];
-
- // If a theme has been selected use that to get the regions otherwise use
- // the default theme.
- $theme = $form_state->getValue('theme', $default_theme);
-
- // Get all blocks by their regions.
- $blocks = $this->getBlocks()->getAllByRegion($theme);
-
- // Get regions of the selected theme.
- $regions = $this->getSystemRegionList($theme);
-
- // Add each region.
- foreach ($regions as $region => $title) {
-
- // Add the tabledrag details for this region.
- $form['blocks']['blocks']['#tabledrag'][] = [
- 'action' => 'match',
- 'relationship' => 'sibling',
- 'group' => 'block-region-select',
- 'subgroup' => 'block-region-' . $region,
- 'hidden' => FALSE,
- ];
-
- $form['blocks']['blocks']['#tabledrag'][] = [
- 'action' => 'order',
- 'relationship' => 'sibling',
- 'group' => 'block-weight',
- 'subgroup' => 'block-weight-' . $region,
- ];
-
- // Add the theme region.
- $form['blocks']['blocks']['region-' . $region] = [
- '#attributes' => [
- 'class' => ['region-title'],
- ],
- 'title' => [
- '#markup' => $title,
- '#wrapper_attributes' => [
- 'colspan' => 6,
- ],
- ],
- ];
-
- $regionEmptyClass = empty($blocks[$region])
- ? 'region-empty'
- : 'region-populated';
-
- $form['blocks']['blocks']['region-' . $region . '-message'] = [
- '#attributes' => [
- 'class' => ['region-message', 'region-' . $region . '-message', $regionEmptyClass],
- ],
- 'message' => [
- '#markup' => '' . $this->t('No blocks in this region') . '',
- '#wrapper_attributes' => [
- 'colspan' => 6,
- ],
- ],
- ];
-
- // Add each block specified for the region if there are any.
- if (isset($blocks[$region])) {
- /** @var BlockPluginInterface $block */
- foreach ($blocks[$region] as $block_id => $block) {
- $configuration = $block->getConfiguration();
-
- $operations = [
- 'edit' => [
- 'title' => $this->t('Edit'),
- 'url' => Url::fromRoute('context.reaction.blocks.block_edit', [
- 'context' => $context->id(),
- 'reaction_id' => $this->getPluginId(),
- 'block_id' => $block_id,
- ], [
- 'query' => [
- 'theme' => $theme,
- ],
- ]),
- 'attributes' => $this->getAjaxAttributes(),
- ],
- 'delete' => [
- 'title' => $this->t('Delete'),
- 'url' => Url::fromRoute('context.reaction.blocks.block_delete', [
- 'context' => $context->id(),
- 'block_id' => $block_id,
- ]),
- 'attributes' => $this->getAjaxAttributes(),
- ],
- ];
-
- $form['blocks']['blocks'][$block_id] = [
- '#attributes' => [
- 'class' => ['draggable'],
- ],
- 'label' => [
- '#markup' => $block->label(),
- ],
- 'category' => [
- '#markup' => $block->getPluginDefinition()['category'],
- ],
- 'unique' => [
- '#markup' => $this->blockShouldBePlacedUniquely($block) ? $this->t('Yes') : $this->t('No'),
- ],
- 'region' => [
- '#type' => 'select',
- '#title' => $this->t('Region for @block block', ['@block' => $block->label()]),
- '#title_display' => 'invisible',
- '#default_value' => $region,
- '#options' => $regions,
- '#attributes' => [
- 'class' => ['block-region-select', 'block-region-' . $region],
- ],
- ],
- 'weight' => [
- '#type' => 'weight',
- '#default_value' => isset($configuration['weight']) ? $configuration['weight'] : 0,
- '#title' => $this->t('Weight for @block block', ['@block' => $block->label()]),
- '#title_display' => 'invisible',
- '#attributes' => [
- 'class' => ['block-weight', 'block-weight-' . $region],
- ],
- ],
- 'operations' => [
- '#type' => 'operations',
- '#links' => $operations,
- ],
- ];
- }
- }
- }
-
- return $form;
- }
-
- /**
- * Check to see if the block should be uniquely placed.
- *
- * @param BlockPluginInterface $block
- *
- * @return bool
- */
- private function blockShouldBePlacedUniquely(BlockPluginInterface $block) {
- $configuration = $block->getConfiguration();
- return (isset($configuration['unique']) && $configuration['unique']);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $blocks = $form_state->getValue(['blocks', 'blocks'], []);
-
- // Save configuration for including default blocks.
- $config = $this->getConfiguration();
- $config['include_default_blocks'] = $form_state->getValue(['blocks', 'include_default_blocks'], FALSE);
- $this->setConfiguration($config);
-
- if (is_array($blocks)) {
- foreach ($blocks as $block_id => $configuration) {
- $block = $this->getBlock($block_id);
- $configuration += $block->getConfiguration();
-
- $block_state = (new FormState())->setValues($configuration);
- $block->submitConfigurationForm($form, $block_state);
-
- // If the block is context aware then add context mapping to the block.
- if ($block instanceof ContextAwarePluginInterface) {
- $block->setContextMapping($block_state->getValue('context_mapping', []));
- }
-
- $this->updateBlock($block_id, $block_state->getValues());
- }
- }
- }
-
- /**
- * Should reaction include default blocks from Block layout.
- *
- * @return bool
- */
- public function includeDefaultBlocks() {
- $config = $this->getConfiguration();
- return isset($config['include_default_blocks']) ? $config['include_default_blocks'] : FALSE;
- }
-
- /**
- * Wraps system_region_list().
- *
- * @param string $theme
- * The theme to get a list of regions for.
- *
- * @param string $show
- * What type of regions that should be returned, defaults to all regions.
- *
- * @return array
- *
- * @todo This could be moved to a service since we use it in a couple of places.
- */
- protected function getSystemRegionList($theme, $show = REGIONS_ALL) {
- return system_region_list($theme, $show);
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/BodyClass.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/BodyClass.php
deleted file mode 100644
index 56df9ece4..000000000
--- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/BodyClass.php
+++ /dev/null
@@ -1,66 +0,0 @@
- '',
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function summary() {
- return $this->getConfiguration()['body_class'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function execute(array &$vars = []) {
- return [
- 'class' => explode(' ', $this->getConfiguration()['body_class']),
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
- $form['body_class'] = [
- '#title' => $this->t('Section class'),
- '#type' => 'textfield',
- '#description' => $this->t('Provides this text as additional body class in the html.html.twig.'),
- '#default_value' => $this->getConfiguration()['body_class'],
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $this->setConfiguration([
- 'body_class' => $form_state->getValue('body_class'),
- ]);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Menu.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Menu.php
deleted file mode 100644
index 44e7b92e6..000000000
--- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Menu.php
+++ /dev/null
@@ -1,91 +0,0 @@
-menuParentFormSelector = $menu_parent_form_selector;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('menu.parent_form_selector')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function summary() {
- return $this->t('Set active menu item based on conditions.');
- }
-
- /**
- * {@inheritdoc}
- */
- public function execute(array &$vars = []) {
- $config = $this->getConfiguration();
- return $config['menu'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
- $parent_element = $this->menuParentFormSelector->parentSelectElement('main:');
- $config = $this->getConfiguration();
- $form['menu_items'] = [
- '#title' => $this->t('Menu'),
- '#type' => 'select',
- '#options' => $parent_element['#options'],
- '#multiple' => TRUE,
- '#default_value' => isset($config['menu']) ? $config['menu'] : '',
- '#size' => 15,
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $values = array_keys($form_state->getValue('menu_items'));
-
- $this->setConfiguration([
- 'menu' => $values,
- ]);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/PageTemplateSuggestions.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/PageTemplateSuggestions.php
deleted file mode 100644
index 76e1e8c8d..000000000
--- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/PageTemplateSuggestions.php
+++ /dev/null
@@ -1,55 +0,0 @@
-t('Gives you ability to add template suggestions.');
- }
-
- /**
- * Executes the plugin.
- */
- public function execute() {
- $config = $this->getConfiguration();
- return $config['suggestions'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
- $config = $this->getConfiguration();
-
- $form['suggestions'] = [
- '#type' => 'textarea',
- '#title' => $this->t('Page template suggestions'),
- '#default_value' => isset($config['suggestions']) ? $config['suggestions'] : '',
- '#description' => $this->t('Enter page template suggestions such as "page__front", one per line, in order of preference (using underscores instead of hyphens). Entered template suggestions will override page.html.twig template.'),
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $config['suggestions'] = str_replace("\r\n", "\n", $form_state->getValue('suggestions'));
- $this->setConfiguration($config);
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Regions.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Regions.php
deleted file mode 100644
index 153464a81..000000000
--- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Regions.php
+++ /dev/null
@@ -1,170 +0,0 @@
-themeManager = $themeManager;
- $this->themeHandler = $themeHandler;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition) {
- return new static(
- $configuration,
- $pluginId,
- $pluginDefinition,
- $container->get('theme.manager'),
- $container->get('theme_handler')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function summary() {
- return $this->t('Lets you remove regions from selected theme.');
- }
-
- /**
- * Executes the plugin.
- */
- public function execute() {
- // TODO: Implement execute() method.
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
-
- $themes = $this->themeHandler->listInfo();
- $default_theme = $this->themeHandler->getDefault();
-
- // Build configuration form for each installed theme.
- foreach ($themes as $theme_id => $theme) {
- if ($theme_id == $default_theme) {
- $title = $this->t('Disable Regions in %theme (Default)', [
- '%theme' => $theme->info['name'],
- ]);
- }
- else {
- $title = $this->t('Disable Regions in %theme', [
- '%theme' => $theme->info['name'],
- ]);
- }
-
- $form[$theme_id] = [
- '#type' => 'details',
- '#title' => $title,
- '#weight' => 5,
- '#open' => FALSE,
- ];
-
- // Get regions of the theme.
- $regions = $this->getSystemRegionList($theme_id);
-
- // Get disabled regions.
- $disabled_regions = $this->getDisabledRegions();
-
- $form[$theme_id]['regions'] = [
- '#type' => 'checkboxes',
- '#options' => $regions,
- '#title' => $this->t('Disable the following'),
- '#default_value' => isset($disabled_regions[$theme_id]) ? $disabled_regions[$theme_id] : [],
- ];
- }
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $themes = $form_state->getValues();
- if (is_array($themes)) {
- foreach ($themes as $theme_name => $region) {
- $disabled_regions = array_keys(array_filter($region['regions']));
- if (!empty($disabled_regions)) {
- $configuration['regions'][$theme_name] = $disabled_regions;
- $configuration += $this->getConfiguration();
- }
- else {
- $configuration['regions'][$theme_name] = [];
- $configuration += $this->getConfiguration();
- }
- $this->setConfiguration($configuration);
- }
- }
- }
-
- /**
- * Wraps system_region_list().
- *
- * @param string $theme
- * The theme to get a list of regions for.
- *
- * @param string $show
- * What type of regions that should be returned, defaults to all regions.
- *
- * @return array
- *
- * @todo This could be moved to a service since we use it in a couple of places.
- */
- protected function getSystemRegionList($theme, $show = REGIONS_ALL) {
- return system_region_list($theme, $show);
- }
-
- /**
- * Get disabled regions.
- */
- protected function getDisabledRegions() {
- $configurations = $this->getConfiguration();
- return isset($configurations['regions']) ? $configurations['regions'] : [];
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Theme.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Theme.php
deleted file mode 100644
index 204e295ec..000000000
--- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReaction/Theme.php
+++ /dev/null
@@ -1,105 +0,0 @@
-themeManager = $themeManager;
- $this->themeHandler = $themeHandler;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $pluginId, $pluginDefinition) {
- return new static(
- $configuration,
- $pluginId,
- $pluginDefinition,
- $container->get('theme.manager'),
- $container->get('theme_handler')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function summary() {
- return $this->t('Gives you ability to change theme.');
- }
-
- /**
- * Executes the plugin.
- */
- public function execute() {
- // TODO: Implement execute() method.
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
-
- $themes = $this->themeHandler->listInfo();
- $default_theme = $this->themeHandler->getDefault();
-
- $theme_options = [];
- foreach ($themes as $theme_id => $theme) {
- $theme_options[$theme_id] = $theme->info['name'];
- }
- $configuration = $this->getConfiguration();
-
- $form['theme'] = [
- '#type' => 'radios',
- '#options' => $theme_options,
- '#title' => $this->t('Select theme'),
- '#default_value' => isset($configuration['theme']) ? $configuration['theme'] : $default_theme,
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $configuration['theme'] = $form_state->getValue('theme');
- $configuration += $this->getConfiguration();
- $this->setConfiguration($configuration);
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReactionPluginCollection.php b/sites/all/modules/contrib/admin/context/src/Plugin/ContextReactionPluginCollection.php
deleted file mode 100644
index e464f9af8..000000000
--- a/sites/all/modules/contrib/admin/context/src/Plugin/ContextReactionPluginCollection.php
+++ /dev/null
@@ -1,17 +0,0 @@
-contextManager = $contextManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('context.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function setMainContent(array $main_content) {
- $this->mainContent = $main_content;
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setTitle($title) {
- $this->title = $title;
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function build() {
- $build = [
- '#cache' => [
- 'tags' => ['context_block_page', $this->getPluginId()],
- ],
- ];
-
- // Place main content block, it will be removed by the reactions if a main
- // content block has been manually placed.
- $build['content']['system_main'] = $this->mainContent;
-
- // Execute each block reaction and let them modify the page build.
- foreach ($this->contextManager->getActiveReactions('blocks') as $reaction) {
- $build = $reaction->execute($build, $this->title, $this->mainContent);
- }
-
- // Execute each block reaction and check if default block should be included in page build.
- foreach ($this->contextManager->getActiveReactions('blocks') as $reaction) {
- if ($reaction->includeDefaultBlocks()) {
- $build = NestedArray::mergeDeep($this->getBuildFromBlockLayout(), $build);
- return $build;
- }
- }
- return $build;
- }
-
- /**
- * Get build from Block layout.
- */
- private function getBuildFromBlockLayout() {
- $plugin_manager = \Drupal::service('plugin.manager.display_variant');
- $display_variant = $plugin_manager->createInstance('block_page', $plugin_manager->getDefinition('block_page'));
- $display_variant->setTitle($this->title);
-
- return $display_variant->build();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Annotation/ContextReaction.php b/sites/all/modules/contrib/admin/context/src/Reaction/Annotation/ContextReaction.php
deleted file mode 100644
index b27033848..000000000
--- a/sites/all/modules/contrib/admin/context/src/Reaction/Annotation/ContextReaction.php
+++ /dev/null
@@ -1,48 +0,0 @@
- $block) {
- $configuration = $block->getConfiguration();
-
- if ($configuration['theme'] !== $theme) {
- continue;
- }
-
- $region = isset($configuration['region'])
- ? $configuration['region']
- : NULL;
-
- $region_assignments[$region][$block_id] = $block;
- }
-
- foreach ($region_assignments as $region => $region_assignment) {
- // @todo Determine the reason this needs error suppression.
- @uasort($region_assignment, function (BlockPluginInterface $a, BlockPluginInterface $b) {
- $a_config = $a->getConfiguration();
- $a_weight = isset($a_config['weight']) ? $a_config['weight'] : 0;
-
- $b_config = $b->getConfiguration();
- $b_weight = isset($b_config['weight']) ? $b_config['weight'] : 0;
-
- if ($a_weight == $b_weight) {
- return strcmp($a->label(), $b->label());
- }
-
- return $a_weight > $b_weight ? 1 : -1;
- });
-
- $region_assignments[$region] = $region_assignment;
- }
-
- return $region_assignments;
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Controller/ContextReactionBlocksController.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Controller/ContextReactionBlocksController.php
deleted file mode 100644
index 3e16250f2..000000000
--- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Controller/ContextReactionBlocksController.php
+++ /dev/null
@@ -1,210 +0,0 @@
-blockManager = $blockManager;
- $this->contextRepository = $contextRepository;
- $this->themeHandler = $themeHandler;
- $this->contextManager = $contextManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('plugin.manager.block'),
- $container->get('context.repository'),
- $container->get('theme_handler'),
- $container->get('context.manager')
- );
- }
-
- /**
- * Display a library of blocks that can be added to the context reaction.
- *
- * @param \Symfony\Component\HttpFoundation\Request $request
- * The request object.
- *
- * @param \Drupal\context\ContextInterface $context
- * The context the blocks reaction belongs to.
- *
- * @param string $reaction_id
- * The ID of the blocks reaction that the selected block
- * should be added to.
- *
- * @return array
- */
- public function blocksLibrary(Request $request, ContextInterface $context, $reaction_id) {
-
- // If a theme has been defined in the query string then use this for
- // the add block link, default back to the default theme.
- $theme = $request->query->get('theme', $this->themeHandler->getDefault());
-
- // Only add blocks which work without any available context.
- $blocks = $this->blockManager->getDefinitionsForContexts($this->contextRepository->getAvailableContexts());
-
- // Order by category, and then by admin label.
- $blocks = $this->blockManager->getSortedDefinitions($blocks);
-
- $build['filter'] = [
- '#type' => 'search',
- '#title' => $this->t('Filter'),
- '#title_display' => 'invisible',
- '#size' => 30,
- '#placeholder' => $this->t('Filter by block name'),
- '#attributes' => [
- 'class' => ['context-table-filter'],
- 'data-element' => '.block-add-table',
- 'title' => $this->t('Enter a part of the block name to filter by.'),
- ],
- ];
-
- $headers = [
- $this->t('Block'),
- $this->t('Category'),
- $this->t('Operations'),
- ];
-
- $build['blocks'] = [
- '#type' => 'table',
- '#header' => $headers,
- '#rows' => [],
- '#empty' => $this->t('No blocks available.'),
- '#attributes' => [
- 'class' => ['block-add-table'],
- ],
- ];
-
- // Add each block definition to the table.
- foreach ($blocks as $block_id => $block) {
- $links = [
- 'add' => [
- 'title' => $this->t('Place block'),
- 'url' => Url::fromRoute('context.reaction.blocks.block_add', [
- 'context' => $context->id(),
- 'reaction_id' => $reaction_id,
- 'block_id' => $block_id,
- ], [
- 'query' => [
- 'theme' => $theme,
- ],
- ]),
- 'attributes' => [
- 'class' => ['use-ajax'],
- 'data-dialog-type' => 'modal',
- 'data-dialog-options' => Json::encode([
- 'width' => 700,
- ]),
- ],
- ],
- ];
-
- $build['blocks']['#rows'][] = [
- 'title' => [
- 'data' => [
- '#type' => 'inline_template',
- '#template' => '
{{ label }}
',
- '#context' => [
- 'label' => $block['admin_label'],
- ],
- ],
- ],
- 'category' => [
- 'data' => $block['category'],
- ],
- 'operations' => [
- 'data' => [
- '#type' => 'operations',
- '#links' => $links,
- ],
- ],
- ];
- }
-
- $build['#attached']['library'][] = 'context_ui/admin';
-
- return $build;
- }
-
- /**
- * Callback for the theme select list on the Context blocks reaction form.
- *
- * @param Request $request
- * The current request.
- *
- * @param ContextInterface $context
- * The context the block reaction is located on.
- *
- * @return \Drupal\Core\Ajax\AjaxResponse
- */
- public function blocksFormThemeSelect(Request $request, ContextInterface $context) {
- $theme = $request->request->get('reactions[blocks][theme]', '', TRUE);
-
- // Get the context form and supply it with the blocks theme value.
- $form = $this->contextManager->getForm($context, 'edit', [
- 'reactions' => [
- 'blocks' => [
- 'theme' => $theme,
- ],
- ],
- ]);
-
- $response = new AjaxResponse();
-
- $response->addCommand(new ReplaceCommand('#context-reactions', $form['reactions']));
-
- return $response;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockAddForm.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockAddForm.php
deleted file mode 100644
index 7dc9a2f90..000000000
--- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockAddForm.php
+++ /dev/null
@@ -1,30 +0,0 @@
-t('Add block');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function prepareBlock($block_id) {
- return $this->blockManager->createInstance($block_id);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockDeleteForm.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockDeleteForm.php
deleted file mode 100644
index d2feed2e0..000000000
--- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockDeleteForm.php
+++ /dev/null
@@ -1,151 +0,0 @@
-contextManager = $contextManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static (
- $container->get('context.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'context_reaction_blocks_delete_block_form';
- }
-
- /**
- * Returns the question to ask the user.
- *
- * @return string
- * The form question. The page title will be set to this value.
- */
- public function getQuestion() {
- return $this->t('Are you sure you want to remove the %label block?', [
- '%label' => $this->block->getConfiguration()['label'],
- ]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return $this->context->urlInfo();
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $block_id = NULL) {
- $this->context = $context;
-
- $this->reaction = $this->context->getReaction('blocks');
- $this->block = $this->reaction->getBlock($block_id);
-
- $form = parent::buildForm($form, $form_state);
-
- // Remove the cancel button if this is an AJAX request since Drupals built
- // in modal dialogues does not handle buttons that are not a primary
- // button very well.
- if ($this->getRequest()->isXmlHttpRequest()) {
- unset($form['actions']['cancel']);
- }
-
- // Submit the form with AJAX if possible.
- $form['actions']['submit']['#ajax'] = [
- 'callback' => '::submitFormAjax'
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $configuration = $this->block->getConfiguration();
-
- $this->reaction->removeBlock($configuration['uuid']);
-
- $this->context->save();
-
- // If this is not an AJAX request then redirect and show a message.
- if (!$this->getRequest()->isXmlHttpRequest()) {
- drupal_set_message($this->t('The %label block has been removed.', [
- '%label' => $configuration['label']]
- ));
-
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
- }
-
- /**
- * Handle when the form is submitted trough AJAX.
- *
- * @return AjaxResponse
- */
- public function submitFormAjax() {
- $contextForm = $this->contextManager->getForm($this->context, 'edit');
-
- $response = new AjaxResponse();
-
- $response->addCommand(new CloseModalDialogCommand());
- $response->addCommand(new ReplaceCommand('#context-reactions', $contextForm['reactions']));
-
- return $response;
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockEditForm.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockEditForm.php
deleted file mode 100644
index deca31101..000000000
--- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockEditForm.php
+++ /dev/null
@@ -1,28 +0,0 @@
-t('Update block');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function prepareBlock($block_id) {
- return $this->reaction->getBlock($block_id);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockFormBase.php b/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockFormBase.php
deleted file mode 100644
index c8738fdc9..000000000
--- a/sites/all/modules/contrib/admin/context/src/Reaction/Blocks/Form/BlockFormBase.php
+++ /dev/null
@@ -1,343 +0,0 @@
-blockManager = $block_manager;
- $this->contextRepository = $contextRepository;
- $this->themeHandler = $themeHandler;
- $this->formBuilder = $formBuilder;
- $this->contextReactionManager = $contextReactionManager;
- $this->contextManager = $contextManager;
- $this->request = $requestStack->getCurrentRequest();
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('plugin.manager.block'),
- $container->get('context.repository'),
- $container->get('theme_handler'),
- $container->get('form_builder'),
- $container->get('plugin.manager.context_reaction'),
- $container->get('context.manager'),
- $container->get('request_stack')
- );
- }
-
- /**
- * Prepares the block plugin based on the block ID.
- *
- * @param string $block_id
- * Either a block ID, or the plugin ID used to create a new block.
- *
- * @return \Drupal\Core\Block\BlockPluginInterface
- * The block plugin.
- */
- abstract protected function prepareBlock($block_id);
-
- /**
- * Get the value to use for the submit button.
- *
- * @return TranslatableMarkup
- */
- abstract protected function getSubmitValue();
-
- /**
- * Form constructor.
- *
- * @param array $form
- * An associative array containing the structure of the form.
- *
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * The current state of the form.
- *
- * @param ContextInterface $context
- * The context the reaction belongs to.
- *
- * @param string|null $reaction_id
- * The ID of the blocks reaction the block should be added to.
- *
- * @param string|null $block_id
- * The ID of the block to show a configuration form for.
- *
- * @return array
- */
- public function buildForm(array $form, FormStateInterface $form_state, ContextInterface $context = NULL, $reaction_id = NULL, $block_id = NULL) {
- $this->context = $context;
-
- $this->reaction = $this->context->getReaction($reaction_id);
- $this->block = $this->prepareBlock($block_id);
-
- // If a theme was defined in the query use this theme for the block
- // otherwise use the default theme.
- $theme = $this->getRequest()->query->get('theme', $this->themeHandler->getDefault());
-
- // Some blocks require the theme name in the form state like Site Branding
- $form_state->set('block_theme', $theme);
-
- // Some blocks require contexts, set a temporary value with gathered
- // contextual values.
- $form_state->setTemporaryValue('gathered_contexts', $this->contextRepository->getAvailableContexts());
-
- $configuration = $this->block->getConfiguration();
-
- $form['#tree'] = TRUE;
-
- $form['settings'] = $this->block->buildConfigurationForm([], $form_state);
-
- $form['settings']['id'] = [
- '#type' => 'value',
- '#value' => $this->block->getPluginId(),
- ];
-
- $form['region'] = [
- '#type' => 'select',
- '#title' => $this->t('Region'),
- '#description' => $this->t('Select the region where this block should be displayed.'),
- '#options' => $this->getThemeRegionOptions($theme),
- '#default_value' => isset($configuration['region']) ? $configuration['region'] : '',
- ];
-
- $form['unique'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Unique'),
- '#description' => $this->t('Check if the block should be uniquely placed, this means that the block can not be overridden by other blocks of the same type in the selected region.'),
- '#default_value' => isset($configuration['unique']) ? $configuration['unique'] : FALSE,
- ];
-
- $form['theme'] = [
- '#type' => 'value',
- '#value' => $theme,
- ];
-
- $form['css_class'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Block Class'),
- '#default_value' => isset($configuration['css_class']) ? $configuration['css_class'] : '',
- ];
-
- $form['actions']['submit'] = [
- '#type' => 'submit',
- '#value' => $this->getSubmitValue(),
- '#button_type' => 'primary',
- '#ajax' => [
- 'callback' => '::submitFormAjax'
- ],
- ];
-
- // Remove ajax from submit, if this is not ajax request.
- if (!$this->request->isXmlHttpRequest()) {
- unset($form['actions']['submit']['#ajax']);
- }
-
- // Disable cache on form to prevent ajax forms from failing.
- $form_state->disableCache();
-
- return $form;
- }
-
- /**
- * Form submission handler.
- *
- * @param array $form
- * An associative array containing the structure of the form.
- *
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * The current state of the form.
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $settings = (new FormState())->setValues($form_state->getValue('settings'));
-
- // Call the plugin submit handler.
- $this->block->submitConfigurationForm($form, $settings);
-
- // Update the original form values.
- $form_state->setValue('settings', $settings->getValues());
-
- // Add available contexts if this is a context aware block.
- if ($this->block instanceof ContextAwarePluginInterface) {
- $this->block->setContextMapping($form_state->getValue(['settings', 'context_mapping'], []));
- }
-
- $configuration = array_merge($this->block->getConfiguration(), [
- 'region' => $form_state->getValue('region'),
- 'theme' => $form_state->getValue('theme'),
- 'css_class' => $form_state->getValue('css_class'),
- 'unique' => $form_state->getValue('unique'),
- 'context_id' => $this->context->id(),
- ]);
-
- // Add/Update the block.
- if (!isset($configuration['uuid'])) {
- $this->reaction->addBlock($configuration);
- } else {
- $this->reaction->updateBlock($configuration['uuid'], $configuration);
- }
-
- $this->context->save();
-
- $form_state->setRedirectUrl(Url::fromRoute('entity.context.edit_form', [
- 'context' => $this->context->id(),
- ]));
- }
-
- /**
- * Handle when the form is submitted trough AJAX.
- *
- * @return AjaxResponse
- */
- public function submitFormAjax(array &$form, FormStateInterface $form_state) {
- $response = new AjaxResponse();
-
- if ($form_state->getErrors()) {
- $messages = StatusMessages::renderMessages(NULL);
- $output[] = $messages;
- $output[] = $form;
- $form_class = '.' . str_replace('_', '-', $form_state->getFormObject()->getFormId()) ;
- // Remove any previously added error messages.
- $response->addCommand(new RemoveCommand('#drupal-modal .messages--error'));
- // Replace old form with new one and with error message.
- $response->addCommand(new ReplaceCommand($form_class, $output));
- }
- else {
- $form = $this->contextManager->getForm($this->context, 'edit');
- $response->addCommand(new CloseModalDialogCommand());
- $response->addCommand(new ReplaceCommand('#context-reactions', $form['reactions']));
- }
-
- return $response;
- }
-
- /**
- * Get a list of regions for the select list.
- *
- * @param string $theme
- * The theme to get a list of regions for.
- *
- * @param string $show
- * What type of regions that should be returned, defaults to all regions.
- *
- * @return array
- */
- protected function getThemeRegionOptions($theme, $show = REGIONS_ALL) {
- $regions = system_region_list($theme, $show);
-
- foreach ($regions as $region => $title) {
- $regions[$region] = $title;
- }
-
- return $regions;
- }
-
-}
-
diff --git a/sites/all/modules/contrib/admin/context/src/Reaction/ContextReactionFormBase.php b/sites/all/modules/contrib/admin/context/src/Reaction/ContextReactionFormBase.php
deleted file mode 100644
index 8db2fa9aa..000000000
--- a/sites/all/modules/contrib/admin/context/src/Reaction/ContextReactionFormBase.php
+++ /dev/null
@@ -1,67 +0,0 @@
-context = $context;
- $this->reaction = $this->context->getReaction($reaction_id);
-
- $form['reaction'] = [
- '#tree' => TRUE,
- ];
-
- $form['actions'] = [
- '#type' => 'actions'
- ];
-
- $form['actions']['submit'] = [
- '#type' => 'submit',
- '#value' => $this->t('Save'),
- '#button_type' => 'primary',
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->context->save();
- }
-}
diff --git a/sites/all/modules/contrib/admin/context/src/Theme/ThemeSwitcherNegotiator.php b/sites/all/modules/contrib/admin/context/src/Theme/ThemeSwitcherNegotiator.php
deleted file mode 100644
index 6ce7340d5..000000000
--- a/sites/all/modules/contrib/admin/context/src/Theme/ThemeSwitcherNegotiator.php
+++ /dev/null
@@ -1,55 +0,0 @@
-getContexts() as $context) {
- foreach ($context->getReactions() as $reaction) {
- if ($reaction instanceof Theme) {
- $theme_reaction = TRUE;
- break;
- }
- }
- }
-
- if ($theme_reaction) {
- foreach($context_manager->getActiveReactions('theme') as $theme_reaction) {
- $configuration = $theme_reaction->getConfiguration();
- $this->theme = $configuration['theme'];
- return TRUE;
- }
- }
-
- return FALSE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function determineActiveTheme(RouteMatchInterface $route_match) {
- return $this->theme;
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/.travis.yml b/sites/all/modules/contrib/admin/domain/.travis.yml
deleted file mode 100644
index 8e82646e4..000000000
--- a/sites/all/modules/contrib/admin/domain/.travis.yml
+++ /dev/null
@@ -1,96 +0,0 @@
-language: php
-sudo: false
-
-matrix:
- fast_finish: true
- include:
- - env: DRUPAL=8.6.x
- php: 7.1
- - env: DRUPAL=8.6.x
- php: 7.2
- - env: DRUPAL=8.7.x
- php: 7.1
- - env: DRUPAL=8.7.x
- php: 7.2
-
-addons:
- hosts:
- - example.com
- - one.example.com
- - two.example.com
- - three.example.com
- - four.example.com
- - five.example.com
-
-cache:
- directories:
- - $HOME/.composer/cache
-
-env:
- global:
- # add composer's global bin directory to the path
- # see: https://github.com/drush-ops/drush#install---composer
- - PATH="$PATH:$HOME/.composer/vendor/bin"
-
-mysql:
- database: domain
- username: root
- encoding: utf8
-
-notifications:
- email: false
-
-before_install:
- # Remove Xdebug. Not an issue for PHP 7.
- - phpenv config-rm xdebug.ini || true
-
- - composer self-update
-
- # Install Drush.
- - composer global require --no-interaction drush/drush:8.*
-
-install:
- # Optimize MySQL timeout and max packet size.
- - echo "mysql.connect_timeout=3000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - echo "default_socket_timeout=3000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - mysql -e 'create database domain'
- - mysql -e "SET GLOBAL wait_timeout = 36000;"
- - mysql -e "SET GLOBAL max_allowed_packet = 134209536;"
-
-before_script:
-
- # Remember the current rules test directory for later use in the Drupal installation.
- - TESTDIR=$(pwd)
- # Navigate out of module directory to prevent blown stack by recursive module lookup.
- - cd ..
-
- # Download Drupal 8 core.
- - travis_retry drush dl drupal-$DRUPAL --drupal-project-rename=drupal
- - cd drupal
-
- # Update PHPUnit.
- - composer run-script drupal-phpunit-upgrade
-
- # Make the module appear in the correct place
- - ln -s $TESTDIR modules/domain
-
- # Install drupal default profile
- - /usr/bin/env PHP_OPTIONS="-d sendmail_path=$(which true)" drush --yes --verbose site-install minimal --db-url=mysql://root:@127.0.0.1/domain
- - drush --yes en simpletest domain domain_access domain_alias domain_config domain_source
- - drush cr
-
- # Start a web server on port 8080 in the background.
- - nohup php -S 0.0.0.0:8080 > /dev/null 2>&1 &
-
- # Wait until the web server is responding.
- - until curl -s example.com:8080; do true; done > /dev/null
-
-script:
- - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain
- - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Kernel" --php `which php` --url http://example.com:8080 domain
- - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_access
- - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_alias
- - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Kernel" --php `which php` --url http://example.com:8080 domain_alias
- - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_config
- - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_content
- - php core/scripts/run-tests.sh --suppress-deprecations --verbose --color --concurrency 20 --types "PHPUnit-Functional" --php `which php` --url http://example.com:8080 domain_source
diff --git a/sites/all/modules/contrib/admin/domain/CHANGELOG.md b/sites/all/modules/contrib/admin/domain/CHANGELOG.md
deleted file mode 100644
index 37be56dfc..000000000
--- a/sites/all/modules/contrib/admin/domain/CHANGELOG.md
+++ /dev/null
@@ -1,134 +0,0 @@
-Changelog
-=====
-
-31-JUL-2016 8.x-1.0-alpha1
-22-AUG-2016 8.x-1.0-alpha2
-30-AUG-2016 8.x-1.0-alpha3
-01-SEP-2016 8.x-1.0-alpha4
-25-OCT-2016 8.x-1.0-alpha5
-20-NOV-2016 8.x-1.0-alpha6
-06-DEC-2016 Adds the domain_alpha module to handle critical pre-release updates.
-13-DEC-2016 8.x-1.0-alpha7
-12-MAR-2017 8.x-1.0-alpha8
-23-APR-2017 8.x-1.0-alpha9
-01-DEC-2017 8.x-1.0-alpha10
-19-DEC-2017 8.x-1.0-alpha11
-12-FEB-2018 8.x-1.0-alpha12
-07-MAR-2018 8.x-1.0-alpha13
-19-OCT-2018 8.x-1.0-alpha14
-21-FEB-2019 8.x-1.0-alpha15
-
-Status
-====
-
-The 8.x-1.x version is a ground up rewrite of a module originally written for
-Drupal 5.
-
-The following feature sets are considered critical for each release stage. Items
-marked with [x] are considered complete.
-
-# Alpha
-- [x] Domain entity for storage and configuration
-- [x] Domain negotiation for active requests
-- [x] API for modifying active domain requests
-- [x] API for modifying paths per domain
-- [x] Mechanism for access restriction inactive domains
-- [x] Form for adding / editing / deleting domain records
-- [x] Validation of domain record patterns
-- [x] Domain server information block
-- [x] Domain switcher block
-- [x] Domain context for block visibility
-- [x] Entity reference support, with an API for altering entity lists
-- [x] Alias registration and negotiation
-- [x] Alias validation
-- [x] Configuration overrides per domain
-- [x] Language-aware configuration overrides
-- [x] Enable node access control via domain references (Domain Access)
-- [x] Allow nodes to be assigned to domains
-- [x] Allow users to be assigned as domain editors
-- [x] Set permissions for content editing based on domain
-- [x] Restrict publication options based on user domains
-- [x] Support the all affiliates concept of publication
-- [x] Support the all affiliates concept for editors
-- [x] Test and document cross-domain logins
-- [x] Make language optional for domain overrides
-- [x] Use domain source for path rewrites
-- [x] Finish the path alter behavior
-- [x] Catalog @TODO items as issues
-- [x] Drupal cache system makes it difficult to serve different homepage for each domain
-- [x] Provide common views support for attached fields
-- [x] Recreate the Domain Content module with bulk operations
-- [x] Add help text to domain overview screen
-- [x] Views argument handler to show proper title.
-- [x] Ensure unique numeric ids for use with node access
-- [x] Invalidate cache on Domain save
-- [x] Invalidate render cache on Alias save
-- [x] DomainConfigOverrider returns empty $overrides
-- [x] Allow non-ascii domains and aliases
-- [x] The domain_validate hook needs tests
-- [x] Allow partial config loading
-
-# Beta
-- [x] Actions for domain operations
-- [x] Drush support for domain operations
-- [x] Replace / inject the storage manager in DomainAliasLoader.
-- [x] Replace / inject the storage manager in domainStorage.
-- [x] Write tests for Domain Content.
-- [x] Views access handler for domain content.
-- [x] Restrict Domain Source options using JS
-- [x] Handle site name overrides -- perhaps as a new field?
-- [x] Restore the `domain_grant_all` permission?
-- [x] Domain token support
-- [x] Module configurations
- - [x] Allow configuration of access-exempt paths for inactive domains
- - [x] www prefix handling
- - [x] Add domain-specific CSS classes
- - [x] Path matching for URL rewrites?
- - [x] Allow non-ascii characters in domains
-- [x] Recreate the Domain Nav module
-- [x] Allow selective access to domain record editing
-- [x] Allow access to actions based on assigned domain permissions
-- [x] Tests for all module hooks
-- [x] Proper tests for domain record validation
-- [x] Check test logic in testDomainAliasNegotiator()
-- [x] Test that sort logic in DomainAliasLoader matches what is documented
-- [x] Error handling in DomainAliasForm
-- [x] Error checking in DomainAliasController
-- [x] Deprecated methods in DomainAliasController
-- [x] Error reporting in `domain_alias_domain_request_alter()`
-- [x] Ensure completeness of DomainAccessPermissionsTest
-- [x] Check module setup behavior in tests
-- [x] Make all affiliates default value configurable
-- [x] Review drupalUserIsLoggedIn() hack
-- [x] Review DomainNegotiatorTest for completeness
-- [x] Review core note in DomainEntityReferenceTest
-- [x] Expand DomainActionsTest
-- [x] DomainViewBuilder review
-- [x] Dependency Injection in DomainValidator
-- [x] Inject the module handler service in DomainListBuilder::getOperations()
-- [x] `drush_domain_generate_domains()` has odd counting logic
-- [x] Separate permissions for Domain Alias
-- [x] Check loader logic in the DomainSource PathProcessor
-- [x] Check loader logic in Domain Access `node_access`
-- [x] Check id logic in Domain Alias list controller
-- [x] Check domain responses on configuration forms
-- [x] Remove deprecated `entity_get_form_display`
-- [x] Implement theme functions or twig templates where proper
-- [x] Advanced drush integration / complete labelled tasks
-- [ ] Add filter options to domain_access and domain_source views
-- [ ] Test cron handling
-- [ ] Caching strategies in DomainNegotiator
-- [ ] Caching strategies in DomainConfigOverrides
-- [ ] Cache in the DomainAccessManager
-- [ ] Proper handling of default node values
-- [ ] Do not allow actions to be edited?
-- [o] Recreate the Domain Theme module -- see https://www.drupal.org/project/domain_theme_switch
-
-# Final
-- [ ] Security review
-- [ ] Provide an upgrade path from 6.x
-- [ ] Provide an upgrade path from 7.x-3.x
-- [x] Remove calls to deprecated methods / classes
-- [ ] Remove unnecessary use statements
-- [ ] Support Tour module
-- [ ] Views schema fails -- see https://www.drupal.org/project/drupal/issues/2834801
diff --git a/sites/all/modules/contrib/admin/domain/LICENSE.txt b/sites/all/modules/contrib/admin/domain/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/domain/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/domain/README.md b/sites/all/modules/contrib/admin/domain/README.md
deleted file mode 100644
index 691d60bba..000000000
--- a/sites/all/modules/contrib/admin/domain/README.md
+++ /dev/null
@@ -1,222 +0,0 @@
-Domain
-======
-
-The Domain module suite lets you share users, content, and configuration across a group of domains from a single installation and database.
-
-Current Status
-------
-
-Domain module for Drupal port to Drupal 8, under active development.
-
-Domain required Drupal 8.5 or higher.
-
-Active branch is the 8-x.1-x branch in GitHub. Begin any forks from there.
-
-The underlying API is stable, and it's currently usable for access control.
-The configuration supports manual editing. Themes should work. Views and Bulk
-Operations are not yet supported.
-
-For a complete feature status list, see [CHANGELOG.md](https://github.com/agentrickard/domain/blob/8.x-1.x/CHANGELOG.md)
-
-Included modules
--------
-
-* *Domain*
- The core module. Domain provides means for registering multiple domains within a
- single Drupal installation. It allows users to be assigned as domain administrators,
- provides a Block and Views display context, and creates a default entity reference
- field for use by other modules.
-
-* *Domain Access*
- Provides node access controls based on domains. (This module contains much of the
- Drupal 7 functionality). It allows users to be assigned as editors of content per-domain,
- sets content visibility rules, and provides Views integration for content.
-
-* *Domain Alias*
- Allows multiple hostnames to be pointed to a single registered domain. These aliases
- can include wildcards (such as *.example.com) and may be configured to redirect to
- their canonical domain. Domain Alias also allows developers to register aliases per
- `environment`, so that different hosts are used consistently across development
- environments. See the README file for Domain Alias for more information.
-
-* *Domain Config*
- Provides a means for changing configuration settings on a per-domain basis. See the
- README for Domain Config for more information.
-
-* *Domain Content*
- Provides content overview pages on a per-domain basis, so that editors may review
- content assigned to specific domains. This module is a series of Views.
-
-* *Domain Source*
- Allows content to be assigned a canonical domain when writing URLs. Domain Source will
- ensure that content that appears on multiple domains always links to one URL. See
- the module's README for more information.
-
-
-Implementation Notes
-======
-
-Cross-domain logins
-------
-
-To use cross-domain logins, you must now set the *cookie_domain* value in
-*sites/default/services.yml*.
-
-To do so, clone `default.services.yml` to `services.yml` and change the
-`cookie_domain` value to match the root hostname of your sites. Note that
-cross-domain login requires the sharing of a top-level domain, so a setting like
-`.example.com` will work for all `example.com` subdomains.
-
-Example:
-
-```
-cookie_domain: '.example.com'
-```
-
-See https://www.drupal.org/node/2391871.
-
-Cross-Site HTTP requests (CORS)
-------
-As of Drupal 8.2, it's possible to allow a particular site to enable CORS for responses
-served by Drupal.
-
-In the case of Domain, allowing CORS may remove AJAX errors caused when using some forms,
-particularly entity references, when the AJAX request goes to another domain.
-
-This feature is not enabled by default because there are security consequences. See
-https://www.drupal.org/node/2715637 for more information and instructions.
-
-To enable CORS for all domains, copy `default.services.yml` to `services.yml` and enable
-the following lines:
-
-```
- # Configure Cross-Site HTTP requests (CORS).
- # Read https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
- # for more information about the topic in general.
- # Note: By default the configuration is disabled.
- cors.config:
- enabled: false
- # Specify allowed headers, like 'x-allowed-header'.
- allowedHeaders: []
- # Specify allowed request methods, specify ['*'] to allow all possible ones.
- allowedMethods: []
- # Configure requests allowed from specific origins.
- allowedOrigins: ['*']
- # Sets the Access-Control-Expose-Headers header.
- exposedHeaders: false
- # Sets the Access-Control-Max-Age header.
- maxAge: false
- # Sets the Access-Control-Allow-Credentials header.
- supportsCredentials: false
-```
-
-The key here is setting `enabled` to `false`.
-
-Trusted host settings
-------
-
-If using the trusted host security setting in Drupal 8, be sure to add each domain
-and alias to the pattern list. For example:
-
-```
-$settings['trusted_host_patterns'] = array(
- '^.+\.example\.org$',
- '^myexample\.com$',
- '^myexample\.dev$',
- '^localhost$',
-);
-```
-
-We *strongly encourage* the use of trusted host settings. When Domain issues a redirect,
-it will check the domain hostname against these settings. Any redirect that does not
-match the trusted host settings will be denied and throw an error.
-
-See https://www.drupal.org/node/1992030 for more information.
-
-Configuring domain records
--------
-To create a domain record, you must provide the following information:
-
-* A unique *hostname*, which may include a port. (Therefore, example.com and
-example.com:8080 are considered different.) The hostname may only contain
-alphanumeric characters, dashes, dots, and one colon. If you wish to use
-international domain names, toggle the `Allow non-ASCII characters in domains
- and aliases.` setting.
-* A *machine_name* that must be unique. This value will be autogenerated and
-cannot be edited once created.
-* A *name* to be used in lists of domains.
-* A URL scheme, used for writing links to the domain. The scheme may be `http`,
-`https`, or `variable`. If `variable` is used, the scheme will be inherited from
-the server or request settings. This option is good if your test environments
-do not have secure certificates but your production environment does.
-* A *status* indicating `active` or `inactive`. Inactive domains may only be
-viewed by users with permission to `view inactive domains` all other users will
-be redirected to the default domain (see below).
-* The *weight* to be used when sorting domains. These values autoincrement as
-new domains are created.
-* Whether the domain is the *default* or not. Only one domain can be set as
- `default`. The default domain is used for redirects in cases where other
- domains are either restricted (inactive) or fail to load. This value can be
- reassigned after domains are created.
-
-Domain records are *configuration entities*, which means they are not stored in
-the database nor accessible to Views by default. They are, however, exportable
-as part of your configuration.
-
-Domains and caching
-------
-
-If some variable changes are not picked up when the page renders, you may need
-add domain-sensitivity to the site's cache.
-
-To do so, clone `default.services.yml` to `services.yml` (if you have not
-already done so) and change the `required_cache_contexts` value to:
-
-```YAML
- required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions', 'url.site']
-```
-
-The addition of `url.site` should provide the domain context that the cache
-layer requires.
-
-For developers, see also the information in the Domain Alias README.
-
-Contributing
-====
-
-If you'd like to contribute, please do. Github forks and pull requests are preferable.
-If you prefer a patch-based workflow, you can attach patches to GitHub issues or Drupal.org
-issues. If you open a Drupal.org issue, please link to it from the appropriate GitHub
-issue.
-
-The GitHub issues are grouped under three milestones:
-
-1. Alpha -- items required for a test release. When this is complete, we will roll an
-alpha1 release on Drupal.org.
-2. Beta -- items considered critical features for a release. When complete, we will roll
-a beta release on Drupal.org.
-3. Final -- items required for a stable, secure release on Drupal.org.
-
-We would like to tackle issues in that order, but feel free to work on what motivates you.
-
-Testing [](https://travis-ci.com/agentrickard/domain)
-====
-
-@zerolab built a Travis definition file for automated testing! That means all pull requests will automatically run tests!
-
-If you file a pull request or patch, please (at a minimum) run the existing tests to check
-for failures. Writing additional tests will greatly speed completion, as I won't commit
-code without test coverage.
-
-New tests should be written in PHPUnit as Functional, Kernel, or Unit tests.
-
-Because Domain requires varying http host requests to test, we can't normally use the Drupal.org
-testing infrastructure. (This may change, but we are not counting on it.)
-
-To setup a proper environment locally, you need multiple or wilcard domains configured to
-point to your drupal instance. I use variants of `example.com` for local tests. See
-`DomainTestBase` for documentation. Domain testing should work with root hosts other than
-`example.com`, though we also expect to find the subdomains `one.*, two.*, three.*, four.*, five.*`
-in most test cases. See `DomainTestBase::domainCreateTestDomains()` for the logic.
-
-When running tests, you normally need to be on the default domain.
diff --git a/sites/all/modules/contrib/admin/domain/composer.json b/sites/all/modules/contrib/admin/domain/composer.json
deleted file mode 100644
index 1613e13c2..000000000
--- a/sites/all/modules/contrib/admin/domain/composer.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "drupal/domain",
- "description": "Creates domain records within a Drupal installation.",
- "type": "drupal-module",
- "license": "GPL-2.0+",
- "authors": [
- {
- "name": "Ken Rickard",
- "email": "agentrickard@gmail.com"
- }
- ],
- "support": {
- "issues": "http://drupal.org/project/issues/domain",
- "irc": "http://irc.freenode.org/drupal-contribute",
- "source": "http://cgit.drupalcode.org/domain"
- },
- "extra": {
- "drush": {
- "services": {
- "domain/drush.services.yml": "^9",
- "domain_access/drush.services.yml": "^9",
- "domain_source/drush.services.yml": "^9"
- }
- }
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/domain.settings.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/domain.settings.yml
deleted file mode 100644
index bdcce5339..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/config/install/domain.settings.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-allow_non_ascii: false
-www_prefix: false
-login_paths: "/user/login\r\n/user/password"
-css_classes: ''
diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/field.field.user.user.field_domain_admin.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/field.field.user.user.field_domain_admin.yml
deleted file mode 100644
index e70c002b4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/config/install/field.field.user.user.field_domain_admin.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-langcode: en
-status: true
-dependencies:
- config:
- - field.storage.user.field_domain_admin
- module:
- - user
-id: user.user.field_domain_admin
-field_name: field_domain_admin
-entity_type: user
-bundle: user
-label: 'Domain administrator'
-description: 'Select the domains this user may administer.'
-required: false
-translatable: false
-default_value: { }
-default_value_callback: ''
-settings:
- handler: 'domain:domain'
- target_bundles: null
- sort:
- field: weight
- direction: ASC
-field_type: entity_reference
diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/field.storage.user.field_domain_admin.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/field.storage.user.field_domain_admin.yml
deleted file mode 100644
index 86ec5b253..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/config/install/field.storage.user.field_domain_admin.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - user
-id: user.field_domain_admin
-field_name: field_domain_admin
-entity_type: user
-type: entity_reference
-settings:
- target_type: domain
-module: core
-locked: false
-cardinality: -1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_default_action.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_default_action.yml
deleted file mode 100644
index c7bf8b9c2..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_default_action.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
-id: domain_default_action
-label: 'Set default domain record'
-type: domain
-plugin: domain_default_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_delete_action.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_delete_action.yml
deleted file mode 100644
index 8f1e94d57..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_delete_action.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
-id: domain_delete_action
-label: 'Delete domain record'
-type: domain
-plugin: domain_delete_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_disable_action.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_disable_action.yml
deleted file mode 100644
index b9817b947..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_disable_action.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
-id: domain_disable_action
-label: 'Disable domain record'
-type: domain
-plugin: domain_disable_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_enable_action.yml b/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_enable_action.yml
deleted file mode 100644
index c23ede79b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/config/install/system.action.domain_enable_action.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
-id: domain_enable_action
-label: 'Enable domain record'
-type: domain
-plugin: domain_enable_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain/config/schema/domain.schema.yml b/sites/all/modules/contrib/admin/domain/domain/config/schema/domain.schema.yml
deleted file mode 100644
index aa0138d73..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/config/schema/domain.schema.yml
+++ /dev/null
@@ -1,95 +0,0 @@
-# Schema for the configuration files of the Domain module.
-domain.settings:
- type: config_object
- label: 'Domain settings'
- mapping:
- allow_non_ascii:
- type: boolean
- label: 'Allow non-ASCII characters'
- www_prefix:
- type: boolean
- label: 'Ignore www prefix when negotiating domains'
- login_paths:
- type: text
- label: 'Paths that should be accessible for inactive domains'
- css_classes:
- type: text
- label: 'Custom css classes to apply to the body tag of each domain'
-
-domain.record.*:
- type: config_entity
- label: 'Domain record'
- mapping:
- id:
- type: string
- label: 'ID'
- uuid:
- type: string
- label: 'ID'
- domain_id:
- type: integer
- label: 'Domain ID'
- hostname:
- type: string
- label: 'Hostname'
- name:
- type: label
- label: 'Name'
- scheme:
- type: string
- label: 'Scheme'
- status:
- type: boolean
- label: 'Status'
- weight:
- type: integer
- label: 'Weight'
- is_default:
- type: boolean
- label: 'Default domain'
-
-action.configuration.domain_default_action:
- type: action_configuration_default
- label: 'Set default domain record'
-action.configuration.domain_delete_action:
- type: action_configuration_default
- label: 'Delete domain record'
-action.configuration.domain_disable_action:
- type: action_configuration_default
- label: 'Disable domain record'
-action.configuration.domain_enable_action:
- type: action_configuration_default
- label: 'Enable domain record'
-
-block.settings.domain_nav_block:
- type: block_settings
- label: 'Domain navigation block'
- mapping:
- link_options:
- type: string
- label: 'Link paths'
- link_theme:
- type: string
- label: 'Link theme'
- link_label:
- type: string
- label: 'Link text'
-
-condition.plugin.domain:
- type: condition.plugin
- mapping:
- domains:
- type: sequence
- sequence:
- type: string
-
-views.access.domain:
- type: mapping
- label: 'Domains'
- mapping:
- domain:
- type: sequence
- label: 'List of domains'
- sequence:
- type: string
- label: 'Domain'
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.api.php b/sites/all/modules/contrib/admin/domain/domain/domain.api.php
deleted file mode 100644
index 7762c9b12..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.api.php
+++ /dev/null
@@ -1,138 +0,0 @@
-addProperty('myvar', 'mydomainvar');
- }
-}
-
-/**
- * Allows modules to modify the inbound domain request.
- *
- * When using this hook, first check $domain->getMatchType(), which returns a
- * numeric constant indicating the type of match derived by the caller or by
- * earlier returns of this hook (such as domain_alias_request_alter()).
- * Use this value to determine if the request needs to be overridden. Valid
- * types are DomainNegotiator::DOMAIN_MATCH_NONE,
- * DomainNegotiator::DOMAIN_MATCH_EXACT, DomainNegotiator::DOMAIN_MATCH_ALIAS.
- *
- * To issue a redirect, as in the case of Domain Alias, set a redirect
- * property to a valid response code (301 or 302).
- *
- * @param \Drupal\domain\DomainInterface $domain
- * A domain object defined by Drupal\domain\DomainInterface.
- */
-function hook_domain_request_alter(\Drupal\domain\DomainInterface &$domain) {
- // Add a special case to the example domain.
- if ($domain->getMatchType() == \Drupal\domain\DomainNegotiator::DOMAIN_MATCH_EXACT && $domain->id() == 'example_com') {
- // Do something here.
- $domain->addProperty('foo', 'Bar');
- }
-}
-
-/**
- * Adds administrative operations for the domain overview form.
- *
- * These operations are only available to users who can administer the domain.
- * That access check happens prior to this hook being called. If your use-case
- * requires additional permission checking, you should provide it before
- * returning any values.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * A domain record object.
- * @param \Drupal\Core\Session\AccountInterface $account
- * The user account performing the operation.
- *
- * @return array
- * An array of operations which uses a unique string key and requires the
- * elements 'title' and 'url'; the 'query' value is optional, and used
- * for link-actions with tokens
- */
-function hook_domain_operations(\Drupal\domain\DomainInterface $domain, \Drupal\Core\Session\AccountInterface $account) {
- $operations = [];
- // Check permissions.
- if ($account->hasPermission('view domain aliases') || $account->hasPermission('administer domain aliases')) {
- // Add aliases to the list.
- $id = $domain->id();
- $operations['domain_alias'] = [
- 'title' => t('Aliases'),
- 'url' => \Drupal\Core\Url::fromRoute('domain_alias.admin', ['domain' => $id]),
- 'weight' => 60,
- ];
- }
- return $operations;
-}
-
-/**
- * Alter the validation step of a domain record.
- *
- * This hook allows modules to change or extend how domain validation
- * happens. Most useful for international domains or other special cases
- * where a site wants to restrict domain creation is some manner.
- *
- * NOTE: This does not apply to Domain Alias records.
- *
- * No return value. Modify $error_list by reference. Return an empty array
- * or NULL to validate this domain.
- *
- * @param array &$error_list
- * The list of current validation errors. Modify this value by reference.
- * If you return an empty array or NULL, the domain is considered valid.
- * @param string $hostname
- * The HTTP_HOST string value being validated, such as one.example.com.
- * Note that this is checked for uniqueness separately. This value is not
- * modifiable.
- *
- * @see domain_valid_domain()
- */
-function hook_domain_validate_alter(array &$error_list, $hostname) {
- // Only allow TLDs to be .org for our site.
- if (substr($hostname, -4) != '.org') {
- $error_list[] = t('Only .org domains may be registered.');
- }
-}
-
-/**
- * Alter the list of domains that may be referenced.
- *
- * Note that this hook does not fire for users with the 'administer domains'
- * permission.
- *
- * No return value. Modify the $query object via methods.
- *
- * @param \Drupal\Core\Entity\Query\QueryInterface $query
- * An entity query prepared by DomainSelection::buildEntityQuery().
- * @param \Drupal\Core\Session\AccountInterface $account
- * The account of the user viewing the reference list.
- * @param array $context
- * A keyed array passing two items:
- * - entity_type The type of entity (e.g. node, user) that requested the list.
- * - bundle The entity subtype (e.g. 'article' or 'page').
- * - field_type The access field group used for this selection. Groups are
- * 'editor' for assigning editorial permissions (as in Domain Access)
- * 'admin' for assigning administrative permissions for a specific domain.
- * Most contributed modules will use 'editor'.
- */
-function hook_domain_references_alter(\Drupal\Core\Entity\Query\QueryInterface $query, \Drupal\Core\Session\AccountInterface $account, array $context) {
- // Remove the default domain from non-admins when editing nodes.
- if ($context['entity_type'] == 'node' && $context['field_type'] == 'editor' && !$account->hasPermission('edit assigned domains')) {
- $default = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultId();
- $query->condition('id', $default, '<>');
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.drush.inc b/sites/all/modules/contrib/admin/domain/domain/domain.drush.inc
deleted file mode 100644
index bb089bcf2..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.drush.inc
+++ /dev/null
@@ -1,634 +0,0 @@
- 'List active domains for the site.',
- 'examples' => [
- 'drush domain-list',
- 'drush domains',
- ],
- 'aliases' => ['domains'],
- ];
- $items['domain-add'] = [
- 'description' => 'Add a new domain to the site.',
- 'examples' => [
- 'drush domain-add example.com \'My Test Site\'',
- 'drush domain-add example.com \'My Test Site\' --inactive=1 --https==1',
- 'drush domain-add example.com \'My Test Site\' --weight=10',
- 'drush domain-add example.com \'My Test Site\' --validate=1',
- ],
- 'arguments' => [
- 'hostname' => 'The domain hostname to register (e.g. example.com).',
- 'name' => 'The name of the site (e.g. Domain Two).',
- ],
- 'options' => [
- 'inactive' => 'Set the domain to inactive status if set.',
- 'https' => 'Use https protocol for this domain if set.',
- 'weight' => 'Set the order (weight) of the domain.',
- 'is_default' => 'Set this domain as the default domain.',
- 'validate' => 'Force a check of the URL response before allowing registration.',
- ],
- ];
- $items['domain-delete'] = [
- 'description' => 'Delete a domain from the site.',
- 'examples' => [
- 'drush domain-delete example.com',
- 'drush domain-delete 1',
- ],
- 'arguments' => [
- 'domain' => 'The numeric id or hostname of the domain to delete.',
- ],
- ];
- $items['domain-test'] = [
- 'description' => 'Tests domains for proper response. If run from a subfolder, you must specify the --uri.',
- 'examples' => [
- 'drush domain-test',
- 'drush domain-test example.com',
- 'drush domain-test 1',
- ],
- 'arguments' => [
- 'domain_id' => 'The numeric id or hostname of the domain to test. If no value is passed, all domains are tested.',
- ],
- 'options' => [
- 'base_path' => 'The subdirectory name if Drupal is installed in a folder other than server root.',
- ],
- ];
- $items['domain-default'] = [
- 'description' => 'Sets the default domain. If run from a subfolder, you must specify the --uri.',
- 'examples' => [
- 'drush domain-default example.com',
- 'drush domain-default 1',
- 'drush domain-default 1 --validate=1',
- ],
- 'arguments' => [
- 'domain_id' => 'The numeric id or hostname of the domain to make default.',
- ],
- 'options' => [
- 'validate' => 'Force a check of the URL response before allowing registration.',
- ],
- ];
- $items['domain-disable'] = [
- 'description' => 'Sets a domain status to off.',
- 'examples' => [
- 'drush domain-disable example.com',
- 'drush domain-disable 1',
- ],
- 'arguments' => [
- 'domain_id' => 'The numeric id or hostname of the domain to disable.',
- ],
- ];
- $items['domain-enable'] = [
- 'description' => 'Sets a domain status to on.',
- 'examples' => [
- 'drush domain-disable example.com',
- 'drush domain-disable 1',
- ],
- 'arguments' => [
- 'domain_id' => 'The numeric id or hostname of the domain to enable.',
- ],
- ];
- $items['domain-name'] = [
- 'description' => 'Changes a domain label.',
- 'examples' => [
- 'drush domain-name example.com Foo',
- 'drush domain-name 1 Foo',
- ],
- 'arguments' => [
- 'domain_id' => 'The numeric id or hostname of the domain to relabel.',
- 'name' => 'The name to use for the domain.',
- ],
- ];
- $items['domain-machine-name'] = [
- 'description' => 'Changes a domain name.',
- 'examples' => [
- 'drush domain-machine-name example.com foo',
- 'drush domain-machine-name 1 foo',
- ],
- 'arguments' => [
- 'domain_id' => 'The numeric id or hostname of the domain to rename.',
- 'name' => 'The machine-readable name to use for the domain.',
- ],
- ];
- $items['domain-scheme'] = [
- 'description' => 'Changes a domain scheme.',
- 'examples' => [
- 'drush domain-scheme example.com https',
- 'drush domain-scheme 1 https',
- ],
- 'arguments' => [
- 'domain_id' => 'The numeric id or hostname of the domain to change.',
- 'scheme' => 'The URL schema (http or https) to use for the domain.',
- ],
- ];
- $items['generate-domains'] = [
- 'description' => 'Generate domains for testing.',
- 'arguments' => [
- 'primary' => 'The primary domain to use. This will be created and used for *.example.com hostnames.',
- ],
- 'options' => [
- 'count' => 'The count of extra domains to generate. Default is 15.',
- 'empty' => 'Pass empty=1 to truncate the {domain} table before creating records.',
- ],
- 'examples' => [
- 'drush domain-generate example.com',
- 'drush domain-generate example.com --count=25',
- 'drush domain-generate example.com --count=25 --empty=1',
- 'drush gend',
- 'drush gend --count=25',
- 'drush gend --count=25 --empty=1',
- ],
- 'aliases' => ['gend'],
- ];
- return $items;
-}
-
-/**
- * Implements hook_drush_help().
- */
-function domain_drush_help($section) {
- $items = domain_drush_command();
- $name = str_replace('domain:', '', $section);
- if (isset($items[$name])) {
- return dt($items[$name]['description']);
- }
-}
-
-/**
- * Shows the domain list.
- */
-function drush_domain_list() {
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted(NULL, TRUE);
-
- if (empty($domains)) {
- drush_print(dt('No domains have been created. Use drush domain-add to create one.'));
- return;
- }
-
- $header = [
- 'weight' => dt('Weight'),
- 'name' => dt('Name'),
- 'hostname' => dt('Hostname'),
- 'scheme' => dt('Scheme'),
- 'status' => dt('Status'),
- 'is_default' => dt('Default'),
- 'domain_id' => dt('Domain Id'),
- 'id' => dt('Machine name'),
- ];
- $rows = [array_values($header)];
- foreach ($domains as $domain) {
- $row = [];
- foreach ($header as $key => $name) {
- $row[] = Html::escape($domain->get($key));
- }
- $rows[] = $row;
- }
-
- drush_print_table($rows, TRUE);
-}
-
-/**
- * Generates a list of domains for testing.
- *
- * In my environment, I name hostnames one.* two.* up to ten. I also use
- * foo.* bar.* and baz.*. We also want a non-hostname here and use
- * myexample.com.
- *
- * The script may also add test1, test2, test3 up to any number to test a
- * large number of domains. This test is mostly for UI testing.
- *
- * @param string $primary
- * The root domain to use for domain creation.
- */
-function drush_domain_generate_domains($primary = 'example.com') {
- // Check the number of domains to create.
- $count = drush_get_option('count');
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE);
- if (empty($count)) {
- $count = 15;
- }
- // Ensure we don't duplicate any domains.
- $existing = [];
- if (!empty($domains)) {
- foreach ($domains as $domain) {
- $existing[] = $domain->getHostname();
- }
- }
- // Set up one.* and so on.
- $names = [
- 'one',
- 'two',
- 'three',
- 'four',
- 'five',
- 'six',
- 'seven',
- 'eight',
- 'nine',
- 'ten',
- 'foo',
- 'bar',
- 'baz',
- ];
- // Set the creation array.
- $new = [$primary];
- foreach ($names as $name) {
- $new[] = $name . '.' . $primary;
- }
- // Include a non hostname.
- $new[] = 'my' . $primary;
- // Filter against existing so we can count correctly.
- $prepared = [];
- foreach ($new as $key => $value) {
- if (!in_array($value, $existing)) {
- $prepared[] = $value;
- }
- }
- // Add any test domains that have numeric prefixes. We don't expect these URLs
- // to work, and mainly use these for testing the user interface.
- $needed = $count - count($prepared);
- for ($i = 1; $i <= $needed; $i++) {
- $prepared[] = 'test' . $i . '.' . $primary;
- }
-
- // Get the initial item weight for sorting.
- $start_weight = count($domains);
- $prepared = array_slice($prepared, 0, $count);
-
- // Create the domains.
- foreach ($prepared as $key => $item) {
- $hostname = mb_strtolower($item);
- $values = [
- 'name' => ($item != $primary) ? ucwords(str_replace(".$primary", '', $item)) : \Drupal::config('system.site')->get('name'),
- 'hostname' => $hostname,
- 'scheme' => 'http',
- 'status' => 1,
- 'weight' => ($item != $primary) ? $key + $start_weight + 1 : -1,
- 'is_default' => 0,
- 'id' => \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($hostname),
- ];
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->create($values);
- domain_drush_create($domain);
- }
-
- // If nothing created, say so.
- if (empty($new)) {
- drush_print(dt('No new domains were created.'));
- }
-}
-
-/**
- * Validates the domain generation script.
- *
- * @param string $primary
- * The root domain to use for domain creation.
- */
-function drush_domain_generate_domains_validate($primary = 'example.com') {
- if ($empty = drush_get_option('empty')) {
- db_query("TRUNCATE TABLE {domain}");
- }
- return;
- // TODO: Add validation.
-}
-
-/**
- * Adds a new domain.
- *
- * @param string $hostname
- * The domain name to register.
- * @param string $name
- * The name to use for this domain.
- */
-function drush_domain_add($hostname, $name) {
- $records_count = \Drupal::entityTypeManager()->getStorage('domain')->getQuery()->count()->execute();
- $start_weight = $records_count + 1;
- $hostname = mb_strtolower($hostname);
- /** @var \Drupal\domain\DomainStorageInterface $domain_storage */
- $domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
- $values = [
- 'hostname' => $hostname,
- 'name' => $name,
- 'status' => (!drush_get_option('invalid')) ? 1 : 0,
- 'scheme' => (!drush_get_option('https')) ? 'http' : 'https',
- 'weight' => ($weight = drush_get_option('weight')) ? $weight : $start_weight + 1,
- 'is_default' => ($is_default = drush_get_option('is_default')) ? $is_default : 0,
- 'id' => $domain_storage->createMachineName($hostname),
- 'validate_url' => (drush_get_option('validate')) ? 1 : 0,
- ];
- $domain = $domain_storage->create($values);
- domain_drush_create($domain);
-}
-
-/**
- * Validates the domain add command arguments.
- *
- * @param string $hostname
- * The domain name to register.
- * @param string $name
- * The name to use for this domain.
- *
- * @return bool
- * TRUE when validation passed, FALSE otherwise.
- */
-function drush_domain_add_validate($hostname, $name) {
- $errors = domain_drush_validate_domain($hostname);
- if (!empty($errors)) {
- return drush_set_error('domain', $errors);
- }
- elseif (\Drupal::entityTypeManager()->getStorage('domain')->loadByHostname($hostname)) {
- return drush_set_error('domain', dt('The hostname is already registered.'));
- }
- return TRUE;
-}
-
-/**
- * Creates a domain record.
- *
- * @param Drupal\domain\DomainInterface $domain
- * A domain entity.
- */
-function domain_drush_create(DomainInterface $domain) {
- if ($error = domain_drush_check_response($domain)) {
- drush_set_error('hostname', $error);
- }
- else {
- $domain->save();
- if ($domain->getDomainId()) {
- drush_print(dt('Created @name at @domain.', ['@name' => $domain->label(), '@domain' => $domain->getHostname()]));
- }
- else {
- drush_print(dt('The request could not be completed.'));
- }
- }
-}
-
-/**
- * Runs a check to ensure that the domain is responsive.
- *
- * @param Drupal\domain\DomainInterface $domain
- * A domain entity.
- *
- * @return string
- * An error message if the domain url does not validate. Else empty.
- */
-function domain_drush_check_response(DomainInterface $domain) {
- // Check the domain response. First, clear the path value.
- if ($domain->validate_url) {
- $domain->setPath();
- try {
- $response = $domain->getResponse();
- }
- // We cannot know which Guzzle Exception class will be returned; be generic.
- catch (RequestException $e) {
- watchdog_exception('domain', $e);
- // File a general server failure.
- $domain->setResponse(500);
- }
- // If validate_url is set, then we must receive a 200 response.
- if ($domain->getResponse() != 200) {
- if (empty($response)) {
- $response = 500;
- }
- return dt('The server request to @url returned a @response response. To proceed, disable the test of the server response by leaving off the --validate flag.', ['@url' => $domain->getPath(), '@response' => $response]);
- }
- }
-}
-
-/**
- * Validates a domain.
- *
- * @param string $hostname
- * The domain name to validate for syntax and uniqueness.
- *
- * @return array
- * An array of errors encountered.
- *
- * @see domain_validate()
- */
-function domain_drush_validate_domain($hostname) {
- /** @var \Drupal\domain\DomainValidatorInterface $validator */
- $validator = \Drupal::service('domain.validator');
- return $validator->validate($hostname);
-}
-
-/**
- * Deletes a domain record.
- *
- * @param string $argument
- * The domain_id to delete. Pass 'all' to delete all records.
- */
-function drush_domain_delete($argument = NULL) {
- if (is_null($argument)) {
- drush_set_error('domain', dt('You must specify a domain to delete.'));
- }
- if ($argument == 'all') {
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE);
- if (empty($domains)) {
- drush_print(dt('There are no domains to delete.'));
- return;
- }
- $content = drush_choice([1 => dt('Delete all domains')], dt('This action may not be undone. Continue?'), '!value');
- if (empty($content)) {
- return;
- }
- }
- // Resolve the domain.
- elseif ($domain = drush_domain_get_from_argument($argument)) {
- if ($domain->isDefault()) {
- return drush_set_error('domain', dt('The primary domain may not be deleted. Use drush domain-default to set a new default domain.'));
- }
- $domains = [$domain];
- }
- else {
- return;
- }
- foreach ($domains as $domain) {
- $domain->delete();
- drush_print(dt('Domain record @domain deleted.', ['@domain' => $domain->getHostname()]));
- }
-
- return;
-
- // TODO: Set options for re-assigning content.
- $list = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE);
- $options = ['0' => dt('Do not reassign')];
- foreach ($list as $data) {
- if ($data->id() != $domain->id()) {
- $options[$data->getDomainId()] = $data->getHostname();
- }
- }
- $content = drush_choice($options, dt('Reassign content to:'), '!value');
- if (empty($content)) {
- return;
- }
- $users = drush_choice($options, dt('Reassign users to:'), '!value');
- if (empty($users)) {
- return;
- }
- $values['domain_access'] = (!empty($content)) ? $content : 'none';
- $values['domain_editor'] = (!empty($content)) ? $users : 'none';
-
- domain_delete($domain, $values);
-
- drush_print(dt('Domain record deleted.'));
-}
-
-/**
- * Tests a domain record for the proper HTTP response.
- *
- * @param string $argument
- * The domain_id to test. Passing no value tests all records.
- */
-function drush_domain_test($argument = NULL) {
- // TODO: This won't work in a subdirectory without a parameter.
- if ($base_path = drush_get_option('base_path')) {
- $GLOBALS['base_path'] = '/' . $base_path . '/';
- }
- if (is_null($argument)) {
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE);
- }
- else {
- if ($domain = drush_domain_get_from_argument($argument)) {
- $domains = [$domain];
- }
- else {
- return;
- }
- }
- foreach ($domains as $domain) {
- if ($domain->getResponse() != 200) {
- drush_print(dt('Fail: !error. Please pass a --uri parameter or a --base_path to retest.', ['!error' => $domain->getResponse()]));
- }
- else {
- drush_print(dt('Success: !url tested successfully.', ['!url' => $domain->getPath()]));
- }
- }
-}
-
-/**
- * Sets the default domain id.
- */
-function drush_domain_default($argument) {
- // Resolve the domain.
- if ($domain = drush_domain_get_from_argument($argument)) {
- $validate = (drush_get_option('validate')) ? 1 : 0;
- $domain->addProperty('validate_url', $validate);
- if ($error = domain_drush_check_response($domain)) {
- drush_set_error('domain', $error);
- }
- else {
- $domain->saveDefault();
- drush_print(dt('!domain set to primary domain.', ['!domain' => $domain->getHostname()]));
- }
- }
-}
-
-/**
- * Disables a domain.
- */
-function drush_domain_disable($argument) {
- // Resolve the domain.
- if ($domain = drush_domain_get_from_argument($argument)) {
- if ($domain->status()) {
- $domain->disable();
- drush_print(dt('!domain has been disabled.', ['!domain' => $domain->getHostname()]));
- }
- else {
- drush_print(dt('!domain is already disabled.', ['!domain' => $domain->getHostname()]));
- }
- }
-}
-
-/**
- * Enables a domain.
- */
-function drush_domain_enable($argument) {
- // Resolve the domain.
- if ($domain = drush_domain_get_from_argument($argument)) {
- if (!$domain->status()) {
- $domain->enable();
- drush_print(dt('!domain has been enabled.', ['!domain' => $domain->getHostname()]));
- }
- else {
- drush_print(dt('!domain is already enabled.', ['!domain' => $domain->getHostname()]));
- }
- }
-}
-
-/**
- * Changes a domain name.
- */
-function drush_domain_name($argument, $name) {
- // Resolve the domain.
- if ($domain = drush_domain_get_from_argument($argument)) {
- $domain->saveProperty('name', $name);
- }
-}
-
-/**
- * Changes a domain machine_name.
- */
-function drush_domain_machine_name($argument, $machine_name) {
- $machine_name = \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($machine_name);
- // Resolve the domain.
- if ($domain = drush_domain_get_from_argument($argument)) {
- $results = \Drupal::entityTypeManager()
- ->getStorage('domain')
- ->loadByProperties(['machine_name' => $machine_name]);
- foreach ($results as $result) {
- if ($result->id() == $machine_name) {
- drush_print(dt('The machine_name @machine_name is being used by domain @hostname.', ['@machine_name' => $machine_name, '@hostname' => $result->getHostname()]));
- return;
- }
- }
- $domain->saveProperty('id', $machine_name);
- }
-}
-
-/**
- * Changes a domain scheme.
- */
-function drush_domain_scheme($argument) {
- // Resolve the domain.
- if ($domain = drush_domain_get_from_argument($argument)) {
- $content = drush_choice([1 => dt('http'), 2 => dt('https')], dt('Select the default http scheme:'), '!value');
- if (empty($content)) {
- return;
- }
- $scheme = 'http';
- if ($content == 2) {
- $scheme = 'https';
- }
- $domain->saveProperty('scheme', $scheme);
- }
-}
-
-/**
- * Converts a domain string or domain_id to a $domain array.
- *
- * On failure, throws a drush error.
- */
-function drush_domain_get_from_argument($argument) {
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->load($argument);
- if (!$domain) {
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->loadByHostname($argument);
- }
- if (!$domain) {
- drush_set_error('domain', dt('Domain record not found.'));
- return NULL;
- }
- return $domain;
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.info.yml b/sites/all/modules/contrib/admin/domain/domain/domain.info.yml
deleted file mode 100644
index 190ac69b3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.info.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Domain
-description: 'Creates domain records within a Drupal installation.'
-type: module
-package: Domain
-# version: VERSION
-# core: 8.x
-dependencies:
- - drupal:system (>=8.5)
- - drupal:options
-configure: domain.admin
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.install b/sites/all/modules/contrib/admin/domain/domain/domain.install
deleted file mode 100644
index 8b7dee9b9..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.install
+++ /dev/null
@@ -1,36 +0,0 @@
-getStorage('entity_form_display')->load('user.user.default')) {
- $display->setComponent(DOMAIN_ADMIN_FIELD, [
- 'type' => 'options_buttons',
- 'weight' => 50,
- ])->save();
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.libraries.yml b/sites/all/modules/contrib/admin/domain/domain/domain.libraries.yml
deleted file mode 100644
index 6c70e1411..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.libraries.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-drupal.domain:
- version: VERSION
- js:
- js/domain.js: {}
- dependencies:
- - core/jquery
- - core/drupal
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.links.action.yml b/sites/all/modules/contrib/admin/domain/domain/domain.links.action.yml
deleted file mode 100644
index e65a9b02c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-entity.domain_add:
- route_name: entity.domain.add
- title: 'Add domain record'
- appears_on:
- - domain.admin
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.links.menu.yml b/sites/all/modules/contrib/admin/domain/domain/domain.links.menu.yml
deleted file mode 100644
index 50e3f3971..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.links.menu.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-domain.admin:
- title: Domains
- route_name: domain.admin
- parent: system.admin_config
- description: 'Domain configuration'
- weight: 0
-domain.admin_list:
- title: Domain records
- route_name: domain.admin
- parent: domain.admin
- description: 'Manage the domain records used by the site.'
- weight: -10
-domain.settings:
- title: Domain settings
- route_name: domain.settings
- parent: domain.admin
- description: 'Domain module settings'
- weight: 0
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.links.task.yml b/sites/all/modules/contrib/admin/domain/domain/domain.links.task.yml
deleted file mode 100644
index e66821094..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.links.task.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-domain.admin:
- title: Domain records
- route_name: domain.admin
- base_route: domain.admin
-domain.settings:
- title: Domain settings
- route_name: domain.settings
- base_route: domain.admin
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.module b/sites/all/modules/contrib/admin/domain/domain/domain.module
deleted file mode 100644
index 960674976..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.module
+++ /dev/null
@@ -1,177 +0,0 @@
-getPath(), ['absolute' => TRUE]);
-}
-
-/**
- * Implements hook_entity_load().
- *
- * The $domain->path and $domain->uri properties are derived from data in the
- * {domain} table. We use the hook system to load that data to indicate that
- * the data is not native to the object.
- *
- * This action is performed in hook_entity_load(), which precedes the running
- * of hook_domain_load() and ensures that our data is present for other modules.
- */
-function domain_entity_load(array $entities, $entity_type) {
- if ($entity_type == 'domain') {
- foreach ($entities as $domain) {
- $domain->setPath();
- $domain->setUrl();
- }
- }
-}
-
-/**
- * Implements hook_help().
- */
-function domain_help($route_name, RouteMatchInterface $route_match) {
- switch ($route_name) {
- case 'domain.admin':
- $output = t('
The following domains have been created for your site. The currently active domain
- is shown in boldface. You may click on a domain to change the currently active domain.
-
');
- return $output;
- }
-}
-
-/**
- * Implements hook_token_info().
- */
-function domain_token_info() {
- return \Drupal::service('domain.token')->getTokenInfo();
-}
-
-/**
- * Implements hook_tokens().
- */
-function domain_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
- return \Drupal::service('domain.token')->getTokens($type, $tokens, $data, $options, $bubbleable_metadata);
-}
-
-/**
- * Implements hook_preprocess_HOOK() for html.html.twig.
- */
-function domain_preprocess_html(array &$variables) {
- // Add class to body tag, if set.
- $config = \Drupal::config('domain.settings');
- if ($string = $config->get('css_classes')) {
- $token = \Drupal::token();
- // Prepare the classes proparly, with one class per string.
- $classes = explode(' ', trim($string));
- foreach ($classes as $class) {
- // Ensure no leading or trailing space.
- $class = trim($class);
- if (!empty($class)) {
- $variables['attributes']['class'][] = Html::getClass($token->replace($class));
- }
- }
- }
-}
-
-/**
- * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\user\UserForm.
- *
- * Handle settings that the user cannot access.
- */
-function domain_form_user_form_alter(&$form, &$form_state, $form_id) {
- // Add the options hidden from the user silently to the form.
- $manager = \Drupal::service('domain.element_manager');
- $form = $manager->setFormOptions($form, $form_state, DOMAIN_ADMIN_FIELD);
-}
-
-/**
- * Implements hook_domain_references_alter().
- */
-function domain_domain_references_alter($query, $account, $context) {
- // Restrict domains by assignment, being sure only to act on the admin field.
- if ($context['field_type'] == 'admin' && $context['entity_type'] == 'user') {
- if ($account->hasPermission('administer domains')) {
- // Do nothing.
- }
- elseif ($account->hasPermission('assign domain administrators')) {
- $allowed = \Drupal::service('domain.element_manager')->getFieldValues($account, DOMAIN_ADMIN_FIELD);
- $query->condition('id', array_keys($allowed), 'IN');
- }
- else {
- // Remove all options.
- $query->condition('id', '-no-possible-match-');
- }
- }
-}
-
-/**
- * Implements hook_views_data_alter().
- */
-function domain_views_data_alter(array &$data) {
- $table = 'user__' . DOMAIN_ADMIN_FIELD;
- // Since domains are not stored in the database, relationships cannot be used.
- unset($data[$table][DOMAIN_ADMIN_FIELD]['relationship']);
-}
-
-/**
- * Implements hook_theme().
- */
-function domain_theme() {
- return [
- 'domain_nav_block' => [
- 'render element' => 'items',
- ],
- ];
-}
-
-/**
- * Prepares variables for block templates.
- *
- * Default template: domain-nav-block.html.twig.
- *
- * @param array $variables
- * An associative array containing:
- * - items: An array of labels and urls for use in the list.
- * Properties used: 'label', 'url', 'active'.
- */
-function template_preprocess_domain_nav_block(array &$variables) {
- $variables['items'] = $variables['items']['#items'];
-}
-
-/**
- * Implements hook_hook_info().
- */
-function domain_hook_info() {
- $hooks['domain_request_alter'] = [
- 'group' => 'domain',
- ];
- $hooks['domain_validate_alter'] = [
- 'group' => 'domain',
- ];
- $hooks['domain_references_alter'] = [
- 'group' => 'domain',
- ];
- return $hooks;
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.permissions.yml b/sites/all/modules/contrib/admin/domain/domain/domain.permissions.yml
deleted file mode 100644
index c3b2d2f80..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.permissions.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-administer domains:
- title: 'Administer all domain records'
- description: 'View, create, edit, and delete domain records. Allows all permissions for the module.'
- restrict access: true
-access inactive domains:
- title: 'Access inactive domains'
- description: 'Access domain URLs for domains marked as inactive.'
- restrict access: true
-assign domain administrators:
- title: 'Assign additional administrators to assigned domains'
- restrict access: true
-create domains:
- title: 'Create domain records'
- restrict access: true
-edit assigned domains:
- title: 'Edit assigned domain records'
- restrict access: true
-delete assigned domains:
- title: 'Delete assigned domain records'
- restrict access: true
-use domain nav block:
- title: 'Access the domain navigation block'
-use domain switcher block:
- title: 'Access the domain switcher block'
- restrict access: true
-view assigned domains:
- title: 'View assigned domains in the administration list'
-view domain list:
- title: 'View all registered domains in the administration list'
-view domain information:
- title: 'View debugging information for domain handling'
- restrict access: true
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.routing.yml b/sites/all/modules/contrib/admin/domain/domain/domain.routing.yml
deleted file mode 100644
index c230a9994..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.routing.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-domain.admin:
- path: '/admin/config/domain'
- defaults:
- _entity_list: 'domain'
- _title: 'Domains'
- _title_context: 'With modules'
- requirements:
- _custom_access: 'Drupal\domain\Access\DomainListCheck::viewDomainList'
-
-domain.settings:
- path: '/admin/config/domain/settings'
- defaults:
- _title: 'Domain settings'
- _form: '\Drupal\domain\Form\DomainSettingsForm'
- requirements:
- _permission: 'administer domains'
-
-entity.domain.add:
- path: '/admin/config/domain/add'
- defaults:
- _entity_form: domain.edit
- _title: 'Add domain record'
- options:
- _admin_route: TRUE
- requirements:
- _entity_create_access: domain
-
-entity.domain.edit_form:
- path: '/admin/config/domain/edit/{domain}'
- defaults:
- _entity_form: domain.edit
- _title: 'Edit domain record'
- options:
- _admin_route: TRUE
- requirements:
- _entity_access: domain.update
-
-entity.domain.delete_form:
- path: '/admin/config/domain/delete/{domain}'
- defaults:
- _entity_form: domain.delete
- _title: 'Delete'
- options:
- _admin_route: TRUE
- requirements:
- _entity_access: domain.delete
-
-domain.inline_action:
- path: '/admin/config/domain/{op}/{domain}'
- defaults:
- _controller: 'Drupal\domain\Controller\DomainController::ajaxOperation'
- requirements:
- _entity_access: domain.update
- _csrf_token: 'TRUE'
- op: 'enable|disable|default'
diff --git a/sites/all/modules/contrib/admin/domain/domain/domain.services.yml b/sites/all/modules/contrib/admin/domain/domain/domain.services.yml
deleted file mode 100644
index 8b87c6a5f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/domain.services.yml
+++ /dev/null
@@ -1,41 +0,0 @@
-services:
- access_check.domain:
- class: Drupal\domain\Access\DomainAccessCheck
- tags:
- - { name: access_check }
- arguments: ['@domain.negotiator', '@config.factory', '@path.matcher']
- access_check.domain_route:
- class: Drupal\domain\Access\DomainRouteCheck
- tags:
- - { name: access_check, applies_to: _domain }
- arguments: ['@domain.negotiator']
- domain.current_domain_context:
- class: Drupal\domain\ContextProvider\CurrentDomainContext
- arguments: ['@domain.negotiator']
- tags:
- - { name: 'context_provider' }
- domain.element_manager:
- class: Drupal\domain\DomainElementManager
- arguments: ['@entity_type.manager']
- domain.negotiator:
- class: Drupal\domain\DomainNegotiator
- arguments: ['@request_stack', '@module_handler', '@entity_type.manager', '@config.factory']
- domain.subscriber:
- class: Drupal\domain\EventSubscriber\DomainSubscriber
- tags:
- - { name: event_subscriber }
- arguments: ['@domain.negotiator', '@entity_type.manager', '@access_check.domain', '@current_user']
- domain.token:
- class: Drupal\domain\DomainToken
- arguments: ['@entity_type.manager', '@domain.negotiator']
- domain.validator:
- class: Drupal\domain\DomainValidator
- arguments: ['@module_handler', '@config.factory', '@http_client', '@entity_type.manager']
- # @deprecated and will be removed for 8.x-1.0 release.
- domain.creator:
- class: Drupal\domain\DomainCreator
- arguments: ['@domain.loader', '@domain.negotiator']
- # @deprecated and will be removed for 8.x-1.0 release.
- domain.loader:
- class: Drupal\domain\DomainLoader
- arguments: ['@config.typed', '@config.factory']
diff --git a/sites/all/modules/contrib/admin/domain/domain/drush.services.yml b/sites/all/modules/contrib/admin/domain/domain/drush.services.yml
deleted file mode 100644
index 84d23f785..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/drush.services.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-services:
- domain.commands:
- class: \Drupal\domain\Commands\DomainCommands
- tags:
- - { name: drush.command }
diff --git a/sites/all/modules/contrib/admin/domain/domain/js/domain.js b/sites/all/modules/contrib/admin/domain/domain/js/domain.js
deleted file mode 100644
index be71eceeb..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/js/domain.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * @file
- * Attaches behaviors for the Domain module.
- */
-(function ($) {
-
- "use strict";
-
- /**
- *
- * @type {Drupal~behavior}
- */
- Drupal.behaviors.domainSettingsSummaries = {
- attach: function () {
- // The drupalSetSummary method required for this behavior is not available
- // on the Blocks administration page, so we need to make sure this
- // behavior is processed only if drupalSetSummary is defined.
- if (typeof jQuery.fn.drupalSetSummary === 'undefined') {
- return;
- }
-
- // There may be an easier way to do this. Right now, we just copy code
- // from block module.
- function checkboxesSummary(context) {
- var vals = [];
- var $checkboxes = $(context).find('input[type="checkbox"]:checked + label');
- var il = $checkboxes.length;
- for (var i = 0; i < il; i++) {
- vals.push($($checkboxes[i]).html());
- }
- if (!vals.length) {
- vals.push(Drupal.t('Not restricted'));
- }
- return vals.join(', ');
- }
-
- $('[data-drupal-selector="edit-visibility-domain"]').drupalSetSummary(checkboxesSummary);
-
- }
- };
-
-})(jQuery);
diff --git a/sites/all/modules/contrib/admin/domain/domain/migrations/d7_domain.yml b/sites/all/modules/contrib/admin/domain/domain/migrations/d7_domain.yml
deleted file mode 100644
index 52e31b119..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/migrations/d7_domain.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-id: d7_domain
-label: Domain Records
-migration_tags:
- - Drupal 7
-source:
- plugin: d7_domain
-process:
- id: machine_name
- name: sitename
- hostname: subdomain
- weight: weight
- is_default: is_default
- scheme: scheme
- path: subdomain
- status: valid
-destination:
- plugin: entity:domain
- destination_module: domain
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainAccessCheck.php b/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainAccessCheck.php
deleted file mode 100644
index 0a48aec4f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainAccessCheck.php
+++ /dev/null
@@ -1,92 +0,0 @@
-domainNegotiator = $negotiator;
- $this->configFactory = $config_factory;
- $this->pathMatcher = $path_matcher;
- }
-
- /**
- * {@inheritdoc}
- */
- public function applies(Route $route) {
- return $this->checkPath($route->getPath());
- }
-
- /**
- * {@inheritdoc}
- */
- public function checkPath($path) {
- $allowed_paths = $this->configFactory->get('domain.settings')->get('login_paths');
- return !$this->pathMatcher->matchPath($path, $allowed_paths);
- }
-
- /**
- * {@inheritdoc}
- */
- public function access(AccountInterface $account) {
- $domain = $this->domainNegotiator->getActiveDomain();
- // Is the domain allowed?
- // No domain, let it pass.
- if (empty($domain)) {
- return AccessResult::allowed()->addCacheTags(['url.site']);
- }
- // Active domain, let it pass.
- if ($domain->status()) {
- return AccessResult::allowed()->addCacheTags(['url.site']);
- }
- // Inactive domain, require permissions.
- else {
- $permissions = ['administer domains', 'access inactive domains'];
- $operator = 'OR';
- return AccessResult::allowedIfHasPermissions($account, $permissions, $operator)->addCacheTags(['url.site']);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainListCheck.php b/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainListCheck.php
deleted file mode 100644
index 271080766..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainListCheck.php
+++ /dev/null
@@ -1,29 +0,0 @@
-hasPermission('administer domains') || $account->hasPermission('view domain list') || $account->hasPermission('view assigned domains')) {
- return AccessResult::allowed();
- }
- return AccessResult::forbidden();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainRouteCheck.php b/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainRouteCheck.php
deleted file mode 100644
index a67066a30..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Access/DomainRouteCheck.php
+++ /dev/null
@@ -1,81 +0,0 @@
-domainNegotiator = $negotiator;
- }
-
- /**
- * {@inheritdoc}
- */
- public function applies(Route $route) {
- return $route->hasRequirement($this->requirementsKey);
- }
-
- /**
- * Checks access to a route with a _domain requirement.
- *
- * @param \Symfony\Component\Routing\Route $route
- * The route to check against.
- * @param \Drupal\Core\Session\AccountInterface $account
- * The currently logged in account.
- *
- * @return \Drupal\Core\Access\AccessResultInterface
- * The access result.
- *
- * @see \Drupal\domain\Plugin\views\access\Domain
- */
- public function access(Route $route, AccountInterface $account) {
- // Requirements just allow strings, so this might be a comma separated list.
- $string = $route->getRequirement($this->requirementsKey);
- $domain = $this->domainNegotiator->getActiveDomain();
- // Since only one domain can be active per request, we only suport OR logic.
- $allowed = array_filter(array_map('trim', explode('+', $string)));
- if (!empty($domain) && in_array($domain->id(), $allowed)) {
- return AccessResult::allowed()->addCacheContexts(['url.site']);
- }
- // If there is no allowed domain, give other access checks a chance.
- return AccessResult::neutral()->addCacheContexts(['url.site']);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Commands/DomainCommandException.php b/sites/all/modules/contrib/admin/domain/domain/src/Commands/DomainCommandException.php
deleted file mode 100644
index 0ab54726b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Commands/DomainCommandException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-domainStorage()->loadMultipleSorted();
-
- if (empty($domains)) {
- $this->logger()->warning(dt('No domains have been created. Use "drush domain:add" to create one.'));
- return new RowsOfFields([]);
- }
-
- $keys = [
- 'weight',
- 'name',
- 'hostname',
- 'response',
- 'scheme',
- 'status',
- 'is_default',
- 'domain_id',
- 'id',
- ];
- $rows = [];
- /** @var \Drupal\domain\DomainInterface $domain */
- foreach ($domains as $domain) {
- $row = [];
- foreach ($keys as $key) {
- switch($key) {
- case 'response':
- try {
- $v = $this->checkDomain($domain);
- }
- catch(\GuzzleHttp\Exception\TransferException $ex) {
- $v = dt('500 - Failed');
- }
- catch(Exception $ex) {
- $v = dt('500 - Exception');
- }
- if ($v >= 200 && $v <= 299) {
- $v = dt('200 - OK');
- }
- elseif ($v == 500) {
- $v = dt('500 - No server');
- }
- break;
- case 'status':
- $v = $domain->get($key);
- if (($options['inactive'] && $v) || ($options['active'] && !$v)) {
- continue 3; // switch, for, for
- }
- $v = !empty($v) ? dt('Active') : dt('Inactive');
- break;
- case 'is_default':
- $v = $domain->get($key);
- $v = !empty($v) ? dt('Default') : '';
- break;
- default:
- $v = $domain->get($key);
- break;
- }
-
- $row[$key] = Html::escape($v);
- }
- $rows[] = $row;
- }
- return new RowsOfFields($rows);
- }
-
- /**
- * List general information about the domains on the site.
- *
- * @usage drush domain:info
- *
- * @command domain:info
- * @aliases domain-info,dinf
- *
- * @return \Consolidation\OutputFormatters\StructuredData\PropertyList
- * @field-labels
- * count: All Domains
- * count_active: Active Domains
- * default_id: Default Domain ID
- * default_host: Default Domain hostname
- * scheme: Fields in Domain entity
- * domain_admin_entities: Domain admin entities
- * @list-orientation true
- * @format table
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function infoDomains() {
- $default_domain = $this->domainStorage()->loadDefaultDomain();
-
- // Load all domains:
- $all_domains = $this->domainStorage()->loadMultiple(NULL);
- $active_domains = [];
- foreach ($all_domains as $domain) {
- if ($domain->status()) {
- $active_domains[] = $domain;
- }
- }
-
- $keys = [
- 'count',
- 'count_active',
- 'default_id',
- 'default_host',
- 'scheme',
- ];
- $rows = [];
- foreach ($keys as $key) {
- $v = '';
- switch($key) {
- case 'count':
- $v = count($all_domains);
- break;
- case 'count_active':
- $v = count($active_domains);
- break;
- case 'default_id':
- $v = '-unset-';
- if ($default_domain) {
- $v = $default_domain->id();
- }
- break;
- case 'default_host':
- $v = '-unset-';
- if ($default_domain) {
- $v = $default_domain->getHostname();
- }
- break;
- case 'scheme':
- $v = implode(', ', array_keys($this->domainStorage()->loadSchema()));
- break;
- }
-
- $rows[$key] = $v;
- }
-
-
- // Display which entities are enabled for domain by checking for the fields.
- $rows['domain_admin_entities'] = $this->getFieldEntities(DOMAIN_ADMIN_FIELD);
-
- return new PropertyList($rows);
- }
-
- /**
- * Finds entities that reference a specific field.
- *
- * @param $field_name
- * The field name to lookup.
- */
- public function getFieldEntities($field_name) {
- $entity_manager = \Drupal::entityManager();
- $field_map = $entity_manager->getFieldMap();
- $domain_entities = [];
- foreach($field_map as $type => $fields) {
- if (array_key_exists($field_name, $fields)) {
- $domain_entities[] = $type;
- }
- }
- return implode(', ', $domain_entities);
- }
-
- /**
- * Add a new domain to the site.
- *
- * @param $hostname
- * The domain hostname to register (e.g. example.com).
- * @param $name
- * The name of the site (e.g. Domain Two).
- * @param array $options An associative array of optional values.
- *
- * @option inactive
- * Set the domain to inactive status if set.
- * @option scheme
- * Use indicated protocol for this domain, defaults to 'https'. Options:
- * - http: normal http (no SSL).
- * - https: secure https (with SSL).
- * - variable: match the scheme used by the request.
- * @option weight
- * Set the order (weight) of the domain.
- * @option is_default
- * Set this domain as the default domain.
- * @option validate
- * Force a check of the URL response before allowing registration.
- *
- * @usage drush domain-add example.com 'My Test Site'
- * @usage drush domain-add example.com 'My Test Site' --scheme=https --inactive
- * @usage drush domain-add example.com 'My Test Site' --weight=10
- * @usage drush domain-add example.com 'My Test Site' --validate
- *
- * @command domain:add
- * @aliases domain-add
- *
- * @return string
- * The entity id of the created domain.
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function add($hostname, $name, array $options = ['weight' => null, 'scheme' => null]) {
- // Validate the weight arg.
- if (!empty($options['weight']) && !is_numeric($options['weight'])) {
- throw new DomainCommandException(
- dt('Domain weight "!weight" must be a number',
- ['!weight' => !empty($options['weight']) ? $options['weight'] : ''])
- );
- }
-
- // Validate the scheme arg.
- if (!empty($options['scheme']) &&
- ($options['scheme'] !== 'http' && $options['scheme'] !== 'https' && $options['scheme'] !== 'variable')
- ) {
- throw new DomainCommandException(
- dt('Scheme name "!scheme" not known',
- ['!scheme' => !empty($options['scheme']) ? $options['scheme'] : ''])
- );
- }
-
- $domains = $this->domainStorage()->loadMultipleSorted();
- $start_weight = count($domains) + 1;
- $values = [
- 'hostname' => $hostname,
- 'name' => $name,
- 'status' => empty($options['inactive']),
- 'scheme' => empty($options['scheme']) ? 'http' : $options['scheme'],
- 'weight' => empty($options['weight']) ? $start_weight : $options['weight'],
- 'is_default' => !empty($options['is_default']),
- 'id' => $this->domainStorage()->createMachineName($hostname),
- ];
- /** @var DomainInterface $domain */
- $domain = $this->domainStorage()->create($values);
-
- // Check for hostname validity. This is required.
- $valid = $this->validateDomain($domain);
- if (!empty($valid)) {
- throw new DomainCommandException(
- dt('Hostname is not valid. !errors',
- ['!errors' => implode(" ", $valid)])
- );
- }
- // Check for hostname and id uniqueness.
- foreach ($domains as $existing) {
- if ($hostname == $existing->getHostname()) {
- throw new DomainCommandException(
- dt('No domain created. Hostname is a duplicate of !hostname.',
- ['!hostname' => $hostname])
- );
- }
- if ($values['id'] == $existing->id()) {
- throw new DomainCommandException(
- dt('No domain created. Id is a duplicate of !id.',
- ['!id' => $existing->id()])
- );
- }
- }
-
- $validate_response = (bool) $options['validate'];
- if ($this->createDomain($domain, $validate_response)) {
- return dt('Created the !hostname with machine id !id.', ['!hostname' => $values['hostname'], '!id' => $values['id']]);
- }
- else {
- return dt('No domain created.');
- }
- }
-
- /**
- * Delete a domain from the site.
- *
- * Deletes the domain from the Drupal configuration and optionally reassign
- * content and/or profiles associated with the deleted domain to another.
- * The domain marked as default cannot be deleted: to achieve this goal,
- * mark another, possibly newly created, domain as the default domain, then
- * delete the old default.
- *
- * The usage example descriptions are based on starting with three domains:
- * - id:19476, machine: example_com, domain: example.com
- * - id:29389, machine: example_org, domain: example.org (default)
- * - id:91736, machine: example_net, domain: example.net
- *
- * @param $domain_id
- * The numeric id, machine name, or hostname of the domain to delete. The
- * value "all" is taken to mean delete all except the default domain.
- * @param array $options
- * An associative array of options whose values come from cli, aliases,
- * config, etc.
- *
- * @usage drush domain:delete example.com
- * Delete the domain example.com, assigning its content and users to
- * the default domain, example.org.
- *
- * @usage drush domain:delete --content-assign=ignore example.com
- * Delete the domain example.com, leaving its content untouched but
- * assigning its users to the default domain.
- *
- * @usage drush domain:delete --content-assign=example_net --users-assign=example_net
- * example.com Delete the domain example.com, assigning its content and
- * users to the example.net domain.
- *
- * @usage drush domain:delete --dryrun 19476
- * Show the effects of delete the domain example.com and assigning its
- * content and users to the default domain, example.org, but not doing so.
- *
- * @usage drush domain:delete --chatty example_net
- * Verbosely Delete the domain example.net and assign its content and users
- * to the default domain, example.org.
- *
- * @usage drush domain-delete --chatty all
- * Verbosely Delete the domains example.com and example.net and assign
- * their content and users to the default domain, example.org.
- *
- * @option chatty
- * Document each step as it is performed.
- * @option dryrun
- * Do not do anything, but explain what would be done. Implies --chatty.
- * @option users-assign
- * Values "prompt", "ignore", "default", , Reassign user accounts
- * associated with the the domain being deleted to the default domain,
- * to the domain whose machine name is , or leave the user accounts
- * alone (and so inaccessible in the normal way). The default value is
- * 'prompt': ask which domain to use.
- *
- * @command domain:delete
- * @aliases domain-delete
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- *
- * @see https://github.com/consolidation/annotated-command#option-event-hook
- */
- public function delete($domain_id, $options = ['users-assign' => null, 'dryrun' => null, 'chatty' => null]) {
- if (is_null($options['users-assign'])) {
- $policy_users = 'prompt';
- }
-
- $this->is_dry_run = (bool) $options['dryrun'];
-
- // Get current domain list and perform validation checks.
- $default_domain = $this->domainStorage()->loadDefaultDomain();
- $all_domains = $this->domainStorage()->loadMultipleSorted(NULL);
-
- if (empty($all_domains)) {
- throw new DomainCommandException('There are no configured domains.');
- }
- if (empty($domain_id)) {
- throw new DomainCommandException('You must specify a domain to delete.');
- }
-
- // Determine which domains to be deleted.
- if ($domain_id === 'all') {
- $domains = $all_domains;
- if (empty($domains)) {
- $this->logger()->info(dt('There are no domains to delete.'));
- return;
- }
- $really = $this->io()->confirm(dt('This action cannot be undone. Continue?:'), FALSE);
- if (empty($really)) {
- return;
- }
- // TODO: handle deletion of all domains.
- }
- elseif ($domain = $this->getDomainFromArgument($domain_id)) {
- if ($domain->isDefault()) {
- throw new DomainCommandException('The primary domain may not be deleted.
- Use drush domain:default to set a new default domain.');
- }
- $domains = [$domain];
- }
-
- if (!empty($options['users-assign'])) {
- if (in_array($options['users-assign'], $this->reassignment_policies, TRUE)) {
- $policy_users = $options['users-assign'];
- }
- }
-
- $delete_options = [
- 'entity_filter' => 'user',
- 'policy' => $policy_users,
- 'field' => DOMAIN_ADMIN_FIELD,
- ];
-
- if ($policy_users !== 'ignore') {
- $messages[] = $this->doReassign($domain, $delete_options);
- }
-
- // Fire any registered hooks for deletion, passing them current imput.
- $handlers = $this->getCustomEventHandlers('domain-delete');
- $messages = [];
- foreach ($handlers as $handler) {
- $messages[] = $handler($domain, $options);
- }
-
- $this->deleteDomain($domains, $options);
-
- $message = dt('Domain record !domain deleted.', ['!domain' => $domain->id()]);
- if ($messages) {
- $message .= "\n" . implode("\n", $messages);
- }
- $this->logger()->info($message);
- return $message;
- }
-
- /**
- * Handles reassignment of entities to another domain.
- *
- * This method includes necessary UI elements if the user is prompted to
- * choose a new domain.
- *
- * @param Drupal\domain\DomainInterface $target_domain
- * The domain selected for deletion.
- * @param array $delete_options
- * A selection of options for deletion, defined in reassignLinkedEntities().
- */
- public function doReassign(DomainInterface $target_domain, array $delete_options) {
- $policy = $delete_options['policy'];
- $default_domain = $this->domainStorage()->loadDefaultDomain();
- $all_domains = $this->domainStorage()->loadMultipleSorted(NULL);
-
- // Perform the 'prompt' for a destination domain.
- if ($policy === 'prompt') {
- // Make a list of the eligible destination domains in form id -> name.
- $noassign_domain = [$target_domain->id()];
-
- $reassign_list = $this->filterDomains($all_domains, $noassign_domain);
- $reassign_base = [
- 'ignore' => dt('Do not reassign'),
- 'default' => dt('Reassign to default domain'),
- ];
- $reassign_list = array_map(
- function (DomainInterface $d) {
- return $d->getHostname();
- },
- $reassign_list
- );
- $reassign_list = array_merge($reassign_base, $reassign_list);
- $policy = $this->io()->choice(dt('Reassign @type field @field data to:', ['@type' => $delete_options['entity_filter'], '@field' => $delete_options['field']]), $reassign_list);
- }
- elseif ($policy === 'default') {
- $policy = $default_domain->id();
- }
- if ($policy !== 'ignore') {
- $delete_options['policy'] = $policy;
- $target = [$target_domain];
- $count = $this->reassignLinkedEntities($target, $delete_options);
- return dt('@count @type entities updated field @field.', ['@count' => $count, '@type' => $delete_options['entity_filter'], '@field' => $delete_options['field']]);
- }
- }
-
- /**
- * Tests domains for proper response.
- *
- * If run from a subfolder, you must specify the --uri.
- *
- * @param $domain_id
- * The machine name or hostname of the domain to make default.
- *
- * @usage drush domain-test
- * @usage drush domain-test example.com
- *
- * @command domain:test
- * @aliases domain-test
- *
- * @field-labels
- * id: Machine name
- * url: URL
- * response: HTTP Response
- * @default-fields id,url,response
- *
- * @return \Consolidation\OutputFormatters\StructuredData\RowsOfFields
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function test($domain_id = null) {
- if (is_null($domain_id)) {
- $domains = $this->domainStorage()->loadMultipleSorted();
- }
- else {
- if ($domain = $this->getDomainFromArgument($domain_id)) {
- $domains = [$domain];
- }
- else {
- throw new DomainCommandException(dt('Domain @domain not found.',
- ['@domain' => $options['domain']]));
- }
- }
- $keys = ['url', 'response'];
- $rows = [];
- foreach ($domains as $domain) {
- $rows[] = [
- 'id' => $domain->id(),
- 'url' => $domain->getPath(),
- 'response' => $domain->getResponse(),
- ];
- }
- return new RowsOfFields($rows);
- }
-
- /**
- * Sets the default domain.
- *
- * @param $domain_id
- * The machine name or hostname of the domain to make default.
- * @param array $options
- * An associative array of options whose values come from cli, aliases,
- * config, etc.
- * @option validate
- * Force a check of the URL response before allowing registration.
- * @usage drush domain-default www.example.com
- * @usage drush domain-default example_org
- * @usage drush domain-default www.example.org --validate=1
- *
- * @command domain:default
- * @aliases domain-default
- *
- * @return string
- * The machine name of the default domain.
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function defaultDomain($domain_id, array $options = ['validate' => null]) {
- // Resolve the domain.
- if (!empty($domain_id) && $domain = $this->getDomainFromArgument($domain_id)) {
- $validate = ($options['validate']) ? 1 : 0;
- $domain->addProperty('validate_url', $validate);
- if ($error = $this->checkHTTPResponse($domain)) {
- throw new DomainCommandException(dt('Unable to verify domain !domain: !error',
- ['!domain' => $domain->getHostname(), '!error' => $error]));
- }
- else {
- $domain->saveDefault();
- }
- }
-
- // Now, ask for the current default, so we know if it worked.
- $domain = $this->domainStorage()->loadDefaultDomain();
- if ($domain->status()) {
- $this->logger()->info(dt('!domain set to primary domain.',
- ['!domain' => $domain->getHostname()]));
- }
- else {
- $this->logger()->warning(dt('!domain set to primary domain, but is also inactive.',
- ['!domain' => $domain->getHostname()]));
- }
- return $domain->id();
- }
-
- /**
- * Deactivates the domain.
- *
- * @param $domain_id
- * The numeric id or hostname of the domain to disable.
- * @usage drush domain-disable example.com
- * @usage drush domain-disable 1
- *
- * @command domain:disable
- * @aliases domain-disable
- *
- * @return string
- * 'disabled' if the domain is now disabled.
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function disable($domain_id) {
- // Resolve the domain.
- if ($domain = $this->getDomainFromArgument($domain_id)) {
- if ($domain->status()) {
- $domain->disable();
- $this->logger()->info(dt('!domain has been disabled.',
- ['!domain' => $domain->getHostname()]));
- return dt('Disabled !domain.', ['!domain' => $domain->getHostname()]);
- }
- else {
- $this->logger()->info(dt('!domain is already disabled.',
- ['!domain' => $domain->getHostname()]));
- return dt('!domain is already disabled.', ['!domain' => $domain->getHostname()]);
- }
- }
- return dt('No matching domain record found.');
- }
-
- /**
- * Activates the domain.
- *
- * @param $domain_id
- * The numeric id or hostname of the domain to enable.
- * @usage drush domain-disable example.com
- * @usage drush domain-enable 1
- *
- * @command domain:enable
- * @aliases domain-enable
- *
- * @return string
- * 'enabled' if the domain is now enabled.
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function enable($domain_id) {
- // Resolve the domain.
- if ($domain = $this->getDomainFromArgument($domain_id)) {
- if (!$domain->status()) {
- $domain->enable();
- $this->logger()->info(dt('!domain has been enabled.',
- ['!domain' => $domain->getHostname()]));
- return dt('Enabled !domain.', ['!domain' => $domain->getHostname()]);
- }
- else {
- $this->logger()->info(dt('!domain is already enabled.',
- ['!domain' => $domain->getHostname()]));
- return dt('!domain is already enabled.', ['!domain' => $domain->getHostname()]);
- }
- }
- return dt('No matching domain record found.');
- }
-
- /**
- * Changes a domain label.
- *
- * @param $domain_id
- * The machine name or hostname of the domain to relabel.
- * @param $name
- * The name to use for the domain.
- * @usage drush domain-name example.com Foo
- * @usage drush domain-name 1 Foo
- *
- * @command domain:name
- * @aliases domain-name
- *
- * @return string
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function renameDomain($domain_id, $name) {
- // Resolve the domain.
- if ($domain = $this->getDomainFromArgument($domain_id)) {
- $domain->saveProperty('name', $name);
- return dt('Renamed !domain to !name.', ['!domain' => $domain->getHostname(), '!name' => $domain->label()]);
- }
- return dt('No matching domain record found.');
- }
-
- /**
- * Changes a domain scheme.
- *
- * @param $domain_id
- * The machine name or hostname of the domain to change.
- * @param $scheme
- * The scheme to use for the domain: http, https, or variable.
- *
- * @usage drush domain-scheme example.com http
- * @usage drush domain-scheme example_com https
- *
- * @command domain:scheme
- * @aliases domain-scheme
- *
- * @return string
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function scheme($domain_id, $scheme = null) {
- $new_scheme = null;
-
- // Resolve the domain.
- if ($domain = $this->getDomainFromArgument($domain_id)) {
- if (!empty($scheme)) {
- // --set with a value
- $new_scheme = $scheme;
- }
- else {
- // Prompt for selection.
- $new_scheme = $this->io()->choice(dt('Select the default http scheme:'),
- [
- 'http' => 'http',
- 'https' => 'https',
- 'variable' => 'variable',
- ]);
- }
-
- // If we were asked to change scheme, validate the value and do so.
- if (!empty($new_scheme)) {
- switch ($new_scheme) {
- case 'http':
- $new_scheme = 'http';
- break;
-
- case 'https':
- $new_scheme = 'https';
- break;
-
- case 'variable':
- $new_scheme = 'variable';
- break;
-
- default:
- throw new DomainCommandException(
- dt('Scheme name "!scheme" not known', ['!scheme' => $new_scheme])
- );
- }
- $domain->saveProperty('scheme', $new_scheme);
- }
-
- // Either way, return the (new | current) scheme for this domain.
- return dt('Scheme is now to "!scheme" for !domain', ['!scheme' => $domain->get('scheme'),'!domain' => $domain->id()]);
- }
-
- // We couldn't find the domain - so fail.
- throw new DomainCommandException(
- dt('Domain name "!domain" not known', ['!domain' => $domain_id])
- );
- }
-
- /**
- * Generate domains for testing.
- *
- * @param $primary
- * The primary domain to use. This will be created and used for
- * *.example.com hostnames.
- * @param array $options
- * An associative array of options whose values come from cli, aliases,
- * config, etc.
- * @option count
- * The count of extra domains to generate. Default is 15.
- * @option empty
- * Pass empty=1 to truncate the {domain} table before creating records.
- * @usage drush domain-generate example.com
- * @usage drush domain-generate example.com --count=25
- * @usage drush domain-generate example.com --count=25 --empty=1
- * @usage drush gend
- * @usage drush gend --count=25
- * @usage drush gend --count=25 --empty=1
- *
- * @command domain:generate
- * @aliases gend,domgen,domain-generate
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- public function generate($primary = 'example.com', array $options = ['count' => null, 'empty' => null]) {
- // Check the number of domains to create.
- $count = $options['count'];
- if (is_null($count)) {
- $count = 15;
- }
-
- $domains = $this->domainStorage()->loadMultiple(NULL);
- if (!empty($options['empty'])) {
- $this->domainStorage()->delete($domains);
- $domains = $this->domainStorage()->loadMultiple(NULL);
- }
- // Ensure we don't duplicate any domains.
- $existing = [];
- if (!empty($domains)) {
- /** @var DomainInterface $domain */
- foreach ($domains as $domain) {
- $existing[] = $domain->getHostname();
- }
- }
- // Set up one.* and so on.
- $names = [
- 'one',
- 'two',
- 'three',
- 'four',
- 'five',
- 'six',
- 'seven',
- 'eight',
- 'nine',
- 'ten',
- 'foo',
- 'bar',
- 'baz',
- ];
- // Set the creation array.
- $new = [$primary];
- foreach ($names as $name) {
- $new[] = $name . '.' . $primary;
- }
- // Include a non hostname.
- $new[] = 'my' . $primary;
- // Filter against existing so we can count correctly.
- $prepared = [];
- foreach ($new as $key => $value) {
- if (!in_array($value, $existing, true)) {
- $prepared[] = $value;
- }
- }
-
- // Add any test domains that have numeric prefixes. We don't expect these URLs to work,
- // and mainly use these for testing the user interface.
- // Test that we already have test domains.
- $start = 1;
- foreach ($existing as $exists) {
- $name = explode('.', $exists);
- if (substr_count($name[0], 'test') > 0) {
- $num = (int) str_replace('test', '', $name[0]) + 1;
- if ($num > $start) {
- $start = $num;
- }
- }
- }
- $needed = $count - count($prepared) + $start;
- for ($i = $start; $i <= $needed; $i++) {
- $prepared[] = 'test' . $i . '.' . $primary;
- }
- // Get the initial item weight for sorting.
- $start_weight = count($domains);
- $prepared = array_slice($prepared, 0, $count);
- $list = [];
-
- // Create the domains.
- foreach ($prepared as $key => $item) {
- $hostname = mb_strtolower($item);
- $values = [
- 'name' => ($item != $primary) ? ucwords(str_replace(".$primary", '', $item)) : \Drupal::config('system.site')->get('name'),
- 'hostname' => $hostname,
- 'scheme' => 'http',
- 'status' => 1,
- 'weight' => ($item != $primary) ? $key + $start_weight + 1 : -1,
- 'is_default' => 0,
- 'id' => $this->domainStorage()->createMachineName($hostname),
- ];
- $domain = $this->domainStorage()->create($values);
- $domain->save();
- $list[] = dt('Created @domain.', ['@domain' => $domain->getHostname()]);
- }
-
- // If nothing created, say so.
- if (empty($prepared)) {
- return dt('No new domains were created.');
- }
- else {
- return dt("Created @count new domains:\n@list", ['@count' => count($prepared), '@list' => implode("\n", $list)]);
- }
- }
-
- /**
- * Gets a domain storage object or throw an exception.
- *
- * Note that domain can run very early in the bootstrap, so we cannot
- * reliably inject this service.
- *
- * @return DomainStorageInterface
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- protected function domainStorage() {
- if (!is_null($this->domain_storage)) {
- return $this->domain_storage;
- }
-
- try {
- $this->domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
- }
- catch (PluginNotFoundException $e) {
- throw new DomainCommandException('Unable to get domain: no storage', $e);
- }
- catch (InvalidPluginDefinitionException $e) {
- throw new DomainCommandException('Unable to get domain: bad storage', $e);
- }
-
- return $this->domain_storage;
- }
-
- /**
- * Loads a domain based on a string identifier.
- *
- * @param string $argument
- * The machine name or the hostname of an existing domain.
- *
- * @return \Drupal\domain\DomainInterface
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- protected function getDomainFromArgument($argument) {
-
- // Try loading domain assuming arg is a machine name.
- $domain = $this->domainStorage()->load($argument);
- if (!$domain) {
- // Try loading assuming it is a host name.
- $domain = $this->domainStorage()->loadByHostname($argument);
- }
-
- // domain_id (an INT) is only used internally because the Node Access
- // system demands the use of numeric keys. It should never be used to load
- // or identify domain records. Use the machine_name or hostname instead.
- if (!$domain) {
- throw new DomainCommandException(
- dt('Domain record could not be found from "!a".', ['!a' => $argument])
- );
- }
-
- return $domain;
- }
-
- /**
- * Filters a list of domains by excluding domains appearing in a specific list.
- *
- * @param DomainInterface[] $domains
- * List of domains.
- * @param string[] $exclude
- * List of domain id to exclude from the list.
- * @param DomainInterface[] $initial
- * Initial value of list that will be returned.
- *
- * @return array
- */
- protected function filterDomains(array $domains, array $exclude, array $initial = []) {
- foreach ($domains as $domain) {
- // Exclude unwanted domains.
- if (!in_array($domain->id(), $exclude, FALSE)) {
- $initial[$domain->id()] = $domain;
- }
- }
- return $initial;
- }
-
- /**
- * Checks the domain response.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * The domain to check.
- * @param bool $validate_url
- * True to validate this domain by performing a URL lookup; False to skip
- * the checks.
- *
- * @return bool
- * True if the domain resolves properly, or we are not checking,
- * False otherwise.
- */
- protected function checkHTTPResponse(DomainInterface $domain, $validate_url = FALSE) {
- // Ensure the url is rebuilt.
- if ($validate_url) {
- $code = $this->checkDomain($domain);
-
- // Some sort of success:
- return $code >= 200 && $code <= 299;
- }
- // Not validating, so all is well!
- return FALSE;
- }
-
- /**
- * Helper function: check a domain is responsive and create it.
- *
- * @param DomainInterface $domain
- * The (as yet unsaved) domain to create.
- * @param bool $check_response
- * Indicates that registration should not be allowed unless the server
- * returns a 200 response.
- *
- * @return bool
- * TODO: stndardize this return so we can issue good messages.
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- protected function createDomain(DomainInterface $domain, $check_response = FALSE) {
- if ($check_response) {
- $valid = $this->checkHTTPResponse($domain, TRUE);
- if (!$valid) {
- throw new DomainCommandException(
- dt('The server did not return a 200 response for !d. Domain creation failed. Remove the --validate flag to save this domain.', ['!d' => $domain->getHostname()])
- );
- }
- }
- else {
- try {
- $domain->save();
- }
- catch (EntityStorageException $e) {
- throw new DomainCommandException('Unable to save domain', $e);
- }
-
- if ($domain->getDomainId()) {
- $this->logger()->info(dt('Created @name at @domain.',
- ['@name' => $domain->label(), '@domain' => $domain->getHostname()]));
- return TRUE;
- }
- else {
- $this->logger()->error(dt('The request could not be completed.'));
- }
- }
- return FALSE;
- }
-
- /**
- * Checks a domain exists by trying to do an http request to it.
- *
- * @param DomainInterface $domain
- * The domain to validate for syntax and uniqueness.
- *
- * @return int
- * The server response code for the request.
- *
- * @see domain_validate()
- */
- protected function checkDomain(DomainInterface $domain) {
- /** @var \Drupal\domain\DomainValidatorInterface $validator */
- $validator = \Drupal::service('domain.validator');
- return $validator->checkResponse($domain);
- }
-
- /**
- * Validates a domain meets the standards for a hostname.
- *
- * @param DomainInterface $domain
- * The domain to validate for syntax and uniqueness.
- * @return string[]
- * Array of strings indicating issues found.
- *
- * @see domain_validate()
- */
- protected function validateDomain(DomainInterface $domain) {
- /** @var \Drupal\domain\DomainValidatorInterface $validator */
- $validator = \Drupal::service('domain.validator');
- return $validator->validate($domain->getHostname());
- }
-
- /**
- * Deletes a domain record.
- *
- * @param DomainInterface[] $domains
- * The domain_id to delete. Pass 'all' to delete all records.
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- * @throws \UnexpectedValueException
- */
- protected function deleteDomain(array $domains) {
- foreach ($domains as $domain) {
- if (!$domain instanceof DomainInterface) {
- throw new StorageException('deleting domains: value is not a domain');
- }
- $hostname = $domain->getHostname();
-
- if ($this->is_dry_run) {
- $this->logger()->info(dt('DRYRUN: Domain record @domain deleted.',
- ['@domain' => $hostname]));
- continue;
- }
-
- try {
- $domain->delete();
- }
- catch (EntityStorageException $e) {
- throw new DomainCommandException(dt('Unable to delete domain: @domain',
- ['@domain' => $hostname]), $e);
- }
- $this->logger()->info(dt('Domain record @domain deleted.',
- ['@domain' => $hostname]));
- }
- }
-
- /**
- * Returns a list of the entity types that are domain enabled.
- *
- * A domain-enabled entity is defined here as an entity type that includes
- * the domain access field(s).
- *
- * @param string $using_field
- * The specific field name to look for.
- *
- * @return string[]
- * List of entity machine names that support domain references.
- */
- protected function findDomainEnabledEntities($using_field = DOMAIN_ADMIN_FIELD) {
- $this->ensureEntityFieldMap();
- $entities = [];
- foreach($this->entity_field_map as $type => $fields) {
- if (array_key_exists($using_field, $fields)) {
- $entities[] = $type;
- }
- }
- return $entities;
- }
-
- /**
- * Determines whether or not a given entity is domain-enabled.
- *
- * @param string $entity_type
- * The machine name of the entity.
- * @param string $field
- * The name of the field to check for existence.
- *
- * @return bool
- * True if this type of entity has a domain field.
- */
- protected function entityHasDomainField($entity_type, $field = DOMAIN_ADMIN_FIELD) {
- // Try to avoid repeated calls to getFieldMap(), assuming it's expensive.
- $this->ensureEntityFieldMap();
- return array_key_exists($field, $this->entity_field_map[$entity_type]);
- }
-
- /**
- * Ensure the local entity field map has been defined.
- *
- * Asking for the entity field map cause a lot of lookup, so we lazily
- * fetch it and then remember it to avoid repeated checks.
- */
- protected function ensureEntityFieldMap() {
- // Try to avoid repeated calls to getFieldMap() assuming it's expensive.
- if (empty($this->entity_field_map)) {
- $entity_manager = \Drupal::entityManager();
- $this->entity_field_map = $entity_manager->getFieldMap();
- }
- }
-
- /**
- * Enumerate entity instances of the supplied type and domain.
- *
- * @param string $entity_type
- * The entity type name, e.g. 'node'
- * @param string $domain_id
- * The machine name of the domain to enumerate.
- * @param string $field
- * The field to manipulate in the entity, e.g. DOMAIN_ACCESS_FIELD.
- *
- * @return int|string[]
- * List of entity IDs for the selected domain.
- * @todo: should this really be a string[] of fields?
- */
- protected function enumerateDomainEntities($entity_type, $domain_id, $field, $just_count = FALSE) {
- if (!$this->entityHasDomainField($entity_type, $field)) {
- $this->logger()->info('Entity type @entity_type does not have field @field, so none found.',
- ['@entity_type'=> $entity_type,
- '@field' => $field]);
- return [];
- }
-
- $efq = \Drupal::entityQuery($entity_type);
- // Don't access check or we wont get all of the possible entities moved.
- $efq->accessCheck(FALSE);
- $efq->condition($field, $domain_id, '=');
- if ($just_count) {
- $efq->count();
- }
- return $efq->execute();
- }
-
- /**
- * Reassign old_domain entities, of the supplied type, to the new_domain.
- *
- * @param string $entity_type
- * The entity type name, e.g. 'node'
- * @param string $field
- * The field to manipulate in the entity, e.g. DOMAIN_ADMIN_FIELD.
- * @param \Drupal\domain\DomainInterface $old_domain
- * The domain the entities currently belong to. It is not an error for
- * entity ids to be passed in that are not in this domain, though of course
- * not very useful.
- * @param \Drupal\domain\DomainInterface $new_domain
- * The domain the entities should now belong to: When an entity belongs to
- * the old_domain, this domain replaces it.
- * @param array $ids
- * List of entity IDs for the selected domain and all of type $entity_type.
- *
- * @return int
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Drupal\Core\Entity\EntityStorageException
- */
- protected function reassignEntities($entity_type, $field, DomainInterface $old_domain, DomainInterface $new_domain, array $ids) {
- $entity_storage = \Drupal::entityTypeManager()->getStorage($entity_type);
- $entities = $entity_storage->loadMultiple($ids);
-
- foreach($entities as $entity) {
- $changed = FALSE;
- if (!$entity->hasField($field)) {
- continue;
- }
- // Multivalue fields are used, so check each one.
- foreach ($entity->get($field) as $k => $item) {
- if ($item->target_id == $old_domain->id()) {
-
- if ($this->is_dry_run) {
- $this->logger()->info(dt('DRYRUN: Update domain membership for entity @id to @new.',
- [ '@id' => $entity->id(), '@new' => $new_domain->id() ]));
-
- // Don't set changed, so don't save either.
- continue;
- }
-
- $changed = TRUE;
- $item->target_id = $new_domain->id();
- }
- }
- if ($changed) {
- $entity->save();
- }
- }
- return count($entities);
- }
-
- /**
- * Return the Domain object corresponding to a policy string.
- *
- * @param string $policy
- * In general one of 'prompt' | 'default' | 'ignore' or a domain entity
- * machine name, but this function does not process 'prompt'.
- *
- * @return \Drupal\Core\Entity\EntityInterface|\Drupal\domain\DomainInterface|null
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- protected function getDomainInstanceFromPolicy($policy) {
- switch($policy) {
- /* Use the Default Domain machine name */
- case 'default':
- $new_domain = $this->domainStorage()->loadDefaultDomain();
- break;
-
- /* Ask interactively for a Domain machine name */
- case 'prompt':
- case 'ignore':
- return NULL;
-
- /* Use this (specified) Domain machine name */
- default:
- $new_domain = $this->domainStorage()->load($policy);
- break;
- }
- return $new_domain;
- }
-
- /**
- * Reassign entities of the supplied type to the $policy domain.
- *
- * @param array $options
- * [
- * 'entity_filter' => 'node',
- * 'policy' => 'prompt' | 'default' | 'ignore' | {domain_id}
- * 'field' => DOMAIN_ACCESS_FIELD,
- * ];
- *
- * @param DomainInterface[] $domains
- * List of the domains to reassign content away from.
- *
- * @throws \Drupal\domain\Commands\DomainCommandException
- */
- protected function reassignLinkedEntities($domains, array $options) {
- $count = 0;
- $field = $options['field'];
- $entity_typenames = $this->findDomainEnabledEntities($field);
-
- $new_domain = $this->getDomainInstanceFromPolicy($options['policy']);
- if (empty($new_domain)) {
- throw new DomainCommandException('invalid destination domain');
- }
-
- // For each entity type...
- $exceptions = FALSE;
- foreach ($entity_typenames as $name) {
- if (empty($options['entity_filter']) || $options['entity_filter'] === $name) {
-
- // For each domain being reassigned from...
- foreach ($domains as $domain) {
- $ids = $this->enumerateDomainEntities($name, $domain->id(), $field);
- if (!empty($ids)) {
- try {
- if ($options['chatty']) {
- $this->logger()->info('Reassigning @count @entity_name entities to @domain',
- ['@entity_name'=>'',
- '@count' => \count($ids),
- '@domain' => $new_domain->id()]);
- }
- $count = $this->reassignEntities($name, $field, $domain, $new_domain, $ids);
- }
- catch (PluginException $e) {
- $exceptions = TRUE;
- $this->logger()->error('Unable to reassign content to @new_domain: plugin exception: @ex',
- ['@ex' => $e->getMessage(),
- '@new_domain' => $new_domain->id()]);
- }
- catch (EntityStorageException $e) {
- $exceptions = TRUE;
- $this->logger()->error('Unable to reassign content to @new_domain: storage exception: @ex',
- ['@ex' => $e->getMessage(),
- '@new_domain' => $new_domain->id()]);
- }
- }
- }
- }
- }
- if ($exceptions) {
- throw new DomainCommandException('Errors encountered during reassign.');
- }
-
- return $count;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/ContextProvider/CurrentDomainContext.php b/sites/all/modules/contrib/admin/domain/domain/src/ContextProvider/CurrentDomainContext.php
deleted file mode 100644
index 51cb962d6..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/ContextProvider/CurrentDomainContext.php
+++ /dev/null
@@ -1,66 +0,0 @@
-negotiator = $negotiator;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRuntimeContexts(array $unqualified_context_ids) {
- // Load the current domain.
- $current_domain = $this->negotiator->getActiveDomain();
- // Set the context.
- $context = new Context(new ContextDefinition('entity:domain', $this->t('Active domain')), $current_domain);
-
- // Allow caching.
- $cacheability = new CacheableMetadata();
- $cacheability->setCacheContexts(['url.site']);
- $context->addCacheableDependency($cacheability);
-
- // Prepare the result.
- $result = [
- 'entity:domain' => $context,
- ];
-
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAvailableContexts() {
- $context = new Context(new ContextDefinition('entity:domain', $this->t('Active domain')));
- return ['entity:domain' => $context];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainController.php b/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainController.php
deleted file mode 100644
index 78837c984..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainController.php
+++ /dev/null
@@ -1,76 +0,0 @@
-saveDefault();
- $message = $this->t('Domain record set as default');
- if ($domain->isDefault()) {
- $success = TRUE;
- }
- break;
-
- case 'enable':
- $domain->enable();
- $message = $this->t('Domain record has been enabled.');
- if ($domain->status()) {
- $success = TRUE;
- }
- break;
-
- case 'disable':
- $domain->disable();
- $message = $this->t('Domain record has been disabled.');
- if (!$domain->status()) {
- $success = TRUE;
- }
- break;
- }
-
- // Set a message.
- if ($success) {
- \Drupal::messenger()->addMessage($message);
- }
- else {
- \Drupal::messenger()->addMessage($this->t('The operation failed.'));
- }
-
- // Return to the invoking page.
- $url = Url::fromRoute('domain.admin', [], ['absolute' => TRUE]);
- return new RedirectResponse($url->toString(), 302);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainControllerBase.php b/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainControllerBase.php
deleted file mode 100644
index 71a855dd4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Controller/DomainControllerBase.php
+++ /dev/null
@@ -1,58 +0,0 @@
-domainStorage = $domain_storage;
- $this->entityTypeManager = $entity_type_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('entity_type.manager')->getStorage('domain'),
- $container->get('entity_type.manager')
- );
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainAccessControlHandler.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainAccessControlHandler.php
deleted file mode 100644
index 2f8a2985c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainAccessControlHandler.php
+++ /dev/null
@@ -1,119 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->domainElementManager = $domain_element_manager;
- $this->userStorage = $user_storage;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
- return new static(
- $entity_type,
- $container->get('entity_type.manager'),
- $container->get('domain.element_manager'),
- $container->get('entity_type.manager')->getStorage('user')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function checkAccess(EntityInterface $entity, $operation, AccountInterface $account = NULL) {
- $account = $this->prepareUser($account);
- // Check the global permission.
- if ($account->hasPermission('administer domains')) {
- return AccessResult::allowed();
- }
- // @TODO: This may not be relevant.
- if ($operation == 'create' && $account->hasPermission('create domains')) {
- return AccessResult::allowed();
- }
- // For view, we allow admins unless the domain is inactive.
- $is_admin = $this->isDomainAdmin($entity, $account);
- if ($operation == 'view' && ($entity->status() || $account->hasPermission('access inactive domains')) && ($is_admin || $account->hasPermission('view domain list'))) {
- return AccessResult::allowed();
- }
- // For other operations, check that the user is a domain admin.
- if ($operation == 'update' && $account->hasPermission('edit assigned domains') && $is_admin) {
- return AccessResult::allowed();
- }
- if ($operation == 'delete' && $account->hasPermission('delete assigned domains') && $is_admin) {
- return AccessResult::allowed();
- }
- return AccessResult::forbidden();
- }
-
- /**
- * Checks if a user can administer a specific domain.
- *
- * @param \Drupal\Core\Entity\EntityInterface $entity
- * The entity to retrieve field data from.
- * @param \Drupal\Core\Session\AccountInterface $account
- * The user account.
- *
- * @return bool
- * TRUE if a user can administer a specific domain, or FALSE.
- */
- public function isDomainAdmin(EntityInterface $entity, AccountInterface $account) {
- $user = $this->userStorage->load($account->id());
- $user_domains = $this->domainElementManager->getFieldValues($user, DOMAIN_ADMIN_FIELD);
- return isset($user_domains[$entity->id()]);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainCreator.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainCreator.php
deleted file mode 100644
index 94eb0ab2a..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainCreator.php
+++ /dev/null
@@ -1,81 +0,0 @@
-loader = $loader;
- $this->negotiator = $negotiator;
- }
-
- /**
- * {@inheritdoc}
- */
- public function createDomain(array $values = []) {
- $default = $this->loader->loadDefaultId();
- $domains = $this->loader->loadMultiple();
- if (empty($values)) {
- $values['hostname'] = $this->createHostname();
- $values['name'] = \Drupal::config('system.site')->get('name');
- }
- $values += [
- 'scheme' => \Drupal::entityTypeManager()->getStorage('domain')->getDefaultScheme(),
- 'status' => 1,
- 'weight' => count($domains) + 1,
- 'is_default' => (int) empty($default),
- ];
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->create($values);
-
- return $domain;
- }
-
- /**
- * {@inheritdoc}
- */
- public function createHostname() {
- return $this->negotiator->negotiateActiveHostname();
- }
-
- /**
- * {@inheritdoc}
- */
- public function createMachineName($hostname = NULL) {
- if (empty($hostname)) {
- $hostname = $this->createHostname();
- }
- return preg_replace('/[^a-z0-9_]/', '_', $hostname);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainCreatorInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainCreatorInterface.php
deleted file mode 100644
index b8da0e628..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainCreatorInterface.php
+++ /dev/null
@@ -1,48 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->domainStorage = $entity_type_manager->getStorage('domain');
- }
-
- /**
- * {@inheritdoc}
- */
- public function setFormOptions(array $form, FormStateInterface $form_state, $field_name, $hide_on_disallow = FALSE) {
- // There are cases, such as Entity Browser, where the form is partially
- // invoked, but without our fields.
- if (!isset($form[$field_name])) {
- return $form;
- }
- $fields = $this->fieldList($field_name);
- $empty = FALSE;
- $disallowed = $this->disallowedOptions($form_state, $form[$field_name]);
- if (empty($form[$field_name]['widget']['#options']) ||
- (count($form[$field_name]['widget']['#options']) == 1 &&
- isset($form[$field_name]['widget']['#options']['_none'])
- )
- ) {
- $empty = TRUE;
- }
-
- // If the domain form element is set as a group, and the field is not
- // assigned to another group, then move it. See
- // domain_access_form_node_form_alter().
- if (isset($form['domain']) && !isset($form[$field_name]['#group'])) {
- $form[$field_name]['#group'] = 'domain';
- }
- // If no values and we should hide the element, do so.
- if ($hide_on_disallow && $empty) {
- $form[$field_name]['#access'] = FALSE;
- }
- // Check for domains the user cannot access or the absence of any options.
- if (!empty($disallowed) || $empty) {
- // @TODO: Potentially show this information to users with permission.
- $form[$field_name . '_disallowed'] = [
- '#type' => 'value',
- '#value' => $disallowed,
- ];
- $form['domain_hidden_fields'] = [
- '#type' => 'value',
- '#value' => $fields,
- ];
- if ($hide_on_disallow || $empty) {
- $form[$field_name]['#access'] = FALSE;
- }
- elseif (!empty($disallowed)) {
- $form[$field_name]['widget']['#description'] .= $this->listDisallowed($disallowed);
- }
- // Call our submit function to merge in values.
- // Account for all the submit buttons on the node form.
- $buttons = ['preview', 'delete'];
- $submit = $this->getSubmitHandler();
- foreach ($form['actions'] as $key => $action) {
- if (!in_array($key, $buttons) && isset($form['actions'][$key]['#submit']) && !in_array($submit, $form['actions'][$key]['#submit'])) {
- array_unshift($form['actions'][$key]['#submit'], $submit);
- }
- }
- }
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function submitEntityForm(array &$form, FormStateInterface $form_state) {
- $fields = $form_state->getValue('domain_hidden_fields');
- foreach ($fields as $field) {
- $entity_values = [];
- $values = $form_state->getValue($field . '_disallowed');
- if (!empty($values)) {
- $info = $form_state->getBuildInfo();
- $node = $form_state->getFormObject()->getEntity();
- $entity_values = $form_state->getValue($field);
- }
- foreach ($values as $value) {
- $entity_values[]['target_id'] = $value;
- }
- // Prevent a fatal error caused by passing a NULL value.
- // See https://www.drupal.org/node/2841962.
- if (!empty($entity_values)) {
- $form_state->setValue($field, $entity_values);
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function disallowedOptions(FormStateInterface $form_state, array $field) {
- $options = [];
- $info = $form_state->getBuildInfo();
- $entity = $form_state->getFormObject()->getEntity();
- $entity_values = $this->getFieldValues($entity, $field['widget']['#field_name']);
- if (isset($field['widget']['#options'])) {
- $options = array_diff_key($entity_values, $field['widget']['#options']);
- }
- return array_keys($options);
- }
-
- /**
- * {@inheritdoc}
- */
- public function fieldList($field_name) {
- static $fields = [];
- $fields[] = $field_name;
- // Return only unique field names. AJAX requests can result in duplicates.
- // See https://www.drupal.org/project/domain/issues/2930934.
- return array_unique($fields);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFieldValues(EntityInterface $entity, $field_name) {
- // @TODO: static cache.
- $list = [];
- // @TODO In tests, $entity is returning NULL.
- if (is_null($entity)) {
- return $list;
- }
- // Get the values of an entity.
- $values = $entity->hasField($field_name) ? $entity->get($field_name) : NULL;
- // Must be at least one item.
- if (!empty($values)) {
- foreach ($values as $item) {
- if ($target = $item->getValue()) {
- if ($domain = $this->domainStorage->load($target['target_id'])) {
- $list[$domain->id()] = $domain->getDomainId();
- }
- }
- }
- }
- return $list;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSubmitHandler() {
- return '\\Drupal\\domain\\DomainElementManager::submitEntityForm';
- }
-
- /**
- * Lists the disallowed domains in the user interface.
- *
- * @param array $disallowed
- * An array of domain ids.
- *
- * @return string
- * A string suitable for display.
- */
- public function listDisallowed(array $disallowed) {
- $domains = $this->domainStorage->loadMultiple($disallowed);
- $string = $this->t('The following domains are currently assigned and cannot be changed:');
- foreach ($domains as $domain) {
- $items[] = $domain->label();
- }
- $build = [
- '#theme' => 'item_list',
- '#items' => $items,
- ];
- $string .= render($build);
- return '
' . $string . '
';
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainElementManagerInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainElementManagerInterface.php
deleted file mode 100644
index 9c6832dc4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainElementManagerInterface.php
+++ /dev/null
@@ -1,105 +0,0 @@
-domainStorage = $domain_storage;
- $this->renderer = $renderer;
- $this->validator = $validator;
- $this->entityTypeManager = $entity_type_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('entity_type.manager')->getStorage('domain'),
- $container->get('renderer'),
- $container->get('domain.validator'),
- $container->get('entity_type.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function form(array $form, FormStateInterface $form_state) {
- $form = parent::form($form, $form_state);
- /** @var \Drupal\domain\Entity\Domain $domain */
- $domain = $this->entity;
-
- // Create defaults if this is the first domain.
- $count_existing = $this->domainStorage->getQuery()->count()->execute();
- if (!$count_existing) {
- $domain->addProperty('hostname', $this->domainStorage->createHostname());
- $domain->addProperty('name', $this->config('system.site')->get('name'));
- }
- $form['domain_id'] = [
- '#type' => 'value',
- '#value' => $domain->getDomainId(),
- ];
- $form['hostname'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Hostname'),
- '#size' => 40,
- '#maxlength' => 80,
- '#default_value' => $domain->getCanonical(),
- '#description' => $this->t('The canonical hostname, using the full subdomain.example.com format. Leave off the http:// and the trailing slash and do not include any paths. If this domain uses a custom http(s) port, you should specify it here, e.g.: subdomain.example.com:1234 The hostname may contain only lowercase alphanumeric characters, dots, dashes, and a colon (if using alternative ports).'),
- ];
- $form['id'] = [
- '#type' => 'machine_name',
- '#default_value' => !empty($domain->id()) ? $domain->id() : '',
- '#disabled' => !empty($domain->id()),
- '#machine_name' => [
- 'source' => ['hostname'],
- 'exists' => [$this->domainStorage, 'load'],
- ],
- ];
- $form['name'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Name'),
- '#size' => 40,
- '#maxlength' => 80,
- '#default_value' => $domain->label(),
- '#description' => $this->t('The human-readable name is shown in domain lists and may be used as the title tag.'),
- ];
- // Do not use the :// suffix when storing data.
- $add_suffix = FALSE;
- $form['scheme'] = [
- '#type' => 'radios',
- '#title' => $this->t('Domain URL scheme'),
- '#options' => [
- 'http' => 'http://',
- 'https' => 'https://',
- 'variable' => 'Variable',
- ],
- '#default_value' => $domain->getRawScheme(),
- '#description' => $this->t('This URL scheme will be used when writing links and redirects to this domain and its resources. Selecting Variable will inherit the current scheme of the web request.'),
- ];
- $form['status'] = [
- '#type' => 'radios',
- '#title' => $this->t('Domain status'),
- '#options' => [1 => $this->t('Active'), 0 => $this->t('Inactive')],
- '#default_value' => (int) $domain->status(),
- '#description' => $this->t('"Inactive" domains are only accessible to user roles with that assigned permission.'),
- ];
- $form['weight'] = [
- '#type' => 'weight',
- '#title' => $this->t('Weight'),
- '#delta' => $count_existing + 1,
- '#default_value' => $domain->getWeight(),
- '#description' => $this->t('The sort order for this record. Lower values display first.'),
- ];
- $form['is_default'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Default domain'),
- '#default_value' => $domain->isDefault(),
- '#description' => $this->t('If a URL request fails to match a domain record, the settings for this domain will be used. Only one domain can be default.'),
- ];
- $form['validate_url'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Test server response'),
- '#default_value' => TRUE,
- '#description' => $this->t('Validate that url of the host is accessible to Drupal before saving.'),
- ];
- $required = $this->validator->getRequiredFields();
- foreach ($form as $key => $element) {
- if (in_array($key, $required)) {
- $form[$key]['#required'] = TRUE;
- }
- }
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- /** @var \Drupal\domain\DomainInterface $entity */
- $entity = $this->entity;
- $hostname = $entity->getHostname();
- $errors = $this->validator->validate($hostname);
- if (!empty($errors)) {
- // Render errors to display as message.
- $message = [
- '#theme' => 'item_list',
- '#items' => $errors,
- ];
- $message = $this->renderer->renderPlain($message);
- $form_state->setErrorByName('hostname', $message);
- }
- // Validate if the same hostname exists.
- // Do not use domain loader because it may change hostname.
- $existing = $this->domainStorage->loadByProperties(['hostname' => $hostname]);
- $existing = reset($existing);
- // If we have already registered a hostname, make sure we don't create a
- // duplicate.
- // We cannot check id() here, as the machine name is editable.
- if ($existing && $existing->getDomainId() != $entity->getDomainId()) {
- $form_state->setErrorByName('hostname', $this->t('The hostname is already registered.'));
- }
-
- // Check the domain response. First, clear the path value.
- $entity->setPath();
- // Check the response.
- $response = $this->validator->checkResponse($entity);
- // If validate_url is set, then we must receive a 200 response.
- if ($entity->validate_url && $response != 200) {
- if (empty($response)) {
- $response = 500;
- }
- $form_state->setErrorByName('hostname', $this->t('The server request to @url returned a @response response. To proceed, disable the Test server response in the form.', ['@url' => $entity->getPath(), '@response' => $response]));
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $form, FormStateInterface $form_state) {
- $status = parent::save($form, $form_state);
- if ($status == SAVED_NEW) {
- \Drupal::messenger()->addMessage($this->t('Domain record created.'));
- }
- else {
- \Drupal::messenger()->addMessage($this->t('Domain record updated.'));
- }
- $form_state->setRedirect('domain.admin');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainInterface.php
deleted file mode 100644
index ce963d803..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainInterface.php
+++ /dev/null
@@ -1,239 +0,0 @@
-get('entity_type.manager')->getStorage($entity_type->id()),
- $container->get('current_user'),
- $container->get('redirect.destination'),
- $container->get('entity_type.manager'),
- $container->get('module_handler'),
- $container->get('domain.element_manager')
- );
- }
-
- /**
- * Constructs a new DomainListBuilder object.
- *
- * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
- * The entity type definition.
- * @param \Drupal\domain\DomainStorageInterface $domain_storage
- * The domain storage class.
- * @param \Drupal\Core\Session\AccountInterface $account
- * The active user account.
- * @param \Drupal\Core\Routing\RedirectDestinationInterface $destination_handler
- * The redirect destination helper.
- * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
- * The entity type manager.
- * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
- * The module handler.
- * @param \Drupal\domain\DomainElementManagerInterface $domain_element_manager
- * The domain field element manager.
- */
- public function __construct(EntityTypeInterface $entity_type, DomainStorageInterface $domain_storage, AccountInterface $account, RedirectDestinationInterface $destination_handler, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, DomainElementManagerInterface $domain_element_manager) {
- parent::__construct($entity_type, $domain_storage);
- $this->entityTypeId = $entity_type->id();
- $this->domainStorage = $domain_storage;
- $this->entityType = $entity_type;
- $this->currentUser = $account;
- $this->destinationHandler = $destination_handler;
- $this->entityTypeManager = $entity_type_manager;
- $this->accessHandler = $this->entityTypeManager->getAccessControlHandler('domain');
- $this->moduleHandler = $module_handler;
- $this->domainElementManager = $domain_element_manager;
- $this->userStorage = $this->entityTypeManager->getStorage('user');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'domain_admin_overview_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getOperations(EntityInterface $entity) {
- $operations = parent::getOperations($entity);
- $destination = $this->destinationHandler->getAsArray();
- $default = $entity->isDefault();
- $id = $entity->id();
-
- // If the user cannot edit domains, none of these actions are permitted.
- $access = $this->accessHandler->checkAccess($entity, 'update');
- if ($access->isForbidden()) {
- return $operations;
- }
-
- $super_admin = $this->currentUser->hasPermission('administer domains');
- if ($super_admin || $this->currentUser->hasPermission('access inactive domains')) {
- if ($entity->status() && !$default) {
- $operations['disable'] = [
- 'title' => $this->t('Disable'),
- 'url' => Url::fromRoute('domain.inline_action', ['op' => 'disable', 'domain' => $id]),
- 'weight' => 50,
- ];
- }
- elseif (!$default) {
- $operations['enable'] = [
- 'title' => $this->t('Enable'),
- 'url' => Url::fromRoute('domain.inline_action', ['op' => 'enable', 'domain' => $id]),
- 'weight' => 40,
- ];
- }
- }
- if (!$default && $super_admin) {
- $operations['default'] = [
- 'title' => $this->t('Make default'),
- 'url' => Url::fromRoute('domain.inline_action', ['op' => 'default', 'domain' => $id]),
- 'weight' => 30,
- ];
- }
- if (!$default && $this->accessHandler->checkAccess($entity, 'delete')->isAllowed()) {
- $operations['delete'] = [
- 'title' => $this->t('Delete'),
- 'url' => Url::fromRoute('entity.domain.delete_form', ['domain' => $id]),
- 'weight' => 20,
- ];
- }
- $operations += $this->moduleHandler->invokeAll('domain_operations', [$entity, $this->currentUser]);
- foreach ($operations as $key => $value) {
- if (isset($value['query']['token'])) {
- $operations[$key]['query'] += $destination;
- }
- }
- /** @var DomainInterface $default */
- $default = $this->domainStorage->loadDefaultDomain();
-
- // Deleting the site default domain is not allowed.
- if ($default && $id == $default->id()) {
- unset($operations['delete']);
- }
- return $operations;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildHeader() {
- $header['label'] = $this->t('Name');
- $header['hostname'] = $this->t('Hostname');
- $header['status'] = $this->t('Status');
- $header['is_default'] = $this->t('Default');
- $header += parent::buildHeader();
- if (!$this->currentUser->hasPermission('administer domains')) {
- unset($header['weight']);
- }
- return $header;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildRow(EntityInterface $entity) {
- // If the user cannot view the domain, none of these actions are permitted.
- $admin = $this->accessHandler->checkAccess($entity, 'view');
- if ($admin->isForbidden()) {
- return;
- }
-
- $row['label'] = $this->getLabel($entity);
- $row['hostname'] = ['#markup' => $entity->getLink()];
- if ($entity->isActive()) {
- $row['hostname']['#prefix'] = '';
- $row['hostname']['#suffix'] = '';
- }
- $row['status'] = ['#markup' => $entity->status() ? $this->t('Active') : $this->t('Inactive')];
- $row['is_default'] = ['#markup' => ($entity->isDefault() ? $this->t('Yes') : $this->t('No'))];
- $row += parent::buildRow($entity);
-
- if (!$this->currentUser->hasPermission('administer domains')) {
- unset($row['weight']);
- }
-
- return $row;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $form = parent::buildForm($form, $form_state);
- $form[$this->entitiesKey]['#domains'] = $this->entities;
- $form['actions']['submit']['#value'] = $this->t('Save configuration');
- // Only super-admins may sort domains.
- if (!$this->currentUser->hasPermission('administer domains')) {
- $form['actions']['submit']['#access'] = FALSE;
- unset($form['#tabledrag']);
- }
- // Delta is set after each row is loaded.
- $count = count($this->domainStorage->loadMultiple()) + 1;
- foreach (Element::children($form['domains']) as $key) {
- if (isset($form['domains'][$key]['weight'])) {
- $form['domains'][$key]['weight']['#delta'] = $count;
- }
- }
- return $form;
- }
-
- /**
- * {@inheritdoc}
- *
- * Overrides the parent method to prevent saving bad data.
- *
- * @link https://www.drupal.org/project/domain/issues/2925798
- * @link https://www.drupal.org/project/domain/issues/2925629
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- foreach ($form_state->getValue($this->entitiesKey) as $id => $value) {
- if (isset($this->entities[$id]) && $this->entities[$id]->get($this->weightKey) != $value['weight']) {
- // Reset weight properly.
- $this->entities[$id]->set($this->weightKey, $value['weight']);
- // Do not allow accidental hostname rewrites.
- $this->entities[$id]->set('hostname', $this->entities[$id]->getCanonical());
- $this->entities[$id]->save();
- }
- }
- }
-
- /**
- * Internal sort method for form weights.
- */
- private function sortByWeight($a, $b) {
- if ($a['weight'] < $b['weight']) {
- return 0;
- }
- return 1;
- }
-
- /**
- * {@inheritdoc}
- *
- * Builds the entity listing as a form with pagination. This method overrides
- * both Drupal\Core\Config\Entity\DraggableListBuilder::render() and
- * Drupal\Core\Entity\EntityListBuilder::render().
- */
- public function render() {
- // Build the default form, which includes weights.
- $form = $this->formBuilder()->getForm($this);
-
- // Only add the pager if a limit is specified.
- if ($this->limit) {
- $form['pager'] = [
- '#type' => 'pager',
- ];
- }
- return $form;
- }
-
- /**
- * {@inheritdoc}
- *
- * Loads entity IDs using a pager sorted by the entity weight. The default
- * behavior when using a limit is to sort by id.
- *
- * We also have to limit by assigned domains of the active user.
- *
- * See Drupal\Core\Entity\EntityListBuilder::getEntityIds()
- *
- * @return array
- * An array of entity IDs.
- */
- protected function getEntityIds() {
- $query = $this->getStorage()->getQuery()
- ->sort($this->entityType->getKey('weight'));
-
- // If the user cannot administer domains, we must filter the query further
- // by assigned IDs. We don't have to check permissions here, because that is
- // handled by the route system and buildRow(). There are two permissions
- // that allow users to view the entire list.
- if (!$this->currentUser->hasPermission('administer domains') && !$this->currentUser->hasPermission('view domain list')) {
- $user = $this->userStorage->load($this->currentUser->id());
- $allowed = $this->domainElementManager->getFieldValues($user, DOMAIN_ADMIN_FIELD);
- $query->condition('id', array_keys($allowed), 'IN');
- }
-
- // Only add the pager if a limit is specified.
- if ($this->limit) {
- $query->pager($this->limit);
- }
- return $query->execute();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainLoader.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainLoader.php
deleted file mode 100644
index 1372779a3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainLoader.php
+++ /dev/null
@@ -1,163 +0,0 @@
-typedConfig = $typed_config;
- $this->configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadSchema() {
- $fields = $this->typedConfig->getDefinition('domain.record.*');
- return isset($fields['mapping']) ? $fields['mapping'] : [];
- }
-
- /**
- * {@inheritdoc}
- */
- public function load($id, $reset = FALSE) {
- $controller = $this->getStorage();
- if ($reset) {
- $controller->resetCache([$id]);
- }
- return $controller->load($id);
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadDefaultId() {
- $result = $this->loadDefaultDomain();
- if (!empty($result)) {
- return $result->id();
- }
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadDefaultDomain() {
- $result = $this->getStorage()->loadByProperties(['is_default' => TRUE]);
- if (!empty($result)) {
- return current($result);
- }
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadMultiple(array $ids = NULL, $reset = FALSE) {
- $controller = $this->getStorage();
- if ($reset) {
- $controller->resetCache($ids);
- }
- return $controller->loadMultiple($ids);
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadMultipleSorted(array $ids = NULL) {
- $domains = $this->loadMultiple($ids);
- uasort($domains, [$this, 'sort']);
- return $domains;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByHostname($hostname) {
- $hostname = $this->prepareHostname($hostname);
- $result = $this->getStorage()->loadByProperties(['hostname' => $hostname]);
- if (empty($result)) {
- return NULL;
- }
- return current($result);
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadOptionsList() {
- $list = [];
- foreach ($this->loadMultipleSorted() as $id => $domain) {
- $list[$id] = $domain->label();
- }
- return $list;
- }
-
- /**
- * {@inheritdoc}
- */
- public function sort(DomainInterface $a, DomainInterface $b) {
- return $a->getWeight() > $b->getWeight();
- }
-
- /**
- * Loads the storage controller.
- *
- * We use the loader very early in the request cycle. As a result, if we try
- * to inject the storage container, we hit a circular dependency. Using this
- * method at least keeps our code easier to update.
- */
- protected function getStorage() {
- $storage = \Drupal::entityTypeManager()->getStorage('domain');
- return $storage;
- }
-
- /**
- * {@inheritdoc}
- */
- public function prepareHostname($hostname) {
- // Strip www. prefix off the hostname.
- $ignore_www = $this->configFactory->get('domain.settings')->get('www_prefix');
- if ($ignore_www && substr($hostname, 0, 4) == 'www.') {
- $hostname = substr($hostname, 4);
- }
- return $hostname;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainLoaderInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainLoaderInterface.php
deleted file mode 100644
index 7f124363c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainLoaderInterface.php
+++ /dev/null
@@ -1,119 +0,0 @@
- label for use in forms.
- */
- public function loadOptionsList();
-
- /**
- * Sorts domains by weight.
- *
- * For use by loadMultipleSorted().
- *
- * @param DomainInterface $a
- * The first Domain object to sort.
- * @param DomainInterface $b
- * The Domain object to compare against.
- *
- * @return bool
- * Wether the first domain weight is greater or not.
- */
- public function sort(DomainInterface $a, DomainInterface $b);
-
- /**
- * Gets the entity field schema for domain records.
- *
- * @return array
- * An array representing the field schema of the object.
- */
- public function loadSchema();
-
- /**
- * Removes www. prefix from a hostname, if set.
- *
- * @param string $hostname
- * A hostname.
- *
- * @return string
- * The cleaned hostname.
- */
- public function prepareHostname($hostname);
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiator.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiator.php
deleted file mode 100644
index ef68f7c5f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiator.php
+++ /dev/null
@@ -1,231 +0,0 @@
-requestStack = $requestStack;
- $this->moduleHandler = $module_handler;
- $this->entityTypeManager = $entity_type_manager;
- $this->configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setRequestDomain($httpHost, $reset = FALSE) {
- // @TODO: Investigate caching methods.
- $this->setHttpHost($httpHost);
- // Try to load a direct match.
- if ($domain = $this->domainStorage()->loadByHostname($httpHost)) {
- // If the load worked, set an exact match flag for the hook.
- $domain->setMatchType(self::DOMAIN_MATCH_EXACT);
- }
- // If a straight load fails, create a base domain for checking. This data
- // is required for hook_domain_request_alter().
- else {
- $values = ['hostname' => $httpHost];
- /** @var \Drupal\domain\DomainInterface $domain */
- $domain = $this->domainStorage()->create($values);
- $domain->setMatchType(self::DOMAIN_MATCH_NONE);
- }
-
- // Now check with modules (like Domain Alias) that register alternate
- // lookup systems with the main module.
- $this->moduleHandler->alter('domain_request', $domain);
-
- // We must have registered a valid id, else the request made no match.
- if (!empty($domain->id())) {
- $this->setActiveDomain($domain);
- }
- // Fallback to default domain if no match.
- elseif ($domain = $this->domainStorage()->loadDefaultDomain()) {
- $this->moduleHandler->alter('domain_request', $domain);
- $domain->setMatchType(self::DOMAIN_MATCH_NONE);
- if (!empty($domain->id())) {
- $this->setActiveDomain($domain);
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function setActiveDomain(DomainInterface $domain) {
- // @TODO: caching
- $this->domain = $domain;
- }
-
- /**
- * Determine the active domain.
- */
- protected function negotiateActiveDomain() {
- $httpHost = $this->negotiateActiveHostname();
- $this->setRequestDomain($httpHost);
- return $this->domain;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getActiveDomain($reset = FALSE) {
- if ($reset) {
- $this->negotiateActiveDomain();
- }
- return $this->domain;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getActiveId() {
- return $this->domain->id();
- }
-
- /**
- * {@inheritdoc}
- */
- public function negotiateActiveHostname() {
- if ($request = $this->requestStack->getCurrentRequest()) {
- $httpHost = $request->getHttpHost();
- }
- else {
- $httpHost = $_SERVER['HTTP_HOST'];
- }
- $hostname = !empty($httpHost) ? $httpHost : 'localhost';
- return $this->domainStorage()->prepareHostname($hostname);
- }
-
- /**
- * {@inheritdoc}
- */
- public function setHttpHost($httpHost) {
- $this->httpHost = $httpHost;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getHttpHost() {
- return $this->httpHost;
- }
-
- /**
- * {@inheritdoc}
- */
- public function isRegisteredDomain($hostname) {
- // Direct hostname match always passes.
- if ($domain = $this->domainStorage()->loadByHostname($hostname)) {
- return TRUE;
- }
- // Check for registered alias matches.
- $values = ['hostname' => $hostname];
- /** @var \Drupal\domain\DomainInterface $domain */
- $domain = $this->domainStorage()->create($values);
- $domain->setMatchType(self::DOMAIN_MATCH_NONE);
-
- // Now check with modules (like Domain Alias) that register alternate
- // lookup systems with the main module.
- $this->moduleHandler->alter('domain_request', $domain);
-
- // We must have registered a valid id, else the request made no match.
- if (!empty($domain->id())) {
- return TRUE;
- }
- return FALSE;
- }
-
- /**
- * Retrieves the domain storage handler.
- *
- * @return \Drupal\domain\DomainStorageInterface
- * The domain storage handler.
- */
- protected function domainStorage() {
- if (!$this->domainStorage) {
- $this->domainStorage = $this->entityTypeManager->getStorage('domain');
- }
- return $this->domainStorage;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiatorInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiatorInterface.php
deleted file mode 100644
index 6dbfb3d5b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainNegotiatorInterface.php
+++ /dev/null
@@ -1,93 +0,0 @@
-getRequestContext()->getCompleteBaseUrl();
- return !UrlHelper::isExternal($url) || UrlHelper::externalIsLocal($url, $base_url) || $this->externalIsRegistered($url, $base_url);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function isSafe($url) {
- return $this->isLocal($url);
- }
-
- /**
- * Returns the request context.
- *
- * @return \Drupal\Core\Routing\RequestContext
- * The request context.
- */
- protected function getRequestContext() {
- if (!isset($this->requestContext)) {
- $this->requestContext = \Drupal::service('router.request_context');
- }
- return $this->requestContext;
- }
-
- /**
- * Sets the request context.
- *
- * @param \Drupal\Core\Routing\RequestContext $request_context
- * The request context.
- *
- * @return $this
- */
- public function setRequestContext(RequestContext $request_context) {
- $this->requestContext = $request_context;
-
- return $this;
- }
-
- /**
- * Determines if an external URL points to this domain-aware installation.
- *
- * This method replaces the logic in
- * Drupal\Component\Utility\UrlHelper::externalIsLocal(). Since that class is
- * not directly extendable, we have to replace it.
- *
- * @param string $url
- * A string containing an external URL, such as "http://example.com/foo".
- * @param string $base_url
- * The base URL string to check against, such as "http://example.com/".
- *
- * @return bool
- * TRUE if the URL has the same domain and base path.
- *
- * @throws \InvalidArgumentException
- * Exception thrown when $url is not fully qualified.
- */
- public static function externalIsRegistered($url, $base_url) {
- $url_parts = parse_url($url);
- $base_parts = parse_url($base_url);
-
- if (empty($url_parts['host'])) {
- throw new \InvalidArgumentException('A path was passed when a fully qualified domain was expected.');
- }
-
- // Check that the host name is registered with trusted hosts.
- $trusted = self::checkTrustedHost($url_parts['host']);
- if (!$trusted) {
- return FALSE;
- }
-
- // Check that the requested $url is registered.
- $negotiator = \Drupal::service('domain.negotiator');
- $registered_domain = $negotiator->isRegisteredDomain($url_parts['host']);
-
- if (!isset($url_parts['path']) || !isset($base_parts['path'])) {
- return $registered_domain;
- }
- else {
- // When comparing base paths, we need a trailing slash to make sure a
- // partial URL match isn't occurring. Since base_path() always returns
- // with a trailing slash, we don't need to add the trailing slash here.
- return ($registered_domain && stripos($url_parts['path'], $base_parts['path']) === 0);
- }
- }
-
- /**
- * Checks that a host is registered with trusted_host_patterns.
- *
- * This method is cribbed from Symfony's Request::getHost() method.
- *
- * @param string $host
- * The hostname to check.
- *
- * @return bool
- * TRUE if the hostname matches the trusted_host_patterns. FALSE otherwise.
- * It is the caller's responsibility to deal with this result securely.
- */
- public static function checkTrustedHost($host) {
- // See Request::setTrustedHosts();
- if (!isset(self::$trustedHostPatterns)) {
- self::$trustedHostPatterns = array_map(function ($hostPattern) {
- return sprintf('#%s#i', $hostPattern);
- }, Settings::get('trusted_host_patterns', []));
- // Reset the trusted host match array.
- self::$trustedHosts = [];
- }
-
- // Trim and remove port number from host. Host is lowercase as per RFC
- // 952/2181.
- $host = mb_strtolower(preg_replace('/:\d+$/', '', trim($host)));
-
- // In the original Symfony code, hostname validation runs here. We have
- // removed that portion because Domains are already validated on creation.
- if (count(self::$trustedHostPatterns) > 0) {
- // To avoid host header injection attacks, you should provide a list of
- // trusted host patterns.
- if (in_array($host, self::$trustedHosts)) {
- return TRUE;
- }
- foreach (self::$trustedHostPatterns as $pattern) {
- if (preg_match($pattern, $host)) {
- self::$trustedHosts[] = $host;
- return TRUE;
- }
- }
- return FALSE;
- }
- // In cases where trusted_host_patterns are not set, allow all. This is
- // flagged as a security issue by Drupal core in the Reports UI.
- return TRUE;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainStorage.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainStorage.php
deleted file mode 100644
index d2b28e26f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainStorage.php
+++ /dev/null
@@ -1,202 +0,0 @@
-configFactory = $config_factory;
- $this->uuidService = $uuid_service;
- $this->languageManager = $language_manager;
- $this->typedConfig = $typed_config;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
- return new static(
- $entity_type,
- $container->get('config.factory'),
- $container->get('uuid'),
- $container->get('language_manager'),
- $container->get('config.typed')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadSchema() {
- $fields = $this->typedConfig->getDefinition('domain.record.*');
- return isset($fields['mapping']) ? $fields['mapping'] : [];
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadDefaultId() {
- $result = $this->loadDefaultDomain();
- if (!empty($result)) {
- return $result->id();
- }
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadDefaultDomain() {
- $result = $this->loadByProperties(['is_default' => TRUE]);
- if (!empty($result)) {
- return current($result);
- }
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadMultipleSorted(array $ids = NULL) {
- $domains = $this->loadMultiple($ids);
- uasort($domains, [$this, 'sort']);
- return $domains;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByHostname($hostname) {
- $hostname = $this->prepareHostname($hostname);
- $result = $this->loadByProperties(['hostname' => $hostname]);
- if (empty($result)) {
- return NULL;
- }
- return current($result);
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadOptionsList() {
- $list = [];
- foreach ($this->loadMultipleSorted() as $id => $domain) {
- $list[$id] = $domain->label();
- }
- return $list;
- }
-
- /**
- * {@inheritdoc}
- */
- public function sort(DomainInterface $a, DomainInterface $b) {
- return $a->getWeight() > $b->getWeight();
- }
-
- /**
- * {@inheritdoc}
- */
- public function prepareHostname($hostname) {
- // Strip www. prefix off the hostname.
- $ignore_www = $this->configFactory->get('domain.settings')->get('www_prefix');
- if ($ignore_www && substr($hostname, 0, 4) == 'www.') {
- $hostname = substr($hostname, 4);
- }
- return $hostname;
- }
-
- /**
- * {@inheritdoc}
- */
- public function create(array $values = []) {
- $default = $this->loadDefaultId();
- $domains = $this->loadMultiple();
- if (empty($values)) {
- $values['hostname'] = $this->createHostname();
- $values['name'] = \Drupal::config('system.site')->get('name');
- }
- $values += [
- 'scheme' => $this->getDefaultScheme(),
- 'status' => 1,
- 'weight' => count($domains) + 1,
- 'is_default' => (int) empty($default),
- ];
- $domain = parent::create($values);
-
- return $domain;
- }
-
- /**
- * {@inheritdoc}
- */
- public function createHostname() {
- // We cannot inject the negotiator due to dependencies.
- return \Drupal::service('domain.negotiator')->negotiateActiveHostname();
- }
-
- /**
- * {@inheritdoc}
- */
- public function createMachineName($hostname = NULL) {
- if (empty($hostname)) {
- $hostname = $this->createHostname();
- }
- return preg_replace('/[^a-z0-9_]/', '_', $hostname);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDefaultScheme() {
- // Use the foundation request if possible.
- $request = \Drupal::request();
- if (!empty($request)) {
- $scheme = $request->getScheme();
- }
- // Else use the server variable.
- elseif (!empty($_SERVER['https'])) {
- $scheme = 'https';
- }
- // Else fall through to default.
- else {
- $scheme = 'http';
- }
- return $scheme;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainStorageInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainStorageInterface.php
deleted file mode 100644
index 115a6c225..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainStorageInterface.php
+++ /dev/null
@@ -1,124 +0,0 @@
- label for use in forms.
- */
- public function loadOptionsList();
-
- /**
- * Sorts domains by weight.
- *
- * For use by loadMultipleSorted().
- *
- * @param DomainInterface $a
- * The first Domain object to sort.
- * @param DomainInterface $b
- * The Domain object to compare against.
- *
- * @return bool
- * Wether the first domain weight is greater or not.
- */
- public function sort(DomainInterface $a, DomainInterface $b);
-
- /**
- * Gets the entity field schema for domain records.
- *
- * @return array
- * An array representing the field schema of the object.
- */
- public function loadSchema();
-
- /**
- * Removes www. prefix from a hostname, if set.
- *
- * @param string $hostname
- * A hostname.
- *
- * @return string
- * The cleaned hostname.
- */
- public function prepareHostname($hostname);
-
- /**
- * Gets the hostname of the active request.
- *
- * @return string
- * The hostname string of the current request.
- */
- public function createHostname();
-
- /**
- * Creates a machine-name string from the hostname.
- *
- * This string is the primary key of the entity.
- *
- * @param string $hostname
- * The hostname of the domain record. If empty, the current request will be
- * used.
- *
- * @return string
- * A string containing A-Z, a-z, 0-9, and _ characters.
- */
- public function createMachineName($hostname = NULL);
-
- /**
- * Returns the default http/https scheme for the site.
- *
- * This function helps us account for variable schemes across environments.
- *
- * @return string
- * A string representation of s scheme (http|https).
- */
- public function getDefaultScheme();
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainToken.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainToken.php
deleted file mode 100644
index f6c217460..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainToken.php
+++ /dev/null
@@ -1,186 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->domainStorage = $this->entityTypeManager->getStorage('domain');
- $this->negotiator = $negotiator;
- }
-
- /**
- * Implements hook_token_info().
- */
- public function getTokenInfo() {
- // Domain token types.
- $info['types']['domain'] = [
- 'name' => $this->t('Domains'),
- 'description' => $this->t('Tokens related to domains.'),
- 'needs-data' => 'domain',
- ];
- // These two types require the Token contrib module.
- $info['types']['current-domain'] = [
- 'name' => $this->t('Current domain'),
- 'description' => $this->t('Tokens related to the current domain.'),
- 'type' => 'domain',
- ];
- $info['types']['default-domain'] = [
- 'name' => $this->t('Default domain'),
- 'description' => $this->t('Tokens related to the default domain.'),
- 'type' => 'domain',
- ];
-
- // Domain tokens.
- $info['tokens']['domain']['id'] = [
- 'name' => $this->t('Domain id'),
- 'description' => $this->t("The domain's numeric ID."),
- ];
- $info['tokens']['domain']['machine-name'] = [
- 'name' => $this->t('Domain machine name'),
- 'description' => $this->t('The domain machine identifier.'),
- ];
- $info['tokens']['domain']['path'] = [
- 'name' => $this->t('Domain path'),
- 'description' => $this->t('The base URL for the domain.'),
- ];
- $info['tokens']['domain']['name'] = [
- 'name' => $this->t('Domain name'),
- 'description' => $this->t('The domain name.'),
- ];
- $info['tokens']['domain']['url'] = [
- 'name' => $this->t('Domain URL'),
- 'description' => $this->t("The domain's URL for the current page request."),
- ];
- $info['tokens']['domain']['hostname'] = [
- 'name' => $this->t('Domain hostname'),
- 'description' => $this->t('The domain hostname.'),
- ];
- $info['tokens']['domain']['scheme'] = [
- 'name' => $this->t('Domain scheme'),
- 'description' => $this->t('The domain scheme.'),
- ];
- $info['tokens']['domain']['status'] = [
- 'name' => $this->t('Domain status'),
- 'description' => $this->t('The domain status.'),
- ];
- $info['tokens']['domain']['weight'] = [
- 'name' => $this->t('Domain weight'),
- 'description' => $this->t('The domain weight.'),
- ];
- $info['tokens']['domain']['is_default'] = [
- 'name' => $this->t('Domain default'),
- 'description' => $this->t('The domain is the default domain.'),
- ];
-
- return $info;
- }
-
- /**
- * Implements hook_tokens().
- */
- public function getTokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
- $replacements = [];
-
- $domain = NULL;
-
- // Based on the type, get the proper domain context.
- switch ($type) {
- case 'domain':
- if (!empty($data['domain'])) {
- $domain = $data['domain'];
- }
- else {
- $domain = $this->negotiator->getActiveDomain();
- }
- break;
-
- case 'current-domain':
- $domain = $this->negotiator->getActiveDomain();
- break;
-
- case 'default-domain':
- $domain = $this->domainStorage->loadDefaultDomain();
- break;
- }
-
- // Set the token information.
- if (!empty($domain)) {
- $callbacks = $this->getCallbacks();
- foreach ($tokens as $name => $original) {
- if (isset($callbacks[$name])) {
- $replacements[$original] = $domain->{$callbacks[$name]}();
- $bubbleable_metadata->addCacheableDependency($domain);
- }
- }
- }
-
- return $replacements;
- }
-
- /**
- * Maps tokens to their entity callbacks.
- *
- * We assume that the token will call an instance of DomainInterface.
- *
- * @return array
- * An array of callbacks keyed by the token string.
- */
- public function getCallbacks() {
- return [
- 'id' => 'getDomainId',
- 'machine-name' => 'id',
- 'path' => 'getPath',
- 'name' => 'label',
- 'hostname' => 'getHostname',
- 'scheme' => 'getScheme',
- 'status' => 'status',
- 'weight' => 'getWeight',
- 'is_default' => 'isDefault',
- 'url' => 'getUrl',
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainValidator.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainValidator.php
deleted file mode 100644
index 5d68100af..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainValidator.php
+++ /dev/null
@@ -1,152 +0,0 @@
-moduleHandler = $module_handler;
- $this->configFactory = $config_factory;
- $this->httpClient = $http_client;
- $this->entityTypeManager = $entity_type_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public function validate($hostname) {
- $error_list = [];
- // Check for at least one dot or the use of 'localhost'.
- // Note that localhost can specify a port.
- $localhost_check = explode(':', $hostname);
- if (substr_count($hostname, '.') == 0 && $localhost_check[0] != 'localhost') {
- $error_list[] = $this->t('At least one dot (.) is required, except when using localhost.');
- }
- // Check for one colon only.
- if (substr_count($hostname, ':') > 1) {
- $error_list[] = $this->t('Only one colon (:) is allowed.');
- }
- // If a colon, make sure it is only followed by numbers.
- elseif (substr_count($hostname, ':') == 1) {
- $parts = explode(':', $hostname);
- $port = (int) $parts[1];
- if (strcmp($port, $parts[1])) {
- $error_list[] = $this->t('The port protocol must be an integer.');
- }
- }
- // The domain cannot begin or end with a period.
- if (substr($hostname, 0, 1) == '.') {
- $error_list[] = $this->t('The domain must not begin with a dot (.)');
- }
- // The domain cannot begin or end with a period.
- if (substr($hostname, -1) == '.') {
- $error_list[] = $this->t('The domain must not end with a dot (.)');
- }
- // Check for valid characters, unless using non-ASCII domains.
- $config = $this->configFactory->get('domain.settings');
- $non_ascii = $config->get('allow_non_ascii');
- if (!$non_ascii) {
- $pattern = '/^[a-z0-9\.\-:]*$/i';
- if (!preg_match($pattern, $hostname)) {
- $error_list[] = $this->t('Only alphanumeric characters, dashes, and a colon are allowed.');
- }
- }
- // Check for lower case.
- if ($hostname != mb_strtolower($hostname)) {
- $error_list[] = $this->t('Only lower-case characters are allowed.');
- }
- // Check for 'www' prefix if redirection / handling is
- // enabled under global domain settings.
- // Note that www prefix handling must be set explicitly in the UI.
- // See http://drupal.org/node/1529316 and http://drupal.org/node/1783042
- if ($config->get('www_prefix') && (substr($hostname, 0, strpos($hostname, '.')) == 'www')) {
- $error_list[] = $this->t('WWW prefix handling: Domains must be registered without the www. prefix.');
- }
-
- // Allow modules to alter this behavior.
- $this->moduleHandler->alter('domain_validate', $error_list, $hostname);
-
- return $error_list;
- }
-
- /**
- * {@inheritdoc}
- */
- public function checkResponse(DomainInterface $domain) {
- $url = $domain->getPath() . drupal_get_path('module', 'domain') . '/tests/200.png';
- try {
- // GuzzleHttp no longer allows for bogus URL calls.
- $request = $this->httpClient->get($url);
- }
- // We cannot know which Guzzle Exception class will be returned; be generic.
- catch (RequestException $e) {
- // File a general server failure.
- $domain->setResponse(500);
- return $domain->getResponse();
- }
- // Expected result (i.e. no exception thrown.)
- $domain->setResponse($request->getStatusCode());
-
- return $domain->getResponse();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRequiredFields() {
- return ['hostname', 'name', 'scheme', 'status', 'weight'];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/DomainValidatorInterface.php b/sites/all/modules/contrib/admin/domain/domain/src/DomainValidatorInterface.php
deleted file mode 100644
index b1c349c20..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/DomainValidatorInterface.php
+++ /dev/null
@@ -1,45 +0,0 @@
-getStorage('domain');
- $default = $domain_storage->loadDefaultId();
- $count = $storage_controller->getQuery()->count()->execute();
- $values += [
- 'scheme' => empty($GLOBALS['is_https']) ? 'http' : 'https',
- 'status' => 1,
- 'weight' => $count + 1,
- 'is_default' => (int) empty($default),
- ];
- // Note that we have not created a domain_id, which is only used for
- // node access control and will be added on save.
- }
-
- /**
- * {@inheritdoc}
- */
- public function isActive() {
- $negotiator = \Drupal::service('domain.negotiator');
- /** @var self $domain */
- $domain = $negotiator->getActiveDomain();
- if (empty($domain)) {
- return FALSE;
- }
- return ($this->id() == $domain->id());
- }
-
- /**
- * {@inheritdoc}
- */
- public function addProperty($name, $value) {
- if (!isset($this->{$name})) {
- $this->{$name} = $value;
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function isDefault() {
- return (bool) $this->is_default;
- }
-
- /**
- * {@inheritdoc}
- */
- public function isHttps() {
- return (bool) ($this->getScheme(FALSE) == 'https');
- }
-
- /**
- * {@inheritdoc}
- */
- public function saveDefault() {
- if (!$this->isDefault()) {
- // Swap the current default.
- /** @var self $default */
- if ($default = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultDomain()) {
- $default->is_default = FALSE;
- $default->setHostname($default->getCanonical());
- $default->save();
- }
- // Save the new default.
- $this->is_default = TRUE;
- $this->setHostname($this->getCanonical());
- $this->save();
- }
- else {
- \Drupal::messenger()->addMessage($this->t('The selected domain is already the default.'), 'warning');
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function enable() {
- $this->setStatus(TRUE);
- $this->setHostname($this->getCanonical());
- $this->save();
- }
-
- /**
- * {@inheritdoc}
- */
- public function disable() {
- if (!$this->isDefault()) {
- $this->setStatus(FALSE);
- $this->setHostname($this->getCanonical());
- $this->save();
- }
- else {
- \Drupal::messenger()->addMessage($this->t('The default domain cannot be disabled.'), 'warning');
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function saveProperty($name, $value) {
- if (isset($this->{$name})) {
- $this->{$name} = $value;
- $this->setHostname($this->getCanonical());
- $this->save();
- \Drupal::messenger()->addMessage($this->t('The @key attribute was set to @value for domain @hostname.', [
- '@key' => $name,
- '@value' => $value,
- '@hostname' => $this->hostname,
- ]));
- }
- else {
- \Drupal::messenger()->addMessage($this->t('The @key attribute does not exist.', ['@key' => $name]));
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function setPath() {
- global $base_path;
- $this->path = $this->getScheme() . $this->getHostname() . ($base_path ?: '/');
- }
-
- /**
- * {@inheritdoc}
- */
- public function setUrl() {
- $request = \Drupal::request();
- $uri = $request ? $request->getRequestUri() : '/';
- $this->url = $this->getScheme() . $this->getHostname() . $uri;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getPath() {
- if (!isset($this->path)) {
- $this->setPath();
- }
- return $this->path;
- }
-
- /**
- * Returns the raw path of the domain object, without the base url.
- */
- public function getRawPath() {
- return $this->getScheme() . $this->getHostname();
- }
-
- /**
- * Builds a link from a known internal path.
- *
- * @param string $path
- * A Drupal-formatted internal path, starting with /. Note that it is the
- * caller's responsibility to handle the base_path().
- *
- * @return string
- * The built link.
- */
- public function buildUrl($path) {
- return $this->getRawPath() . $path;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getUrl() {
- if (!isset($this->url)) {
- $this->setUrl();
- }
- return $this->url;
- }
-
- /**
- * {@inheritdoc}
- */
- public function preSave(EntityStorageInterface $storage) {
- parent::preSave($storage);
- // Sets the default domain properly.
- /** @var self $default */
- $default = $storage->loadDefaultDomain();
- if (!$default) {
- $this->is_default = TRUE;
- }
- elseif ($this->is_default && $default->getDomainId() != $this->getDomainId()) {
- // Swap the current default.
- $default->is_default = FALSE;
- $default->save();
- }
- // Ensures we have a proper domain_id but does not erase existing ones.
- if ($this->isNew() && empty($this->getDomainId())) {
- $this->createDomainId();
- }
- // Prevent duplicate hostname.
- $hostname = $this->getHostname();
- // Do not use domain loader because it may change hostname.
- $existing = $storage->loadByProperties(['hostname' => $hostname]);
- $existing = reset($existing);
- if ($existing && $this->getDomainId() != $existing->getDomainId()) {
- throw new ConfigValueException("The hostname ($hostname) is already registered.");
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function postSave(EntityStorageInterface $storage, $update = TRUE) {
- parent::postSave($storage, $update);
- // Invalidate cache tags relevant to domains.
- \Drupal::service('cache_tags.invalidator')->invalidateTags(['rendered', 'url.site']);
- }
-
- /**
- * {@inheritdoc}
- */
- public static function postDelete(EntityStorageInterface $storage, array $entities) {
- parent::postDelete($storage, $entities);
- foreach ($entities as $entity) {
- $actions = $storage->loadMultiple([
- 'domain_default_action.' . $entity->id(),
- 'domain_delete_action.' . $entity->id(),
- 'domain_disable_action.' . $entity->id(),
- 'domain_enable_action.' . $entity->id(),
- ]);
- foreach ($actions as $action) {
- $action->delete();
- }
- }
- // Invalidate cache tags relevant to domains.
- \Drupal::service('cache_tags.invalidator')->invalidateTags(['rendered', 'url.site']);
- }
-
- /**
- * {@inheritdoc}
- */
- public function createDomainId() {
- // We cannot reliably use sequences (1, 2, 3) because those can be different
- // across environments. Instead, we use the crc32 hash function to create a
- // unique numeric id for each domain. In some systems (Windows?) we have
- // reports of crc32 returning a negative number. Issue #2794047.
- // If we don't use hash(), then crc32() returns different results for 32-
- // and 64-bit systems. On 32-bit systems, the number returned may also be
- // too large for PHP.
- // See #2908236.
- $id = hash('crc32', $this->id());
- $id = abs(hexdec(substr($id, 0, -2)));
- $this->createNumericId($id);
- }
-
- /**
- * Creates a unique numeric id for use in the {node_access} table.
- *
- * @param int $id
- * An integer to use as the numeric id.
- */
- public function createNumericId($id) {
- // Ensure that this value is unique.
- $storage = \Drupal::entityTypeManager()->getStorage('domain');
- $result = $storage->loadByProperties(['domain_id' => $id]);
- if (empty($result)) {
- $this->domain_id = $id;
- }
- else {
- $id++;
- $this->createNumericId($id);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function getScheme($add_suffix = TRUE) {
- $scheme = $this->scheme;
- if ($scheme == 'variable') {
- $scheme = \Drupal::entityTypeManager()->getStorage('domain')->getDefaultScheme();
- }
- elseif ($scheme != 'https') {
- $scheme = 'http';
- }
- $scheme .= ($add_suffix) ? '://' : '';
-
- return $scheme;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRawScheme() {
- return $this->scheme;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getResponse() {
- if (empty($this->response)) {
- $validator = \Drupal::service('domain.validator');
- $validator->checkResponse($this);
- }
- return $this->response;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setResponse($response) {
- $this->response = $response;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getLink($current_path = TRUE) {
- $options = ['absolute' => TRUE, 'https' => $this->isHttps()];
- if ($current_path) {
- $url = Url::fromUri($this->getUrl(), $options);
- }
- else {
- $url = Url::fromUri($this->getPath(), $options);
- }
-
- return Link::fromTextAndUrl($this->getCanonical(), $url)->toString();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRedirect() {
- return $this->redirect;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setRedirect($code = 302) {
- $this->redirect = $code;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getHostname() {
- return $this->hostname;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setHostname($hostname) {
- $this->hostname = $hostname;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDomainId() {
- return $this->domain_id;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getWeight() {
- return $this->weight;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setMatchType($match_type = DomainNegotiator::DOMAIN_MATCH_EXACT) {
- $this->matchType = $match_type;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getMatchType() {
- return $this->matchType;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getPort() {
- $ports = explode(':', $this->getHostname());
- if (isset($ports[1])) {
- return ':' . $ports[1];
- }
- return '';
- }
-
- /**
- * {@inheritdoc}
- */
- public function setCanonical($hostname = NULL) {
- if (is_null($hostname)) {
- $this->canonical = $this->getHostname();
- }
- else {
- $this->canonical = $hostname;
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCanonical() {
- if (empty($this->canonical)) {
- $this->setCanonical();
- }
- return $this->canonical;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/EventSubscriber/DomainSubscriber.php b/sites/all/modules/contrib/admin/domain/domain/src/EventSubscriber/DomainSubscriber.php
deleted file mode 100644
index a170d3bce..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/EventSubscriber/DomainSubscriber.php
+++ /dev/null
@@ -1,140 +0,0 @@
-domainNegotiator = $negotiator;
- $this->entityTypeManager = $entity_type_manager;
- $this->domainStorage = $this->entityTypeManager->getStorage('domain');
- $this->accessCheck = $access_check;
- $this->account = $account;
- }
-
- /**
- * Sets the domain context of the request.
- *
- * This method also determines the redirect status for the http request.
- *
- * Specifically, here we determine if a redirect is required. That happens
- * in one of two cases: an unauthorized request to an inactive domain is made;
- * a domain alias is set to redirect to its primary domain record.
- *
- * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
- * The Event to process.
- *
- * @see domain_alias_domain_request_alter
- */
- public function onKernelRequestDomain(GetResponseEvent $event) {
- // Negotiate the request and set domain context.
- /** @var \Drupal\domain\DomainInterface $domain */
- if ($domain = $this->domainNegotiator->getActiveDomain(TRUE)) {
- $hostname = $domain->getHostname();
- $domain_url = $domain->getUrl();
- if ($domain_url) {
- $redirect_status = $domain->getRedirect();
- $path = trim($event->getRequest()->getPathInfo(), '/');
- // If domain negotiation asked for a redirect, issue it.
- if (is_null($redirect_status) && $this->accessCheck->checkPath($path)) {
- // Else check for active domain or inactive access.
- /** @var \Drupal\Core\Access\AccessResult $access */
- $access = $this->accessCheck->access($this->account);
- // If the access check fails, reroute to the default domain.
- // Note that Allowed, Neutral, and Failed are the options here.
- // We insist on Allowed.
- if (!$access->isAllowed()) {
- /** @var \Drupal\domain\DomainInterface $default */
- $default = $this->domainStorage->loadDefaultDomain();
- $domain_url = $default->getUrl();
- $redirect_status = 302;
- $hostname = $default->getHostname();
- }
- }
- }
- if (!empty($redirect_status)) {
- // Pass a redirect if necessary.
- if (DomainRedirectResponse::checkTrustedHost($hostname)) {
- $response = new TrustedRedirectResponse($domain_url, $redirect_status);
- }
- else {
- // If the redirect is not to a registered hostname, reject the
- // request.
- $response = new Response('The provided host name is not a valid redirect.', 401);
- }
- $event->setResponse($response);
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getSubscribedEvents() {
- // This needs to fire very early in the stack, before accounts are cached.
- $events[KernelEvents::REQUEST][] = ['onKernelRequestDomain', 50];
- return $events;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainDeleteForm.php b/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainDeleteForm.php
deleted file mode 100644
index 589148614..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainDeleteForm.php
+++ /dev/null
@@ -1,45 +0,0 @@
-t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('domain.admin');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Delete');
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->entity->delete();
- \Drupal::messenger()->addMessage($this->t('Domain %label has been deleted.', ['%label' => $this->entity->label()]));
- \Drupal::logger('domain')->notice('Domain %label has been deleted.', ['%label' => $this->entity->label()]);
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainSettingsForm.php b/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainSettingsForm.php
deleted file mode 100644
index bc25dabc8..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Form/DomainSettingsForm.php
+++ /dev/null
@@ -1,97 +0,0 @@
-config('domain.settings');
- $form['allow_non_ascii'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Allow non-ASCII characters in domains and aliases'),
- '#default_value' => $config->get('allow_non_ascii'),
- '#description' => $this->t('Domains may be registered with international character sets. Note that not all DNS server respect non-ascii characters.'),
- ];
- $form['www_prefix'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Ignore www prefix when negotiating domains'),
- '#default_value' => $config->get('www_prefix'),
- '#description' => $this->t('Domain negotiation will ignore any www prefixes for all requests.'),
- ];
- // Get the usable tokens for this field.
- $patterns = [];
- foreach (\Drupal::service('domain.token')->getCallbacks() as $key => $callback) {
- $patterns[] = "[domain:$key]";
- }
- $form['css_classes'] = [
- '#type' => 'textfield',
- '#size' => 80,
- '#title' => $this->t('Custom CSS classes'),
- '#default_value' => $config->get('css_classes'),
- '#description' => $this->t('Enter any CSS classes that should be added to the <body> tag. Available replacement patterns are: @patterns', [
- '@patterns' => implode(', ', $patterns),
- ]),
- ];
- $form['login_paths'] = [
- '#type' => 'textarea',
- '#rows' => 5,
- '#columns' => 40,
- '#title' => $this->t('Paths that should be accessible for inactive domains'),
- '#default_value' => $config->get('login_paths'),
- '#description' => $this->t('Inactive domains are only accessible to users with permission.
- Enter any paths that should be accessible, one per line. Normally, only the
- login path will be allowed.'),
- ];
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $config = $this->config('domain.settings');
- foreach ($this->settingsKeys() as $key) {
- $config->set($key, $form_state->getValue($key));
- }
- $config->save();
- parent::submitForm($form, $form_state);
- }
-
- /**
- * Returns an array of settings keys.
- */
- public function settingsKeys() {
- return [
- 'allow_non_ascii',
- 'www_prefix',
- 'login_paths',
- 'css_classes',
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DefaultDomain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DefaultDomain.php
deleted file mode 100644
index f44253bef..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DefaultDomain.php
+++ /dev/null
@@ -1,47 +0,0 @@
-saveDefault();
- }
-
- /**
- * {@inheritdoc}
- */
- public function executeMultiple(array $objects) {
- foreach ($objects as $object) {
- if ($object instanceof DomainInterface) {
- $object->saveDefault();
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
- $access_result = AccessResult::allowedIfHasPermission($account, 'administer domains');
- return $return_as_object ? $access_result : $access_result->isAllowed();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DeleteDomain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DeleteDomain.php
deleted file mode 100644
index 0450a6d88..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DeleteDomain.php
+++ /dev/null
@@ -1,47 +0,0 @@
-delete();
- }
-
- /**
- * {@inheritdoc}
- */
- public function executeMultiple(array $objects) {
- foreach ($objects as $object) {
- if ($object instanceof DomainInterface) {
- $object->delete();
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
- $access_result = AccessResult::allowedIfHasPermission($account, 'administer domains');
- return $return_as_object ? $access_result : $access_result->isAllowed();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DisableDomain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DisableDomain.php
deleted file mode 100644
index f227f0604..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/DisableDomain.php
+++ /dev/null
@@ -1,47 +0,0 @@
-disable();
- }
-
- /**
- * {@inheritdoc}
- */
- public function executeMultiple(array $objects) {
- foreach ($objects as $object) {
- if ($object instanceof DomainInterface) {
- $object->disable();
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
- $access_result = AccessResult::allowedIfHasPermission($account, 'administer domains');
- return $return_as_object ? $access_result : $access_result->isAllowed();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/EnableDomain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/EnableDomain.php
deleted file mode 100644
index 0b9deab27..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Action/EnableDomain.php
+++ /dev/null
@@ -1,47 +0,0 @@
-enable();
- }
-
- /**
- * {@inheritdoc}
- */
- public function executeMultiple(array $objects) {
- foreach ($objects as $object) {
- if ($object instanceof DomainInterface) {
- $object->enable();
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
- $access_result = AccessResult::allowedIfHasPermission($account, 'administer domains');
- return $return_as_object ? $access_result : $access_result->isAllowed();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainBlockBase.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainBlockBase.php
deleted file mode 100644
index ccc8d0643..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainBlockBase.php
+++ /dev/null
@@ -1,20 +0,0 @@
-getSetting('link_options') == 'home') {
- return ['url.site'];
- }
- return ['url'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function blockForm($form, FormStateInterface $form_state) {
- $defaults = $this->defaultConfiguration();
- $elements['link_options'] = [
- '#title' => $this->t('Link paths'),
- '#type' => 'radios',
- '#required' => TRUE,
- '#options' => ['active' => $this->t('Link to active url'), 'home' => $this->t('Link to site home page')],
- '#default_value' => !empty($this->configuration['link_options']) ? $this->configuration['link_options'] : $defaults['link_options'],
- '#description' => $this->t('Determines how links to each domain will be written. Note that some paths may not be accessible on all domains.'),
- ];
- $options = [
- 'select' => $this->t('JavaScript select list'),
- 'menus' => $this->t('Menu-style tab links'),
- 'ul' => $this->t('Unordered list of links'),
- ];
- $elements['link_theme'] = [
- '#type' => 'radios',
- '#title' => t('Link theme'),
- '#default_value' => !empty($this->configuration['link_theme']) ? $this->configuration['link_theme'] : $defaults['link_theme'],
- '#options' => $options,
- '#description' => $this->t('Select how to display the block output.'),
- ];
- $options = [
- 'name' => $this->t('The domain display name'),
- 'hostname' => $this->t('The raw hostname'),
- 'url' => $this->t('The domain base URL'),
- ];
- $elements['link_label'] = [
- '#type' => 'radios',
- '#title' => $this->t('Link text'),
- '#default_value' => !empty($this->configuration['link_label']) ? $this->configuration['link_label'] : $defaults['link_label'],
- '#options' => $options,
- '#description' => $this->t('Select the text to display for each link.'),
- ];
- return $elements;
- }
-
- /**
- * {@inheritdoc}
- */
- public function blockSubmit($form, FormStateInterface $form_state) {
- // Process the block's submission handling if no errors occurred only.
- if (!$form_state->getErrors()) {
- foreach (array_keys($this->defaultConfiguration()) as $element) {
- $this->configuration[$element] = $form_state->getValue($element);
- }
- }
- }
-
- /**
- * Overrides \Drupal\block\BlockBase::access().
- */
- public function access(AccountInterface $account, $return_as_object = FALSE) {
- $access = AccessResult::allowedIfHasPermissions($account, ['administer domains', 'use domain nav block'], 'OR');
- return $return_as_object ? $access : $access->isAllowed();
- }
-
- /**
- * Build the output.
- */
- public function build() {
- /** @var \Drupal\domain\DomainInterface $active_domain */
- $active_domain = \Drupal::service('domain.negotiator')->getActiveDomain();
- $access_handler = \Drupal::entityTypeManager()->getAccessControlHandler('domain');
- $account = \Drupal::currentUser();
-
- // Determine the visible domain list.
- $items = [];
- $add_path = ($this->getSetting('link_options') == 'active');
- /** @var \Drupal\domain\DomainInterface $domain */
- foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted() as $domain) {
- // Set the URL.
- $options = ['absolute' => TRUE, 'https' => ($domain->getScheme() == 'https')];
- if ($add_path) {
- $url = Url::fromUri($domain->getUrl(), $options);
- }
- else {
- $url = Url::fromUri($domain->getPath(), $options);
- }
- // Set the label text.
- $label = $domain->label();
- if ($this->getSetting('link_label') == 'hostname') {
- $label = $domain->getHostname();
- }
- elseif ($this->getSetting('link_label') == 'url') {
- $label = $domain->getPath();
- }
- // Handles menu links.
- if ($domain->status() || $account->hasPermission('access inactive domains')) {
- if ($this->getSetting('link_theme') == 'menus') {
- // @TODO: active trail isn't working properly, likely because this
- // isn't really a menu.
- $items[] = [
- 'title' => $label,
- 'url' => $url,
- 'attributes' => [],
- 'below' => [],
- 'is_expanded' => FALSE,
- 'is_collapsed' => FALSE,
- 'in_active_trail' => $domain->isActive(),
- ];
- }
- elseif ($this->getSetting('link_theme') == 'select') {
- $items[] = [
- 'label' => $label,
- 'url' => $url->toString(),
- 'active' => $domain->isActive(),
- ];
- }
- else {
- $items[] = ['#markup' => Link::fromTextAndUrl($label, $url)->toString()];
- }
- }
- }
-
- // Set the proper theme.
- switch ($this->getSetting('link_theme')) {
- case 'select':
- $build['#theme'] = 'domain_nav_block';
- $build['#items'] = $items;
- break;
-
- case 'menus':
- // Map the $items params to what menu.html.twig expects.
- $build['#items'] = $items;
- $build['#menu_name'] = 'domain-nav';
- $build['#sorted'] = TRUE;
- $build['#theme'] = 'menu__' . strtr($build['#menu_name'], '-', '_');
- break;
-
- case 'ul':
- default:
- $build['#theme'] = 'item_list';
- $build['#items'] = $items;
- break;
- }
-
- return $build;
- }
-
- /**
- * {@inheritdoc}
- */
- public function defaultConfiguration() {
- return [
- 'link_options' => 'home',
- 'link_theme' => 'ul',
- 'link_label' => 'name',
- ];
- }
-
- /**
- * Gets the configuration for the block, loading defaults if not set.
- *
- * @param string $key
- * The setting key to retrieve, a string.
- *
- * @return string
- * The setting value, a string.
- */
- public function getSetting($key) {
- if (isset($this->settings[$key])) {
- return $this->settings[$key];
- }
- $defaults = $this->defaultConfiguration();
- if (isset($this->configuration[$key])) {
- $this->settings[$key] = $this->configuration[$key];
- }
- else {
- $this->settings[$key] = $defaults[$key];
- }
- return $this->settings[$key];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainServerBlock.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainServerBlock.php
deleted file mode 100644
index a2b0bfc1c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainServerBlock.php
+++ /dev/null
@@ -1,144 +0,0 @@
-isAllowed();
- }
-
- /**
- * Build the output.
- */
- public function build() {
- /** @var \Drupal\domain\DomainInterface $domain */
- $domain = \Drupal::service('domain.negotiator')->getActiveDomain();
- if (!$domain) {
- return [
- '#markup' => $this->t('No domain record could be loaded.'),
- ];
- }
- $header = [$this->t('Server'), $this->t('Value')];
- $rows[] = [
- $this->t('HTTP_HOST request'),
- Html::escape($_SERVER['HTTP_HOST']),
- ];
- // Check the response test.
- $domain->getResponse();
- $check = \Drupal::entityTypeManager()->getStorage('domain')->loadByHostname($_SERVER['HTTP_HOST']);
- $match = $this->t('Exact match');
- // This value is not translatable.
- $environment = 'default';
- if (!$check) {
- // Specific check for Domain Alias.
- if (isset($domain->alias)) {
- $match = $this->t('ALIAS: Using alias %id', ['%id' => $domain->alias->getPattern()]);
- // Get the environment.
- $environment = $domain->alias->getEnvironment();
- }
- else {
- $match = $this->t('FALSE: Using default domain.');
- }
- }
- $rows[] = [
- $this->t('Domain match'),
- $match,
- ];
- $rows[] = [
- $this->t('Environment'),
- $environment,
- ];
- $rows[] = [
- $this->t('Canonical hostname'),
- $domain->getCanonical(),
- ];
- $rows[] = [
- $this->t('Base path'),
- $domain->getPath(),
- ];
- $rows[] = [
- $this->t('Current URL'),
- $domain->getUrl(),
- ];
-
- $www = \Drupal::config('domain.settings')->get('www_prefix');
- $rows[] = [
- $this->t('Strip www prefix'),
- !empty($www) ? $this->t('On') : $this->t('Off'),
- ];
- $list = $domain->toArray();
- ksort($list);
- foreach ($list as $key => $value) {
- if (is_null($value)) {
- $value = $this->t('NULL');
- }
- elseif ($value === TRUE) {
- $value = $this->t('TRUE');
- }
- elseif ($value === FALSE) {
- $value = $this->t('FALSE');
- }
- elseif ($key == 'status' || $key == 'is_default') {
- $value = empty($value) ? $this->t('FALSE') : $this->t('TRUE');
- }
- $rows[] = [
- Html::escape($key),
- !is_array($value) ? Html::escape($value) : $this->printArray($value),
- ];
- }
- return [
- '#theme' => 'table',
- '#rows' => $rows,
- '#header' => $header,
- ];
- }
-
- /**
- * Prints array data for the server block.
- *
- * @param array $array
- * An array of data. Note that we support two levels of nesting.
- *
- * @return string
- * A suitable output string.
- */
- public function printArray(array $array) {
- $items = [];
- foreach ($array as $key => $val) {
- if (!is_array($val)) {
- $value = Html::escape($val);
- }
- else {
- $list = [];
- foreach ($val as $k => $v) {
- $list[] = $this->t('@key : @value', ['@key' => $k, '@value' => $v]);
- }
- $value = implode(' ', $list);
- }
- $items[] = $this->t('@key : @value', ['@key' => $key, '@value' => $value]);
- }
- $variables['domain_server'] = [
- '#theme' => 'item_list',
- '#items' => $items,
- ];
- return render($variables);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainSwitcherBlock.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainSwitcherBlock.php
deleted file mode 100644
index 25428f5a9..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainSwitcherBlock.php
+++ /dev/null
@@ -1,50 +0,0 @@
-isAllowed();
- }
-
- /**
- * Build the output.
- */
- public function build() {
- /** @var \Drupal\domain\DomainInterface $active_domain */
- $active_domain = \Drupal::service('domain.negotiator')->getActiveDomain();
- $items = [];
- /** @var \Drupal\domain\DomainInterface $domain */
- foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted() as $domain) {
- $string = $domain->getLink();
- if (!$domain->status()) {
- $string .= '*';
- }
- if ($domain->id() == $active_domain->id()) {
- $string = '' . $string . '';
- }
- $items[] = ['#markup' => $string];
- }
- return [
- '#theme' => 'item_list',
- '#items' => $items,
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainTokenBlock.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainTokenBlock.php
deleted file mode 100644
index 30fb54efd..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Block/DomainTokenBlock.php
+++ /dev/null
@@ -1,81 +0,0 @@
-isAllowed();
- }
-
- /**
- * Build the output.
- */
- public function build() {
- /** @var \Drupal\domain\DomainInterface $domain */
- $domain = \Drupal::service('domain.negotiator')->getActiveDomain();
- if (!$domain) {
- return [
- '#markup' => $this->t('No domain record could be loaded.'),
- ];
- }
- $header = [$this->t('Token'), $this->t('Value')];
- return [
- '#theme' => 'table',
- '#rows' => $this->renderTokens($domain),
- '#header' => $header,
- ];
- }
-
- /**
- * Generates available tokens for printing.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * The active domain request.
- *
- * @return array
- * An array keyed by token name, with value of replacement value.
- */
- private function renderTokens(DomainInterface $domain) {
- $rows = [];
- $token = \Drupal::token();
- $tokens = $token->getInfo();
- // The 'domain' token is supported by core. The others by Token module,
- // so we cannot assume that Token module is present.
- $domain_tokens = ['domain', 'current-domain', 'default-domain'];
- foreach ($domain_tokens as $key) {
- if (isset($tokens['tokens'][$key])) {
- $data = [];
- // Pass domain data to the default handler.
- if ($key == 'domain') {
- $data['domain'] = $domain;
- }
- foreach ($tokens['tokens'][$key] as $name => $info) {
- $string = "[$key:$name]";
- $rows[] = [
- $string,
- $token->replace($string, $data),
- ];
- }
- }
- }
- return $rows;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Condition/Domain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Condition/Domain.php
deleted file mode 100644
index 7347401b4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/Condition/Domain.php
+++ /dev/null
@@ -1,150 +0,0 @@
-domainNegotiator = $domain_negotiator;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $container->get('domain.negotiator'),
- $configuration,
- $plugin_id,
- $plugin_definition
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
- $form['domains'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('When the following domains are active'),
- '#default_value' => $this->configuration['domains'],
- '#options' => array_map('\Drupal\Component\Utility\Html::escape', \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList()),
- '#description' => $this->t('If you select no domains, the condition will evaluate to TRUE for all requests.'),
- '#attached' => [
- 'library' => [
- 'domain/drupal.domain',
- ],
- ],
- ];
- $form = parent::buildConfigurationForm($form, $form_state);
- if (isset($form['context_mapping']['entity:domain']['#title'])) {
- $form['context_mapping']['entity:domain']['#title'] = $this->t('Select the Domain condition');
- $form['context_mapping']['entity:domain']['#description'] = $this->t('This value must be set to "Active domain" for the context to work.');
- }
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function defaultConfiguration() {
- return [
- 'domains' => [],
- ] + parent::defaultConfiguration();
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $this->configuration['domains'] = array_filter($form_state->getValue('domains'));
- parent::submitConfigurationForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function summary() {
- // Use the domain labels. They will be sanitized below.
- $domains = array_intersect_key(\Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList(), $this->configuration['domains']);
- if (count($domains) > 1) {
- $domains = implode(', ', $domains);
- }
- else {
- $domains = reset($domains);
- }
- if ($this->isNegated()) {
- return $this->t('Active domain is not @domains', ['@domains' => $domains]);
- }
- else {
- return $this->t('Active domain is @domains', ['@domains' => $domains]);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function evaluate() {
- $domains = $this->configuration['domains'];
- if (empty($domains) && !$this->isNegated()) {
- return TRUE;
- }
- // If the context did not load, derive from the request.
- if (!$domain = $this->getContextValue('entity:domain')) {
- $domain = $this->domainNegotiator->getActiveDomain();
- }
- // No context found?
- if (empty($domain)) {
- return FALSE;
- }
- // NOTE: The context system handles negation for us.
- return (bool) in_array($domain->id(), $domains);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheContexts() {
- $contexts = parent::getCacheContexts();
- $contexts[] = 'url.site';
- return $contexts;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/EntityReferenceSelection/DomainAdminSelection.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/EntityReferenceSelection/DomainAdminSelection.php
deleted file mode 100644
index 556660215..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/EntityReferenceSelection/DomainAdminSelection.php
+++ /dev/null
@@ -1,34 +0,0 @@
-currentUser->hasPermission('administer domains')) {
- return $query;
- }
- // Can this user access inactive domains?
- if (!$this->currentUser->hasPermission('access inactive domains')) {
- $query->condition('status', 1);
- }
- // Filter domains by the user's assignments, which are controlled by other
- // modules. Those modules must know what type of entity they are dealing
- // with, so look up the entity type and bundle.
- $info = $query->getMetaData('entity_reference_selection_handler');
-
- if (!empty($info->configuration['entity'])) {
- $context['entity_type'] = $info->configuration['entity']->getEntityTypeId();
- $context['bundle'] = $info->configuration['entity']->bundle();
- $context['field_type'] = $this->fieldType;
-
- // Load the current user.
- $account = User::load($this->currentUser->id());
- // Run the alter hook.
- $this->moduleHandler->alter('domain_references', $query, $account, $context);
- }
-
- return $query;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
- $selection_handler_settings = $this->configuration['handler_settings'];
-
- // Merge-in default values.
- $selection_handler_settings += [
- // For the 'target_bundles' setting, a NULL value is equivalent to "allow
- // entities from any bundle to be referenced" and an empty array value is
- // equivalent to "no entities from any bundle can be referenced".
- 'target_bundles' => NULL,
- 'sort' => [
- 'field' => 'weight',
- 'direction' => 'ASC',
- ],
- 'auto_create' => FALSE,
- 'default_selection' => 'current',
- ];
-
- $form['target_bundles'] = [
- '#type' => 'value',
- '#value' => NULL,
- ];
-
- $fields = [
- 'weight' => $this->t('Weight'),
- 'label' => $this->t('Name'),
- 'hostname' => $this->t('Hostname'),
- ];
-
- $form['sort']['field'] = [
- '#type' => 'select',
- '#title' => $this->t('Sort by'),
- '#options' => $fields,
- '#ajax' => FALSE,
- '#default_value' => $selection_handler_settings['sort']['field'],
- ];
-
- $form['sort']['direction'] = [
- '#type' => 'select',
- '#title' => $this->t('Sort direction'),
- '#required' => TRUE,
- '#options' => [
- 'ASC' => $this->t('Ascending'),
- 'DESC' => $this->t('Descending'),
- ],
- '#default_value' => $selection_handler_settings['sort']['direction'],
- ];
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/migrate/source/d7/DomainRecord.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/migrate/source/d7/DomainRecord.php
deleted file mode 100644
index 2b2945c9f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/migrate/source/d7/DomainRecord.php
+++ /dev/null
@@ -1,57 +0,0 @@
-select('domain', 'd')->fields('d', $fields);
- }
-
- /**
- * {@inheritdoc}
- */
- public function fields() {
- return [
- 'domain_id' => $this->t('Domain ID.'),
- 'subdomain' => $this->t('Subdomain.'),
- 'sitename' => $this->t('Sitename.'),
- 'scheme' => $this->t('Scheme.'),
- 'valid' => $this->t('Valid.'),
- 'weight' => $this->t('Weight.'),
- 'is_default' => $this->t('Is default.'),
- 'machine_name' => $this->t('Machine name.'),
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getIds() {
- return ['domain_id' => ['type' => 'integer']];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/views/access/Domain.php b/sites/all/modules/contrib/admin/domain/domain/src/Plugin/views/access/Domain.php
deleted file mode 100644
index 69ae30ab2..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Plugin/views/access/Domain.php
+++ /dev/null
@@ -1,188 +0,0 @@
-domainStorage = $domain_storage;
- $this->domainNegotiator = $domain_negotiator;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('entity_type.manager')->getStorage('domain'),
- $container->get('domain.negotiator')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function access(AccountInterface $account) {
- $id = $this->domainNegotiator->getActiveId();
- $options = array_filter($this->options['domain']);
- return isset($options[$id]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function alterRouteDefinition(Route $route) {
- if ($this->options['domain']) {
- $route->setRequirement('_domain', (string) implode('+', $this->options['domain']));
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function summaryTitle() {
- $count = count($this->options['domain']);
- if ($count < 1) {
- return $this->t('No domain(s) selected');
- }
- elseif ($count > 1) {
- return $this->t('Multiple domains');
- }
- else {
- $domains = $this->domainStorage->loadOptionsList();
- $domain = reset($this->options['domain']);
- return $domains[$domain];
- }
- }
-
- /**
- * {@inheritdoc}
- */
- protected function defineOptions() {
- $options = parent::defineOptions();
- $options['domain'] = ['default' => []];
-
- return $options;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildOptionsForm(&$form, FormStateInterface $form_state) {
- parent::buildOptionsForm($form, $form_state);
- $form['domain'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('Domain'),
- '#default_value' => $this->options['domain'],
- '#options' => $this->domainStorage->loadOptionsList(),
- '#description' => $this->t('Only the checked domain(s) will be able to access this display.'),
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateOptionsForm(&$form, FormStateInterface $form_state) {
- $domain = $form_state->getValue(['access_options', 'domain']);
- $domain = array_filter($domain);
-
- if (!$domain) {
- $form_state->setError($form['domain'], $this->t('You must select at least one domain if type is "by domain"'));
- }
-
- $form_state->setValue(['access_options', 'domain'], $domain);
- }
-
- /**
- * {@inheritdoc}
- */
- public function calculateDependencies() {
- $dependencies = parent::calculateDependencies();
-
- foreach (array_keys($this->options['domain']) as $id) {
- if ($domain = $this->domainStorage->load($id)) {
- $dependencies[$domain->getConfigDependencyKey()][] = $domain->getConfigDependencyName();
- }
- }
-
- return $dependencies;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheMaxAge() {
- return Cache::PERMANENT;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheContexts() {
- return ['url.site'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheTags() {
- return [];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/src/Tests/DomainTestBase.php b/sites/all/modules/contrib/admin/domain/domain/src/Tests/DomainTestBase.php
deleted file mode 100644
index a66295a3b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/src/Tests/DomainTestBase.php
+++ /dev/null
@@ -1,105 +0,0 @@
-baseHostname or the
- * domainCreateTestDomains() method.
- *
- * @var string
- */
- public $baseHostname;
-
- /**
- * Modules to enable.
- *
- * @var array
- */
- public static $modules = ['domain', 'node'];
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- parent::setUp();
-
- // Create Basic page and Article node types.
- if ($this->profile != 'standard') {
- $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
- }
-
- // Set the base hostname for domains.
- $this->setBaseHostname();
- }
-
- /**
- * Returns whether a given user account is logged in.
- *
- * @param \Drupal\user\UserInterface $account
- * The user account object to check.
- *
- * @return bool
- * TRUE if a given user account is logged in, or FALSE.
- */
- protected function drupalUserIsLoggedIn(UserInterface $account) {
- // @TODO: This is a temporary hack for the test login fails when setting $cookie_domain.
- if (!isset($account->session_id)) {
- return (bool) $account->id();
- }
- // The session ID is hashed before being stored in the database.
- // @see \Drupal\Core\Session\SessionHandler::read()
- return (bool) db_query("SELECT sid FROM {users_field_data} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = :sid", [':sid' => Crypt::hashBase64($account->session_id)])->fetchField();
- }
-
- /**
- * Login a user on a specific domain.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * The domain to log the user into.
- * @param \Drupal\user\UserInterface $account
- * The user account to login.
- */
- public function domainLogin(DomainInterface $domain, UserInterface $account) {
- if ($this->loggedInUser) {
- $this->drupalLogout();
- }
-
- // Login.
- $url = $domain->getPath() . 'user/login';
- $edit = ['name' => $account->getAccountName(), 'pass' => $account->passRaw];
- $this->drupalPostForm($url, $edit, t('Log in'));
-
- // @see WebTestBase::drupalUserIsLoggedIn()
- if (isset($this->sessionId)) {
- $account->session_id = $this->sessionId;
- }
- $pass = $this->assert($this->drupalUserIsLoggedIn($account), new FormattableMarkup('User %name successfully logged in.', ['%name' => $account->getUsername()]), 'User login');
- if ($pass) {
- $this->loggedInUser = $account;
- $this->container->get('current_user')->setAccount($account);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/templates/domain-nav-block.html.twig b/sites/all/modules/contrib/admin/domain/domain/templates/domain-nav-block.html.twig
deleted file mode 100644
index d2d4c0aca..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/templates/domain-nav-block.html.twig
+++ /dev/null
@@ -1,32 +0,0 @@
-{#
-/**
- * @file
- * Custom theme implementation for a select-and-go menu list.
- *
- * Available variables:
- * - items: A list of items containing an array of strings.
- * - label: the label text
- * - url: the link url string
- * - active: indicates if the domain is currently active.
- *
- * @ingroup themeable
- */
-#}
-{%- if items -%}
-
-{%- else -%}
- {{- empty -}}
-{%- endif -%}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/200.png b/sites/all/modules/contrib/admin/domain/domain/tests/200.png
deleted file mode 100644
index d6152bd3c0dafa162b6bf93aeafa34f8bea930de..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 593
zcmV-X0zW{8v8EKj1?C?pQ(!$r{ONp<)(A#R8x=DwwG>^zYh_tH9-}w6b
zGK9BSlC-nO)NZfX0Cc_Y^!DiP^6vBYrohmDyWpL?!E@#|%09%|tm(Bohxa95gs>s@sxX-1-
z)BtzDEqSIFdbiu|`rGUE1a-Shkh@2Ps{nAkJC@A=UzrblzW`sKxy{)}im|Q6)_1Pa
zsm0ciwaXWGvjA?n2zR{F=JQXV&=q#FMTM;E@bq<}y#RB&{r>(>hp8nuVZ8tV0H#Sq
zK~#9!VqgFP7H$SOkchF6gEBR=o#h4mB=taSeI*7XekLJlO;ZL2)@c7^OHM{cMjtf?
z2Jg^tb|xU3ky+G`f!Caakpn1`As*($kiyK!o){>@#2mrK#}KdUt`m@CYv(HL8O#tA
zq6#uoU5tUjm?1X74aind*79J8WZ+SBaddProperty('foo', 'bar');
- }
-}
-
-/**
- * Implements hook_domain_validate_alter().
- */
-function domain_test_domain_validate_alter(&$error_list, $hostname) {
- // Deliberate test fail.
- if ($hostname == 'fail.example.com') {
- $error_list[] = 'Fail.example.com cannot be registered';
- }
-}
-
-/**
- * Implements hook_domain_request_alter().
- */
-function domain_test_domain_request_alter(DomainInterface &$domain) {
- $domain->addProperty('foo1', 'bar1');
-}
-
-/**
- * Implements hook_domain_operations().
- */
-function domain_test_domain_operations(DomainInterface $domain) {
- $operations = [];
- // Add aliases to the list.
- $id = $domain->id();
- $operations['domain_test'] = [
- 'title' => t('Test'),
- 'url' => Url::fromRoute('entity.domain.edit_form', ['domain' => $id]),
- 'weight' => 80,
- ];
- return $operations;
-}
-
-/**
- * Implements hook_domain_references_alter().
- */
-function domain_test_domain_references_alter($query, $account, $context) {
- if ($context['entity_type'] == 'node') {
- $test = 'Test string';
- $query->addMetadata('domain_test', $test);
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/Condition/DomainConditionTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/Condition/DomainConditionTest.php
deleted file mode 100644
index 2462d13f3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/Condition/DomainConditionTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-manager = $this->container->get('plugin.manager.condition');
-
- // Create test domains.
- $this->domainCreateTestDomains(5);
-
- // Get two sample domains.
- $this->domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $this->testDomain = array_shift($this->domains);
- $this->notDomain = array_shift($this->domains);
- }
-
- /**
- * Test the domain condition.
- */
- public function testConditions() {
- // Grab the domain condition and configure it to check against one domain.
- $condition = $this->manager->createInstance('domain')
- ->setConfig('domains', [$this->testDomain->id() => $this->testDomain->id()])
- ->setContextValue('entity:domain', $this->notDomain);
- $this->assertFalse($condition->execute(), 'Domain request condition fails on wrong domain.');
-
- // Grab the domain condition and configure it to check against itself.
- $condition = $this->manager->createInstance('domain')
- ->setConfig('domains', [$this->testDomain->id() => $this->testDomain->id()])
- ->setContextValue('entity:domain', $this->testDomain);
- $this->assertTrue($condition->execute(), 'Domain request condition succeeds on matching domain.');
-
- // Check for the proper summary.
- // Summaries require an extra space due to negate handling in summary().
- $this->assertEqual($condition->summary(), 'Active domain is ' . $this->testDomain->label());
-
- // Check the negated summary.
- $condition->setConfig('negate', TRUE);
- $this->assertEqual($condition->summary(), 'Active domain is not ' . $this->testDomain->label());
-
- // Check the negated condition.
- $this->assertFalse($condition->execute(), 'Domain request condition fails when condition negated.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainActionsTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainActionsTest.php
deleted file mode 100644
index 7c3b93b31..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainActionsTest.php
+++ /dev/null
@@ -1,100 +0,0 @@
-admin_user = $this->drupalCreateUser(['administer domains', 'access administration pages']);
- $this->drupalLogin($this->admin_user);
-
- $path = 'admin/config/domain';
-
- // Create test domains.
- $this->domainCreateTestDomains(4);
-
- // Visit the domain overview administration page.
- $this->drupalGet($path);
- $this->assertResponse(200);
-
- // Test the domains.
- $storage = \Drupal::entityTypeManager()->getStorage('domain');
- $domains = $storage->loadMultiple();
- $this->assertTrue(count($domains) == 4, 'Four domain records found.');
-
- // Check the default domain.
- $default = $storage->loadDefaultId();
- $key = 'example_com';
- $this->assertTrue($default == $key, 'Default domain set correctly.');
-
- // Test some text on the page.
- foreach ($domains as $domain) {
- $name = $domain->label();
- $this->assertText($name, 'Name found properly.');
- }
- // Test the list of actions.
- $actions = ['delete', 'disable', 'default'];
- foreach ($actions as $action) {
- $this->assertRaw("/domain/{$action}/", 'Actions found properly.');
- }
- // Check that all domains are active.
- $this->assertNoRaw('Inactive', 'Inactive domain not found.');
-
- // Disable a domain and test the enable link.
- $this->clickLink('Disable', 0);
- $this->assertRaw('Inactive', 'Inactive domain found.');
-
- // Visit the domain overview administration page to clear cache.
- $this->drupalGet($path);
- $this->assertResponse(200);
-
- foreach ($storage->loadMultiple() as $domain) {
- if ($domain->id() == 'one_example_com') {
- $this->assertEmpty($domain->status(), 'One domain inactive.');
- }
- else {
- $this->assertNotEmpty($domain->status(), 'Other domains active.');
- }
- }
-
- // Test the list of actions.
- $actions = ['enable', 'delete', 'disable', 'default'];
- foreach ($actions as $action) {
- $this->assertRaw("/domain/{$action}/", 'Actions found properly.');
- }
- // Re-enable the domain.
- $this->clickLink('Enable', 0);
- $this->assertNoRaw('Inactive', 'Inactive domain not found.');
-
- // Visit the domain overview administration page to clear cache.
- $this->drupalGet($path);
- $this->assertResponse(200);
-
- foreach ($storage->loadMultiple() as $domain) {
- $this->assertNotEmpty($domain->status(), 'All domains active.');
- }
-
- // Set a new default domain.
- $this->clickLink('Make default', 0);
-
- // Visit the domain overview administration page to clear cache.
- $this->drupalGet($path);
- $this->assertResponse(200);
-
- // Check the default domain.
- $storage->resetCache();
- $default = $storage->loadDefaultId();
- $key = 'one_example_com';
- $this->assertTrue($default == $key, 'Default domain set correctly.');
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainAdminElementTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainAdminElementTest.php
deleted file mode 100644
index befc13fb6..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainAdminElementTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-domainCreateTestDomains(5);
- }
-
- /**
- * Basic test setup.
- */
- public function testDomainAccessElement() {
- $admin = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer users',
- 'administer domains',
- ]);
- $this->drupalLogin($admin);
-
- $this->drupalGet('admin/people/create');
- $this->assertSession()->statusCodeEquals(200);
-
- // Create a user through the form.
- $this->fillField('name', 'testuser');
- $this->fillField('mail', 'test@example.com');
- $this->fillField('pass[pass1]', 'test');
- $this->fillField('pass[pass2]', 'test');
-
- // We expect to find 5 domain options. We set two as selected.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $count = 0;
- $ids = ['example_com', 'one_example_com', 'two_example_com'];
- foreach ($domains as $domain) {
- $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if (in_array($domain->id(), $ids)) {
- $this->checkField($locator);
- }
- }
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- $storage = \Drupal::entityTypeManager()->getStorage('user');
- $user = $storage->load(3);
- // Check that two values are set.
- $manager = \Drupal::service('domain.element_manager');
- $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 3, 'User saved with three domain records.');
-
- // Now login as a user with limited rights.
- $account = $this->drupalCreateUser([
- 'administer users',
- 'assign domain administrators',
- ]);
- $ids = ['example_com', 'one_example_com'];
- $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ADMIN_FIELD);
- $tester = $storage->load($account->id());
- $values = $manager->getFieldValues($tester, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain records.');
- $storage->resetCache([$account->id()]);
- $this->drupalLogin($account);
-
- $this->drupalGet('user/' . $user->id() . '/edit');
- $this->assertSession()->statusCodeEquals(200);
-
- foreach ($domains as $domain) {
- $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if ($domain->id() == 'example_com') {
- $this->checkField($locator);
- }
- elseif ($domain->id() == 'one_example_com') {
- $this->uncheckField($locator);
- }
- else {
- $this->assertSession()->fieldNotExists($locator);
- }
- }
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Now, check the user.
- $storage->resetCache([$user->id()]);
- $user = $storage->load($user->id());
- // Check that two values are set.
- $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain records.');
-
- // Test the case presented in https://www.drupal.org/node/2841962.
- $config = \Drupal::configFactory()->getEditable('user.settings');
- $config->set('verify_mail', 0);
- $config->set('register', USER_REGISTER_VISITORS);
- $config->save();
- $this->drupalLogout();
- $this->drupalGet('user/register');
- $this->assertSession()->statusCodeEquals(200);
- $this->assertSession()->responseNotContains('Domain administrator');
- foreach ($domains as $domain) {
- $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']';
- $this->assertSession()->fieldNotExists($locator);
- }
- // Create a user through the form.
- $this->fillField('name', 'testuser2');
- $this->fillField('mail', 'test2@example.com');
- // In 8.3, this field is not present?
- if (!empty($this->findField('pass[pass1]'))) {
- $this->fillField('pass[pass1]', 'test');
- $this->fillField('pass[pass2]', 'test');
- }
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCSSTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCSSTest.php
deleted file mode 100644
index f861b4188..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainCSSTest.php
+++ /dev/null
@@ -1,79 +0,0 @@
-install(['bartik']);
- }
-
- /**
- * Tests the handling of an inbound request.
- */
- public function testDomainNegotiator() {
- // No domains should exist.
- $this->domainTableIsEmpty();
-
- // Create four new domains programmatically.
- $this->domainCreateTestDomains(4);
-
- // The test runner doesn't use a theme that contains the preprocess hook,
- // so set to use Bartik.
- $config = $this->config('system.theme');
- $config->set('default', 'bartik')->save();
-
- // Test the response of the default home page.
- foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) {
- $this->drupalGet($domain->getPath());
- $text = 'id() . '-class');
- $this->assertRaw($text, 'Custom CSS present.' . $text);
- }
-
- // Set the css classes.
- $config = $this->config('domain.settings');
- $config->set('css_classes', '[domain:machine-name]-class [domain:name]-class')->save();
- // Test the response of the default home page.
- foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) {
- // The render cache trips up this test. In production, it may be
- // necessary to add the url.site cache context. See README.md.
- drupal_flush_all_caches();
- $this->drupalGet($domain->getPath());
- $text = 'id() . '"';
- $this->assertRaw($string, 'Found the domain option');
- if (!isset($one)) {
- $one = $domain->id();
- continue;
- }
- if (!isset($two)) {
- $two = $domain->id();
- }
- }
-
- // Try to post a node, assigned to the first two domains.
- $edit['title[0][value]'] = 'Test node';
- $edit["field_domain[{$one}]"] = TRUE;
- $edit["field_domain[{$two}]"] = TRUE;
- $this->drupalPostForm('node/add/article', $edit, 'Save');
- $this->assertResponse(200);
- $node = \Drupal::entityTypeManager()->getStorage('node')->load(1);
- $values = $node->get('field_domain');
-
- // Get the expected value count.
- $this->assertTrue(count($values) == 2, 'Node saved with two domain records.');
-
- }
-
- /**
- * Creates a simple field for testing on the article content type.
- *
- * Note: This code is a model for auto-creation of fields.
- */
- public function domainCreateTestField() {
- $label = 'domain';
- $name = 'field_' . $label;
-
- $storage = [
- 'field_name' => $name,
- 'entity_type' => 'node',
- 'type' => 'entity_reference',
- 'cardinality' => -1,
- 'settings' => [
- 'target_type' => 'domain',
- ],
- ];
- $field_storage_config = \Drupal::entityTypeManager()->getStorage('field_storage_config')->create($storage);
- $field_storage_config->save();
-
- $field = [
- 'field_name' => $name,
- 'entity_type' => 'node',
- 'label' => 'Domain test field',
- 'bundle' => 'article',
- 'settings' => [
- 'handler_settings' => [
- 'sort' => ['field' => 'weight', 'direction' => 'ASC'],
- ],
- ],
- ];
- $field_config = \Drupal::entityTypeManager()->getStorage('field_config')->create($field);
- $field_config->save();
-
- // Tell the form system how to behave.
- if ($display = \Drupal::entityTypeManager()->getStorage('entity_form_display')->load('node.article.default')) {
- $display->setComponent($name, ['type' => 'options_buttons'])->save();
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainFormsTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainFormsTest.php
deleted file mode 100644
index 066ddb4fe..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainFormsTest.php
+++ /dev/null
@@ -1,82 +0,0 @@
-admin_user = $this->drupalCreateUser(['administer domains', 'create domains']);
- $this->drupalLogin($this->admin_user);
-
- $storage = \Drupal::entityTypeManager()->getStorage('domain');
-
- // No domains should exist.
- $this->domainTableIsEmpty();
-
- // Visit the main domain administration page.
- $this->drupalGet('admin/config/domain');
-
- // Check for the add message.
- if (substr_count(\Drupal::VERSION, '8.5') > 0) {
- $this->assertText('There is no Domain record yet.', 'Text for no domains found.');
- }
- else {
- $this->assertText('There are no domain record entities yet.', 'Text for no domains found.');
- }
- // Visit the add domain administration page.
- $this->drupalGet('admin/config/domain/add');
-
- // Make a POST request on admin/config/domain/add.
- $edit = $this->domainPostValues();
- $this->drupalPostForm('admin/config/domain/add', $edit, 'Save');
-
- // Did it save correctly?
- $default_id = $storage->loadDefaultId();
- $this->assertTrue(!empty($default_id), 'Domain record saved via form.');
-
- // Does it load correctly?
- $storage->resetCache([$default_id]);
- $new_domain = $storage->load($default_id);
- $this->assertTrue($new_domain->id() == $default_id, 'Domain loaded properly.');
-
- // Has a UUID been set?
- $this->assertTrue(!empty($new_domain->uuid()), 'Entity UUID set properly.');
-
- // Visit the edit domain administration page.
- $editUrl = 'admin/config/domain/edit/' . $new_domain->id();
- $this->drupalGet($editUrl);
-
- // Update the record.
- $edit = [];
- $edit['name'] = 'Foo';
- $edit['validate_url'] = 0;
- $this->drupalPostForm($editUrl, $edit, 'Save');
-
- // Check that the update succeeded.
- $storage->resetCache([$default_id]);
- $domain = $storage->load($default_id);
- $this->assertTrue($domain->label() == 'Foo', 'Domain record updated via form.');
-
- // Visit the delete domain administration page.
- $deleteUrl = 'admin/config/domain/delete/' . $new_domain->id();
- $this->drupalGet($deleteUrl);
-
- // Delete the record.
- $this->drupalPostForm($deleteUrl, [], 'Delete');
- $storage->resetCache([$default_id]);
- $domain = $storage->load($default_id);
- $this->assertTrue(empty($domain), 'Domain record deleted.');
-
- // No domains should exist.
- $this->domainTableIsEmpty();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainGetResponseTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainGetResponseTest.php
deleted file mode 100644
index 35128bce3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainGetResponseTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-domainTableIsEmpty();
-
- // Create a new domain programmatically.
- $this->domainCreateTestDomains();
-
- // Check the created domain based on its known id value.
- $key = 'example_com';
- /** @var \Drupal\domain\Entity\Domain $domain */
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->load($key);
-
- // Our testing server should be able to access the test PNG file.
- $this->assert($domain->getResponse() == 200, 'Server returned a 200 response.');
-
- // Now create a bad domain.
- $values = [
- 'hostname' => 'foo.bar',
- 'id' => 'foo_bar',
- 'name' => 'Foo',
- ];
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->create($values);
-
- $domain->save();
- $this->assert($domain->getResponse() == 500, 'Server test returned a 500 response.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainInactiveTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainInactiveTest.php
deleted file mode 100644
index b2af33a70..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainInactiveTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
-config('system.site');
- $site_config->set('page.front', '/node')->save();
-
- // Create four new domains programmatically.
- $this->domainCreateTestDomains(4);
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
-
- // Grab a known domain for testing.
- $domain = $domains['two_example_com'];
- $this->drupalGet($domain->getPath());
- $this->assertTrue($domain->status(), 'Tested domain is set to active.');
- $this->assertTrue($domain->getPath() == $this->getUrl(), 'Loaded the active domain.');
-
- // Disable the domain and test for redirect.
- $domain->disable();
- $default = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultDomain();
- // Our postSave() cache tag clear should allow this to work properly.
- $this->drupalGet($domain->getPath());
-
- $this->assertFalse($domain->status(), 'Tested domain is set to inactive.');
- $this->assertTrue($default->getPath() == $this->getUrl(), 'Redirected an inactive domain to the default domain.');
-
- // Check to see if the user can login.
- $url = $domain->getPath() . 'user/login';
- $this->drupalGet($url);
- $this->assertResponse(200, 'Request to login on inactive domain allowed.');
- // Check to see if the user can reset password.
- $url = $domain->getPath() . 'user/password';
- $this->drupalGet($url);
- $this->assertResponse(200, 'Request to reset password on inactive domain allowed.');
-
- // Try to access with the proper permission.
- user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['access inactive domains']);
- // Must flush cache because we did not resave the domain.
- drupal_flush_all_caches();
- $this->assertFalse($domain->status(), 'Tested domain is set to inactive.');
- $this->drupalGet($domain->getPath());
-
- // Set up two additional domains.
- $domain2 = $domains['one_example_com'];
- $domain3 = $domains['three_example_com'];
-
- // Check against trusted host patterns.
- $settings['settings']['trusted_host_patterns'] = (object) [
- 'value' => ['^' . $this->prepareTrustedHostname($domain->getHostname()) . '$',
- '^' . $this->prepareTrustedHostname($domain2->getHostname()) . '$',
- ],
- 'required' => TRUE,
- ];
- $this->writeSettings($settings);
-
- // Revoke the permission change.
- user_role_revoke_permissions(RoleInterface::ANONYMOUS_ID, ['access inactive domains']);
-
- $domain2->saveDefault();
-
- // Test the trusted host, which should redirect to default.
- $this->drupalGet($domain->getPath());
- $this->assertTrue($domain2->getPath() == $this->getUrl(), 'Redirected from the inactive domain.');
- $this->assertResponse(200, 'Request to trusted host allowed.');
-
- // The redirect is cached, so we must flush cache to test again.
- drupal_flush_all_caches();
-
- // Test another inactive domain that is not trusted.
- // Disable the domain and test for redirect.
- $domain3->saveDefault();
- $this->drupalGet($domain->getPath());
- $this->assertRaw('The provided host name is not a valid redirect.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListBuilderTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListBuilderTest.php
deleted file mode 100644
index a2ec8ac93..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListBuilderTest.php
+++ /dev/null
@@ -1,211 +0,0 @@
-domainCreateTestDomains(150);
- }
-
- /**
- * Basic test setup.
- */
- public function testDomainListBuilder() {
- $admin = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- ]);
- $this->drupalLogin($admin);
-
- $this->drupalGet('admin/config/domain');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check that links are printed.
- foreach ($this->getPaginatedDomains() as $domain) {
- $href = 'admin/config/domain/edit/' . $domain->id();
- $this->assertSession()->linkByHrefExists($href, 0, 'Link found ' . $href);
- $this->assertSession()->assertEscaped($domain->label());
- // Check for pagination.
- $this->checkPagination();
- }
-
- // Go to page 2.
- $this->clickLink('Next');
- foreach ($this->getPaginatedDomains(1) as $domain) {
- $href = 'admin/config/domain/edit/' . $domain->id();
- $this->assertSession()->linkByHrefExists($href, 0, 'Link found ' . $href);
- $this->assertSession()->assertEscaped($domain->label());
- // Check for pagination.
- $this->checkPagination();
- }
-
- // Now login as a user with limited rights.
- $account = $this->drupalCreateUser([
- 'create article content',
- 'edit any article content',
- 'edit assigned domains',
- 'view domain list',
- ]);
- $ids = ['example_com', 'one_example_com'];
- $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ADMIN_FIELD);
- $user_storage = \Drupal::entityTypeManager()->getStorage('user');
- $user = $user_storage->load($account->id());
- $manager = \Drupal::service('domain.element_manager');
- $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain records.');
-
- $this->drupalLogin($account);
-
- $this->drupalGet('admin/config/domain');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check that links are printed.
- $path = 'admin/config/domain';
- $this->drupalGet($path);
- foreach ($this->getPaginatedDomains() as $domain) {
- $href = 'admin/config/domain/edit/' . $domain->id();
- if (in_array($domain->id(), $ids)) {
- $this->assertSession()->linkByHrefExists($href, 0, 'Link found');
- $this->assertSession()->assertEscaped($domain->label());
- }
- else {
- $this->assertSession()->linkByHrefNotExists($href, 'Link not found');
- $this->assertSession()->assertEscaped($domain->label());
- }
- // Check for pagination.
- $this->checkPagination();
- }
-
- // Check access to the pages/routes.
- foreach ($this->getPaginatedDomains() as $domain) {
- $path = 'admin/config/domain/edit/' . $domain->id();
- $this->drupalGet($path);
- if (in_array($domain->id(), $ids)) {
- $this->assertSession()->statusCodeEquals(200);
- }
- else {
- $this->assertSession()->statusCodeEquals(403);
- }
- }
-
- // Go to page 2.
- $this->drupalGet('admin/config/domain');
- $this->clickLink('Next');
- foreach ($this->getPaginatedDomains(1) as $domain) {
- $href = 'admin/config/domain/edit/' . $domain->id();
- if (in_array($domain->id(), $ids)) {
- $this->assertSession()->linkByHrefExists($href, 0, 'Link found');
- $this->assertSession()->assertEscaped($domain->label());
- }
- else {
- $this->assertSession()->linkByHrefNotExists($href, 'Link not found');
- $this->assertSession()->assertEscaped($domain->label());
- }
- // Check for pagination.
- $this->checkPagination();
- }
-
- // Now login as a user with more limited rights.
- $account2 = $this->drupalCreateUser([
- 'create article content',
- 'edit any article content',
- 'edit assigned domains',
- 'view assigned domains',
- ]);
- $ids = ['example_com', 'one_example_com'];
- $this->addDomainsToEntity('user', $account2->id(), $ids, DOMAIN_ADMIN_FIELD);
- $user_storage = \Drupal::entityTypeManager()->getStorage('user');
- $user = $user_storage->load($account2->id());
- $manager = \Drupal::service('domain.element_manager');
- $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain records.');
-
- $this->drupalLogin($account2);
-
- $this->drupalGet('admin/config/domain');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check that domains are listed and links are printed.
- $path = 'admin/config/domain';
- $this->drupalGet($path);
- foreach ($this->getPaginatedDomains() as $domain) {
- $href = 'admin/config/domain/edit/' . $domain->id();
- if (in_array($domain->id(), $ids)) {
- $this->assertSession()->linkByHrefExists($href, 0, 'Link found');
- $this->assertSession()->assertEscaped($domain->label());
- }
- else {
- $this->assertSession()->linkByHrefNotExists($href, 'Link not found');
- $this->assertSession()->assertNoEscaped($domain->label());
- }
- // Check for pagination.
- $this->checkNoPagination();
- }
-
- // Check access to the pages/routes.
- foreach ($this->getPaginatedDomains() as $domain) {
- $path = 'admin/config/domain/edit/' . $domain->id();
- $this->drupalGet($path);
- if (in_array($domain->id(), $ids)) {
- $this->assertSession()->statusCodeEquals(200);
- }
- else {
- $this->assertSession()->statusCodeEquals(403);
- }
- }
-
- }
-
- /**
- * Returns an array of domains, paginated and sorted by weight.
- *
- * @param int $page
- * The page number to return.
- */
- private function getPaginatedDomains($page = 0) {
- $limit = 50;
- $offset = $page * $limit;
- return array_slice($this->getDomainsSorted(), $offset, $limit);
- }
-
- /**
- * Checks that pagination links appear, as expected.
- */
- private function checkPagination() {
- foreach (['?page=0', '?page=1', '?page=2'] as $href) {
- $this->assertSession()->linkByHrefExists($href, 0, 'Link found');
- }
- }
-
- /**
- * Checks that pagination links do not appear, as expected.
- */
- private function checkNoPagination() {
- foreach (['?page=0', '?page=1', '?page=2'] as $href) {
- $this->assertSession()->linkByHrefNotExists($href, 0, 'Link not found');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListWeightTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListWeightTest.php
deleted file mode 100644
index 441adb610..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainListWeightTest.php
+++ /dev/null
@@ -1,109 +0,0 @@
-domainCreateTestDomains(60);
- }
-
- /**
- * Basic test setup.
- */
- public function testDomainWeight() {
- // Test the default sort values. Should be 1 to 60.
- $domains = $this->getDomainsSorted();
- $i = 1;
- foreach ($domains as $domain) {
- $this->assert($domain->getWeight() == $i, 'Weight set to ' . $i);
- $i++;
- }
- // The last domain should be test59_example_com.
- $this->assert($domain->id() == 'test59_example_com', 'Last domain is test59');
- $domains_old = $domains;
-
- $admin = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- ]);
- $this->drupalLogin($admin);
-
- $this->drupalGet('admin/config/domain');
- $this->assertSession()->statusCodeEquals(200);
-
- // Set one weight to 61.
- $locator = 'edit-domains-one-example-com-weight';
- $this->fillField($locator, 61);
-
- // Save the form.
- $this->pressButton('edit-submit');
-
- $domains = $this->getDomainsSorted();
- $i = 1;
- foreach ($domains as $domain) {
- // Weights should be the same one page 1 except for the one we changed.
- if ($domain->id() == 'one_example_com') {
- $this->assert($domain->getWeight() == 61, 'Weight set to 61 ' . $domain->getWeight());
- }
- else {
- $this->assert($domain->getWeight() == $domains_old[$domain->id()]->getWeight() . 'Weights unchanged');
- }
- $i++;
- }
- // The last domain should be one_example_com.
- $this->assert($domain->id() == 'one_example_com', 'Last domain is one');
-
- // Go to page two.
- $this->clickLink('Next');
- $this->assertSession()->statusCodeEquals(200);
- // Set one weight to 2.
- $locator = 'edit-domains-one-example-com-weight';
- $this->fillField($locator, 2);
- // Save the form.
- $this->pressButton('edit-submit');
-
- $this->drupalGet('admin/config/domain');
- $this->assertSession()->statusCodeEquals(200);
-
- // Go to page two.
- $this->clickLink('Next');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check the domain sort order.
- $domains = $this->getDomainsSorted();
- $i = 1;
- foreach ($domains as $domain) {
- if ($domain->id() == 'one_example_com') {
- $this->assert($domain->getWeight() == 2, 'Weight set to 2');
- }
- else {
- $this->assert($domain->getWeight() == $domains_old[$domain->id()]->getWeight() . 'Weights unchanged');
- }
- }
- // The last domain should be test59_example_com.
- $this->assert($domain->id() == 'test59_example_com', 'Last domain is test59' . $domain->id());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNavBlockTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNavBlockTest.php
deleted file mode 100644
index f75710ce2..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNavBlockTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-domainCreateTestDomains(4);
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
-
- // Place the nav block.
- $block = $this->drupalPlaceBlock('domain_nav_block');
-
- // Let the anon user view the block.
- user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['use domain nav block']);
-
- // Load the homepage. All links should appear.
- $this->drupalGet('');
- // Confirm domain links.
- foreach ($domains as $id => $domain) {
- $this->findLink($domain->label());
- }
-
- // Disable one of the domains. One link should not appear.
- $disabled = $domains['one_example_com'];
- $disabled->disable();
-
- // Load the homepage.
- $this->drupalGet('');
- // Confirm domain links.
- foreach ($domains as $id => $domain) {
- if ($id != 'one_example_com') {
- $this->findLink($domain->label());
- }
- else {
- $this->assertNoRaw($domain->label());
- }
- }
- // Let the anon user view diabled domains. All links should appear.
- user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['access inactive domains']);
-
- // Load the homepage.
- $this->drupalGet('');
- // Confirm domain links.
- foreach ($domains as $id => $domain) {
- $this->findLink($domain->label());
- }
-
- // Now update the configuration and test again.
- $this->config('block.block.' . $block->id())
- ->set('settings.link_options', 'active')
- ->set('settings.link_label', 'hostname')
- ->save();
-
- // Load the the login page.
- $this->drupalGet('user/login');
- // Confirm domain links.
- foreach ($domains as $id => $domain) {
- $this->findLink($domain->getHostname());
- $this->assertRaw($domain->buildUrl('/user/login'));
- }
-
- // Now update the configuration and test again.
- $this->config('block.block.' . $block->id())
- ->set('settings.link_options', 'home')
- ->set('settings.link_theme', 'menu')
- ->set('settings.link_label', 'url')
- ->save();
-
- // Load the the login page.
- $this->drupalGet('user/login');
- // Confirm domain links.
- foreach ($domains as $id => $domain) {
- $this->findLink($domain->getPath());
- $this->assertRaw($domain->getPath());
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNegotiatorTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNegotiatorTest.php
deleted file mode 100644
index 010030962..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainNegotiatorTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-domainTableIsEmpty();
-
- // Create four new domains programmatically.
- $this->domainCreateTestDomains(4);
-
- // Since we cannot read the service request, we place a block
- // which shows the current domain information.
- $this->drupalPlaceBlock('domain_server_block');
-
- // To get around block access, let the anon user view the block.
- user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['view domain information']);
-
- // Test the response of the default home page.
- foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) {
- $this->drupalGet($domain->getPath());
- $this->assertRaw($domain->label(), 'Loaded the proper domain.');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainReferencesTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainReferencesTest.php
deleted file mode 100644
index e9e4a1397..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainReferencesTest.php
+++ /dev/null
@@ -1,220 +0,0 @@
-domainCreateTestDomains(5);
- }
-
- /**
- * Basic test setup.
- */
- public function testDomainReferences() {
- // Create an admin user. This will be user 2.
- $admin = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer users',
- 'administer domains',
- 'assign domain editors',
- ]);
- $this->drupalLogin($admin);
-
- $this->drupalGet('admin/people/create');
- $this->assertSession()->statusCodeEquals(200);
-
- // Create a user through the form. This will be user 3.
- $this->fillField('name', 'testuser');
- $this->fillField('mail', 'test@example.com');
- $this->fillField('pass[pass1]', 'test');
- $this->fillField('pass[pass2]', 'test');
-
- // We expect to find 5 domain options. We set three as selected.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
-
- $ids = ['example_com', 'one_example_com', 'two_example_com'];
- $edit_ids = ['example_com', 'one_example_com'];
- foreach ($domains as $domain) {
- $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if (in_array($domain->id(), $ids)) {
- $this->checkField($locator);
- }
- $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if (in_array($domain->id(), $edit_ids)) {
- $this->checkField($locator);
- }
- }
-
- // Find the all affiliates field.
- $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]';
- $this->findField($locator);
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Load our test user.
- $storage = \Drupal::entityTypeManager()->getStorage('user');
- $testuser = $storage->load(3);
- // Check that three values are set.
- $manager = \Drupal::service('domain.element_manager');
- $values = $manager->getFieldValues($testuser, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 3, 'User saved with three domain admin records.');
- // Check that no access fields are set.
- $values = $manager->getFieldValues($testuser, DOMAIN_ACCESS_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain access records.');
-
- // Now login as a user with limited rights. This is user 4.
- $account = $this->drupalCreateUser([
- 'administer users',
- 'assign domain administrators',
- ]);
- // Set some domain assignments for this user.
- $ids = ['example_com', 'one_example_com'];
- $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ADMIN_FIELD);
- $limited_admin = $storage->load($account->id());
- $values = $manager->getFieldValues($limited_admin, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain admin records.');
- // Check that no access fields are set.
- $values = $manager->getFieldValues($limited_admin, DOMAIN_ACCESS_FIELD);
- $this->assert(count($values) == 0, 'User saved with no domain access records.');
-
- // Now edit user 3 as user 4 with limited rights.
- $this->drupalLogin($account);
- $this->drupalGet('user/' . $testuser->id() . '/edit');
- $this->assertSession()->statusCodeEquals(200);
-
- foreach ($domains as $domain) {
- $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if ($domain->id() == 'example_com') {
- $this->checkField($locator);
- }
- elseif ($domain->id() == 'one_example_com') {
- $this->uncheckField($locator);
- }
- else {
- $this->assertSession()->fieldNotExists($locator);
- }
- // No Domain Access field rights exist for this user.
- $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']';
- $this->assertSession()->fieldNotExists($locator);
- }
-
- // The all affiliates field should not be present..
- $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]';
- $this->assertSession()->fieldNotExists($locator);
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Now, check the user.
- $storage->resetCache([$testuser->id()]);
- $testuser = $storage->load($testuser->id());
- // Check that two values are set.
- $values = $manager->getFieldValues($testuser, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain admin records.');
- // Check that no access fields are set.
- $values = $manager->getFieldValues($testuser, DOMAIN_ACCESS_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain access records.');
-
- // Now login as a user with different limited rights. This is user 5.
- $new_account = $this->drupalCreateUser([
- 'administer users',
- 'assign domain administrators',
- 'assign domain editors',
- ]);
- $ids = ['example_com', 'one_example_com'];
- $new_ids = ['one_example_com', 'four_example_com'];
- $this->addDomainsToEntity('user', $new_account->id(), $ids, DOMAIN_ADMIN_FIELD);
- $this->addDomainsToEntity('user', $new_account->id(), $new_ids, DOMAIN_ACCESS_FIELD);
-
- $new_admin = $storage->load($new_account->id());
- $values = $manager->getFieldValues($new_admin, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain admin records.');
- $values = $manager->getFieldValues($new_admin, DOMAIN_ACCESS_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain access records.');
-
- // Now edit the user as someone with limited rights.
- $storage->resetCache([$new_admin->id()]);
- $this->drupalLogin($new_account);
-
- $this->drupalGet('user/' . $testuser->id() . '/edit');
- $this->assertSession()->statusCodeEquals(200);
-
- foreach ($domains as $domain) {
- $locator = DOMAIN_ADMIN_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if ($domain->id() == 'example_com') {
- $this->checkField($locator);
- }
- elseif ($domain->id() == 'one_example_com') {
- $this->uncheckField($locator);
- }
- else {
- $this->assertSession()->fieldNotExists($locator);
- }
- // Some Domain Access field rights exist for this user. This adds
- // one to the count.
- $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']';
- if (in_array($domain->id(), $new_ids)) {
- $this->findField($locator);
- $this->checkField($locator);
- }
- else {
- $this->assertSession()->fieldNotExists($locator);
- }
- }
-
- // The all affiliates field should not be present..
- $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]';
- $this->assertSession()->fieldNotExists($locator);
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Now, check the user.
- $storage->resetCache([$testuser->id()]);
- $testuser = $storage->load($testuser->id());
- // Check that two values are set.
- $values = $manager->getFieldValues($testuser, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain admin records.');
- $values = $manager->getFieldValues($testuser, DOMAIN_ACCESS_FIELD);
- $this->assert(count($values) == 3, 'User saved with three domain access records.');
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTestBase.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTestBase.php
deleted file mode 100644
index 66cc82504..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTestBase.php
+++ /dev/null
@@ -1,232 +0,0 @@
-baseHostname or the
- * domainCreateTestDomains() method.
- *
- * @var string
- */
- public $baseHostname;
-
- /**
- * Modules to enable.
- *
- * @var array
- */
- public static $modules = ['domain', 'node'];
-
- /**
- * We use the standard profile for testing.
- *
- * @var string
- */
- protected $profile = 'standard';
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- parent::setUp();
-
- // Set the base hostname for domains.
- $this->baseHostname = \Drupal::entityTypeManager()->getStorage('domain')->createHostname();
- }
-
- /**
- * The methods below are brazenly copied from Rules module.
- *
- * They are all helper methods that make writing tests a bit easier.
- */
-
- /**
- * Finds link with specified locator.
- *
- * @param string $locator
- * Link id, title, text or image alt.
- *
- * @return \Behat\Mink\Element\NodeElement|null
- * The link node element.
- */
- public function findLink($locator) {
- return $this->getSession()->getPage()->findLink($locator);
- }
-
- /**
- * Confirms absence of link with specified locator.
- *
- * @param string $locator
- * Link id, title, text or image alt.
- *
- * @return bool
- * TRUE if link is absent, or FALSE.
- */
- public function findNoLink($locator) {
- return empty($this->getSession()->getPage()->hasLink($locator));
- }
-
- /**
- * Finds field (input, textarea, select) with specified locator.
- *
- * @param string $locator
- * Input id, name or label.
- *
- * @return \Behat\Mink\Element\NodeElement|null
- * The input field element.
- */
- public function findField($locator) {
- return $this->getSession()->getPage()->findField($locator);
- }
-
- /**
- * Finds button with specified locator.
- *
- * @param string $locator
- * Button id, value or alt.
- *
- * @return \Behat\Mink\Element\NodeElement|null
- * The button node element.
- */
- public function findButton($locator) {
- return $this->getSession()->getPage()->findButton($locator);
- }
-
- /**
- * Presses button with specified locator.
- *
- * @param string $locator
- * Button id, value or alt.
- *
- * @throws \Behat\Mink\Exception\ElementNotFoundException
- */
- public function pressButton($locator) {
- $this->getSession()->getPage()->pressButton($locator);
- }
-
- /**
- * Fills in field (input, textarea, select) with specified locator.
- *
- * @param string $locator
- * Input id, name or label.
- * @param string $value
- * Value.
- *
- * @throws \Behat\Mink\Exception\ElementNotFoundException
- *
- * @see \Behat\Mink\Element\NodeElement::setValue
- */
- public function fillField($locator, $value) {
- $this->getSession()->getPage()->fillField($locator, $value);
- }
-
- /**
- * Checks checkbox with specified locator.
- *
- * @param string $locator
- * An input id, name or label.
- *
- * @throws \Behat\Mink\Exception\ElementNotFoundException
- */
- public function checkField($locator) {
- $this->getSession()->getPage()->checkField($locator);
- }
-
- /**
- * Unchecks checkbox with specified locator.
- *
- * @param string $locator
- * An input id, name or label.
- *
- * @throws \Behat\Mink\Exception\ElementNotFoundException
- */
- public function uncheckField($locator) {
- $this->getSession()->getPage()->uncheckField($locator);
- }
-
- /**
- * Selects option from select field with specified locator.
- *
- * @param string $locator
- * An input id, name or label.
- * @param string $value
- * The option value.
- * @param bool $multiple
- * Whether to select multiple options.
- *
- * @throws \Behat\Mink\Exception\ElementNotFoundException
- *
- * @see NodeElement::selectOption
- */
- public function selectFieldOption($locator, $value, $multiple = FALSE) {
- $this->getSession()->getPage()->selectFieldOption($locator, $value, $multiple);
- }
-
- /**
- * Returns whether a given user account is logged in.
- *
- * @param \Drupal\Core\Session\AccountInterface $account
- * The user account object to check.
- *
- * @return bool
- * TRUE if a given user account is logged in, or FALSE.
- */
- protected function drupalUserIsLoggedIn(AccountInterface $account) {
- // @TODO: This is a temporary hack for the test login fails when setting $cookie_domain.
- if (!isset($account->session_id)) {
- return (bool) $account->id();
- }
- // The session ID is hashed before being stored in the database.
- // @see \Drupal\Core\Session\SessionHandler::read()
- return (bool) db_query("SELECT sid FROM {users_field_data} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = :sid", [':sid' => Crypt::hashBase64($account->session_id)])->fetchField();
- }
-
- /**
- * Login a user on a specific domain.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * The domain to log the user into.
- * @param \Drupal\Core\Session\AccountInterface $account
- * The user account to login.
- */
- public function domainLogin(DomainInterface $domain, AccountInterface $account) {
- // Due to a quirk in session handling that we cannot directly access, it
- // works if we login, then logout, and then login to a specific domain.
- $this->drupalLogin($account);
- if ($this->loggedInUser) {
- $this->drupalLogout();
- }
-
- // Login.
- $url = $domain->getPath() . 'user/login';
- $this->submitForm([
- 'name' => $account->getUsername(),
- 'pass' => $account->passRaw,
- ], t('Log in'));
-
- // @see BrowserTestBase::drupalUserIsLoggedIn()
- $account->sessionId = $this->getSession()->getCookie($this->getSessionName());
- $this->assertTrue($this->drupalUserIsLoggedIn($account), 'User successfully logged in.');
-
- $this->loggedInUser = $account;
- $this->container->get('current_user')->setAccount($account);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTokenTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTokenTest.php
deleted file mode 100644
index 5f5039e15..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainTokenTest.php
+++ /dev/null
@@ -1,75 +0,0 @@
-domainTableIsEmpty();
-
- // Create four new domains programmatically.
- $this->domainCreateTestDomains(4);
-
- // Since we cannot read the service request, we place a block
- // which shows the current domain token information.
- $this->drupalPlaceBlock('domain_token_block');
-
- // To get around block access, let the anon user view the block.
- user_role_grant_permissions(AccountInterface::ANONYMOUS_ROLE, ['view domain information']);
-
- // Test the response of the default home page.
- foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) {
- $this->drupalGet($domain->getPath());
- $this->assertRaw($domain->label(), 'Loaded the proper domain.');
- $this->assertRaw('
", "$token found correctly.");
- // The URL token is sensitive to the path, which is /user, but that
- // does not come across when making the callback outside of a request
- // context.
- $value = $domain->{$callback}();
- if ($token == '[domain:url]') {
- $value = str_replace('user', '', $value);
- if (substr($value, -1) != '/') {
- $value .= '/';
- }
- }
- $this->assertRaw('
' . $value . '
', 'Value set correctly to ' . $value);
- }
- }
- }
-
- /**
- * Gets the list of tokens and value callbacks used by the test.
- *
- * @return array
- * An array keyed by token string, with value of expected domain value.
- */
- private function tokenList() {
- $tokens = [];
- foreach (\Drupal::service('domain.token')->getCallbacks() as $key => $callback) {
- $name = "[domain:$key]";
- $tokens[$name] = $callback;
- }
- return $tokens;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainValidatorTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainValidatorTest.php
deleted file mode 100644
index 25a73fefe..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainValidatorTest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-domainTableIsEmpty();
- $validator = \Drupal::service('domain.validator');
- $storage = \Drupal::entityTypeManager()->getStorage('domain');
-
- // Create a domain.
- $this->domainCreateTestDomains(1, 'foo.com');
- // Check the created domain based on its known id value.
- $key = 'foo.com';
- /** @var \Drupal\domain\Entity\Domain $domain */
- $domain = $storage->loadByHostname($key);
- $this->assertTrue(!empty($domain), 'Test domain created.');
-
- // Valid hostnames to test. Valid is the boolean value.
- $hostnames = [
- 'localhost' => 1,
- 'example.com' => 1,
- // See www-prefix test, below.
- 'www.example.com' => 1,
- 'one.example.com' => 1,
- 'example.com:8080' => 1,
- // Only one colon.
- 'example.com::8080' => 0,
- // No letters after a colon.
- 'example.com:abc' => 0,
- // Cannot begin with a dot.
- '.example.com' => 0,
- // Cannot end with a dot.
- 'example.com.' => 0,
- // Lowercase only.
- 'EXAMPLE.com' => 0,
- // ascii-only.
- 'éxample.com' => 0,
- ];
- foreach ($hostnames as $hostname => $valid) {
- $errors = $validator->validate($hostname);
- if ($valid) {
- $this->assertTrue(empty($errors), 'Validation correct with no errors.');
- }
- else {
- $this->assertTrue(!empty($errors), 'Validation correct with proper errors.');
- }
- }
- // Test duplicate hostname creation.
- $test_hostname = 'foo.com';
- $test_domain = $storage->create([
- 'hostname' => $test_hostname,
- 'name' => 'Test domain',
- 'id' => 'test_domain',
- ]);
- try {
- $test_domain->save();
- $this->fail('Duplicate hostname validation');
- }
- catch (ConfigValueException $e) {
- $expected_message = "The hostname ($test_hostname) is already registered.";
- $this->assertEqual($expected_message, $e->getMessage());
- }
- // Test the two configurable options.
- $config = $this->config('domain.settings');
- $config->set('www_prefix', TRUE);
- $config->set('allow_non_ascii', TRUE);
- $config->save();
- // Valid hostnames to test. Valid is the boolean value.
- $hostnames = [
- // No www-prefix allowed.
- 'www.example.com' => 0,
- // ascii-only allowed.
- 'éxample.com' => 1,
- ];
- foreach ($hostnames as $hostname => $valid) {
- $errors = $validator->validate($hostname);
- if ($valid) {
- $this->assertTrue(empty($errors), 'Validation test correct with no errors.');
- }
- else {
- $this->assertTrue(!empty($errors), 'Validation test correct with errors.');
- }
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainViewsAccessTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainViewsAccessTest.php
deleted file mode 100644
index f1da872e4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Functional/DomainViewsAccessTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
-domainCreateTestDomains(5);
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- // Enable the views.
- $this->enableViewsTestModule();
- // Create a user. To test the area output was more difficult, so we just
- // configured two views. The page shows the first, admin, user, and the
- // block will show this new user name.
- $this->user = $this->drupalCreateUser(['administer domains', 'create domains']);
- // Place the view block.
- $this->drupalPlaceBlock('views_block:domain_views_access-block_1');
-
- // The block and page should be visible on example_com and one_example_com.
- $allowed = ['example_com', 'one_example_com'];
-
- foreach ($domains as $domain) {
- $path = $domain->getPath() . 'domain-views-access';
- $this->DrupalGet($path);
- if (in_array($domain->id(), $allowed)) {
- $this->assertResponse('200', 'Access allowed');
- $this->assertRaw('admin');
- $this->assertRaw($this->user->getUsername());
- }
- else {
- $this->assertResponse('403', 'Access denied');
- $this->assertNoRaw('admin');
- $this->assertNoRaw($this->user->getUsername());
- }
- // Test the block on another page.
- $this->drupalGet($domain->getPath());
- if (in_array($domain->id(), $allowed)) {
- $this->assertRaw($this->user->getUsername());
- }
- else {
- $this->assertNoRaw($this->user->getUsername());
- }
- }
- }
-
- /**
- * Sets up the domain_test module.
- *
- * Because the schema of domain_test.module is dependent on the test
- * using it, it cannot be enabled normally.
- */
- protected function enableViewsTestModule() {
- \Drupal::service('module_installer')->install(['domain_test']);
- $this->resetAll();
- $this->rebuildContainer();
- $this->container->get('module_handler')->reload();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainConfigTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainConfigTest.php
deleted file mode 100644
index 79508aef7..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainConfigTest.php
+++ /dev/null
@@ -1,39 +0,0 @@
-installEntitySchema('domain');
- // Install the test domain record & views config.
- $this->installConfig('domain_config_schema_test');
- }
-
- /**
- * Dummy test method to ensure config gets installed.
- */
- public function testRun() {
- $this->assertTrue(TRUE);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainHookTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainHookTest.php
deleted file mode 100644
index 8a27c9341..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainHookTest.php
+++ /dev/null
@@ -1,168 +0,0 @@
-domainCreateTestDomains();
-
- // Get the services.
- $this->domainStorage = \Drupal::entityTypeManager()->getStorage('domain');
- $this->currentUser = \Drupal::service('current_user');
- $this->moduleHandler = \Drupal::service('module_handler');
- }
-
- /**
- * Tests domain loading.
- */
- public function testHookDomainLoad() {
- // Check the created domain based on its known id value.
- $domain = $this->domainStorage->load($this->key);
-
- // Internal hooks.
- $path = $domain->getPath();
- $url = $domain->getUrl();
- $this->assertTrue(isset($path), new FormattableMarkup('The path property was set to %path by hook_entity_load.', ['%path' => $path]));
- $this->assertTrue(isset($url), new FormattableMarkup('The url property was set to %url by hook_entity_load.', ['%url' => $url]));
-
- // External hooks.
- $this->assertTrue($domain->foo == 'bar', 'The foo property was set to bar by hook_domain_load.');
- }
-
- /**
- * Tests domain validation.
- */
- public function testHookDomainValidate() {
- $validator = \Drupal::service('domain.validator');
- // Test a good domain.
- $errors = $validator->validate('one.example.com');
- $this->assertEmpty($errors, 'No errors returned for example.com');
-
- // Test our hook implementation, which denies fail.example.com explicitly.
- $errors = $validator->validate('fail.example.com');
- $this->assertNotEmpty($errors, 'Errors returned for fail.example.com');
- $this->assertTrue(current($errors) == 'Fail.example.com cannot be registered', 'Error message returned correctly.');
- }
-
- /**
- * Tests domain request alteration.
- */
- public function testHookDomainRequestAlter() {
- // Set the request.
- $negotiator = \Drupal::service('domain.negotiator');
- $negotiator->setRequestDomain($this->baseHostname);
-
- // Check that the property was added by our hook.
- $domain = $negotiator->getActiveDomain();
- $this->assertTrue($domain->foo1 == 'bar1', 'The foo1 property was set to bar1 by hook_domain_request_alter');
- }
-
- /**
- * Tests domain operations hook.
- */
- public function testHookDomainOperations() {
- $domain = $this->domainStorage->load($this->key);
-
- // Set the request.
- $operations = $this->moduleHandler->invokeAll('domain_operations', [$domain, $this->currentUser]);
-
- // Test that our operations were added by the hook.
- $this->assertTrue(isset($operations['domain_test']), 'Domain test operation loaded.');
- }
-
- /**
- * Tests domain references alter hook.
- */
- public function testHookDomainReferencesAlter() {
- $domain = $this->domainStorage->load($this->key);
-
- // Set the request.
- $manager = \Drupal::service('entity.manager');
- $target_type = 'domain';
-
- // Build a node entity selection query.
- $query = $manager->getStorage($target_type)->getQuery();
- $context = [
- 'entity_type' => 'node',
- 'bundle' => 'article',
- 'field_type' => 'editor',
- ];
-
- // Run the alteration, which should add metadata to the query for nodes.
- $this->moduleHandler->alter('domain_references', $query, $this->currentUser, $context);
- $this->assertTrue($query->getMetaData('domain_test') == 'Test string', 'Domain test query altered.');
-
- // Build a user entity selection query.
- $query = $manager->getStorage($target_type)->getQuery();
- $context = [
- 'entity_type' => 'user',
- 'bundle' => 'user',
- 'field_type' => 'admin',
- ];
-
- // Run the alteration, which does not add metadata for user queries.
- $this->moduleHandler->alter('domain_references', $query, $this->currentUser, $context);
- $this->assertEmpty($query->getMetaData('domain_test'), 'Domain test query not altered.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainVariableSchemeTest.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainVariableSchemeTest.php
deleted file mode 100644
index 7ffd1ee8b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Kernel/DomainVariableSchemeTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-domainCreateTestDomains();
-
- // Get the services.
- $this->domainStorage = \Drupal::entityTypeManager()->getStorage('domain');
- }
-
- /**
- * Tests domain loading.
- */
- public function testDomainScheme() {
- // Set our testing parameters.
- $default_scheme = \Drupal::request()->getScheme();
- $alt_scheme = ($default_scheme == 'https') ? 'http' : 'https';
- $add_suffix = FALSE;
-
- // Our created domain should have a scheme that matches the request.
- $domain = $this->domainStorage->load($this->key);
- $this->assertTrue($domain->getScheme($add_suffix) == $default_scheme);
-
- // Swtich the scheme and see if that works.
- $domain->set('scheme', $alt_scheme);
- $domain->save();
- $domain = $this->domainStorage->load($this->key);
- $this->assertTrue($domain->getScheme($add_suffix) == $alt_scheme);
-
- // Set the scheme to variable, and that should match the default.
- $domain->set('scheme', 'variable');
- $domain->save();
- $this->assertTrue($domain->getScheme($add_suffix) == $default_scheme);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain/tests/src/Traits/DomainTestTrait.php b/sites/all/modules/contrib/admin/domain/domain/tests/src/Traits/DomainTestTrait.php
deleted file mode 100644
index d5af5f273..000000000
--- a/sites/all/modules/contrib/admin/domain/domain/tests/src/Traits/DomainTestTrait.php
+++ /dev/null
@@ -1,168 +0,0 @@
-getStorage('domain')->loadMultiple(NULL, TRUE);
- if (empty($base_hostname)) {
- $base_hostname = $this->baseHostname;
- }
- // Note: these domains are rigged to work on my test server.
- // For proper testing, yours should be set up similarly, but you can pass a
- // $list array to change the default.
- if (empty($list)) {
- $list = [
- '',
- 'one',
- 'two',
- 'three',
- 'four',
- 'five',
- 'six',
- 'seven',
- 'eight',
- 'nine',
- 'ten',
- ];
- }
- for ($i = 0; $i < $count; $i++) {
- if ($i === 0) {
- $hostname = $base_hostname;
- $machine_name = 'example.com';
- $name = 'Example';
- }
- elseif (!empty($list[$i])) {
- $hostname = $list[$i] . '.' . $base_hostname;
- $machine_name = $list[$i] . '.example.com';
- $name = 'Test ' . ucfirst($list[$i]);
- }
- // These domains are not setup and are just for UX testing.
- else {
- $hostname = 'test' . $i . '.' . $base_hostname;
- $machine_name = 'test' . $i . '.example.com';
- $name = 'Test ' . $i;
- }
- // Create a new domain programmatically.
- $values = [
- 'hostname' => $hostname,
- 'name' => $name,
- 'id' => \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($machine_name),
- ];
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->create($values);
- $domain->save();
- }
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE);
- }
-
- /**
- * Adds a test domain to an entity.
- *
- * @param string $entity_type
- * The entity type being acted upon.
- * @param int $entity_id
- * The entity id.
- * @param array|string $ids
- * An id or array of ids to add.
- * @param string $field
- * The name of the domain field used to attach to the entity.
- */
- public function addDomainsToEntity($entity_type, $entity_id, $ids, $field) {
- if ($entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($entity_id)) {
- $entity->set($field, $ids);
- $entity->save();
- }
- }
-
- /**
- * Returns an uncached list of all domains.
- *
- * @return array
- * An array of domain entities.
- */
- public function getDomains() {
- \Drupal::entityTypeManager()->getStorage('domain')->resetCache();
- return \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- }
-
- /**
- * Returns an uncached list of all domains, sorted by weight.
- *
- * @return array
- * An array of domain entities.
- */
- public function getDomainsSorted() {
- \Drupal::entityTypeManager()->getStorage('domain')->resetCache();
- return \Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted();
- }
-
- /**
- * Converts a domain hostname to a trusted host pattern.
- *
- * @param string $hostname
- * A hostname string.
- *
- * @return string
- * A regex-safe hostname, without delimiters.
- */
- public function prepareTrustedHostname($hostname) {
- $hostname = mb_strtolower(preg_replace('/:\d+$/', '', trim($hostname)));
- return preg_quote($hostname);
- }
-
- /**
- * Set the base hostname for this test.
- */
- public function setBaseHostname() {
- $this->baseHostname = \Drupal::entityTypeManager()->getStorage('domain')->createHostname();
- }
-
- /**
- * Reusable test function for checking initial / empty table status.
- */
- public function domainTableIsEmpty() {
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(NULL, TRUE);
- $this->assertTrue(empty($domains), 'No domains have been created.');
- $default_id = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultId();
- $this->assertTrue(empty($default_id), 'No default domain has been set.');
- }
-
- /**
- * Creates domain record for use with POST request tests.
- */
- public function domainPostValues() {
- $edit = [];
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->create();
- $required = \Drupal::service('domain.validator')->getRequiredFields();
- foreach ($required as $key) {
- $edit[$key] = $domain->get($key);
- }
- // URL validation has issues on Travis, so only do it when requested.
- $edit['validate_url'] = 0;
- $edit['id'] = \Drupal::entityTypeManager()->getStorage('domain')->createMachineName($edit['hostname']);
- return $edit;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/domain_access.settings.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/domain_access.settings.yml
deleted file mode 100644
index 2f245f810..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/domain_access.settings.yml
+++ /dev/null
@@ -1 +0,0 @@
-node_advanced_tab: true
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_access.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_access.yml
deleted file mode 100644
index d4cdf636b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_access.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - node
- enforced:
- module:
- - domain_access
-id: node.field_domain_access
-field_name: field_domain_access
-entity_type: node
-type: entity_reference
-settings:
- target_type: domain
-module: core
-locked: false
-cardinality: -1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_all_affiliates.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_all_affiliates.yml
deleted file mode 100644
index 392f68940..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.node.field_domain_all_affiliates.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - node
- enforced:
- module:
- - domain_access
-id: node.field_domain_all_affiliates
-field_name: field_domain_all_affiliates
-entity_type: node
-type: boolean
-settings: { }
-module: core
-locked: false
-cardinality: 1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_access.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_access.yml
deleted file mode 100644
index 25d0b0944..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_access.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - user
- enforced:
- module:
- - domain_access
-id: user.field_domain_access
-field_name: field_domain_access
-entity_type: user
-type: entity_reference
-settings:
- target_type: domain
-module: core
-locked: false
-cardinality: -1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_all_affiliates.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_all_affiliates.yml
deleted file mode 100644
index e8f9888fc..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/field.storage.user.field_domain_all_affiliates.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - user
- enforced:
- module:
- - domain_access
-id: user.field_domain_all_affiliates
-field_name: field_domain_all_affiliates
-entity_type: user
-type: boolean
-settings: { }
-module: core
-locked: false
-cardinality: 1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_all_action.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_all_action.yml
deleted file mode 100644
index d932320f8..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_all_action.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - node
-id: domain_access_all_action
-label: 'Assign content to all affiliates'
-type: node
-plugin: domain_access_all_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_all_action.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_all_action.yml
deleted file mode 100644
index 926e2d55b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_all_action.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - node
-id: domain_access_edit_all_action
-label: 'Assign editors to all affiliates'
-type: user
-plugin: domain_access_edit_all_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_none_action.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_none_action.yml
deleted file mode 100644
index 33e7adf10..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_edit_none_action.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - node
-id: domain_access_edit_none_action
-label: 'Remove editors from all affiliates'
-type: user
-plugin: domain_access_edit_none_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_none_action.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_none_action.yml
deleted file mode 100644
index 4accb23cd..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/install/system.action.domain_access_none_action.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - node
-id: domain_access_none_action
-label: 'Remove content from all affiliates'
-type: node
-plugin: domain_access_none_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.schema.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.schema.yml
deleted file mode 100644
index 63676c661..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.schema.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-domain_access.settings:
- type: config_object
- label: 'Domain Access settings'
- mapping:
- node_advanced_tab:
- type: boolean
- label: 'Move domain access field to a tab in the advanced settings on nodes.'
- node_advanced_tab_open:
- type: boolean
- label: 'Open the Domain Access details by default.'
-action.configuration.domain_access_all_action:
- type: action_configuration_default
- label: 'Assign content to all affiliates'
-action.configuration.domain_access_edit_all_action:
- type: action_configuration_default
- label: 'Assign editors to all affiliates'
-action.configuration.domain_access_edit_none_action:
- type: action_configuration_default
- label: 'Remove editors from all affiliates'
-action.configuration.domain_access_none_action:
- type: action_configuration_default
- label: 'Remove content from all affiliates'
-action.configuration.domain_access_add_action:
- type: mapping
- label: 'Configuration for the add domain(s) to content action'
- mapping:
- domain_id:
- type: string
- label: 'The ID(s) of the domain(s) to add'
-action.configuration.domain_access_remove_action:
- type: mapping
- label: 'Configuration for the remove domain(s) from content action'
- mapping:
- domain_id:
- type: string
- label: 'The ID(s) of the domain(s) to remove'
-action.configuration.domain_access_add_editor_action:
- type: mapping
- label: 'Configuration for the add domain(s) to users action'
- mapping:
- domain_id:
- type: string
- label: 'The ID(s) of the domain(s) to add'
-action.configuration.domain_access_remove_editor_action:
- type: mapping
- label: 'Configuration for the remove domain(s) from users action'
- mapping:
- domain_id:
- type: string
- label: 'The ID(s) of the domain(s) to remove'
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.views.schema.yml b/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.views.schema.yml
deleted file mode 100644
index e489a9227..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/config/schema/domain_access.views.schema.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-# Schema for the domain access plugins.
-
-views.access.domain_access_admin:
- type: mapping
- label: 'Domain Access: Administer domain editors'
-views.access.domain_access_editor:
- type: mapping
- label: 'Domain Access: Edit domain content'
-views.argument.domain_access_argument:
- type: views_argument
- label: 'Domain Access'
-views.field.domain_access_field:
- type: views_field
- label: 'Domain Access'
- mapping:
- click_sort_column:
- type: string
- label: 'Column used for click sorting'
- type:
- type: string
- label: 'Formatter'
- settings:
- label: 'Settings'
- type: field.formatter.settings.[%parent.type]
- group_column:
- type: string
- label: 'Group by column'
- group_columns:
- type: sequence
- label: 'Group by columns'
- sequence:
- type: string
- label: 'Column'
- group_rows:
- type: boolean
- label: 'Display all values in the same row'
- delta_limit:
- type: integer
- label: 'Field'
- delta_offset:
- type: integer
- label: 'Offset'
- delta_reversed:
- type: boolean
- label: 'Reversed'
- delta_first_last:
- type: boolean
- label: 'First and last only'
- multi_type:
- type: string
- label: 'Display type'
- separator:
- type: label
- label: 'Separator'
- field_api_classes:
- type: boolean
- label: 'Use field template'
-views.filter.domain_access_current_all_filter:
- type: views_filter
- label: 'Current Domain or All Domains'
-views.filter.domain_access_filter:
- type: views.filter.in_operator
- label: 'Domain Access'
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.info.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.info.yml
deleted file mode 100644
index b7e3f245f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.info.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: Domain Access
-description: 'Domain-based access control for content.'
-type: module
-package: Domain
-# version: VERSION
-# core: 8.x
-dependencies:
- - drupal:node
- - domain:domain
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.install b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.install
deleted file mode 100644
index 189ea8ff4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.install
+++ /dev/null
@@ -1,46 +0,0 @@
-getStorage('node_type')->loadMultiple();
- foreach ($node_types as $type => $info) {
- $list[$type] = 'node';
- }
- // Install our fields.
- foreach ($list as $bundle => $entity_type) {
- domain_access_confirm_fields($entity_type, $bundle);
- }
- // Install our actions.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- foreach ($domains as $domain) {
- domain_access_domain_insert($domain);
- }
-}
-
-/**
- * Add the setting to open the domain access fieldset.
- */
-function domain_access_update_8001() {
- $config_factory = \Drupal::configFactory();
- $config = $config_factory->getEditable('domain_access.settings');
- $config->set('node_advanced_tab_open', 0);
- $config->save(TRUE);
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.menu.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.menu.yml
deleted file mode 100644
index 92ad9905b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.menu.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-domain_access.settings:
- title: Domain Access settings
- route_name: domain_access.settings
- parent: domain.admin
- description: 'Domain Access settings'
- weight: 10
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.task.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.task.yml
deleted file mode 100644
index 02cc8734d..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.links.task.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-domain_access.settings:
- title: Domain Access settings
- route_name: domain_access.settings
- base_route: domain.admin
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.module b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.module
deleted file mode 100755
index 34d26bbb7..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.module
+++ /dev/null
@@ -1,746 +0,0 @@
-getActiveDomain();
-
- if (empty($active)) {
- $active = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultDomain();
- }
-
- // No domains means no permissions.
- if (empty($active)) {
- return $grants;
- }
-
- $id = $active->getDomainId();
- // Advanced grants for edit/delete require permissions.
- /** @var \Drupal\user\UserInterface $user */
- $user = \Drupal::entityTypeManager()->getStorage('user')->load($account->id());
- $user_domains = \Drupal::service('domain_access.manager')->getAccessValues($user);
- // Grants for view are simple. Use the active domain and all affiliates.
- // Note that "X to any domain" is a global permission designed for admins.
- if ($op == 'view') {
- $grants['domain_id'][] = $id;
- $grants['domain_site'][] = 0;
- if ($user->hasPermission('view unpublished domain content')) {
- if ($user->hasPermission('publish to any domain') || in_array($id, $user_domains) || !empty($user->get(DOMAIN_ACCESS_ALL_FIELD)->value)) {
- $grants['domain_unpublished'][] = $id;
- }
- }
- }
- elseif ($op == 'update' && $user->hasPermission('edit domain content')) {
- if ($user->hasPermission('publish to any domain') || in_array($id, $user_domains) || !empty($user->get(DOMAIN_ACCESS_ALL_FIELD)->value)) {
- $grants['domain_id'][] = $id;
- }
- }
- elseif ($op == 'delete' && $user->hasPermission('delete domain content')) {
- if ($user->hasPermission('publish to any domain') || in_array($id, $user_domains) || !empty($user->get(DOMAIN_ACCESS_ALL_FIELD)->value)) {
- $grants['domain_id'][] = $id;
- }
- }
- return $grants;
-}
-
-/**
- * Implements hook_node_access_records().
- */
-function domain_access_node_access_records(NodeInterface $node) {
- $grants = [];
- // Create grants for each translation of the node. See the report at
- // https://www.drupal.org/node/2825419 for the logic here. Note that right
- // now, grants may not be the same for all languages.
- $translations = $node->getTranslationLanguages();
- foreach ($translations as $langcode => $language) {
- $translation = $node->getTranslation($langcode);
- // If there are no domains set, use the current one.
- $domains = \Drupal::service('domain_access.manager')->getAccessValues($translation);
- /** @var \Drupal\domain\DomainInterface $active */
- if (empty($domains) && $active = \Drupal::service('domain.negotiator')->getActiveDomain()) {
- $domains[$active->id()] = $active->getDomainId();
- }
- foreach ($domains as $id => $domainId) {
- /** @var \Drupal\domain\DomainInterface $domain */
- if ($domain = \Drupal::entityTypeManager()->getStorage('domain')->load($id)) {
- $grants[] = [
- 'realm' => ($translation->isPublished()) ? 'domain_id' : 'domain_unpublished',
- 'gid' => $domain->getDomainId(),
- 'grant_view' => 1,
- 'grant_update' => 1,
- 'grant_delete' => 1,
- 'langcode' => $langcode,
- ];
- }
- }
- // Set the domain_site grant.
- if (!empty($translation->get(DOMAIN_ACCESS_ALL_FIELD)->value) && $translation->isPublished()) {
- $grants[] = [
- 'realm' => 'domain_site',
- 'gid' => 0,
- 'grant_view' => 1,
- 'grant_update' => 0,
- 'grant_delete' => 0,
- 'langcode' => $langcode,
- ];
- }
- // Because of language translation, we must save a record for each language.
- // even if that record adds no permissions, as this one does.
- else {
- $grants[] = [
- 'realm' => 'domain_site',
- 'gid' => 1,
- 'grant_view' => 0,
- 'grant_update' => 0,
- 'grant_delete' => 0,
- 'langcode' => $langcode,
- ];
- }
- }
- return $grants;
-}
-
-/**
- * Implements hook_ENTITY_TYPE_presave().
- *
- * Fires only if Devel Generate module is present, to assign test nodes to
- * domains.
- */
-function domain_access_node_presave(EntityInterface $node) {
- domain_access_presave_generate($node);
-}
-
-/**
- * Implements hook_ENTITY_TYPE_presave().
- *
- * Fires only if Devel Generate module is present, to assign test nodes to
- * domains.
- */
-function domain_access_user_presave(EntityInterface $account) {
- domain_access_presave_generate($account);
-}
-
-/**
- * Handles presave operations for devel generate.
- */
-function domain_access_presave_generate(EntityInterface $entity) {
- // There is a core bug https://www.drupal.org/node/2609252 that causes a
- // fatal database errors if the boolean DOMAIN_ACCESS_ALL_FIELD is set when
- // a user cannot access the field. See domain_access_entity_field_access().
- // To overcome this issue, we cast the boolean to integer, which prevents the
- // failure.
- $value = (int) $entity->get(DOMAIN_ACCESS_ALL_FIELD)->value;
- $entity->set(DOMAIN_ACCESS_ALL_FIELD, $value);
-
- // Handle devel module settings.
- $exists = \Drupal::moduleHandler()->moduleExists('devel_generate');
- $values = [];
- if ($exists && isset($entity->devel_generate)) {
- // If set by the form.
- if (isset($entity->devel_generate['domain_access'])) {
- $selection = array_filter($entity->devel_generate['domain_access']);
- if (isset($selection['random-selection'])) {
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $values[DOMAIN_ACCESS_FIELD] = array_rand($domains, ceil(rand(1, count($domains))));
- }
- else {
- $values[DOMAIN_ACCESS_FIELD] = array_keys($selection);
- }
- }
- if (isset($entity->devel_generate['domain_all'])) {
- $selection = $entity->devel_generate['domain_all'];
- if ($selection == 'random-selection') {
- $values[DOMAIN_ACCESS_ALL_FIELD] = rand(0, 1);
- }
- else {
- $values[DOMAIN_ACCESS_ALL_FIELD] = ($selection = 'yes' ? 1 : 0);
- }
- }
- foreach ($values as $name => $value) {
- $entity->set($name, $value);
- }
- }
-
-}
-
-/**
- * Implements hook_form_FORM_ID_alter().
- *
- * Add options for domains when using Devel Generate.
- */
-function domain_access_form_devel_generate_form_content_alter(&$form, &$form_state, $form_id) {
- // Add our element to the Devel generate form.
- $form['submit']['#weight'] = 10;
- $list = ['random-selection' => t('Random selection')];
- $list += \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList();
- $form['domain_access'] = [
- '#title' => t('Domains'),
- '#type' => 'checkboxes',
- '#options' => $list,
- '#weight' => 2,
- '#multiple' => TRUE,
- '#size' => count($list) > 5 ? 5 : count($list),
- '#default_value' => ['random-selection'],
- '#description' => t('Sets the domains for created nodes. Random selection overrides other choices.'),
- ];
- $form['domain_all'] = [
- '#title' => t('Send to all affiliates'),
- '#type' => 'radios',
- '#options' => [
- 'random-selection' => t('Random selection'),
- 'yes' => t('Yes'),
- 'no' => t('No'),
- ],
- '#default_value' => 'random-selection',
- '#weight' => 3,
- '#description' => t('Sets visibility across all affiliates.'),
- ];
-}
-
-/**
- * Implements hook_form_FORM_ID_alter().
- *
- * Add options for domains when using Devel Generate.
- */
-function domain_access_form_devel_generate_form_user_alter(&$form, &$form_state, $form_id) {
- domain_access_form_devel_generate_form_content_alter($form, $form_state, $form_id);
-}
-
-/**
- * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
- *
- * Move Domain Access fields to an advanced tab like other node settings.
- */
-function domain_access_form_node_form_alter(&$form, FormState $form_state, $form_id) {
- $move_enabled = \Drupal::config('domain_access.settings')->get('node_advanced_tab');
- if (
- $move_enabled && isset($form[DOMAIN_ACCESS_FIELD]) &&
- isset($form[DOMAIN_ACCESS_ALL_FIELD]) &&
- empty($form[DOMAIN_ACCESS_FIELD]['#group']) &&
- empty($form[DOMAIN_ACCESS_ALL_FIELD]['#group'])
- ) {
- // Move to the tabs on the entity form.
- $form[DOMAIN_ACCESS_FIELD]['#group'] = 'domain';
- $form[DOMAIN_ACCESS_ALL_FIELD]['#group'] = 'domain';
- $form['domain'] = [
- '#type' => 'details',
- '#open' => (bool) \Drupal::config('domain_access.settings')->get('node_advanced_tab_open'),
- '#title' => t('Domain settings'),
- '#group' => 'advanced',
- '#attributes' => [
- 'class' => ['node-form-options'],
- ],
- '#attached' => [
- 'library' => ['node/drupal.node'],
- ],
- '#weight' => 100,
- '#optional' => TRUE,
- ];
- }
- // Add the options hidden from the user silently to the form.
- $manager = \Drupal::service('domain.element_manager');
- $form = $manager->setFormOptions($form, $form_state, DOMAIN_ACCESS_FIELD);
-}
-
-/**
- * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\user\UserForm.
- *
- * Handle settings that the user cannot access.
- */
-function domain_access_form_user_form_alter(&$form, &$form_state, $form_id) {
- // Add the options hidden from the user silently to the form.
- $manager = \Drupal::service('domain.element_manager');
- $form = $manager->setFormOptions($form, $form_state, DOMAIN_ACCESS_FIELD);
-}
-
-/**
- * Implements hook_domain_references_alter().
- */
-function domain_access_domain_references_alter($query, $account, $context) {
- // Restrict domains by editorial assignment.
- if ($context['field_type'] != 'editor') {
- return;
- }
- switch ($context['entity_type']) {
- case 'node':
- if ($account->hasPermission('publish to any domain')) {
- break;
- }
- elseif ($account->hasPermission('publish to any assigned domain')) {
- if (!empty($account->get(DOMAIN_ACCESS_ALL_FIELD)->value)) {
- break;
- }
- $allowed = \Drupal::service('domain_access.manager')->getAccessValues($account);
- $query->condition('id', array_keys($allowed), 'IN');
- }
- else {
- // Remove all options.
- $query->condition('id', '-no-possible-match-');
- }
- break;
-
- case 'user':
- if ($account->hasPermission('assign editors to any domain')) {
- // Do nothing.
- }
- elseif ($account->hasPermission('assign domain editors')) {
- if (!empty($account->get(DOMAIN_ACCESS_ALL_FIELD)->value)) {
- break;
- }
- $allowed = \Drupal::service('domain_access.manager')->getAccessValues($account);
- $query->condition('id', array_keys($allowed), 'IN');
- }
- else {
- // Remove all options.
- $query->condition('id', '-no-possible-match-');
- }
- break;
-
- default:
- // No action taken.
- break;
- }
-}
-
-/**
- * Implements hook_node_access().
- */
-function domain_access_node_access(NodeInterface $node, $op, AccountInterface $account) {
- static $active_domain;
- if (!isset($active_domain)) {
- // Ensure that the loader has run. In some tests, the kernel event has not.
- $active = \Drupal::service('domain.negotiator')->getActiveDomain();
- if (empty($active)) {
- $active = \Drupal::service('domain.negotiator')->getActiveDomain(TRUE);
- }
- $active_domain = $active;
- }
- // Check to see that we have a valid active domain.
- // Without one, we cannot assert an opinion about access.
- if (!$active_domain || empty($active_domain->getDomainId())) {
- return AccessResult::neutral();
- }
-
- $type = $node->bundle();
- $manager = \Drupal::service('domain_access.manager');
- $allowed = FALSE;
-
- // In order to access update or delete, the user must be able to View.
- if ($op == 'view' && $manager->checkEntityAccess($node, $account)) {
- /** @var \Drupal\user\UserInterface $user */
- if ($node->isPublished()) {
- $allowed = TRUE;
- }
- elseif ($account->hasPermission('view unpublished domain content')) {
- $allowed = TRUE;
- }
- }
-
- if ($op == 'update') {
- if ($account->hasPermission('update ' . $type . ' content on assigned domains') && $manager->checkEntityAccess($node, $account)) {
- $allowed = TRUE;
- }
- elseif ($account->hasPermission('edit domain content') && $manager->checkEntityAccess($node, $account)) {
- $allowed = TRUE;
- }
- }
-
- if ($op == 'delete') {
- if ($account->hasPermission('delete ' . $type . ' content on assigned domains') && $manager->checkEntityAccess($node, $account)) {
- $allowed = TRUE;
- }
- elseif ($account->hasPermission('delete domain content') && $manager->checkEntityAccess($node, $account)) {
- $allowed = TRUE;
- }
- }
-
- if ($allowed) {
- return AccessResult::allowed()
- ->cachePerPermissions()
- ->cachePerUser()
- ->addCacheableDependency($node);
- }
-
- // No opinion.
- return AccessResult::neutral();
-}
-
-/**
- * Implements hook_node_create_access().
- *
- * @link https://www.drupal.org/node/2348203
- */
-function domain_access_node_create_access(AccountInterface $account, $context, $entity_bundle) {
- // Check to see that we have a valid active domain.
- // Without one, we cannot assert an opinion about access.
- /** @var \Drupal\domain\DomainInterface $active */
- if ($active = \Drupal::service('domain.negotiator')->getActiveDomain()) {
- $id = $active->getDomainId();
- }
- else {
- return AccessResult::neutral();
- }
- // Load the full user record.
- $user = \Drupal::entityTypeManager()->getStorage('user')->load($account->id());
- $user_domains = \Drupal::service('domain_access.manager')->getAccessValues($user);
- if (($account->hasPermission('create ' . $entity_bundle . ' content on assigned domains')
- || $account->hasPermission('create domain content'))
- && in_array($id, $user_domains)) {
- // Note the cache context here!
- return AccessResult::allowed()->addCacheContexts(['user.permissions', 'url.site']);
- }
- // No opinion.
- return AccessResult::neutral();
-}
-
-/**
- * Implements hook_entity_field_access().
- */
-function domain_access_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
- // Hide the domain access fields from the entity add/edit forms
- // when the user cannot access them.
- if ($operation != 'edit') {
- return AccessResult::neutral();
- }
-
- // The entity the field is attached to.
- $entity = $items->getEntity();
-
- if ($field_definition->getName() == DOMAIN_ACCESS_FIELD) {
- if ($entity instanceof AccountInterface) {
- $access = AccessResult::allowedIfHasPermissions($account, [
- 'assign domain editors',
- 'assign editors to any domain',
- ], 'OR');
- }
- elseif ($entity instanceof NodeInterface) {
- // Treat any other entity as content.
- $access = AccessResult::allowedIfHasPermissions($account, [
- 'publish to any domain',
- 'publish to any assigned domain',
- ], 'OR');
- }
- // allowedIfHasPermissions returns allowed() or neutral().
- // In this case, we want it to be forbidden,
- // if user doesn't have the permissions above.
- if (isset($access) && !$access->isAllowed()) {
- return AccessResult::forbidden();
- }
- }
- // Check permissions on the All Affiliates field.
- elseif ($field_definition->getName() == DOMAIN_ACCESS_ALL_FIELD) {
- if ($entity instanceof AccountInterface) {
- return AccessResult::forbiddenIf(!$account->hasPermission('assign editors to any domain'));
- }
- elseif ($entity instanceof NodeInterface) {
- // Treat any other entity as content.
- return AccessResult::forbiddenIf(!$account->hasPermission('publish to any domain'));
- }
- }
-
- return AccessResult::neutral();
-}
-
-/**
- * Implements hook_ENTITY_TYPE_insert().
- *
- * Creates our fields when new node types are created.
- */
-function domain_access_node_type_insert(EntityInterface $entity) {
- /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
- if (!$entity->isSyncing()) {
- // Do not fire hook when config sync in progress.
- domain_access_confirm_fields('node', $entity->id());
- }
-}
-
-/**
- * Implements hook_ENTITY_TYPE_insert().
- *
- * In some cases, form display modes are not set when the node type is created.
- * be sure to update our field definitions on creation of form_display for
- * node types.
- */
-function domain_access_entity_form_display_insert(EntityInterface $entity) {
- if (!$entity->isSyncing() && $entity->getTargetEntityTypeId() == 'node' && $bundle = $entity->getTargetBundle()) {
- domain_access_confirm_fields('node', $bundle);
- }
-}
-
-/**
- * Creates our fields for an entity bundle.
- *
- * @param string $entity_type
- * The entity type being created. Node and user are supported.
- * @param string $bundle
- * The bundle being created.
- * @param array $text
- * The text to use for the field. Keys are:
- * 'name' -- the lower-case, human-readable name of the entity.
- * 'label' -- the form label for the all affiliates field.
- * 'description' -- the help text for the all affiliates field.
- *
- * If calling this function for entities other than user or node, it is the
- * caller's responsibility to provide this text.
- *
- * This function is here for convenience during installation. It is not really
- * an API function. Modules wishing to add fields to non-node entities must
- * provide their own field storage. See the field storage YML sample in
- * tests/modules/domain_access_test for an example of field storage
- * definitions.
- *
- * @see domain_access_node_type_insert()
- * @see domain_access_install()
- */
-function domain_access_confirm_fields($entity_type, $bundle, array $text = []) {
- // We have reports that importing config causes this function to fail.
- try {
- $text['node'] = [
- 'name' => 'content',
- 'label' => 'Send to all affiliates',
- 'description' => 'Make this content available on all domains.',
- ];
- $text['user'] = [
- 'name' => 'user',
- 'label' => 'Editor for all affiliates',
- 'description' => 'Make this user an editor on all domains.',
- ];
-
- $id = $entity_type . '.' . $bundle . '.' . DOMAIN_ACCESS_FIELD;
-
- $field_storage = \Drupal::entityTypeManager()->getStorage('field_config');
- if (!$field = $field_storage->load($id)) {
- $field = [
- 'field_name' => DOMAIN_ACCESS_FIELD,
- 'entity_type' => $entity_type,
- 'label' => 'Domain Access',
- 'bundle' => $bundle,
- // Users should not be required to be a domain editor.
- 'required' => $entity_type !== 'user',
- 'description' => 'Select the affiliate domain(s) for this ' . $text[$entity_type]['name'],
- 'default_value_callback' => 'Drupal\domain_access\DomainAccessManager::getDefaultValue',
- 'settings' => [
- 'handler' => 'default:domain',
- // Handler_settings are deprecated but seem to be necessary here.
- 'handler_settings' => [
- 'target_bundles' => NULL,
- 'sort' => ['field' => 'weight', 'direction' => 'ASC'],
- ],
- 'target_bundles' => NULL,
- 'sort' => ['field' => 'weight', 'direction' => 'ASC'],
- ],
- ];
- $field_config = $field_storage->create($field);
- $field_config->save();
- }
- // Assign the all affiliates field.
- $id = $entity_type . '.' . $bundle . '.' . DOMAIN_ACCESS_ALL_FIELD;
- if (!$field = $field_storage->load($id)) {
- $field = [
- 'field_name' => DOMAIN_ACCESS_ALL_FIELD,
- 'entity_type' => $entity_type,
- 'label' => $text[$entity_type]['label'],
- 'bundle' => $bundle,
- 'required' => FALSE,
- 'description' => $text[$entity_type]['description'],
- ];
- $field_config = $field_storage->create($field);
- $field_config->save();
- }
- // Tell the form system how to behave. Default to radio buttons.
- if ($display = \Drupal::entityTypeManager()->getStorage('entity_form_display')->load($entity_type . '.' . $bundle . '.default')) {
- $display->setComponent(DOMAIN_ACCESS_FIELD, [
- 'type' => 'options_buttons',
- 'weight' => 40,
- ])->setComponent(DOMAIN_ACCESS_ALL_FIELD, [
- 'type' => 'boolean_checkbox',
- 'settings' => ['display_label' => 1],
- 'weight' => 41,
- ])->save();
- }
- }
- catch (Exception $e) {
- \Drupal::logger('domain_access')->notice('Field installation failed.');
- }
-}
-
-/**
- * Implements hook_views_data_alter().
- */
-function domain_access_views_data_alter(array &$data) {
- $table = 'node__' . DOMAIN_ACCESS_FIELD;
- $data[$table][DOMAIN_ACCESS_FIELD]['field']['id'] = 'domain_access_field';
- $data[$table][DOMAIN_ACCESS_FIELD . '_target_id']['filter']['id'] = 'domain_access_filter';
- $data[$table][DOMAIN_ACCESS_FIELD . '_target_id']['argument']['id'] = 'domain_access_argument';
-
- // Current domain filter.
- $data[$table]['current_all'] = [
- 'title' => t('Current domain'),
- 'group' => t('Domain'),
- 'filter' => [
- 'field' => DOMAIN_ACCESS_FIELD . '_target_id',
- 'id' => 'domain_access_current_all_filter',
- 'title' => t('Available on current domain'),
- 'help' => t('Filters out nodes not available on current domain (published to current domain or all affiliates).'),
- ],
- ];
- // Since domains are not stored in the database, relationships cannot be used.
- unset($data[$table][DOMAIN_ACCESS_FIELD]['relationship']);
-
- // Set the user data.
- $table = 'user__' . DOMAIN_ACCESS_FIELD;
- $data[$table][DOMAIN_ACCESS_FIELD]['field']['id'] = 'domain_access_field';
- $data[$table][DOMAIN_ACCESS_FIELD . '_target_id']['filter']['id'] = 'domain_access_filter';
- $data[$table][DOMAIN_ACCESS_FIELD . '_target_id']['argument']['id'] = 'domain_access_argument';
-
- // Since domains are not stored in the database, relationships cannot be used.
- unset($data[$table][DOMAIN_ACCESS_FIELD]['relationship']);
-}
-
-/**
- * Implements hook_ENTITY_TYPE_insert().
- */
-function domain_access_domain_insert($entity) {
- /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
- if ($entity->isSyncing()) {
- // Do not fire hook when config sync in progress.
- return;
- }
- $id = 'domain_access_add_action.' . $entity->id();
- $controller = \Drupal::entityTypeManager()->getStorage('action');
- if (!$controller->load($id)) {
- /** @var \Drupal\system\Entity\Action $action */
- $action = $controller->create([
- 'id' => $id,
- 'type' => 'node',
- 'label' => t('Add selected content to the @label domain', ['@label' => $entity->label()]),
- 'configuration' => [
- 'domain_id' => $entity->id(),
- ],
- 'plugin' => 'domain_access_add_action',
- ]);
- $action->trustData()->save();
- }
- $remove_id = 'domain_access_remove_action.' . $entity->id();
- if (!$controller->load($remove_id)) {
- /** @var \Drupal\system\Entity\Action $action */
- $action = $controller->create([
- 'id' => $remove_id,
- 'type' => 'node',
- 'label' => t('Remove selected content from the @label domain', ['@label' => $entity->label()]),
- 'configuration' => [
- 'domain_id' => $entity->id(),
- ],
- 'plugin' => 'domain_access_remove_action',
- ]);
- $action->trustData()->save();
- }
- $id = 'domain_access_add_editor_action.' . $entity->id();
- if (!$controller->load($id)) {
- /** @var \Drupal\system\Entity\Action $action */
- $action = $controller->create([
- 'id' => $id,
- 'type' => 'user',
- 'label' => t('Add editors to the @label domain', ['@label' => $entity->label()]),
- 'configuration' => [
- 'domain_id' => $entity->id(),
- ],
- 'plugin' => 'domain_access_add_editor_action',
- ]);
- $action->trustData()->save();
- }
- $remove_id = 'domain_access_remove_editor_action.' . $entity->id();
- if (!$controller->load($remove_id)) {
- /** @var \Drupal\system\Entity\Action $action */
- $action = $controller->create([
- 'id' => $remove_id,
- 'type' => 'user',
- 'label' => t('Remove editors from the @label domain', ['@label' => $entity->label()]),
- 'configuration' => [
- 'domain_id' => $entity->id(),
- ],
- 'plugin' => 'domain_access_remove_editor_action',
- ]);
- $action->trustData()->save();
- }
-}
-
-/**
- * Implements hook_ENTITY_TYPE_delete().
- */
-function domain_access_domain_delete(EntityInterface $entity) {
- $controller = \Drupal::entityTypeManager()->getStorage('action');
- $actions = $controller->loadMultiple([
- 'domain_access_add_action.' . $entity->id(),
- 'domain_access_remove_action.' . $entity->id(),
- 'domain_access_add_editor_action.' . $entity->id(),
- 'domain_access_remove_editor_action.' . $entity->id(),
- ]);
- foreach ($actions as $action) {
- $action->delete();
- }
-}
-
-/**
- * Implements hook_form_alter().
- *
- * Find forms that contain the domain access field and allow those to handle
- * default values properly. Note that here we just care if the form saves an
- * entity. We then pass that entity to a helper function.
- *
- * @see domain_access_default_form_values()
- */
-function domain_access_form_alter(&$form, &$form_state, $form_id) {
- if ($object = $form_state->getFormObject() && !empty($object) && is_callable([$object, 'getEntity']) && $entity = $object->getEntity()) {
- domain_access_default_form_values($form, $form_state, $entity);
- }
-}
-
-/**
- * Defines default values for domain access field.
- *
- * This function is a workaround for a core bug. When the domain access field
- * is not accessible to some users, the existing values are not preserved.
- *
- * @see domain_access_entity_field_access()
- */
-function domain_access_default_form_values(&$form, &$form_state, $entity) {
- // Set domain access default value when the user does not have access
- // to edit the field. This seems to work fine for all affiliates, which
- // suggests a core bug in entity reference handling.
- if (!$entity->isNew() &&
- isset($form['field_domain_access']) &&
- !$form['field_domain_access']['#access'] &&
- empty($form['field_domain_access']['widget']['#default_value'])
- ) {
- // Set the default values correctly.
- $values = \Drupal::service('domain_access.manager')->getAccessValues($entity);
- $form['field_domain_access']['widget']['#default_value'] = array_keys($values);
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.permissions.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.permissions.yml
deleted file mode 100644
index b05ebf58b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.permissions.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-permission_callbacks:
- - Drupal\domain_access\DomainAccessPermissions::permissions
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.routing.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.routing.yml
deleted file mode 100644
index fb3071dab..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-domain_access.settings:
- path: '/admin/config/domain/domain_access'
- defaults:
- _title: 'Domain Access settings'
- _form: '\Drupal\domain_access\Form\DomainAccessSettingsForm'
- requirements:
- _permission: 'administer domains'
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.services.yml b/sites/all/modules/contrib/admin/domain/domain_access/domain_access.services.yml
deleted file mode 100644
index 3ae6c385a..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/domain_access.services.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-services:
- domain_access.manager:
- class: Drupal\domain_access\DomainAccessManager
- arguments: ['@domain.negotiator', '@module_handler', '@entity_type.manager']
- access_check.domain_access_views:
- class: Drupal\domain_access\Access\DomainAccessViewsAccess
- arguments: ['@entity_type.manager', '@domain_access.manager']
- tags:
- - { name: access_check, applies_to: _domain_access_views }
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/drush.services.yml b/sites/all/modules/contrib/admin/domain/domain_access/drush.services.yml
deleted file mode 100644
index e7541c0ec..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/drush.services.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-services:
- domain_access.commands:
- class: \Drupal\domain_access\Commands\DomainAccessCommands
- tags:
- - { name: drush.command }
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Access/DomainAccessViewsAccess.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Access/DomainAccessViewsAccess.php
deleted file mode 100644
index 783e61b24..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Access/DomainAccessViewsAccess.php
+++ /dev/null
@@ -1,105 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->domainStorage = $this->entityTypeManager->getStorage('domain');
- $this->userStorage = $this->entityTypeManager->getStorage('user');
- $this->manager = $manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public function access(Route $route, AccountInterface $account, $arg_0 = NULL) {
- // Permissions are stored on the route defaults.
- $permission = $route->getDefault('domain_permission');
- $allPermission = $route->getDefault('domain_all_permission');
-
- // Users with this permission can see any domain content lists, and it is
- // required to view all affiliates.
- if ($account->hasPermission($allPermission)) {
- return AccessResult::allowed();
- }
-
- // Load the domain from the passed argument. In testing, this passed NULL
- // in some instances.
- if (!is_null($arg_0)) {
- $domain = $this->domainStorage->load($arg_0);
- }
-
- // Domain found, check user permissions.
- if (!empty($domain)) {
- if ($this->manager->hasDomainPermissions($account, $domain, [$permission])) {
- return AccessResult::allowed();
- }
- }
- return AccessResult::forbidden();
- }
-
- /**
- * {@inheritdoc}
- */
- public function applies(Route $route) {
- return $route->hasRequirement($this->requirementsKey);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Commands/DomainAccessCommands.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Commands/DomainAccessCommands.php
deleted file mode 100644
index fe408cb3f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Commands/DomainAccessCommands.php
+++ /dev/null
@@ -1,79 +0,0 @@
-getFieldEntities(DOMAIN_ACCESS_FIELD);
-
- return $result;
- }
-
-/**
- * @hook option domain:delete
- */
- public function deleteOptions(Command $command, AnnotationData $annotationData) {
- $command->addOption(
- 'content-assign',
- '',
- InputOption::VALUE_OPTIONAL,
- 'Reassign content for Domain Access',
- null
- );
- }
-
-/**
- * @hook on-event domain-delete
- */
- public function domainAccessDomainDelete($target_domain, $options) {
- // Run our own deletion routine here.
- if (is_null($options['content-assign'])) {
- $policy_content = 'prompt';
- }
- if (!empty($options['content-assign'])) {
- if (in_array($options['content-assign'], $this->reassignment_policies, TRUE)) {
- $policy_content = $options['content-assign'];
- }
- }
-
- $delete_options = [
- 'entity_filter' => 'node',
- 'policy' => $policy_content,
- 'field' => DOMAIN_ACCESS_FIELD,
- ];
-
- return $this->doReassign($target_domain, $delete_options);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManager.php b/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManager.php
deleted file mode 100644
index b498d0228..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManager.php
+++ /dev/null
@@ -1,203 +0,0 @@
-negotiator = $negotiator;
- $this->moduleHandler = $module_handler;
- $this->entityTypeManager = $entity_type_manager;
- $this->domainStorage = $entity_type_manager->getStorage('domain');
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getAccessValues(FieldableEntityInterface $entity, $field_name = DOMAIN_ACCESS_FIELD) {
- // @TODO: static cache.
- $list = [];
- // @TODO In tests, $entity is returning NULL.
- if (is_null($entity)) {
- return $list;
- }
- // Get the values of an entity.
- $values = $entity->hasField($field_name) ? $entity->get($field_name) : NULL;
- // Must be at least one item.
- if (!empty($values)) {
- foreach ($values as $item) {
- if ($target = $item->getValue()) {
- if ($domain = \Drupal::entityTypeManager()->getStorage('domain')->load($target['target_id'])) {
- $list[$domain->id()] = $domain->getDomainId();
- }
- }
- }
- }
- return $list;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getAllValue(FieldableEntityInterface $entity) {
- return $entity->hasField(DOMAIN_ACCESS_ALL_FIELD) ? $entity->get(DOMAIN_ACCESS_ALL_FIELD)->value : NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function checkEntityAccess(FieldableEntityInterface $entity, AccountInterface $account) {
- $entity_domains = $this->getAccessValues($entity);
- $user = \Drupal::entityTypeManager()->getStorage('user')->load($account->id());
- if (!empty($this->getAllValue($user)) && !empty($entity_domains)) {
- return TRUE;
- }
- $user_domains = $this->getAccessValues($user);
- return (bool) !empty(array_intersect($entity_domains, $user_domains));
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getDefaultValue(FieldableEntityInterface $entity, FieldDefinitionInterface $definition) {
- $item = [];
- if (!$entity->isNew()) {
- // If set, ensure we do not drop existing data.
- foreach (self::getAccessValues($entity) as $id) {
- $item[] = $id;
- }
- }
- // When creating a new entity, populate if required.
- elseif ($entity->getFieldDefinition(DOMAIN_ACCESS_FIELD)->isRequired()) {
- /** @var \Drupal\domain\DomainInterface $active */
- if ($active = \Drupal::service('domain.negotiator')->getActiveDomain()) {
- $item[0]['target_uuid'] = $active->uuid();
- }
- }
- return $item;
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasDomainPermissions(AccountInterface $account, DomainInterface $domain, array $permissions, $conjunction = 'AND') {
- // Assume no access.
- $access = FALSE;
-
- // In the case of multiple AND permissions, assume access and then deny if
- // any check fails.
- if ($conjunction == 'AND' && !empty($permissions)) {
- $access = TRUE;
- foreach ($permissions as $permission) {
- if (!($permission_access = $account->hasPermission($permission))) {
- $access = FALSE;
- break;
- }
- }
- }
- // In the case of multiple OR permissions, assume deny and then allow if any
- // check passes.
- else {
- foreach ($permissions as $permission) {
- if ($permission_access = $account->hasPermission($permission)) {
- $access = TRUE;
- break;
- }
- }
- }
- // Validate that the user is assigned to the domain. If not, deny.
- $user = \Drupal::entityTypeManager()->getStorage('user')->load($account->id());
- $allowed = $this->getAccessValues($user);
- if (!isset($allowed[$domain->id()]) && empty($this->getAllValue($user))) {
- $access = FALSE;
- }
-
- return $access;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getContentUrls(FieldableEntityInterface $entity) {
- $list = [];
- $processed = FALSE;
- $domains = $this->getAccessValues($entity);
- if ($this->moduleHandler->moduleExists('domain_source')) {
- $source = domain_source_get($entity);
- if (isset($domains[$source])) {
- unset($domains['source']);
- }
- if (!empty($source)) {
- $list[] = $source;
- }
- $processed = TRUE;
- }
- $list = array_merge($list, array_keys($domains));
- $domains = $this->domainStorage->loadMultiple($list);
- $urls = [];
- foreach ($domains as $domain) {
- $options['domain_target_id'] = $domain->id();
- $url = $entity->toUrl('canonical', $options);
- if ($processed) {
- $urls[$domain->id()] = $url->toString();
- }
- else {
- $urls[$domain->id()] = trim($domain->getPath(), '/') . $url->toString();
- }
- }
- return $urls;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManagerInterface.php b/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManagerInterface.php
deleted file mode 100644
index 7f2f67ddc..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/DomainAccessManagerInterface.php
+++ /dev/null
@@ -1,95 +0,0 @@
- [
- 'title' => $this->t('Assign additional editors to assigned domains'),
- 'restrict access' => TRUE,
- ],
- 'assign editors to any domain' => [
- 'title' => $this->t('Assign additional editors to any domains'),
- 'restrict access' => TRUE,
- ],
- 'publish to any domain' => [
- 'title' => $this->t('Publish to any domain'),
- ],
- 'publish to any assigned domain' => [
- 'title' => $this->t('Publish content to any assigned domain'),
- ],
- 'create domain content' => [
- 'title' => $this->t('Create any content on assigned domains'),
- ],
- 'edit domain content' => [
- 'title' => $this->t('Edit any content on assigned domains'),
- ],
- 'delete domain content' => [
- 'title' => $this->t('Delete any content on assigned domains'),
- ],
- 'view unpublished domain content' => [
- 'title' => $this->t('View unpublished content on assigned domains'),
- 'restrict access' => TRUE,
- ],
- ];
-
- // Generate standard node permissions for all applicable node types.
- foreach (NodeType::loadMultiple() as $type) {
- $permissions += $this->nodePermissions($type);
- }
-
- return $permissions;
- }
-
- /**
- * Helper method to generate standard node permission list for a given type.
- *
- * Shamelessly lifted from node_list_permissions().
- *
- * @param \Drupal\node\Entity\NodeType $type
- * The node type object.
- *
- * @return array
- * An array of permission names and descriptions.
- */
- private function nodePermissions(NodeType $type) {
- // Build standard list of node permissions for this type.
- $id = $type->id();
- $perms = [
- "create $id content on assigned domains" => [
- 'title' => $this->t('%type_name: Create new content on assigned domains', ['%type_name' => $type->label()]),
- ],
- "update $id content on assigned domains" => [
- 'title' => $this->t('%type_name: Edit any content on assigned domains', ['%type_name' => $type->label()]),
- ],
- "delete $id content on assigned domains" => [
- 'title' => $this->t('%type_name: Delete any content on assigned domains', ['%type_name' => $type->label()]),
- ],
- ];
-
- return $perms;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Form/DomainAccessSettingsForm.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Form/DomainAccessSettingsForm.php
deleted file mode 100644
index 2aa0dc4df..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Form/DomainAccessSettingsForm.php
+++ /dev/null
@@ -1,66 +0,0 @@
-config('domain_access.settings');
- $form['node_advanced_tab'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Move Domain Access fields to advanced node settings.'),
- '#default_value' => $config->get('node_advanced_tab'),
- '#description' => $this->t('When checked the Domain Access fields will be shown as a tab in the advanced settings on node edit form. However, if you have placed the fields in a field group already, they will not be moved.'),
- ];
- $form['node_advanced_tab_open'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Open the Domain Access details.'),
- '#description' => $this->t('Set the details tab to be open by default.'),
- '#default_value' => $config->get('node_advanced_tab_open'),
- '#states' => [
- 'visible' => [
- ':input[name="node_advanced_tab"]' => ['checked' => TRUE],
- ],
- ],
- ];
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->config('domain_access.settings')
- ->set('node_advanced_tab', (bool) $form_state->getValue('node_advanced_tab'))
- ->set('node_advanced_tab_open', (bool) $form_state->getValue('node_advanced_tab_open'))
- ->save();
-
- parent::submitForm($form, $form_state);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessActionBase.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessActionBase.php
deleted file mode 100644
index 4f074e820..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessActionBase.php
+++ /dev/null
@@ -1,100 +0,0 @@
-entityType = $entity_type;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('entity.manager')->getDefinition('domain')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function defaultConfiguration() {
- return [
- 'domain_id' => '',
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList();
- $form['domain_id'] = [
- '#type' => 'checkboxes',
- '#title' => t('Domain'),
- '#options' => $domains,
- '#default_value' => $this->configuration['id'],
- '#required' => TRUE,
- ];
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $this->configuration['domain_id'] = $form_state->getValue('domain_id');
- }
-
- /**
- * {@inheritdoc}
- */
- public function calculateDependencies() {
- if (!empty($this->configuration['domain_id'])) {
- $prefix = $this->entityType->getConfigPrefix() . '.';
- $this->addDependency('config', $prefix . $this->configuration['domain_id']);
- }
- return $this->dependencies;
- }
-
- /**
- * {@inheritdoc}
- */
- public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
- /** @var \Drupal\user\UserInterface $object */
- // @TODO: fix this logic.
- $access = $object->access('update', $account, TRUE);
-
- return $return_as_object ? $access : $access->isAllowed();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAdd.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAdd.php
deleted file mode 100644
index 5d388405e..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAdd.php
+++ /dev/null
@@ -1,31 +0,0 @@
-configuration['domain_id'];
- $node_domains = \Drupal::service('domain_access.manager')->getAccessValues($entity);
-
- // Add domain assignment if not present.
- if ($entity !== FALSE && !isset($node_domains[$id])) {
- $node_domains[$id] = $id;
- $entity->set(DOMAIN_ACCESS_FIELD, array_keys($node_domains));
- $entity->save();
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAddEditor.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAddEditor.php
deleted file mode 100644
index e6e963de9..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAddEditor.php
+++ /dev/null
@@ -1,31 +0,0 @@
-configuration['domain_id'];
- $user_domains = \Drupal::service('domain_access.manager')->getAccessValues($entity);
-
- // Skip adding the role to the user if they already have it.
- if ($entity !== FALSE && !isset($user_domains[$id])) {
- $user_domains[$id] = $id;
- $entity->set(DOMAIN_ACCESS_FIELD, array_keys($user_domains));
- $entity->save();
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAll.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAll.php
deleted file mode 100644
index 8ccd91397..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessAll.php
+++ /dev/null
@@ -1,24 +0,0 @@
-set(DOMAIN_ACCESS_ALL_FIELD, 1);
- $entity->save();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditAll.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditAll.php
deleted file mode 100644
index dc2dfa772..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditAll.php
+++ /dev/null
@@ -1,24 +0,0 @@
-set(DOMAIN_ACCESS_ALL_FIELD, 1);
- $entity->save();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditNone.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditNone.php
deleted file mode 100644
index ee3ba9855..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessEditNone.php
+++ /dev/null
@@ -1,24 +0,0 @@
-set(DOMAIN_ACCESS_ALL_FIELD, 0);
- $entity->save();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessNone.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessNone.php
deleted file mode 100644
index 53d670a2b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessNone.php
+++ /dev/null
@@ -1,24 +0,0 @@
-set(DOMAIN_ACCESS_ALL_FIELD, 0);
- $entity->save();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemove.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemove.php
deleted file mode 100644
index d6c676c1a..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemove.php
+++ /dev/null
@@ -1,31 +0,0 @@
-configuration['domain_id'];
- $node_domains = \Drupal::service('domain_access.manager')->getAccessValues($entity);
-
- // Remove domain assignment if present.
- if ($entity !== FALSE && isset($node_domains[$id])) {
- unset($node_domains[$id]);
- $entity->set(DOMAIN_ACCESS_FIELD, array_keys($node_domains));
- $entity->save();
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemoveEditor.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemoveEditor.php
deleted file mode 100644
index 0c2e27905..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/Action/DomainAccessRemoveEditor.php
+++ /dev/null
@@ -1,31 +0,0 @@
-configuration['domain_id'];
- $user_domains = \Drupal::service('domain_access.manager')->getAccessValues($entity);
-
- // Skip adding the role to the user if they already have it.
- if ($entity !== FALSE && isset($user_domains[$id])) {
- unset($user_domains[$id]);
- $entity->set(DOMAIN_ACCESS_FIELD, array_keys($user_domains));
- $entity->save();
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessContent.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessContent.php
deleted file mode 100644
index c58af3de0..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessContent.php
+++ /dev/null
@@ -1,170 +0,0 @@
-domainStorage = $domain_storage;
- $this->userStorage = $user_storage;
- $this->manager = $manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('entity_type.manager')->getStorage('domain'),
- $container->get('entity_type.manager')->getStorage('user'),
- $container->get('domain_access.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function summaryTitle() {
- return $this->t('Domain editor');
- }
-
- /**
- * {@inheritdoc}
- */
- public function access(AccountInterface $account) {
- // Users with this permission can see any domain content lists, and it is
- // required to view all affiliates.
- if ($account->hasPermission($this->allPermission)) {
- return TRUE;
- }
-
- // The routine below determines what domain (if any) was passed to the View.
- if (isset($this->view->element['#arguments'])) {
- foreach ($this->view->element['#arguments'] as $value) {
- if ($domain = $this->domainStorage->load($value)) {
- break;
- }
- }
- }
-
- // Domain found, check user permissions.
- if (!empty($domain)) {
- return $this->manager->hasDomainPermissions($account, $domain, [$this->permission]);
- }
- return FALSE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function alterRouteDefinition(Route $route) {
- if ($domains = $this->domainStorage->loadMultiple()) {
- $list = array_keys($domains);
- }
- $list[] = 'all_affiliates';
- $route->setRequirement('_domain_access_views', (string) implode('+', $list));
- $route->setDefault('domain_permission', $this->permission);
- $route->setDefault('domain_all_permission', $this->allPermission);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheMaxAge() {
- return Cache::PERMANENT;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheContexts() {
- return ['user'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheTags() {
- return [];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessEditor.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessEditor.php
deleted file mode 100644
index 2a34b2a8c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/access/DomainAccessEditor.php
+++ /dev/null
@@ -1,30 +0,0 @@
-getStorage('domain')->load($this->argument)) {
- return $domain->label();
- }
- return parent::title();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/field/DomainAccessField.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/field/DomainAccessField.php
deleted file mode 100644
index 7dd279855..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/field/DomainAccessField.php
+++ /dev/null
@@ -1,50 +0,0 @@
-options['settings']['link'])) {
- foreach ($items as &$item) {
- $object = $item['raw'];
- $entity = $object->getEntity();
- $url = $entity->toUrl()->toString();
- $domain = $item['rendered']['#options']['entity'];
- $item['rendered']['#type'] = 'markup';
- $item['rendered']['#markup'] = '' . $domain->label() . '';
- }
- uasort($items, [$this, 'sort']);
- }
-
- return $items;
- }
-
- /**
- * Sort the domain list, if possible.
- */
- private function sort($a, $b) {
- $domainA = isset($a['rendered']['#options']['entity']) ? $a['rendered']['#options']['entity'] : 0;
- $domainB = isset($b['rendered']['#options']['entity']) ? $b['rendered']['#options']['entity'] : 0;
- if ($domainA !== 0) {
- return $domainA->getWeight() > $domainB->getWeight();
- }
- // We don't have a domain object so sort as best we can.
- return $a['rendered']['#plain_text'] > $b['rendered']['#plain_text'];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php
deleted file mode 100644
index a32c19d1b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessCurrentAllFilter.php
+++ /dev/null
@@ -1,73 +0,0 @@
-value_value = t('Available on current domain');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getValueOptions() {
- $this->valueOptions = [1 => $this->t('Yes'), 0 => $this->t('No')];
- }
-
- /**
- * {@inheritdoc}
- */
- protected function operators() {
- return [];
- }
-
- /**
- * {@inheritdoc}
- */
- public function query() {
- $this->ensureMyTable();
- // @TODO: Proper abstraction of table and field name.
- $all_table = $this->query->ensureTable('node__field_domain_all_affiliates');
- $current_domain = \Drupal::service('domain.negotiator')->getActiveId();
- if (empty($this->value)) {
- // @TODO proper handling of NULL?
- $where = "$this->tableAlias.$this->realField <> '$current_domain'";
- $where = '(' . $where . " OR $this->tableAlias.$this->realField IS NULL)";
- $where = '(' . $where . " AND ($all_table.field_domain_all_affiliates_value = 0 OR $all_table.field_domain_all_affiliates_value IS NULL))";
- }
- else {
- $where = "($this->tableAlias.$this->realField = '$current_domain' OR $all_table.field_domain_all_affiliates_value = 1)";
- }
- $this->query->addWhereExpression($this->options['group'], $where);
- // This filter causes duplicates.
- $this->query->options['distinct'] = TRUE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheContexts() {
- $contexts = parent::getCacheContexts();
-
- $contexts[] = 'url.site';
-
- return $contexts;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessFilter.php b/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessFilter.php
deleted file mode 100644
index 9952a00c8..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/src/Plugin/views/filter/DomainAccessFilter.php
+++ /dev/null
@@ -1,26 +0,0 @@
-valueOptions)) {
- $this->valueTitle = $this->t('Domains');
- $this->valueOptions = \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList();
- }
- return $this->valueOptions;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_access.yml b/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_access.yml
deleted file mode 100644
index a37af529c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_access.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - taxonomy
-id: taxonomy_term.field_domain_access
-field_name: field_domain_access
-entity_type: taxonomy_term
-type: entity_reference
-settings:
- target_type: domain
-module: core
-locked: false
-cardinality: -1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_all_affiliates.yml b/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_all_affiliates.yml
deleted file mode 100644
index 407d58ca3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/config/install/field.storage.taxonomy_term.field_domain_all_affiliates.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - taxonomy
-id: taxonomy_term.field_domain_all_affiliates
-field_name: field_domain_all_affiliates
-entity_type: taxonomy_term
-type: boolean
-settings: { }
-module: core
-locked: false
-cardinality: -1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/domain_access_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/domain_access_test.info.yml
deleted file mode 100644
index b9635a950..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/modules/domain_access_test/domain_access_test.info.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: "Domain Access module tests"
-description: "Support module for domain access testing."
-type: module
-package: Testing
-# version: VERSION
-# core: 8.x
-hidden: TRUE
-
-dependencies:
- - domain
- - domain_access
- - taxonomy
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessAllAffiliatesTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessAllAffiliatesTest.php
deleted file mode 100644
index 56c857e5e..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessAllAffiliatesTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-admin_user = $this->drupalCreateUser([
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Visit the article field administration page.
- $this->drupalGet('admin/structure/types/manage/article/fields');
- $this->assertResponse(200, 'Manage fields page accessed.');
-
- // Check for the field.
- $this->assertText($label, 'Domain form field found.');
-
- // Visit the article field display administration page.
- $this->drupalGet('admin/structure/types/manage/article/display');
- $this->assertResponse(200, 'Manage field display page accessed.');
-
- // Check for the field.
- $this->assertText($label, 'Domain form field found.');
- }
-
- /**
- * Tests the storage of the domain access field.
- */
- public function testDomainAccessAllFieldStorage() {
- $label = 'Send to all affiliates';
- $this->admin_user = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- 'publish to any domain',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Create 5 domains.
- $this->domainCreateTestDomains(5);
-
- // Visit the article field display administration page.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200);
-
- // Check the new field exists on the page.
- $this->assertText($label, 'Found the domain field instance.');
-
- // We expect to find 5 domain options.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- foreach ($domains as $domain) {
- $string = 'value="' . $domain->id() . '"';
- $this->assertRaw($string, 'Found the domain option.');
- if (!isset($one)) {
- $one = $domain->id();
- continue;
- }
- if (!isset($two)) {
- $two = $domain->id();
- }
- }
-
- // Try to post a node, assigned to the first two domains.
- $edit['title[0][value]'] = 'Test node';
- $edit["field_domain_access[{$one}]"] = TRUE;
- $edit["field_domain_access[{$two}]"] = TRUE;
- $edit["field_domain_all_affiliates[value]"] = 1;
- $this->drupalPostForm('node/add/article', $edit, 'Save');
- $this->assertResponse(200);
- $node = \Drupal::entityTypeManager()->getStorage('node')->load(1);
- // Check that two values are set.
- $values = \Drupal::service('domain_access.manager')->getAccessValues($node);
- $this->assertTrue(count($values) == 2, 'Node saved with two domain records.');
- // Check that all affiliates is set.
- $this->assertTrue(!empty($node->get(DOMAIN_ACCESS_ALL_FIELD)->value), 'Node assigned to all affiliates.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessContentUrlsTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessContentUrlsTest.php
deleted file mode 100644
index 7b68a1747..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessContentUrlsTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
- 'page',
- 'title' => 'foo',
- DOMAIN_ACCESS_FIELD => [
- 'example_com',
- 'one_example_com',
- 'two_example_com',
- ],
- DOMAIN_ACCESS_ALL_FIELD => 0,
- ];
- $node = $this->createNode($nodes_values);
-
- // Variables for our tests.
- $path = 'node/1';
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $route_name = 'entity.node.canonical';
- $route_parameters = ['node' => 1];
- $uri = 'entity:' . $path;
- $uri_path = '/' . $path;
- $expected = $uri_path;
- $options = [];
-
- // Get the link using Url::fromRoute().
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- $this->assertTrue($url == $expected, 'fromRoute');
-
- // Get the link using Url::fromUserInput()
- $url = URL::fromUserInput($uri_path, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUserInput');
-
- // Get the link using Url::fromUri()
- $url = URL::fromUri($uri, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUri');
-
- // Get the path processor service.
- $paths = \Drupal::service('domain_access.manager');
- $urls = $paths->getContentUrls($node);
- $expected = [
- 'example_com' => $domains['example_com']->getPath() . 'node/1',
- $id => $domains[$id]->getPath() . 'node/1',
- 'two_example_com' => $domains['two_example_com']->getPath() . 'node/1',
- ];
- $this->assertTrue($expected == $urls);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessDefaultValueTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessDefaultValueTest.php
deleted file mode 100644
index 3610b50c9..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessDefaultValueTest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-admin_user = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- 'publish to any domain',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Create 5 domains.
- $this->domainCreateTestDomains(5);
-
- // Visit the article field display administration page.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200);
-
- // Check the new field exists on the page.
- $this->assertText('Domain Access', 'Found the domain field instance.');
- $this->assertRaw('name="field_domain_access[example_com]" value="example_com" checked="checked"', 'Default domain selected.');
- // Check the all affiliates field.
- $this->assertText('Send to all affiliates', 'Found the all affiliates field instance.');
- $this->assertNoRaw('name="field_domain_all_affiliates[value]" value="1" checked="checked"', 'All affiliates not selected.');
-
- // Now save the node with the values set.
- $edit = [
- 'title[0][value]' => 'Test node',
- 'field_domain_access[example_com]' => 'example_com',
- ];
- $this->drupalPostForm('node/add/article', $edit, 'Save');
-
- // Load the node.
- $node = \Drupal::entityTypeManager()->getStorage('node')->load(1);
- $this->assertTrue($node, 'Article node created.');
- // Check that the values are set.
- $values = \Drupal::service('domain_access.manager')->getAccessValues($node);
- $this->assertTrue(count($values) == 1, 'Node saved with one domain record.');
- $allValue = \Drupal::service('domain_access.manager')->getAllValue($node);
- $this->assertTrue(empty($allValue), 'Not sent to all affiliates.');
-
- // Logout the admin user.
- $this->drupalLogout();
-
- // Create a limited value user.
- $this->test_user = $this->drupalCreateUser([
- 'create article content',
- 'edit any article content',
- ]);
-
- // Login and try to edit the created node.
- $this->drupalLogin($this->test_user);
-
- $this->drupalGet('node/1/edit');
- $this->assertResponse(200);
-
- // Now save the node with the values set.
- $edit = [
- 'title[0][value]' => 'Test node update',
- ];
- $this->drupalPostForm('node/1/edit', $edit, 'Save');
-
- // Load the node.
- $node = \Drupal::entityTypeManager()->getStorage('node')->load(1);
- $this->assertTrue($node, 'Article node created.');
- // Check that the values are set.
- $values = \Drupal::service('domain_access.manager')->getAccessValues($node);
- $this->assertTrue(count($values) == 1, 'Node saved with one domain record.');
- $allValue = \Drupal::service('domain_access.manager')->getAllValue($node);
- $this->assertTrue(empty($allValue), 'Not sent to all affiliates.');
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessElementTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessElementTest.php
deleted file mode 100644
index dc2019a68..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessElementTest.php
+++ /dev/null
@@ -1,151 +0,0 @@
-domainCreateTestDomains(5);
- }
-
- /**
- * Test runner.
- */
- public function testDomainAccessElement() {
- $this->runInstalledTest('article');
- $node_type = $this->createContentType(['type' => 'test']);
- $this->runInstalledTest('test');
- }
-
- /**
- * Basic test setup.
- */
- public function runInstalledTest($node_type) {
- $admin = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- 'publish to any domain',
- ]);
- $this->drupalLogin($admin);
-
- $this->drupalGet('node/add/' . $node_type);
- $this->assertSession()->statusCodeEquals(200);
-
- // Set the title, so the node can be saved.
- $this->fillField('title[0][value]', 'Test node');
-
- // We expect to find 5 domain options. We set two as selected.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $count = 0;
- $ids = ['example_com', 'one_example_com', 'two_example_com'];
- foreach ($domains as $domain) {
- $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if (in_array($domain->id(), $ids)) {
- $this->checkField($locator);
- }
- }
- // Find the all affiliates field.
- $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]';
- $this->findField($locator);
-
- // Set all affiliates to TRUE.
- $this->checkField($locator);
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Get node data. Note that we create one new node for each test case.
- $storage = \Drupal::entityTypeManager()->getStorage('node');
- $nid = $node_type == 'article' ? 1 : 2;
- $node = $storage->load($nid);
- // Check that two values are set.
- $manager = \Drupal::service('domain_access.manager');
- $values = $manager->getAccessValues($node);
- $this->assert(count($values) == 3, 'Node saved with three domain records.');
- $value = $manager->getAllValue($node);
- $this->assert($value == 1, 'Node saved to all affiliates.');
-
- // Now login as a user with limited rights.
- $account = $this->drupalCreateUser([
- 'create ' . $node_type . ' content',
- 'edit any ' . $node_type . ' content',
- 'publish to any assigned domain',
- ]);
- $ids = ['example_com', 'one_example_com'];
- $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ACCESS_FIELD);
- $user_storage = \Drupal::entityTypeManager()->getStorage('user');
- $user = $user_storage->load($account->id());
- $values = $manager->getAccessValues($user);
- $this->assert(count($values) == 2, 'User saved with two domain records.');
- $value = $manager->getAllValue($user);
- $this->assert($value == 0, 'User not saved to all affiliates.');
-
- $this->drupalLogin($account);
-
- $this->drupalGet('node/' . $node->id() . '/edit');
- $this->assertSession()->statusCodeEquals(200);
-
- foreach ($domains as $domain) {
- $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if ($domain->id() == 'example_com') {
- $this->checkField($locator);
- }
- elseif ($domain->id() == 'one_example_com') {
- $this->uncheckField($locator);
- }
-
- else {
- $this->assertSession()->fieldNotExists($locator);
- }
- }
-
- $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]';
- $this->assertSession()->fieldNotExists($locator);
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Now, check the node.
- $storage->resetCache([$node->id()]);
- $node = $storage->load($node->id());
- // Check that two values are set.
- $values = $manager->getAccessValues($node);
- $this->assert(count($values) == 2, 'Node saved with two domain records.');
- $value = $manager->getAllValue($node);
- $this->assert($value == 1, 'Node saved to all affiliates.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityFieldTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityFieldTest.php
deleted file mode 100644
index bf3e448b3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityFieldTest.php
+++ /dev/null
@@ -1,79 +0,0 @@
-domainCreateTestDomains(5);
- }
-
- /**
- * Tests that the fields are accessed properly.
- */
- public function testDomainAccessEntityFields() {
- $label = 'Send to all affiliates';
- // Create a vocabulary.
- $vocabulary = entity_create('taxonomy_vocabulary', [
- 'name' => 'Domain vocabulary',
- 'description' => 'Test taxonomy for Domain Access',
- 'vid' => 'domain_access',
- 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
- 'weight' => 100,
- ]);
- $vocabulary->save();
- $text['taxonomy_term'] = [
- 'name' => 'term',
- 'label' => 'Send to all affiliates',
- 'description' => 'Make this term available on all domains.',
- ];
- domain_access_confirm_fields('taxonomy_term', 'domain_access', $text);
- $this->admin_user = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- 'publish to any domain',
- 'administer taxonomy',
- 'administer taxonomy_term fields',
- 'administer taxonomy_term form display',
- ]);
- $this->drupalLogin($this->admin_user);
- $this->drupalGet('admin/structure/taxonomy/manage/domain_access/overview/fields');
- $this->assertResponse(200, 'Manage fields page accessed.');
-
- // Check for a domain field.
- $this->assertText('Domain Access', 'Domain form field found.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityReferenceTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityReferenceTest.php
deleted file mode 100644
index b952006a7..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessEntityReferenceTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
-admin_user = $this->drupalCreateUser([
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Visit the article field administration page.
- $this->drupalGet('admin/structure/types/manage/article/fields');
- $this->assertResponse(200, 'Manage fields page accessed.');
-
- // Check for a domain field.
- $this->assertText('Domain Access', 'Domain form field found.');
-
- // Visit the article field display administration page.
- $this->drupalGet('admin/structure/types/manage/article/display');
- $this->assertResponse(200, 'Manage field display page accessed.');
-
- // Check for a domain field.
- $this->assertText('Domain Access', 'Domain form field found.');
- }
-
- /**
- * Tests the storage of the domain access field.
- */
- public function testDomainAccessFieldStorage() {
- $this->admin_user = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- 'publish to any domain',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Create 5 domains.
- $this->domainCreateTestDomains(5);
-
- // Visit the article field display administration page.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200);
-
- // Check the new field exists on the page.
- $this->assertText('Domain Access', 'Found the domain field instance.');
-
- // We expect to find 5 domain options.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- foreach ($domains as $domain) {
- $string = 'value="' . $domain->id() . '"';
- $this->assertRaw($string, 'Found the domain option.');
- if (!isset($one)) {
- $one = $domain->id();
- continue;
- }
- if (!isset($two)) {
- $two = $domain->id();
- }
- }
-
- // Try to post a node, assigned to the first two domains.
- $edit['title[0][value]'] = 'Test node';
- $edit["field_domain_access[{$one}]"] = TRUE;
- $edit["field_domain_access[{$two}]"] = TRUE;
- $this->drupalPostForm('node/add/article', $edit, 'Save');
- $this->assertResponse(200);
- $node = \Drupal::entityTypeManager()->getStorage('node')->load(1);
- // Check that two values are set.
- $values = \Drupal::service('domain_access.manager')->getAccessValues($node);
- $this->assertTrue(count($values) == 2, 'Node saved with two domain records.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessFieldTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessFieldTest.php
deleted file mode 100644
index b2c5ebce7..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessFieldTest.php
+++ /dev/null
@@ -1,198 +0,0 @@
-domainCreateTestDomains(5);
- }
-
- /**
- * Tests that the fields are accessed properly.
- */
- public function testDomainAccessFields() {
- $label = 'Send to all affiliates';
-
- // Test a user who can access all domain settings.
- $user1 = $this->drupalCreateUser(['create article content', 'publish to any domain']);
- $this->drupalLogin($user1);
-
- // Visit the article creation page.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200, 'Article creation found.');
-
- // Check for the form options.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- foreach ($domains as $domain) {
- $this->assertText($domain->label(), 'Domain form item found.');
- }
- $this->assertText($label, 'All affiliates field found.');
-
- // Test a user who can access some domain settings.
- $user2 = $this->drupalCreateUser(['create article content', 'publish to any assigned domain']);
- $active_domain = array_rand($domains, 1);
- $this->addDomainsToEntity('user', $user2->id(), $active_domain, DOMAIN_ACCESS_FIELD);
- $this->drupalLogin($user2);
-
- // Visit the article creation page.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200, 'Article creation found.');
-
- // Check for the form options.
- foreach ($domains as $domain) {
- if ($domain->id() == $active_domain) {
- $this->assertRaw('>' . $domain->label() . '', 'Domain form item found.');
- }
- else {
- $this->assertNoRaw('>' . $domain->label() . '', 'Domain form item not found.');
- }
- }
- $this->assertNoText($label, 'All affiliates field not found.');
-
- // Test a user who can access no domain settings.
- $user3 = $this->drupalCreateUser(['create article content']);
- $this->drupalLogin($user3);
-
- // Visit the article creation page.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200, 'Article creation found.');
-
- // Check for the form options.
- foreach ($domains as $domain) {
- $this->assertNoText($domain->label(), 'Domain form item not found.');
- }
- $this->assertNoText($label, 'All affiliates field not found.');
-
- // Attempt saving the node.
- // The domain/domain affiliates fields are not accessible to this user.
- // The save will fail with an EntityStorageException until
- // https://www.drupal.org/node/2609252 is fixed.
- $edit = [];
- $edit['title[0][value]'] = $this->randomMachineName(8);
- $edit['body[0][value]'] = $this->randomMachineName(16);
- $this->drupalPostForm('node/add/article', $edit, t('Save'));
-
- // Check that the node exists in the database.
- $node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
- $this->assertTrue($node, 'Node found in database.');
-
- // Test a user who can assign users to domains.
- $user4 = $this->drupalCreateUser(['administer users', 'assign editors to any domain']);
- $this->drupalLogin($user4);
-
- // Visit the account creation page.
- $this->drupalGet('admin/people/create');
- $this->assertResponse(200, 'User creation found.');
-
- // Check for the form options.
- foreach ($domains as $domain) {
- $this->assertText($domain->label(), 'Domain form item found.');
- }
-
- // Test a user who can assign users to some domains.
- $user5 = $this->drupalCreateUser(['administer users', 'assign domain editors']);
- $active_domain = array_rand($domains, 1);
- $this->addDomainsToEntity('user', $user5->id(), $active_domain, DOMAIN_ACCESS_FIELD);
- $this->drupalLogin($user5);
-
- // Visit the account creation page.
- $this->drupalGet('admin/people/create');
- $this->assertResponse(200, 'User creation found.');
-
- // Check for the form options.
- foreach ($domains as $domain) {
- if ($domain->id() == $active_domain) {
- $this->assertRaw('>' . $domain->label() . '', 'Domain form item found.');
- }
- else {
- $this->assertNoRaw('>' . $domain->label() . '', 'Domain form item not found.');
- }
- }
-
- // Test a user who can access no domain settings.
- $user6 = $this->drupalCreateUser(['administer users']);
- $this->drupalLogin($user6);
-
- // Visit the account creation page.
- $this->drupalGet('admin/people/create');
- $this->assertResponse(200, 'User creation found.');
-
- // Check for the form options.
- foreach ($domains as $domain) {
- $this->assertNoText($domain->label(), 'Domain form item not found.');
- }
-
- // Test a user who can access all domain settings.
- $user7 = $this->drupalCreateUser(['bypass node access', 'publish to any domain']);
- $this->drupalLogin($user7);
-
- // Create a new content type and test that the fields are created.
- // Create a content type programmatically.
- $type = $this->drupalCreateContentType();
- $type_exists = (bool) NodeType::load($type->id());
- $this->assertTrue($type_exists, 'The new content type has been created in the database.');
-
- // The test is not passing to domain_access_node_type_insert() properly.
- domain_access_confirm_fields('node', $type->id());
-
- // Visit the article creation page.
- $this->drupalGet('node/add/' . $type->id());
- $this->assertResponse(200, $type->id() . ' creation found.');
-
- // Check for the form options.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- foreach ($domains as $domain) {
- $this->assertText($domain->label(), 'Domain form item found.');
- }
- $this->assertText($label, 'All affiliates field found.');
-
- // Test user without access to affiliates field editing their user page.
- $user8 = $this->drupalCreateUser(['change own username']);
- $this->drupalLogin($user8);
-
- $user_edit_page = 'user/' . $user8->id() . '/edit';
- $this->drupalGet($user_edit_page);
- // Check for the form options.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- foreach ($domains as $domain) {
- $this->assertNoText($domain->label(), 'Domain form item not found.');
- }
-
- $this->assertNoText($label, 'All affiliates field not found.');
-
- // Change own username.
- $edit = [];
- $edit['name'] = $this->randomMachineName();
-
- $this->drupalPostForm($user_edit_page, $edit, t('Save'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessGrantsTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessGrantsTest.php
deleted file mode 100644
index 5e11081e5..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessGrantsTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-delete('node_access')->execute();
- }
-
- /**
- * Creates a node and tests the creation of node access rules.
- */
- public function testDomainAccessGrants() {
- $node_storage = \Drupal::entityTypeManager()->getStorage('node');
-
- // Create 5 domains.
- $this->domainCreateTestDomains(5);
- // Assign a node to a random domain.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $active_domain = array_rand($domains, 1);
- $domain = $domains[$active_domain];
- // Create an article node.
- $node1 = $this->drupalCreateNode([
- 'type' => 'article',
- DOMAIN_ACCESS_FIELD => [$domain->id()],
- ]);
- $this->assertTrue($node_storage->load($node1->id()), 'Article node created.');
-
- // Test the response of the node on each site. Should allow access only to
- // the selected site.
- foreach ($domains as $domain) {
- $path = $domain->getPath() . 'node/' . $node1->id();
- $this->drupalGet($path);
- if ($domain->id() == $active_domain) {
- $this->assertResponse(200);
- $this->assertRaw($node1->getTitle(), 'Article found on domain.');
- }
- else {
- $this->assertResponse(403);
- }
- }
-
- // Create an article node.
- $node2 = $this->drupalCreateNode([
- 'type' => 'article',
- DOMAIN_ACCESS_FIELD => [$domain->id()],
- DOMAIN_ACCESS_ALL_FIELD => 1,
- ]);
- $this->assertTrue($node_storage->load($node2->id()), 'Article node created.');
- // Test the response of the node on each site. Should allow access on all.
- foreach ($domains as $domain) {
- $path = $domain->getPath() . 'node/' . $node2->id();
- $this->drupalGet($path);
- $this->assertResponse(200);
- $this->assertRaw($node2->getTitle(), 'Article found on domain.');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessLanguageSaveTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessLanguageSaveTest.php
deleted file mode 100644
index dbbe5e939..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessLanguageSaveTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-domainCreateTestDomains(5);
-
- // Add Hungarian and Afrikaans.
- ConfigurableLanguage::createFromLangcode('hu')->save();
- ConfigurableLanguage::createFromLangcode('af')->save();
-
- // Enable content translation for the current entity type.
- \Drupal::service('content_translation.manager')->setEnabled('node', 'page', TRUE);
- }
-
- /**
- * Basic test setup.
- */
- public function testDomainAccessSave() {
- $storage = \Drupal::entityTypeManager()->getStorage('node');
- // Save a node programmatically.
- $node = $storage->create([
- 'type' => 'article',
- 'title' => 'Test node',
- 'uid' => '1',
- 'status' => 1,
- DOMAIN_ACCESS_FIELD => ['example_com'],
- DOMAIN_ACCESS_ALL_FIELD => 1,
- ]);
- $node->save();
-
- // Load the node.
- $node = $storage->load(1);
-
- // Check that two values are set properly.
- $manager = \Drupal::service('domain_access.manager');
- $values = $manager->getAccessValues($node);
- $this->assert(count($values) == 1, 'Node saved with one domain records.');
- $value = $manager->getAllValue($node);
- $this->assert($value == 1, 'Node saved to all affiliates.');
-
- // Create an Afrikaans translation assigned to domain 2.
- $translation = $node->addTranslation('af');
- $translation->title->value = $this->randomString();
- $translation->{DOMAIN_ACCESS_FIELD} = ['example_com', 'one_example_com'];
- $translation->{DOMAIN_ACCESS_ALL_FIELD} = 0;
- $translation->status = 1;
- $node->save();
-
- // Load and check the translated node.
- $parent_node = $storage->load(1);
- $node = $parent_node->getTranslation('af');
- $values = $manager->getAccessValues($node);
- $this->assert(count($values) == 2, 'Node saved with two domain records.');
- $value = $manager->getAllValue($node);
- $this->assert($value == 0, 'Node not saved to all affiliates.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessPermissionsTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessPermissionsTest.php
deleted file mode 100644
index 99787c8b0..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessPermissionsTest.php
+++ /dev/null
@@ -1,300 +0,0 @@
-config('user.role.' . RoleInterface::AUTHENTICATED_ID)->set('permissions', [])->save();
- // Create Basic page node type.
- if ($this->profile != 'standard') {
- $this->drupalCreateContentType([
- 'type' => 'page',
- 'name' => 'Basic page',
- 'display_submitted' => FALSE,
- ]);
- $this->drupalCreateContentType([
- 'type' => 'article',
- 'name' => 'Article',
- 'display_submitted' => FALSE,
- ]);
- }
- $this->accessHandler = \Drupal::entityTypeManager()->getAccessControlHandler('node');
- $this->manager = \Drupal::service('domain_access.manager');
- $this->userStorage = \Drupal::entityTypeManager()->getStorage('user');
- // Create 5 domains.
- $this->domainCreateTestDomains(5);
- $this->domains = $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- }
-
- /**
- * Runs basic tests for node_access function.
- */
- public function testDomainAccessPermissions() {
- // Note that these are hook_node_access() rules. Node Access system tests
- // are in DomainAccessRecordsTest.
- // We expect to find 5 domain options. Set two for later use.
- foreach ($this->domains as $domain) {
- if (!isset($one)) {
- $one = $domain->id();
- continue;
- }
- if (!isset($two)) {
- $two = $domain->id();
- }
- }
-
- // Assign our user to domain $two. Test on $one and $two.
- $domain_user1 = $this->drupalCreateUser([
- 'access content',
- 'edit domain content',
- 'delete domain content',
- ]);
- $this->addDomainsToEntity('user', $domain_user1->id(), $two, DOMAIN_ACCESS_FIELD);
- $domain_user1 = $this->userStorage->load($domain_user1->id());
- $assigned = $this->manager->getAccessValues($domain_user1);
- $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.');
- $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.');
- // Assign one node to default domain, and one to our test domain.
- $domain_node1 = $this->drupalCreateNode(['type' => 'page', DOMAIN_ACCESS_FIELD => [$one]]);
- $domain_node2 = $this->drupalCreateNode(['type' => 'page', DOMAIN_ACCESS_FIELD => [$two]]);
- $assigned = $this->manager->getAccessValues($domain_node1);
- $this->assertTrue(isset($assigned[$one]), 'Node1 assigned to proper test domain.');
- $assigned = $this->manager->getAccessValues($domain_node2);
- $this->assertTrue(isset($assigned[$two]), 'Node2 assigned to proper test domain.');
-
- // Tests 'edit domain content' to edit content assigned to their domains.
- $this->assertNodeAccess([
- 'view' => TRUE,
- 'update' => FALSE,
- 'delete' => FALSE,
- ], $domain_node1, $domain_user1);
- $this->assertNodeAccess([
- 'view' => TRUE,
- 'update' => TRUE,
- 'delete' => TRUE,
- ], $domain_node2, $domain_user1);
-
- // Tests 'edit domain TYPE content'.
- // Assign our user to domain $two. Test on $one and $two.
- $domain_user3 = $this->drupalCreateUser([
- 'access content',
- 'update page content on assigned domains',
- 'delete page content on assigned domains',
- ]);
- $this->addDomainsToEntity('user', $domain_user3->id(), $two, DOMAIN_ACCESS_FIELD);
- $domain_user3 = $this->userStorage->load($domain_user3->id());
- $assigned = $this->manager->getAccessValues($domain_user3);
- $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.');
- $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.');
-
- // Assign two different node types to our test domain.
- $domain_node3 = $this->drupalCreateNode(['type' => 'article', DOMAIN_ACCESS_FIELD => [$two]]);
- $domain_node4 = $this->drupalCreateNode(['type' => 'page', DOMAIN_ACCESS_FIELD => [$two]]);
- $assigned = $this->manager->getAccessValues($domain_node3);
- $this->assertTrue(isset($assigned[$two]), 'Node3 assigned to proper test domain.');
- $assigned = $this->manager->getAccessValues($domain_node4);
- $this->assertTrue(isset($assigned[$two]), 'Node4 assigned to proper test domain.');
-
- // Tests 'edit TYPE content on assigned domains'.
- $this->assertNodeAccess([
- 'view' => TRUE,
- 'update' => FALSE,
- 'delete' => FALSE,
- ], $domain_node3, $domain_user3);
- $this->assertNodeAccess([
- 'view' => TRUE,
- 'update' => TRUE,
- 'delete' => TRUE,
- ], $domain_node4, $domain_user3);
-
- // @TODO: Test edit and delete for user with 'all affiliates' permission.
- // Tests 'edit domain TYPE content'.
- // Assign our user to domain $two. Test on $one and $two.
- $domain_user4 = $this->drupalCreateUser([
- 'access content',
- 'update page content on assigned domains',
- 'delete page content on assigned domains',
- ]);
- $this->addDomainsToEntity('user', $domain_user4->id(), $two, DOMAIN_ACCESS_FIELD);
- $this->addDomainsToEntity('user', $domain_user4->id(), 1, DOMAIN_ACCESS_ALL_FIELD);
- $domain_user4 = $this->userStorage->load($domain_user4->id());
- $assigned = $this->manager->getAccessValues($domain_user4);
- $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.');
- $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.');
- $this->assertTrue(!empty($domain_user4->get(DOMAIN_ACCESS_ALL_FIELD)->value), 'User assign to all affiliates.');
-
- // Assign two different node types to our test domain.
- $domain_node5 = $this->drupalCreateNode(['type' => 'article', DOMAIN_ACCESS_FIELD => [$one]]);
- $domain_node6 = $this->drupalCreateNode(['type' => 'page', DOMAIN_ACCESS_FIELD => [$one]]);
- $assigned = $this->manager->getAccessValues($domain_node5);
- $this->assertTrue(isset($assigned[$one]), 'Node5 assigned to proper test domain.');
- $assigned = $this->manager->getAccessValues($domain_node6);
- $this->assertTrue(isset($assigned[$one]), 'Node6 assigned to proper test domain.');
-
- // Tests 'edit TYPE content on assigned domains'.
- $this->assertNodeAccess([
- 'view' => TRUE,
- 'update' => FALSE,
- 'delete' => FALSE,
- ], $domain_node5, $domain_user4);
- $this->assertNodeAccess([
- 'view' => TRUE,
- 'update' => TRUE,
- 'delete' => TRUE,
- ], $domain_node6, $domain_user4);
-
- }
-
- /**
- * Tests domain access create permissions.
- */
- public function testDomainAccessCreatePermissions() {
- foreach ($this->domains as $domain) {
- if (!isset($one)) {
- $one = $domain->id();
- continue;
- }
- if (!isset($two)) {
- $two = $domain->id();
- }
- }
- // Tests create permissions. Any content on assigned domains.
- $domain_account5 = $this->drupalCreateUser(['access content', 'create domain content']);
- $this->addDomainsToEntity('user', $domain_account5->id(), $two, DOMAIN_ACCESS_FIELD);
- $domain_user5 = $this->userStorage->load($domain_account5->id());
- $assigned = $this->manager->getAccessValues($domain_user5);
- $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.');
- $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.');
- // This test is domain sensitive.
- foreach ($this->domains as $domain) {
- $this->domainLogin($domain, $domain_account5);
- $url = $domain->getPath() . 'node/add/page';
- $this->drupalGet($url);
- if ($domain->id() == $two) {
- $this->assertResponse(200);
- }
- else {
- $this->assertResponse(403);
- }
- // The user should be allowed to create articles.
- $url = $domain->getPath() . 'node/add/article';
- $this->drupalGet($url);
- if ($domain->id() == $two) {
- $this->assertResponse(200);
- }
- else {
- $this->assertResponse(403);
- }
- }
-
- }
-
- /**
- * Tests domain access limited create permissions.
- */
- public function testDomainAccessLimitedCreatePermissions() {
- foreach ($this->domains as $domain) {
- if (!isset($one)) {
- $one = $domain->id();
- continue;
- }
- if (!isset($two)) {
- $two = $domain->id();
- }
- }
- // Tests create permissions. Any content on assigned domains.
- $domain_account6 = $this->drupalCreateUser(['access content', 'create page content on assigned domains']);
- $this->addDomainsToEntity('user', $domain_account6->id(), $two, DOMAIN_ACCESS_FIELD);
- $domain_user6 = $this->userStorage->load($domain_account6->id());
- $assigned = $this->manager->getAccessValues($domain_user6);
- $this->assertTrue(count($assigned) == 1, 'User assigned to one domain.');
- $this->assertTrue(isset($assigned[$two]), 'User assigned to proper test domain.');
- // This test is domain sensitive.
- foreach ($this->domains as $domain) {
- $this->domainLogin($domain, $domain_account6);
- $url = $domain->getPath() . 'node/add/page';
- $this->drupalGet($url);
- if ($domain->id() == $two) {
- $this->assertResponse(200);
- }
- else {
- $this->assertResponse(403);
- }
- // The user should not be allowed to create articles.
- $url = $domain->getPath() . 'node/add/article';
- $this->drupalGet($url);
- $this->assertResponse(403);
- }
- }
-
- /**
- * Asserts that node access correctly grants or denies access.
- *
- * @param array $ops
- * An associative array of the expected node access grants for the node
- * and account, with each key as the name of an operation (e.g. 'view',
- * 'delete') and each value a Boolean indicating whether access to that
- * operation should be granted.
- * @param \Drupal\node\NodeInterface $node
- * The node object to check.
- * @param \Drupal\Core\Session\AccountInterface $account
- * The user account for which to check access.
- */
- public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterface $account) {
- foreach ($ops as $op => $result) {
- $this->assertEqual($result, $this->accessHandler->access($node, $op, $account), 'Expected result returned.');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessRecordsTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessRecordsTest.php
deleted file mode 100644
index 1328d3984..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessRecordsTest.php
+++ /dev/null
@@ -1,80 +0,0 @@
-domainCreateTestDomains(5);
- // Assign a node to a random domain.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $active_domain = array_rand($domains, 1);
- $domain = $domains[$active_domain];
- $node_storage = \Drupal::entityTypeManager()->getStorage('node');
-
- // Create an article node.
- $node1 = $this->drupalCreateNode([
- 'type' => 'article',
- DOMAIN_ACCESS_FIELD => [$domain->id()],
- DOMAIN_ACCESS_ALL_FIELD => 0,
- ]);
- $this->assertTrue($node_storage->load($node1->id()), 'Article node created.');
-
- // Check to see if grants added by domain_node_access_records made it in.
- $query = 'SELECT realm, gid, grant_view, grant_update, grant_delete FROM {node_access} WHERE nid = :nid';
- $records = Database::getConnection()
- ->query($query, [':nid' => $node1->id()])
- ->fetchAll();
-
- $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
- $this->assertEqual($records[0]->realm, 'domain_id', 'Grant with domain_id acquired for node.');
- $this->assertEqual($records[0]->gid, $domain->getDomainId(), 'Grant with proper id acquired for node.');
- $this->assertEqual($records[0]->grant_view, 1, 'Grant view stored.');
- $this->assertEqual($records[0]->grant_update, 1, 'Grant update stored.');
- $this->assertEqual($records[0]->grant_delete, 1, 'Grant delete stored.');
-
- // Create another article node.
- $node2 = $this->drupalCreateNode([
- 'type' => 'article',
- DOMAIN_ACCESS_FIELD => [$domain->id()],
- DOMAIN_ACCESS_ALL_FIELD => 1,
- ]);
- $this->assertTrue($node_storage->load($node2->id()), 'Article node created.');
- // Check to see if grants added by domain_node_access_records made it in.
- $query = 'SELECT realm, gid, grant_view, grant_update, grant_delete FROM {node_access} WHERE nid = :nid ORDER BY realm';
- $records = Database::getConnection()
- ->query($query, [':nid' => $node2->id()])
- ->fetchAll();
- $this->assertEqual(count($records), 2, 'Returned the correct number of rows.');
- $this->assertEqual($records[0]->realm, 'domain_id', 'Grant with domain_id acquired for node.');
- $this->assertEqual($records[0]->gid, $domain->getDomainId(), 'Grant with proper id acquired for node.');
- $this->assertEqual($records[0]->grant_view, 1, 'Grant view stored.');
- $this->assertEqual($records[0]->grant_update, 1, 'Grant update stored.');
- $this->assertEqual($records[0]->grant_delete, 1, 'Grant delete stored.');
- $this->assertEqual($records[1]->realm, 'domain_site', 'Grant with domain_site acquired for node.');
- $this->assertEqual($records[1]->gid, 0, 'Grant with proper id acquired for node.');
- $this->assertEqual($records[1]->grant_view, 1, 'Grant view stored.');
- $this->assertEqual($records[1]->grant_update, 0, 'Grant update stored.');
- $this->assertEqual($records[1]->grant_delete, 0, 'Grant delete stored.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessSaveTest.php b/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessSaveTest.php
deleted file mode 100644
index fd06f9eb8..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_access/tests/src/Functional/DomainAccessSaveTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-domainCreateTestDomains(5);
- }
-
- /**
- * Basic test setup.
- */
- public function testDomainAccessSave() {
- $storage = \Drupal::entityTypeManager()->getStorage('node');
- // Save a node programatically.
- $node = $storage->create([
- 'type' => 'article',
- 'title' => 'Test node',
- 'uid' => '1',
- 'status' => 1,
- DOMAIN_ACCESS_FIELD => ['example_com'],
- DOMAIN_ACCESS_ALL_FIELD => 1,
- ]);
- $node->save();
-
- // Load the node.
- $node = $storage->load(1);
-
- // Check that two values are set properly.
- $manager = \Drupal::service('domain_access.manager');
- $values = $manager->getAccessValues($node);
- $this->assert(count($values) == 1, 'Node saved with one domain records.');
- $value = $manager->getAllValue($node);
- $this->assert($value == 1, 'Node saved to all affiliates.');
-
- // Save a node with different values.
- $node = $storage->create([
- 'type' => 'article',
- 'title' => 'Test node',
- 'uid' => '1',
- 'status' => 1,
- DOMAIN_ACCESS_FIELD => ['example_com', 'one_example_com'],
- DOMAIN_ACCESS_ALL_FIELD => 0,
- ]);
- $node->save();
-
- // Load and check the node.
- $node = $storage->load(2);
- $values = $manager->getAccessValues($node);
- $this->assert(count($values) == 2, 'Node saved with two domain records.');
- $value = $manager->getAllValue($node);
- $this->assert($value == 0, 'Node not saved to all affiliates.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/README.md b/sites/all/modules/contrib/admin/domain/domain_alias/README.md
deleted file mode 100644
index eea1623b8..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/README.md
+++ /dev/null
@@ -1,182 +0,0 @@
-About aliases
-====
-
-Aliases define unique domains or patterns that map to existing domain records.
-For example, you may want to have the following setup:
-
-* example.com (primary domain)
-* my.example.com (active domain record)
-* myexample.com (alias of the my.example.com record)
-
-In effect, myexample.com and my.example.com behave the same way from a Drupal
-perspective. Aliases may also be made to redirect to their parent domain, if
-preferred.
-
-Alias Patterns
-====
-
-The Drupal 8 version of Domain Alias supports multi-character wildcards as part
-of the hostname. You can register an alias to a domain record in any of the
-following patterns.
-```
- *.example.com
- example.*.com
- example.com.*
- *.*.example.com
- example.*.*.com
- example.*
- example.*.*
- example.*.*.*
- *.com
- *.example.*
- example.com:8080
- example.com:*
- example.*:*
- *.com:*
-```
-A maximum of three wildcards are supported. At least one element must not be a
-wildcard. Ports may be wildcards as well, but are optional.
-
-Alias Matching
-====
-
-When a request is sent to Drupal, the domain negotiation system will look for a
-matching record. The order of precedence is as follows.
-
-Example request: `one.example.com`
-
-1. Exact domain record match (`one.example.com`)
-1. Exact alias match (`one.example.com`)
-1. Wildcard match
-```
- one.example.com
- one.example.*
- *.example.com
- one.*.com
- *.example.*
- *.*.com
- one.*.*,
-```
-Note that wildcard matching happens _in the listed order_. The number of
-wildcards is equal to the number of hostname parts minus 1. That is, you cannot register
-an alias that is all wildcards.
-
-Port Matching
-===
-
-Port matching (e.g. example.com:8080) works exactly as hostname matching, with
-one significant change. If the inbound request is on port 80, matches to the
-base hostname are permitted, since port 80 is the default port for HTTP.
-
-For example, a request to example.com:80 will match the following aliases:
-```
- example.com:80
- example.com
- example.com:*
- example.*
- example.*:80
- example.*:*
- *.com
- *.com:80
- *.com:*
-```
-Whereas a request to example.com:8080 will not match the hostname without a port
-specified.
-```
- example.com:8080
- example.com:*
- example.*:8080
- example.*:*
- *.com:8080
- *.com:*
-```
-
-Development Workflow
-====
-
-Aliases can be used to support development across different environments, with unique
-URLs. To support this feature, there is now an `environment` field for each alias. The
-default environment list is:
-
-* default
-* local
-* development
-* staging
-* testing
-
-This list may be overridden by setting the `domain_alias.environments` configuration in
-settings.php.
-
-The operation of these environments is as follows:
-
-* If alias matching the environment is `default`, no changes occur.
-* Else, matching aliases are loaded for all domains, so that links are rewritten to be
-specific to the specified environment. (See `domain_alias_domain_load()` for the logic.)
-
-For instance, consider the following configuration. Your site's canonical domains are:
-
-* example.com
-* foo.example.com
-* bar.example.com
-
-When developing locally, developers use `.local` instead of `.com`. These should be
-aliased to each domain as set as the `local` environment.
-
-* example.local > alias to example.com
-* foo.example.local > alias to foo.example.com
-* bar.example.local > alias to bar.example.com
-
-When pushing changes to the cloud, we use a development server. These are tied to a
-specific cloud host (dev.mycloud.com). You can alias these to the `development`
-environment.
-
-* example.dev.mycloud.com > alias to example.com
-* foo.example.dev.mycloud.com > alias to foo.example.com
-* bar.example.dev.mycloud.com > alias to bar.example.com
-
-The pattern can repeat for each of the environments listed above. The intended use of the
-default set of environments is:
-
-* default -- indicates a canonical URL. No changes will be made.
-* local -- for local development environments.
-* development -- for a development integration server (such as those provided by Acquia,
-Pantheon, and Platform.sh)
-* staging -- for a pre-deployment server (such as those provided by Acquia, Panthon, and
-Platform.sh)
-* testing -- for continuous integration services (such as TravisCI or CircleCI).
-
-None of these environments are required. You may safely set all aliases to default if
-your workflow does not span multiple server environments.
-
-How does it work?
-----
-
-This feature works by mapping each alias to an environment. If the active request matches
-an alias that is set as an environment other than `default`, then matching environment
-aliases are loaded for each domain. If a match is found, the `hostname` value for each
-domain is overwritten.
-
-This overwrite affects the base path and request url that Domain module (and Domain Source)
-use for writing links.
-
-Because the environments are specific to hostnames, this feature will only work if the
-site's cache recognizes `url.site` as a required cache context. Without that, the render
-system will cache the output of a request incorrectly.
-
-Configuration
-----
-
-To use this feature, the following steps must be followed:
-
-* `url.site` must be added as a required_cache_context to your `services.yml` file.
-* Aliases must be mapped to a server environment. Default value is `default`.
-* All aliases should be listed as part of `trusted_host_settings` in `settings.php`.
-
-Technical Notes
-====
-
-The matching follows an explicit sort order shown in DomainAliasSortTest.
-
-The code will attempt to match domains of different lengths when doing wildcard
-matching in an environment. That is, an alias to `example.*` assigned to `local` should
-return `example.local` if the active domain is `one.example.local`, assigned to `local`.
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/config/install/domain_alias.settings.yml b/sites/all/modules/contrib/admin/domain/domain_alias/config/install/domain_alias.settings.yml
deleted file mode 100644
index 41b02b54b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/config/install/domain_alias.settings.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-environments:
- - default
- - local
- - development
- - staging
- - testing
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/config/schema/domain_alias.schema.yml b/sites/all/modules/contrib/admin/domain/domain_alias/config/schema/domain_alias.schema.yml
deleted file mode 100644
index 8b0320581..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/config/schema/domain_alias.schema.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-# Schema for the configuration files of the Domain Alias module.
-domain_alias.settings:
- type: config_object
- label: 'Domain Alias settings'
- mapping:
- environments:
- type: sequence
- label: 'Development environments'
- sequence:
- type: string
- label: 'Environment'
-
-domain_alias.alias.*:
- type: config_entity
- label: 'Domain alias'
- mapping:
- id:
- type: string
- label: 'ID'
- uuid:
- type: string
- label: 'UUID'
- domain_id:
- type: string
- label: 'Domain ID'
- pattern:
- type: string
- label: 'Pattern'
- redirect:
- type: integer
- label: 'Redirect'
- environment:
- type: string
- label: 'Environment'
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.info.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.info.yml
deleted file mode 100644
index b6adc6d03..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.info.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: Domain Alias
-description: 'Maps multiple host requests to a single domain record.'
-type: module
-package: Domain
-# version: VERSION
-# core: 8.x
-dependencies:
- - domain:domain
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.install b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.install
deleted file mode 100644
index 6b2f06aa9..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.install
+++ /dev/null
@@ -1,33 +0,0 @@
-getEditable('domain_alias.settings');
- // Set and save new message value.
- $environments = ['default', 'local', 'development', 'staging', 'testing'];
- $config->set('environments', $environments)->save();
-}
-
-/**
- * Updates domain_alias schema.
- */
-function domain_alias_update_8001() {
- $manager = \Drupal::entityDefinitionUpdateManager();
- // Regenerate entity type indexes.
- $manager->updateEntityType($manager->getEntityType('domain_alias'));
-}
-
-/**
- * Adds domain_alias environment settings.
- */
-function domain_alias_update_8002() {
- // Set the default environments variable.
- domain_alias_set_environments();
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.action.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.action.yml
deleted file mode 100644
index e8ad0ebce..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-domain_alias_add:
- route_name: domain_alias.add
- title: 'Add domain alias'
- appears_on:
- - domain_alias.admin
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.task.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.task.yml
deleted file mode 100644
index 842ea90c2..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.links.task.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-domain_alias.list:
- title: 'Aliases'
- route_name: domain_alias.admin
- tab_root_id: entity.domain.edit_form
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.module b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.module
deleted file mode 100644
index bb4fa8c0b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.module
+++ /dev/null
@@ -1,169 +0,0 @@
-getMatchType() == DomainNegotiator::DOMAIN_MATCH_EXACT) {
- return;
- }
- // If no exact match, then run the alias load routine.
- $hostname = $domain->getHostname();
- $alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
- $domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
- /** @var \Drupal\domain_alias\Entity\DomainAlias $alias */
- if ($alias = $alias_storage->loadByHostname($hostname)) {
- /** @var \Drupal\domain\Entity\Domain $domain */
- if ($domain = $domain_storage->load($alias->getDomainId())) {
- $domain->addProperty('alias', $alias);
- $domain->setMatchType(DomainNegotiator::DOMAIN_MATCH_ALIAS);
- $redirect = $alias->getRedirect();
- if (!empty($redirect)) {
- $domain->setRedirect($redirect);
- }
- }
- else {
- // If the domain did not load, report an error.
- \Drupal::logger('domain_alias')->error('Found matching alias %alias for host request %hostname, but failed to load matching domain with id %id.', [
- '%alias' => $alias->getPattern(),
- '%hostname' => $hostname,
- '%id' => $alias->getDomainId(),
- ]);
- }
- }
-}
-
-/**
- * Implements hook_domain_operations().
- */
-function domain_alias_domain_operations(DomainInterface $domain, AccountInterface $account) {
- $operations = [];
- // Check permissions. The user must be a super-admin or assigned to the
- // domain.
- $is_domain_admin = $domain->access('update', $account);
- if ($account->hasPermission('administer domain aliases') || ($is_domain_admin && $account->hasPermission('view domain aliases'))) {
- // Add aliases to the list of operations.
- $operations['domain_alias'] = [
- 'title' => t('Aliases'),
- 'url' => Url::fromRoute('domain_alias.admin', ['domain' => $domain->id()]),
- 'weight' => 60,
- ];
- }
- return $operations;
-}
-
-/**
- * Implements hook_ENTITY_TYPE_load().
- */
-function domain_alias_domain_load($entities) {
- static $enabled;
- // We can only perform meaningful actions if url.site is a cache context.
- // Otherwise, the render process ignores our changes.
- if (!isset($enabled)) {
- $required_cache_contexts = \Drupal::getContainer()->getParameter('renderer.config')['required_cache_contexts'];
- if (!in_array('url.site', $required_cache_contexts) && !in_array('url', $required_cache_contexts)) {
- $enabled = FALSE;
- return;
- }
- $enabled = TRUE;
- }
-
- // We cannot run before the negotiator service has fired.
- $negotiator = \Drupal::service('domain.negotiator');
- $active = $negotiator->getActiveDomain();
-
- // Do nothing if no domain is active.
- if (is_null($active)) {
- return;
- }
-
- // Load and rewrite environment-specific aliases.
- $alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
- if (isset($active->alias) && $active->alias->getEnvironment() != 'default') {
- foreach ($entities as $id => $domain) {
- if ($environment_aliases = $alias_storage->loadByEnvironmentMatch($domain, $active->alias->getEnvironment())) {
- foreach ($environment_aliases as $environment_alias) {
- $pattern = $environment_alias->getPattern();
- // Add a canonical property.
- $domain->setCanonical();
- // Override the domain hostname and path. We always prefer a string
- // match.
- if (substr_count($pattern, '*') < 1) {
- $domain->setHostname($pattern);
- $domain->setPath();
- $domain->setUrl();
- break;
- }
- else {
- // Do a wildcard replacement based on the current request.
- $request = $negotiator->negotiateActiveHostname();
- // First, check for a wildcard port.
- if (substr_count($pattern, ':*') > 0) {
- // Do not replace ports unless they are nonstandard. See
- // \Symfony\Component\HttpFoundation\Request\getHttpHost().
- if (substr_count($request, ':') > 0) {
- $search = explode(':', $pattern);
- $replace = explode(':', $request);
- if (!empty($search[1]) && !empty($replace[1])) {
- $pattern = str_replace(':' . $search[1], ':' . $replace[1], $pattern);
- }
- }
- // If no port wildcard, then remove the port entirely.
- else {
- $pattern = str_replace(':*', '', $pattern);
- }
- }
-
- $replacements = ['.' => '\.', '*' => '(.+?)'];
- $regex = '/^' . strtr($active->alias->getPattern(), $replacements) . '$/';
- if (preg_match($regex, $request, $matches) && isset($matches[1])) {
- $pattern = str_replace('*', $matches[1], $pattern);
- }
-
- // Do not let the domain loop back on itself.
- if ($pattern != $domain->getCanonical()) {
- $domain->setHostname($pattern);
- $domain->setPath();
- $domain->setUrl();
- }
- }
- }
- }
- }
- }
-}
-
-/**
- * Implements hook_ENTITY_TYPE_delete().
- */
-function domain_alias_domain_delete(EntityInterface $entity) {
- $alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
- $properties = ['domain_id' => $entity->id()];
- foreach ($alias_storage->loadByProperties($properties) as $alias) {
- $alias->delete();
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.permissions.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.permissions.yml
deleted file mode 100644
index 88fd57655..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.permissions.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-administer domain aliases:
- title: 'Administer all domain aliases'
- restrict access: true
-create domain aliases:
- title: 'Create domain aliases for assigned domains'
- restrict access: true
-edit domain aliases:
- title: 'Edit domain aliases for assigned domains'
- restrict access: true
-delete domain aliases:
- title: 'Delete domain aliases for assigned domains'
- restrict access: true
-view domain aliases:
- title: 'View aliases for assigned domains'
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.routing.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.routing.yml
deleted file mode 100644
index 8ac59e418..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.routing.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-domain_alias.admin:
- path: '/admin/config/domain/alias/{domain}'
- defaults:
- _controller: '\Drupal\domain_alias\Controller\DomainAliasController::listing'
- _title: 'Domain aliases'
- _title_context: 'With modules'
- requirements:
- _entity_access: domain.update
- _permission: 'view domain aliases'
-
-entity.domain_alias.edit_form:
- path: '/admin/config/domain/alias/edit/{domain_alias}'
- defaults:
- _entity_form: domain_alias.edit
- _title: 'Edit domain alias'
- requirements:
- _entity_access: domain_alias.update
-
-entity.domain_alias.delete_form:
- path: '/admin/config/domain/alias/delete/{domain_alias}'
- defaults:
- _entity_form: domain_alias.delete
- _title: 'Delete domain alias'
- requirements:
- _entity_access: domain_alias.delete
-
-domain_alias.add:
- path: '/admin/config/domain/alias/{domain}/add'
- defaults:
- _controller: '\Drupal\domain_alias\Controller\DomainAliasController::addAlias'
- _title: 'Add domain alias'
- requirements:
- _entity_access: domain.update
- _permission: 'create domain aliases'
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.services.yml b/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.services.yml
deleted file mode 100644
index 104563a94..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/domain_alias.services.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-services:
- domain_alias.validator:
- class: Drupal\domain_alias\DomainAliasValidator
- arguments: ['@config.factory', '@entity_type.manager']
- # @deprecated and will be removed for 8.x-1.0 release.
- domain_alias.loader:
- class: Drupal\domain_alias\DomainAliasLoader
- arguments: ['@config.typed']
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/Controller/DomainAliasController.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/Controller/DomainAliasController.php
deleted file mode 100644
index 93d1693a1..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/Controller/DomainAliasController.php
+++ /dev/null
@@ -1,48 +0,0 @@
-id();
-
- // Create the stub alias with reference to the parent domain.
- $alias = $this->entityTypeManager()->getStorage('domain_alias')->create($values);
-
- return $this->entityFormBuilder()->getForm($alias);
- }
-
- /**
- * Provides the listing page for aliases.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * An domain record entity.
- *
- * @return array
- * A render array as expected by drupal_render().
- */
- public function listing(DomainInterface $domain) {
- $list = $this->entityTypeManager()->getListBuilder('domain_alias');
- $list->setDomain($domain);
- return $list->render();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasAccessControlHandler.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasAccessControlHandler.php
deleted file mode 100644
index 84c9b09db..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasAccessControlHandler.php
+++ /dev/null
@@ -1,46 +0,0 @@
-prepareUser($account);
- // Check the global permission.
- if ($account->hasPermission('administer domain aliases')) {
- return AccessResult::allowed();
- }
- // For other actions we allow admin if they can administer the parent
- // domains.
- $domain = $entity->getDomain();
- // If this account can administer the domain, allow access to actions based
- // on permission.
- if ($is_admin = $this->isDomainAdmin($domain, $account)) {
- if ($operation == 'view' && $account->hasPermission('view domain aliases')) {
- return AccessResult::allowed();
- }
- if ($operation == 'create' && $account->hasPermission('create domain aliases')) {
- return AccessResult::allowed();
- }
- if ($operation == 'update' && $account->hasPermission('edit domain aliases')) {
- return AccessResult::allowed();
- }
- if ($operation == 'delete' && $account->hasPermission('delete domain aliases')) {
- return AccessResult::allowed();
- }
- }
- return AccessResult::forbidden();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasForm.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasForm.php
deleted file mode 100644
index e033fd002..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasForm.php
+++ /dev/null
@@ -1,239 +0,0 @@
-validator = $validator;
- $this->config = $config;
- $this->entityTypeManager = $entity_type_manager;
- $this->aliasStorage = $alias_storage;
- $this->domainStorage = $domain_storage;
- // Not loaded directly since it is not an interface.
- $this->accessHandler = $this->entityTypeManager->getAccessControlHandler('domain');
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('domain_alias.validator'),
- $container->get('config.factory'),
- $container->get('entity_type.manager'),
- $container->get('entity_type.manager')->getStorage('domain_alias'),
- $container->get('entity_type.manager')->getStorage('domain')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function form(array $form, FormStateInterface $form_state) {
- /** @var \Drupal\domain_alias\DomainAliasInterface $alias */
- $alias = $this->entity;
-
- $form['domain_id'] = [
- '#type' => 'value',
- '#value' => $alias->getDomainId(),
- ];
- $form['pattern'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Pattern'),
- '#size' => 40,
- '#maxlength' => 80,
- '#default_value' => $alias->getPattern(),
- '#description' => $this->t('The matching pattern for this alias.'),
- '#required' => TRUE,
- ];
- $form['id'] = [
- '#type' => 'machine_name',
- '#default_value' => $alias->id(),
- '#machine_name' => [
- 'source' => ['pattern'],
- 'exists' => '\Drupal\domain_alias\Entity\DomainAlias::load',
- ],
- ];
- $form['redirect'] = [
- '#type' => 'select',
- '#options' => $this->redirectOptions(),
- '#default_value' => $alias->getRedirect(),
- '#description' => $this->t('Set an optional redirect directive when this alias is invoked.'),
- ];
- $environments = $this->environmentOptions();
- $form['environment'] = [
- '#type' => 'select',
- '#options' => $environments,
- '#default_value' => $alias->getEnvironment(),
- '#description' => $this->t('Map the alias to a development environment.'),
- ];
- $form['environment_help'] = [
- '#type' => 'details',
- '#open' => FALSE,
- '#collapsed' => TRUE,
- '#title' => $this->t('Environment list'),
- '#description' => $this->t('The table below shows the registered aliases for each environment.'),
- ];
-
- $domains = $this->domainStorage->loadMultipleSorted();
- $rows = [];
- foreach ($domains as $domain) {
- // If the user cannot edit the domain, then don't show in the list.
- $access = $this->accessHandler->checkAccess($domain, 'update');
- if ($access->isForbidden()) {
- continue;
- }
- $row = [];
- $row[] = $domain->label();
- foreach ($environments as $environment) {
- $match_output = [];
- if ($environment == 'default') {
- $match_output[] = $domain->getCanonical();
- }
- $matches = $this->aliasStorage->loadByEnvironmentMatch($domain, $environment);
- foreach ($matches as $match) {
- $match_output[] = $match->getPattern();
- }
- $output = [
- '#items' => $match_output,
- '#theme' => 'item_list',
- ];
- $row[] = \Drupal::service('renderer')->render($output);
- }
- $rows[] = $row;
- }
-
- $form['environment_help']['table'] = [
- '#type' => 'table',
- '#header' => array_merge([$this->t('Domain')], $environments),
- '#rows' => $rows,
- ];
-
- return parent::form($form, $form_state);
- }
-
- /**
- * Returns a list of valid redirect options for the form.
- *
- * @return array
- * A list of valid redirect options.
- */
- public function redirectOptions() {
- return [
- 0 => $this->t('Do not redirect'),
- 301 => $this->t('301 redirect: Moved Permanently'),
- 302 => $this->t('302 redirect: Found'),
- ];
- }
-
- /**
- * Returns a list of valid environement options for the form.
- *
- * @return array
- * A list of valid environment options.
- */
- public function environmentOptions() {
- $list = $this->config->get('domain_alias.settings')->get('environments');
- $environments = [];
- foreach ($list as $item) {
- $environments[$item] = $item;
- }
- return $environments;
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- $errors = $this->validator->validate($this->entity);
- if (!empty($errors)) {
- $form_state->setErrorByName('pattern', $errors);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $form, FormStateInterface $form_state) {
- /** @var \Drupal\domain_alias\DomainAliasInterface $alias */
- $alias = $this->entity;
- $edit_link = $alias->toLink($this->t('Edit'), 'edit-form')->toString();
- if ($alias->save() == SAVED_NEW) {
- \Drupal::messenger()->addMessage($this->t('Created new domain alias.'));
- $this->logger('domain_alias')->notice('Created new domain alias %name.', ['%name' => $alias->label(), 'link' => $edit_link]);
- }
- else {
- \Drupal::messenger()->addMessage($this->t('Updated domain alias.'));
- $this->logger('domain_alias')->notice('Updated domain alias %name.', ['%name' => $alias->label(), 'link' => $edit_link]);
- }
- $form_state->setRedirect('domain_alias.admin', ['domain' => $alias->getDomainId()]);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasInterface.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasInterface.php
deleted file mode 100644
index b4f341ab8..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasInterface.php
+++ /dev/null
@@ -1,44 +0,0 @@
-t('Pattern');
- $header['redirect'] = $this->t('Redirect');
- $header['environment'] = $this->t('Environment');
- return $header + parent::buildHeader();
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildRow(EntityInterface $entity) {
- $row = [];
-
- $row['label'] = $entity->label();
- $redirect = $entity->getRedirect();
- $row['redirect'] = empty($redirect) ? $this->t('None') : $redirect;
- $row['environment'] = $entity->getEnvironment();
- $row += parent::buildRow($entity);
-
- return $row;
- }
-
- /**
- * {@inheritdoc}
- */
- public function render() {
- $build = [
- '#theme' => 'table',
- '#header' => $this->buildHeader(),
- '#rows' => [],
- '#empty' => $this->t('No aliases have been created for this domain.'),
- ];
- foreach ($this->load() as $entity) {
- if ($row = $this->buildRow($entity)) {
- $build['#rows'][$entity->id()] = $row;
- }
- }
- return $build;
- }
-
- /**
- * Loads entity IDs using a pager sorted by the entity id.
- *
- * @return array
- * An array of entity IDs.
- */
- protected function getEntityIds() {
- $query = $this->getStorage()->getQuery()
- ->condition('domain_id', $this->getDomainId())
- ->sort($this->entityType->getKey('id'));
-
- // Only add the pager if a limit is specified.
- if ($this->limit) {
- $query->pager($this->limit);
- }
- return $query->execute();
- }
-
- /**
- * Sets the domain context for this list.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * The domain to set as context for the list.
- */
- public function setDomain(DomainInterface $domain) {
- $this->domain = $domain;
- }
-
- /**
- * Gets the domain context for this list.
- *
- * @return \Drupal\domain\DomainInterface
- * The domain that is context for this list.
- */
- public function getDomainId() {
- // @TODO: check for a use-case where we might need to derive the id?
- return !empty($this->domain) ? $this->domain->id() : NULL;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoader.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoader.php
deleted file mode 100644
index 06440f455..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoader.php
+++ /dev/null
@@ -1,260 +0,0 @@
-typedConfig = $typed_config;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadSchema() {
- $fields = $this->typedConfig->getDefinition('domain_alias.alias.*');
- return isset($fields['mapping']) ? $fields['mapping'] : [];
- }
-
- /**
- * {@inheritdoc}
- */
- public function load($id, $reset = FALSE) {
- $controller = $this->getStorage();
- if ($reset) {
- $controller->resetCache([$id]);
- }
- return $controller->load($id);
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadMultiple(array $ids = NULL, $reset = FALSE) {
- $controller = $this->getStorage();
- if ($reset) {
- $controller->resetCache($ids);
- }
- return $controller->loadMultiple($ids);
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByHostname($hostname) {
- $patterns = $this->getPatterns($hostname);
- foreach ($patterns as $pattern) {
- if ($alias = $this->loadByPattern($pattern)) {
- return $alias;
- }
- }
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByPattern($pattern) {
- $result = $this->getStorage()->loadByProperties(['pattern' => $pattern]);
- if (empty($result)) {
- return NULL;
- }
- return current($result);
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByEnvironment($environment) {
- $result = $this->getStorage()->loadByProperties(['environment' => $environment]);
- if (empty($result)) {
- return NULL;
- }
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByEnvironmentMatch(DomainInterface $domain, $environment) {
- $result = $this->getStorage()->loadByProperties(['domain_id' => $domain->id(), 'environment' => $environment]);
- if (empty($result)) {
- return [];
- }
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function sort($a, $b) {
- // Fewer wildcards is a closer match.
- // A longer string indicates a closer match.
- if ((substr_count($a, '*') > substr_count($b, '*')) || (strlen($a) < strlen($b))) {
- return 1;
- }
- return 0;
- }
-
- /**
- * Returns an array of eligible matching patterns.
- *
- * @param string $hostname
- * A hostname string, in the format example.com.
- *
- * @return array
- * An array of eligible matching patterns.
- */
- public function getPatterns($hostname) {
- $parts = explode('.', $hostname);
- $count = count($parts);
- // Account for ports.
- if (substr_count($hostname, ':') > 0) {
- $ports = explode(':', $parts[$count - 1]);
- $parts[$count - 1] = preg_replace('/:(\d+)/', '', $parts[$count - 1]);
- $parts[] = $ports[1];
- }
- // Build the list of possible matching patterns.
- $patterns = $this->buildPatterns($parts);
- // Pattern lists are sorted based on the fewest wildcards. That gives us
- // more precise matches first.
- uasort($patterns, [$this, 'sort']);
- array_unshift($patterns, $hostname);
-
- // Account for ports.
- if (isset($ports)) {
- $patterns = $this->buildPortPatterns($patterns, $hostname);
- }
-
- // Return unique patters.
- return array_unique($patterns);
- }
-
- /**
- * Builds a list of matching patterns.
- *
- * @param array $parts
- * The hostname of the request, as an array split by dots.
- *
- * @return array
- * An array of eligible matching patterns.
- */
- private function buildPatterns(array $parts) {
- $count = count($parts);
- for ($i = 0; $i < $count; $i++) {
- // Basic replacement of each value.
- $temp = $parts;
- $temp[$i] = '*';
- $patterns[] = implode('.', $temp);
- // Advanced multi-value wildcards.
- // Pattern *.*.
- if (count($temp) > 2 && $i < ($count - 1)) {
- $temp[$i + 1] = '*';
- $patterns[] = implode('.', $temp);
- }
- // Pattern foo.bar.*.
- if ($count > 3 && $i < ($count - 2)) {
- $temp[$i + 2] = '*';
- $patterns[] = implode('.', $temp);
- }
- // Pattern *.foo.*.
- if ($count > 3 && $i < 2) {
- $temp = $parts;
- $temp[$i] = '*';
- $temp[$i + 2] = '*';
- $patterns[] = implode('.', $temp);
- }
- // Pattern *.foo.*.*.
- if ($count > 2) {
- $temp = array_fill(0, $count, '*');
- $temp[$i] = $parts[$i];
- $patterns[] = implode('.', $temp);
- }
- }
- return $patterns;
- }
-
- /**
- * Builds a list of matching patterns, including ports.
- *
- * @param array $patterns
- * An array of eligible matching patterns.
- * @param string $hostname
- * A hostname string, in the format example.com.
- *
- * @return array
- * An array of eligible matching patterns, modified by port.
- */
- private function buildPortPatterns(array $patterns, $hostname) {
- foreach ($patterns as $index => $pattern) {
- // Make a pattern for port wildcards.
- if (substr_count($pattern, ':') < 1) {
- $new = explode('.', $pattern);
- $port = (int) array_pop($new);
- $allow = FALSE;
- // Do not allow *.* or *:*.
- foreach ($new as $item) {
- if ($item != '*') {
- $allow = TRUE;
- }
- }
- if ($allow) {
- // For port 80, allow bare hostname matches.
- if ($port == 80) {
- // Base hostname with port.
- $patterns[] = str_replace(':' . $port, '', $hostname);
- // Base hostname is allowed.
- $patterns[] = implode('.', $new);
- }
- // Base hostname with wildcard port.
- $patterns[] = str_replace(':' . $port, ':*', $hostname);
- // Pattern with exact port.
- $patterns[] = implode('.', $new) . ':' . $port;
- // Pattern with wildcard port.
- $patterns[] = implode('.', $new) . ':*';
- }
- unset($patterns[$index]);
- }
- }
- return $patterns;
- }
-
- /**
- * Loads the storage controller.
- *
- * We use the loader very early in the request cycle. As a result, if we try
- * to inject the storage container, we hit a circular dependency. Using this
- * method at least keeps our code easier to update.
- */
- protected function getStorage() {
- $storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
- return $storage;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoaderInterface.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoaderInterface.php
deleted file mode 100644
index 2009e06f0..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasLoaderInterface.php
+++ /dev/null
@@ -1,104 +0,0 @@
-configFactory = $config_factory;
- $this->uuidService = $uuid_service;
- $this->languageManager = $language_manager;
- $this->typedConfig = $typed_config;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
- return new static(
- $entity_type,
- $container->get('config.factory'),
- $container->get('uuid'),
- $container->get('language_manager'),
- $container->get('config.typed')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadSchema() {
- $fields = $this->typedConfig->getDefinition('domain_alias.alias.*');
- return isset($fields['mapping']) ? $fields['mapping'] : [];
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByHostname($hostname) {
- $patterns = $this->getPatterns($hostname);
- foreach ($patterns as $pattern) {
- if ($alias = $this->loadByPattern($pattern)) {
- return $alias;
- }
- }
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByPattern($pattern) {
- $result = $this->loadByProperties(['pattern' => $pattern]);
- if (empty($result)) {
- return NULL;
- }
- return current($result);
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByEnvironment($environment) {
- $result = $this->loadByProperties(['environment' => $environment]);
- if (empty($result)) {
- return NULL;
- }
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadByEnvironmentMatch(DomainInterface $domain, $environment) {
- $result = $this->loadByProperties(['domain_id' => $domain->id(), 'environment' => $environment]);
- if (empty($result)) {
- return [];
- }
- return $result;
- }
-
- /**
- * {@inheritdoc}
- */
- public function sort($a, $b) {
- // Fewer wildcards is a closer match.
- // A longer string indicates a closer match.
- if ((substr_count($a, '*') > substr_count($b, '*')) || (strlen($a) < strlen($b))) {
- return 1;
- }
- return 0;
- }
-
- /**
- * Returns an array of eligible matching patterns.
- *
- * @param string $hostname
- * A hostname string, in the format example.com.
- *
- * @return array
- * An array of eligible matching patterns.
- */
- public function getPatterns($hostname) {
- $parts = explode('.', $hostname);
- $count = count($parts);
- // Account for ports.
- if (substr_count($hostname, ':') > 0) {
- $ports = explode(':', $parts[$count - 1]);
- $parts[$count - 1] = preg_replace('/:(\d+)/', '', $parts[$count - 1]);
- $parts[] = $ports[1];
- }
- // Build the list of possible matching patterns.
- $patterns = $this->buildPatterns($parts);
- // Pattern lists are sorted based on the fewest wildcards. That gives us
- // more precise matches first.
- uasort($patterns, [$this, 'sort']);
- array_unshift($patterns, $hostname);
-
- // Account for ports.
- if (isset($ports)) {
- $patterns = $this->buildPortPatterns($patterns, $hostname);
- }
-
- // Return unique patters.
- return array_unique($patterns);
- }
-
- /**
- * Builds a list of matching patterns.
- *
- * @param array $parts
- * The hostname of the request, as an array split by dots.
- *
- * @return array
- * An array of eligible matching patterns.
- */
- private function buildPatterns(array $parts) {
- $count = count($parts);
- for ($i = 0; $i < $count; $i++) {
- // Basic replacement of each value.
- $temp = $parts;
- $temp[$i] = '*';
- $patterns[] = implode('.', $temp);
- // Advanced multi-value wildcards.
- // Pattern *.*.
- if (count($temp) > 2 && $i < ($count - 1)) {
- $temp[$i + 1] = '*';
- $patterns[] = implode('.', $temp);
- }
- // Pattern foo.bar.*.
- if ($count > 3 && $i < ($count - 2)) {
- $temp[$i + 2] = '*';
- $patterns[] = implode('.', $temp);
- }
- // Pattern *.foo.*.
- if ($count > 3 && $i < 2) {
- $temp = $parts;
- $temp[$i] = '*';
- $temp[$i + 2] = '*';
- $patterns[] = implode('.', $temp);
- }
- // Pattern *.foo.*.*.
- if ($count > 2) {
- $temp = array_fill(0, $count, '*');
- $temp[$i] = $parts[$i];
- $patterns[] = implode('.', $temp);
- }
- }
- return $patterns;
- }
-
- /**
- * Builds a list of matching patterns, including ports.
- *
- * @param array $patterns
- * An array of eligible matching patterns.
- * @param string $hostname
- * A hostname string, in the format example.com.
- *
- * @return array
- * An array of eligible matching patterns, modified by port.
- */
- private function buildPortPatterns(array $patterns, $hostname) {
- foreach ($patterns as $index => $pattern) {
- // Make a pattern for port wildcards.
- if (substr_count($pattern, ':') < 1) {
- $new = explode('.', $pattern);
- $port = (int) array_pop($new);
- $allow = FALSE;
- // Do not allow *.* or *:*.
- foreach ($new as $item) {
- if ($item != '*') {
- $allow = TRUE;
- }
- }
- if ($allow) {
- // For port 80, allow bare hostname matches.
- if ($port == 80) {
- // Base hostname with port.
- $patterns[] = str_replace(':' . $port, '', $hostname);
- // Base hostname is allowed.
- $patterns[] = implode('.', $new);
- }
- // Base hostname with wildcard port.
- $patterns[] = str_replace(':' . $port, ':*', $hostname);
- // Pattern with exact port.
- $patterns[] = implode('.', $new) . ':' . $port;
- // Pattern with wildcard port.
- $patterns[] = implode('.', $new) . ':*';
- }
- unset($patterns[$index]);
- }
- }
- return $patterns;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasStorageInterface.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasStorageInterface.php
deleted file mode 100644
index 8bf6d1933..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasStorageInterface.php
+++ /dev/null
@@ -1,76 +0,0 @@
-configFactory = $config_factory;
- $this->entityTypeManager = $entity_type_manager;
- $this->aliasStorage = $this->entityTypeManager->getStorage('domain_alias');
- $this->domainStorage = $this->entityTypeManager->getStorage('domain');
- }
-
- /**
- * Validates the rules for a domain alias.
- *
- * @param \Drupal\domain_alias\DomainAliasInterface $alias
- * The Domain Alias to validate.
- *
- * @return \Drupal\Core\StringTranslation\TranslatableMarkup
- * A validation error message, if any.
- */
- public function validate(DomainAliasInterface $alias) {
- $pattern = $alias->getPattern();
-
- // 1) Check for at least one dot or the use of 'localhost'.
- // Note that localhost can specify a port.
- $localhost_check = explode(':', $pattern);
- if (substr_count($pattern, '.') == 0 && $localhost_check[0] != 'localhost') {
- return $this->t('At least one dot (.) is required, except when using localhost.');
- }
-
- // 2) Check that the alias only has one wildcard.
- $count = substr_count($pattern, '*') + substr_count($pattern, '?');
- if ($count > 1) {
- return $this->t('You may only have one wildcard character in each alias.');
- }
- // 3) Only one colon allowed, and it must be followed by an integer.
- $count = substr_count($pattern, ':');
- if ($count > 1) {
- return $this->t('You may only have one colon ":" character in each alias.');
- }
- elseif ($count == 1) {
- $int = substr($pattern, strpos($pattern, ':') + 1);
- if (!is_numeric($int)) {
- return $this->t('A colon may only be followed by an integer indicating the proper port.');
- }
- }
- // 4) Check that the alias doesn't contain any invalid characters.
- // Check for valid characters, unless using non-ASCII domains.
- $non_ascii = $this->configFactory->get('domain.settings')->get('allow_non_ascii');
- if (!$non_ascii) {
- $check = preg_match('/^[a-z0-9\.\+\-\*\?:]*$/', $pattern);
- if ($check == 0) {
- return $this->t('The pattern contains invalid characters.');
- }
- }
- // 5) The alias cannot begin or end with a period.
- if (substr($pattern, 0, 1) == '.') {
- return $this->t('The pattern cannot begin with a dot.');
- }
- if (substr($pattern, -1) == '.') {
- return $this->t('The pattern cannot end with a dot.');
- }
-
- // 6) Check that the alias is not a direct match for a registered domain.
- $check = preg_match('/[a-z0-9\.\+\-:]*$/', $pattern);
- if ($check == 1 && $this->domainStorage->loadByHostname($pattern)) {
- return $this->t('The pattern matches an existing domain record.');
- }
- // 7) Check that the alias is unique across all records.
- if ($alias_check = $this->aliasStorage->loadByPattern($pattern)) {
- /** @var \Drupal\domain_alias\DomainAliasInterface $alias_check */
- if ($alias_check->id() != $alias->id()) {
- return $this->t('The pattern already exists.');
- }
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasValidatorInterface.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasValidatorInterface.php
deleted file mode 100644
index 99c756370..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/DomainAliasValidatorInterface.php
+++ /dev/null
@@ -1,21 +0,0 @@
-pattern;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getEnvironment() {
- return !empty($this->environment) ? $this->environment : 'default';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDomainId() {
- return $this->domain_id;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDomain() {
- $storage = \Drupal::entityTypeManager()->getStorage('domain');
- $domains = $storage->loadByProperties(['domain_id' => $this->domain_id]);
- return $domains ? current($domains) : NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRedirect() {
- return $this->redirect;
- }
-
- /**
- * {@inheritdoc}
- */
- public function postSave(EntityStorageInterface $storage, $update = TRUE) {
- parent::postSave($storage, $update);
- // Invalidate cache tags relevant to domains.
- \Drupal::service('cache_tags.invalidator')->invalidateTags(['rendered', 'url.site']);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/Form/DomainAliasDeleteForm.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/Form/DomainAliasDeleteForm.php
deleted file mode 100644
index cd8cc6220..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/Form/DomainAliasDeleteForm.php
+++ /dev/null
@@ -1,22 +0,0 @@
- $this->entity->getDomainId(),
- ]);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/src/Tests/DomainAliasTestBase.php b/sites/all/modules/contrib/admin/domain/domain_alias/src/Tests/DomainAliasTestBase.php
deleted file mode 100644
index 2e84ba322..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/src/Tests/DomainAliasTestBase.php
+++ /dev/null
@@ -1,26 +0,0 @@
-admin_user = $this->drupalCreateUser(['administer domains', 'access administration pages']);
- $this->drupalLogin($this->admin_user);
-
- // Create test domains.
- $this->domainCreateTestDomains(3);
-
- $domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
- $alias_loader = \Drupal::entityTypeManager()->getStorage('domain_alias');
- $domains = $domain_storage->loadMultiple();
-
- // Save these for later testing.
- $original_domains = $domains;
-
- $base = $this->baseHostname;
- $hostnames = [$base, 'one.' . $base, 'two.' . $base];
-
- // Our patterns should map to example.com, one.example.com, two.example.com.
- $patterns = ['*.' . $base, 'four.' . $base, 'five.' . $base];
- $i = 0;
- foreach ($domains as $domain) {
- $this->assert($domain->getHostname() == $hostnames[$i], 'Hostnames set correctly');
- $this->assert($domain->getCanonical() == $hostnames[$i], 'Canonical domains set correctly');
- $values = [
- 'domain_id' => $domain->id(),
- 'pattern' => array_shift($patterns),
- 'redirect' => 0,
- 'environment' => 'local',
- ];
- $this->createDomainAlias($values);
- $i++;
- }
-
- $path = $domain->getScheme() . 'five.' . $base . '/admin/config/domain';
-
- // Visit the domain overview administration page.
- $this->drupalGet($path);
- $this->assertResponse(200);
-
- // Test the domains.
- $domains = $domain_storage->loadMultiple();
- $this->assertTrue(count($domains) == 3, 'Three domain records found.');
-
- // Check the default domain.
- $default = $domain_storage->loadDefaultId();
- $key = 'example_com';
- $this->assertTrue($default == $key, 'Default domain set correctly.');
-
- // Test some text on the page.
- foreach ($domains as $domain) {
- $name = $domain->label();
- $this->assertText($name, 'Name found properly.');
- }
- // Test the list of actions.
- $actions = ['delete', 'disable', 'default'];
- foreach ($actions as $action) {
- $this->assertRaw("/domain/{$action}/", 'Actions found properly.');
- }
- // Check that all domains are active.
- $this->assertNoRaw('Inactive', 'Inactive domain not found.');
-
- // Disable a domain and test the enable link.
- $this->clickLink('Disable', 0);
- $this->assertRaw('Inactive', 'Inactive domain found.');
-
- // Visit the domain overview administration page to clear cache.
- $this->drupalGet($path);
- $this->assertResponse(200);
-
- foreach ($domain_storage->loadMultiple() as $domain) {
- if ($domain->id() == 'one_example_com') {
- $this->assertEmpty($domain->status(), 'One domain inactive.');
- }
- else {
- $this->assertNotEmpty($domain->status(), 'Other domains active.');
- }
- }
-
- // Test the list of actions.
- $actions = ['enable', 'delete', 'disable', 'default'];
- foreach ($actions as $action) {
- $this->assertRaw("/domain/{$action}/", 'Actions found properly.');
- }
- // Re-enable the domain.
- $this->clickLink('Enable', 0);
- $this->assertNoRaw('Inactive', 'Inactive domain not found.');
-
- // Visit the domain overview administration page to clear cache.
- $this->drupalGet($path);
- $this->assertResponse(200);
-
- foreach ($domain_storage->loadMultiple() as $domain) {
- $this->assertNotEmpty($domain->status(), 'All domains active.');
- }
-
- // Set a new default domain.
- $this->clickLink('Make default', 0);
-
- // Visit the domain overview administration page to clear cache.
- $this->drupalGet($path);
- $this->assertResponse(200);
-
- // Check the default domain.
- $domain_storage->resetCache();
- $default = $domain_storage->loadDefaultId();
- $key = 'one_example_com';
- $this->assertTrue($default == $key, 'Default domain set correctly.');
-
- // Did the hostnames change accidentally?
- foreach ($domain_storage->loadMultiple() as $id => $domain) {
- $this->assertTrue($domain->getHostname() == $original_domains[$id]->getHostname(), 'Hostnames match.');
- }
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasEnvironmentTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasEnvironmentTest.php
deleted file mode 100644
index 3e4dd3e28..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasEnvironmentTest.php
+++ /dev/null
@@ -1,95 +0,0 @@
-domainCreateTestDomains(3);
- }
-
- /**
- * Test for environment matching.
- */
- public function testDomainAliasEnvironments() {
- $domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
- $alias_loader = \Drupal::entityTypeManager()->getStorage('domain_alias');
- $domains = $domain_storage->loadMultipleSorted(NULL, TRUE);
- // Our patterns should map to example.com, one.example.com, two.example.com.
- $patterns = ['*.example.com', 'four.example.com', 'five.example.com'];
- foreach ($domains as $domain) {
- $values = [
- 'domain_id' => $domain->id(),
- 'pattern' => array_shift($patterns),
- 'redirect' => 0,
- 'environment' => 'local',
- ];
- $this->createDomainAlias($values);
- }
- // Test the environment loader.
- $local = $alias_loader->loadByEnvironment('local');
- $this->assert(count($local) == 3, 'Three aliases set to local');
- // Test the environment matcher. $domain here is two.example.com.
- $match = $alias_loader->loadByEnvironmentMatch($domain, 'local');
- $this->assert(count($match) == 1, 'One environment match loaded');
- $alias = current($match);
- $this->assert($alias->getPattern() == 'five.example.com', 'Proper pattern match loaded.');
-
- // Set one alias to a different environment.
- $alias->set('environment', 'testing')->save();
- $local = $alias_loader->loadByEnvironment('local');
- $this->assert(count($local) == 2, 'Two aliases set to local');
- // Test the environment matcher. $domain here is two.example.com.
- $matches = $alias_loader->loadByEnvironmentMatch($domain, 'local');
- $this->assert(count($matches) == 0, 'No environment matches loaded');
-
- // Test the environment matcher. $domain here is one.example.com.
- $domain = $domain_storage->load('one_example_com');
- $matches = $alias_loader->loadByEnvironmentMatch($domain, 'local');
- $this->assert(count($matches) == 1, 'One environment match loaded');
- $alias = current($matches);
- $this->assert($alias->getPattern() == 'four.example.com', 'Proper pattern match loaded.');
-
- // Now load a page and check things.
- // Since we cannot read the service request, we place a block
- // which shows links to all domains.
- $this->drupalPlaceBlock('domain_switcher_block');
-
- // To get around block access, let the anon user view the block.
- user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['administer domains']);
- // For a non-aliased request, the url list should be normal.
- $this->drupalGet($domain->getPath());
- foreach ($domains as $domain) {
- $this->assertSession()->assertEscaped($domain->getHostname());
- $this->assertSession()->linkByHrefExists($domain->getPath(), 0, 'Link found: ' . $domain->getPath());
- }
- // For an aliased request (four.example.com), the list should be aliased.
- $url = $domain->getScheme() . $alias->getPattern() . $domain->getPort();
- $this->drupalGet($url);
- foreach ($matches as $match) {
- $this->assertSession()->assertEscaped($match->getPattern());
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListBuilderTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListBuilderTest.php
deleted file mode 100644
index dc5a971f2..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListBuilderTest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-domainCreateTestDomains(5);
- }
-
- /**
- * Basic test setup.
- */
- public function testDomainListBuilder() {
- $admin = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- 'administer domain aliases',
- 'view domain aliases',
- ]);
- $this->drupalLogin($admin);
-
- $this->drupalGet('admin/config/domain');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check that links are printed.
- foreach ($this->getDomains() as $domain) {
- $href = 'admin/config/domain/alias/' . $domain->id();
- $this->assertSession()->linkByHrefExists($href, 0, 'Link found');
- }
-
- // Now login as a user with limited rights.
- $account = $this->drupalCreateUser([
- 'create article content',
- 'edit any article content',
- 'edit assigned domains',
- 'view domain list',
- 'view domain aliases',
- 'edit domain aliases',
- ]);
- $ids = ['example_com', 'one_example_com'];
- $this->addDomainsToEntity('user', $account->id(), $ids, DOMAIN_ADMIN_FIELD);
- $user_storage = \Drupal::entityTypeManager()->getStorage('user');
- $user = $user_storage->load($account->id());
- $manager = \Drupal::service('domain.element_manager');
- $values = $manager->getFieldValues($user, DOMAIN_ADMIN_FIELD);
- $this->assert(count($values) == 2, 'User saved with two domain records.');
-
- $this->drupalLogin($account);
-
- $this->drupalGet('admin/config/domain');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check that links are printed.
- $path = 'admin/config/domain/';
- $this->drupalGet($path);
- foreach ($this->getDomains() as $domain) {
- $href = 'admin/config/domain/alias/' . $domain->id();
- if (in_array($domain->id(), $ids)) {
- $this->assertSession()->linkByHrefExists($href, 0, 'Link found');
- }
- else {
- $this->assertSession()->linkByHrefNotExists($href, 'Link not found');
- }
- }
-
- // Check access to the pages/routes.
- foreach ($this->getDomains() as $domain) {
- $path = 'admin/config/domain/alias/' . $domain->id();
- $this->drupalGet($path);
- if (in_array($domain->id(), $ids)) {
- $this->assertSession()->statusCodeEquals(200);
- }
- else {
- $this->assertSession()->statusCodeEquals(403);
- }
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListHostnameTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListHostnameTest.php
deleted file mode 100644
index 1d392f79a..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasListHostnameTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
-domainCreateTestDomains(3);
- }
-
- /**
- * Test for environment matching.
- */
- public function testDomainAliasEnvironments() {
- $domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
- $alias_loader = \Drupal::entityTypeManager()->getStorage('domain_alias');
- $domains = $domain_storage->loadMultiple();
-
- $base = $this->baseHostname;
- $hostnames = [$base, 'one.' . $base, 'two.' . $base];
-
- // Our patterns should map to example.com, one.example.com, two.example.com.
- $patterns = ['*.' . $base, 'four.' . $base, 'five.' . $base];
- $i = 0;
- foreach ($domains as $domain) {
- $this->assert($domain->getHostname() == $hostnames[$i], 'Hostnames set correctly');
- $this->assert($domain->getCanonical() == $hostnames[$i], 'Canonical domains set correctly');
- $values = [
- 'domain_id' => $domain->id(),
- 'pattern' => array_shift($patterns),
- 'redirect' => 0,
- 'environment' => 'local',
- ];
- $this->createDomainAlias($values);
- $i++;
- }
- // Test the environment loader.
- $local = $alias_loader->loadByEnvironment('local');
- $this->assert(count($local) == 3, 'Three aliases set to local');
- // Test the environment matcher. $domain here is two.example.com.
- $match = $alias_loader->loadByEnvironmentMatch($domain, 'local');
- $this->assert(count($match) == 1, 'One environment match loaded');
- $alias = current($match);
- $this->assert($alias->getPattern() == 'five.' . $base, 'Proper pattern match loaded.');
-
- $admin = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- ]);
- $this->drupalLogin($admin);
-
- // Load an aliased domain.
- $this->drupalGet($domain->getScheme() . 'five.' . $base . '/admin/config/domain');
- $this->assertSession()->statusCodeEquals(200);
-
- // Save the form.
- $this->pressButton('edit-submit');
- // Ensure the values haven't changed.
- $i = 0;
- $domains = $domain_storage->loadMultiple();
- foreach ($domains as $domain) {
- $this->assert($domain->getHostname() == $hostnames[$i], 'Hostnames set correctly');
- $this->assert($domain->getCanonical() == $hostnames[$i], 'Canonical domains set correctly');
- $i++;
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasNegotiatorTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasNegotiatorTest.php
deleted file mode 100644
index 4f39ab300..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasNegotiatorTest.php
+++ /dev/null
@@ -1,110 +0,0 @@
-domainTableIsEmpty();
-
- // Create two new domains programmatically.
- $this->domainCreateTestDomains(2);
-
- // Since we cannot read the service request, we place a block
- // which shows the current domain information.
- $this->drupalPlaceBlock('domain_server_block');
-
- // To get around block access, let the anon user view the block.
- user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['administer domains']);
-
- // Set the storage handles.
- $domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
- $alias_storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
-
- // Set known prefixes that work with our tests. This will give us domains
- // 'example.com' and 'one.example.com' aliased to 'two.example.com' and
- // 'three.example.com'.
- $prefixes = ['two', 'three'];
- // Test the response of each home page.
- /** @var \Drupal\domain\Entity\Domain $domain */
- foreach ($domain_storage->loadMultiple() as $domain) {
- $alias_domains[] = $domain;
- $this->drupalGet($domain->getPath());
- $this->assertRaw($domain->label(), 'Loaded the proper domain.');
- $this->assertRaw('Exact match', 'Direct domain match.');
- }
-
- // Now, test an alias for each domain.
- foreach ($alias_domains as $index => $alias_domain) {
- $prefix = $prefixes[$index];
- // Set a known pattern.
- $pattern = $prefix . '.' . $this->baseHostname;
- $this->domainAliasCreateTestAlias($alias_domain, $pattern);
- $alias = $alias_storage->loadByPattern($pattern);
- // Set the URL for the request. Note that this is not saved, it is just
- // URL generation.
- $alias_domain->set('hostname', $pattern);
- $alias_domain->setPath();
- $url = $alias_domain->getPath();
- $this->drupalGet($url);
- $this->assertRaw($alias_domain->label(), 'Loaded the proper domain.');
- $this->assertRaw('ALIAS:', 'No direct domain match.');
- $this->assertRaw($alias->getPattern(), 'Alias match.');
-
- // Test redirections.
- // @TODO: This could be much more elegant: the redirects break assertRaw()
- $alias->set('redirect', 301);
- $alias->save();
- $this->drupalGet($url);
- $alias->set('redirect', 302);
- $alias->save();
- $this->drupalGet($url);
- }
- // Test a wildcard alias.
- // @TODO: Refactor this test to merge with the above.
- $alias_domain = $domain_storage->loadDefaultDomain();
- $pattern = '*.' . $this->baseHostname;
- $this->domainAliasCreateTestAlias($alias_domain, $pattern);
- $alias = $alias_storage->loadByPattern($pattern);
- // Set the URL for the request. Note that this is not saved, it is just
- // URL generation.
- $alias_domain->set('hostname', 'four.' . $this->baseHostname);
- $alias_domain->setPath();
- $url = $alias_domain->getPath();
- $this->drupalGet($url);
- $this->assertRaw($alias_domain->label(), 'Loaded the proper domain.');
- $this->assertRaw('ALIAS:', 'No direct domain match.');
- $this->assertRaw($alias->getPattern(), 'Alias match.');
-
- // Test redirections.
- // @TODO: This could be much more elegant: the redirects break assertRaw()
- $alias->set('redirect', 301);
- $alias->save();
- $this->drupalGet($url);
- $alias->set('redirect', 302);
- $alias->save();
- $this->drupalGet($url);
-
- // Revoke the permission change.
- user_role_revoke_permissions(RoleInterface::ANONYMOUS_ID, ['administer domains']);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasSortTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasSortTest.php
deleted file mode 100644
index 204443976..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasSortTest.php
+++ /dev/null
@@ -1,82 +0,0 @@
-sortList();
-
- $storage = \Drupal::entityTypeManager()->getStorage('domain_alias');
- foreach ($list as $key => $values) {
- $patterns = $storage->getPatterns($key);
- $this->assertTrue(empty(array_diff($values, $patterns)), 'Pattern matched as expected for ' . $key);
- }
- }
-
- /**
- * An array of expected matches to specific domains.
- */
- private function sortList() {
- return [
- 'example.com' => [
- 'example.com',
- 'example.*',
- '*.com',
- ],
- 'one.example.com' => [
- 'one.example.com',
- 'one.example.*',
- '*.example.com',
- 'one.*.com',
- '*.example.*',
- '*.*.com',
- 'one.*.*',
- ],
- 'one.two.example.com' => [
- 'one.two.example.com',
- '*.two.example.com',
- 'one.two.example.*',
- 'one.*.example.com',
- '*.*.example.com',
- 'one.two.*.com',
- 'one.*.example.*',
- 'one.*.*.com',
- '*.two.*.com',
- 'one.two.*.*',
- '*.*.example.com',
- '*.*.*.com',
- 'one.*.*.*',
- '*.two.*.*',
- ],
- 'example.com:80' => [
- 'example.com:80',
- 'example.com',
- 'example.*',
- 'example.com:*',
- 'example.*:80',
- 'example.*:*',
- '*.com',
- '*.com:80',
- '*.com:*',
- ],
- 'example.com:8080' => [
- 'example.com:8080',
- 'example.com:*',
- 'example.*:8080',
- 'example.*:*',
- '*.com:8080',
- '*.com:*',
- ],
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasTestBase.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasTestBase.php
deleted file mode 100644
index a7af96f78..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasTestBase.php
+++ /dev/null
@@ -1,22 +0,0 @@
-domainTableIsEmpty();
- $validator = \Drupal::service('domain_alias.validator');
-
- // Create a domain.
- $this->domainCreateTestDomains(1, 'foo.com');
- // Check the created domain based on it's known id value.
- $key = 'foo.com';
- /** @var \Drupal\domain\Entity\Domain $domain */
- $domain = \Drupal::entityTypeManager()->getStorage('domain')->loadByHostname($key);
- $this->assertTrue(!empty($domain), 'Test domain created.');
-
- // Valid patterns to test. Valid is the boolean value.
- $patterns = [
- 'localhost' => 1,
- 'example.com' => 1,
- // See www-prefix test, below.
- 'www.example.com' => 1,
- '*.example.com' => 1,
- 'one.example.com' => 1,
- 'example.com:8080' => 1,
- // Must have a dot or be localhost.
- 'foobar' => 0,
- // Only one wildcard.
- '*.*.example.com' => 0,
- // Only one colon.
- 'example.com::8080' => 0,
- // No letters after a colon.
- 'example.com:abc' => 0,
- // Cannot begin with a dot.
- '.example.com' => 0,
- // Cannot end with a dot.
- 'example.com.' => 0,
- // Lowercase only.
- 'EXAMPLE.com' => 0,
- // ascii-only.
- 'éxample.com' => 0,
- // duplicate.
- 'foo.com' => 0,
- ];
- foreach ($patterns as $pattern => $valid) {
- $alias = $this->domainAliasCreateTestAlias($domain, $pattern, 0, 'default', FALSE);
- $errors = $validator->validate($alias);
- if ($valid) {
- $this->assertTrue(empty($errors), 'Validation test success.');
- }
- else {
- $this->assertTrue(!empty($errors), 'Validation test success.');
- }
- }
- // Test the configurable option.
- $config = $this->config('domain.settings');
- $config->set('allow_non_ascii', TRUE)->save();
- // Valid hostnames to test. Valid is the boolean value.
- $patterns = [
- // ascii-only allowed.
- 'éxample.com' => 1,
- ];
- foreach ($patterns as $pattern => $valid) {
- $alias = $this->domainAliasCreateTestAlias($domain, $pattern, 0, 'default', FALSE);
- $errors = $validator->validate($alias);
- if ($valid) {
- $this->assertTrue(empty($errors), 'Validation test success.');
- }
- else {
- $this->assertTrue(!empty($errors), 'Validation test success.');
- }
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasWildcardTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasWildcardTest.php
deleted file mode 100644
index 218ab80b3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Functional/DomainAliasWildcardTest.php
+++ /dev/null
@@ -1,87 +0,0 @@
-domainCreateTestDomains(3);
- }
-
- /**
- * Test for environment matching.
- */
- public function testDomainAliasWildcards() {
- $domain_storage = \Drupal::entityTypeManager()->getStorage('domain');
- $alias_loader = \Drupal::entityTypeManager()->getStorage('domain_alias');
- $domains = $domain_storage->loadMultipleSorted(NULL, TRUE);
- // Our patterns should map to example.com, one.example.com, two.example.com.
- $patterns = ['example.*', 'four.example.*', 'five.example.*'];
- foreach ($domains as $domain) {
- $values = [
- 'domain_id' => $domain->id(),
- 'pattern' => array_shift($patterns),
- 'redirect' => 0,
- 'environment' => 'local',
- ];
- $this->createDomainAlias($values);
- }
- // Test the environment loader.
- $local = $alias_loader->loadByEnvironment('local');
- $this->assert(count($local) == 3, 'Three aliases set to local');
- // Test the environment matcher. $domain here is two.example.com.
- $match = $alias_loader->loadByEnvironmentMatch($domain, 'local');
- $this->assert(count($match) == 1, 'One environment match loaded');
- $alias = current($match);
- $this->assert($alias->getPattern() == 'five.example.*', 'Proper pattern match loaded.');
-
- // Test the environment matcher. $domain here is one.example.com.
- $domain = $domain_storage->load('example_com');
- $matches = $alias_loader->loadByEnvironmentMatch($domain, 'local');
- $this->assert(count($matches) == 1, 'One environment match loaded');
- $alias = current($matches);
- $this->assert($alias->getPattern() == 'example.*', 'Proper pattern match loaded.');
-
- // Now load a page and check things.
- // Since we cannot read the service request, we place a block
- // which shows links to all domains.
- $this->drupalPlaceBlock('domain_switcher_block');
-
- // To get around block access, let the anon user view the block.
- user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, ['administer domains']);
- // For a non-aliased request, the url list should be normal.
- $this->drupalGet($domain->getPath());
- foreach ($domains as $domain) {
- $this->assertSession()->assertEscaped($domain->getHostname());
- $this->assertSession()->linkByHrefExists($domain->getPath(), 0, 'Link found: ' . $domain->getPath());
- }
- // For an aliased request (four.example.com), the list should be aliased.
- $url = $domain->getScheme() . str_replace('*', 'com', $alias->getPattern()) . $domain->getPort();
- $this->drupalGet($url);
- foreach ($matches as $match) {
- $this->assertSession()->assertEscaped(str_replace('*', 'com', $match->getPattern()));
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Kernel/DomainAliasDomainDeleteTest.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Kernel/DomainAliasDomainDeleteTest.php
deleted file mode 100644
index 94fe73fad..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Kernel/DomainAliasDomainDeleteTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
-domainCreateTestDomains(2);
-
- // Get the services.
- $this->domainStorage = \Drupal::entityTypeManager()->getStorage('domain');
- $this->aliasStorage = \Drupal::entityTypeManager()->getStorage('domain_alias');
- }
-
- /**
- * Tests alias deletion on domain deletion.
- */
- public function testDomainDelete() {
- $domains = $this->domainStorage->loadMultiple();
- $patterns = [
- 'example_com' => '*.example.com',
- 'one_example_com' => 'foo.example.com',
- ];
-
- // Create an alias.
- foreach ($domains as $id => $domain) {
- $values = [
- 'domain_id' => $domain->id(),
- 'pattern' => $patterns[$id],
- 'redirect' => 0,
- 'environment' => 'local',
- ];
- $this->createDomainAlias($values);
- $alias = $this->aliasStorage->loadByPattern($patterns[$id]);
- $this->assertTrue(!empty($alias), 'Alias saved properly');
- }
-
- // Delete one domain.
- $domain->delete();
- $alias = $this->aliasStorage->loadByPattern($patterns[$id]);
- $this->assertTrue(empty($alias), 'Alias deleted properly');
-
- // Check the remaining domain, which should still have an alias.
- $domain = $this->domainStorage->load('example_com');
- $alias = $this->aliasStorage->loadByPattern($patterns[$domain->id()]);
- $this->assertTrue(!empty($alias), 'Alias retained properly');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Traits/DomainAliasTestTrait.php b/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Traits/DomainAliasTestTrait.php
deleted file mode 100644
index bc7e1fffe..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_alias/tests/src/Traits/DomainAliasTestTrait.php
+++ /dev/null
@@ -1,67 +0,0 @@
-getStorage('domain_alias')->create($values);
- if ($save) {
- $alias->save();
- }
-
- return $alias;
- }
-
- /**
- * Creates an alias for testing without passing values.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * A domain entity.
- * @param string $pattern
- * An optional alias pattern.
- * @param int $redirect
- * An optional redirect (301 or 302).
- * @param int $environment
- * An optional environment string.
- * @param bool $save
- * Whether to save the alias or return for validation.
- *
- * @return \Drupal\domain_alias\Entity\DomainAlias
- * A domain alias entity.
- */
- public function domainAliasCreateTestAlias(DomainInterface $domain, $pattern = NULL, $redirect = 0, $environment = 'default', $save = TRUE) {
- if (empty($pattern)) {
- $pattern = '*.' . $domain->getHostname();
- }
- $values = [
- 'domain_id' => $domain->id(),
- 'pattern' => $pattern,
- 'redirect' => $redirect,
- 'environment' => $environment,
- ];
-
- return $this->createDomainAlias($values, $save);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/README.md b/sites/all/modules/contrib/admin/domain/domain_config/README.md
deleted file mode 100644
index 9b5138b58..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/README.md
+++ /dev/null
@@ -1,121 +0,0 @@
-Domain Config
-=============
-
-This module provides a per-domain configuration option so that, for each
-domain, you can change configuration items of any type, such as settings like
-the site name.
-
-By default, these overrides are also language-aware. An override may exist per
-domain, or per-language per domain, based on the prefixes used in the config
-file.
-
-Usage
-=====
-
-Currently, there is no user interface for changing settings, but you can load
-in new files that contain configuration per domain.
-
-The pattern for override files is
-`domain.config.DOMAIN_MACHINE_NAME.LANGCODE.item.name`, with the backup for
-language-insensitive files as `domain.config.DOMAIN_MACHINE_NAME.item.name`,
-where `item.name` is the name of the configuration item being overridden.
-
-To override the site name, for instance, you begin by exporting the
-corresponding configuration item at the Configuration Synchronization screen
-for a single export:
-`admin/config/development/configuration/single/export`
-
-In this case, the type of configuration to be exported is "Simple
-configuration" and the particular item is named `system.site`.
-
-You should have a file like the following:
-
-```YAML
-uuid: 536db351-7aec-407e-a746-70ba9cc9f190
-name: Example
-mail: admin@example.com
-slogan: ''
-page:
- 403: ''
- 404: ''
- front: /user
-admin_compact_mode: false
-weight_select_max: 100
-langcode: en
-default_langcode: en
-```
-
-An override file should contain only the specific data that you want to
-override. To override the name, the only line needed is the one beginning
- ```name:```. The resulting override looks like this:
-
-```YAML
-name: Three
-```
-
-To override both the name and the slogan:
-
-```YAML
-name: Three
-slogan: 'My site slogan'
-```
-
-*Warning: do not copy over the `uuid` value into the new file. Doing so may
-cause the configuration import to fail.*
-
-We want this to apply when the domain `three.example.com` is active and English
-is the active language. Therefore, this file would be named
-`domain.config.three_example_com.en.system.site`. If we wanted this file to
-apply whenever the domain `three.example.com` is active, we would leave off the
-language prefix: `domain.config.three_example_com.system.site`.
-
-For further examples, see the files in
-`\domain\domain_config\tests\modules\domain_config_test\config\install`.
-
-Import that file's contents at the Configuration Synchronization screen for a
-single import:
-`admin/config/development/configuration/single/import`
-
-Note that, unlike when you exported the item, here you always select "Simple
-configuration" as the configuration type to import, independent of the type of
-configuration you're overriding.
-
-settings.php overrides
-----------------------
-
-For environment-specific or sensitive overrides, use the settings.php method.
-In the above case, add:
-
-`$config['domain.config.three_example_com.en.system.site']['name'] = "My special site";`
-
-to your local settings.php file. This will ensure that the `three.example.com`
-domain gets the correct value regardless of other module overrides. If you do
-not have a language set the config system will fallback on the domain-specific
-setting (note the missing '.en'):
-
-`$config['domain.config.three_example_com.system.site']['name'] = "My special site";`
-
-To set nested values you need to nest the config array:
-
-`$config['domain.config.three_example_com.system.site']['page']['front'] = '/node/1;`
-
-Read more about the "Configuration override system" at
-https://www.drupal.org/node/1928898.
-
-Installation
-============
-
-If some variable changes are not picked up when the page renders, you may need
-add domain-sensitivity to the site's cache.
-
-To do so, clone `default.services.yml` to `services.yml` and change the
-`required_cache_contexts` value to:
-
-```YAML
- required_cache_contexts: ['languages:language_interface', 'theme', 'user.permissions', 'url.site']
-```
-
-Dependencies
-============
-
-- Domain
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/domain_config.info.yml b/sites/all/modules/contrib/admin/domain/domain_config/domain_config.info.yml
deleted file mode 100644
index dae75bca8..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/domain_config.info.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: Domain Configuration
-description: 'Allows domain specific configuration.'
-type: module
-package: Domain
-# version: VERSION
-# core: 8.x
-dependencies:
- - domain:domain
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/domain_config.module b/sites/all/modules/contrib/admin/domain/domain_config/domain_config.module
deleted file mode 100644
index bb26c0250..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/domain_config.module
+++ /dev/null
@@ -1,6 +0,0 @@
-domain = $domainNegotiator->getActiveDomain();
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getCid() {
- if (!isset($this->cid)) {
- $domain_id = 'null';
- if (!empty($this->domain)) {
- $domain_id = $this->domain->id();
- }
- $this->cid = 'library_info:' . $domain_id . ':' . $this->themeManager->getActiveTheme()->getName();
- }
-
- return $this->cid;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigOverrider.php b/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigOverrider.php
deleted file mode 100644
index 97f3ec09e..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigOverrider.php
+++ /dev/null
@@ -1,221 +0,0 @@
-storage = $storage;
- $this->moduleHandler = $module_handler;
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadOverrides($names) {
- // Try to prevent repeating lookups.
- static $lookups;
- // Key should be a known length, so hash.
- $key = md5(implode(':', $names));
- if (isset($lookups[$key])) {
- return $lookups[$key];
- }
-
- // Set the context of the override request.
- if (empty($this->contextSet)) {
- $this->initiateContext();
- }
-
- // Prepare our overrides.
- $overrides = [];
- // loadOverrides() runs on config entities, which means that if we try
- // to run this routine on our own data, then we end up in an infinite loop.
- // So ensure that we are _not_ looking up a domain.record.*.
- $check = current($names);
- $list = explode('.', $check);
- if (isset($list[0]) && isset($list[1]) && $list[0] == 'domain' && $list[1] == 'record') {
- $lookups[$key] = $overrides;
- return $overrides;
- }
- if (!empty($this->domain)) {
- foreach ($names as $name) {
- $config_name = $this->getDomainConfigName($name, $this->domain);
- // Check to see if the config storage has an appropriately named file
- // containing override data.
- if ($override = $this->storage->read($config_name['langcode'])) {
- $overrides[$name] = $override;
- }
- // Check to see if we have a file without a specific language.
- elseif ($override = $this->storage->read($config_name['domain'])) {
- $overrides[$name] = $override;
- }
-
- // Apply any settings.php overrides.
- if (isset($GLOBALS['config'][$config_name['langcode']])) {
- $overrides[$name] = $GLOBALS['config'][$config_name['langcode']];
- }
- elseif (isset($GLOBALS['config'][$config_name['domain']])) {
- $overrides[$name] = $GLOBALS['config'][$config_name['domain']];
- }
- }
- $lookups[$key] = $overrides;
- }
-
- return $overrides;
- }
-
- /**
- * Get configuration name for this hostname.
- *
- * It will be the same name with a prefix depending on domain and language:
- * @code domain.config.DOMAIN_ID.LANGCODE @endcode
- *
- * @param string $name
- * The name of the config object.
- * @param \Drupal\domain\DomainInterface $domain
- * The domain object.
- *
- * @return array
- * The domain-language, and domain-specific config names.
- */
- protected function getDomainConfigName($name, DomainInterface $domain) {
- return [
- 'langcode' => 'domain.config.' . $domain->id() . '.' . $this->language->getId() . '.' . $name,
- 'domain' => 'domain.config.' . $domain->id() . '.' . $name,
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheSuffix() {
- $suffix = $this->domain ? $this->domain->id() : '';
- $suffix .= $this->language ? $this->language->getId() : '';
- return ($suffix) ? $suffix : NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
- return NULL;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheableMetadata($name) {
- if (empty($this->contextSet)) {
- $this->initiateContext();
- }
- $metadata = new CacheableMetadata();
- if (!empty($this->domain)) {
- $metadata->addCacheContexts(['url.site', 'languages:language_interface']);
- }
- return $metadata;
- }
-
- /**
- * Sets domain and language contexts for the request.
- *
- * We wait to do this in order to avoid circular dependencies
- * with the locale module.
- */
- protected function initiateContext() {
- // Prevent infinite lookups by caching the request. Since the _construct()
- // is called for each lookup, this is more efficient.
- $this->contextSet = TRUE;
-
- // Get the language context. Note that injecting the language manager
- // into the service created a circular dependency error, so we load from
- // the core service manager.
- $this->languageManager = \Drupal::languageManager();
- $this->language = $this->languageManager->getCurrentLanguage();
-
- // The same issue is true for the domainNegotiator.
- $this->domainNegotiator = \Drupal::service('domain.negotiator');
- // Get the domain context.
- $this->domain = $this->domainNegotiator->getActiveDomain();
- // If we have fired too early in the bootstrap, we must force the routine to
- // run.
- if (empty($this->domain)) {
- $this->domain = $this->domainNegotiator->getActiveDomain(TRUE);
- // Ensure the module hook cache is set properly.
- // See https://www.drupal.org/project/domain/issues/3025541
- $this->moduleHandler->resetImplementations();
- }
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigServiceProvider.php b/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigServiceProvider.php
deleted file mode 100644
index a7841188e..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/src/DomainConfigServiceProvider.php
+++ /dev/null
@@ -1,38 +0,0 @@
-getDefinition('router.route_provider');
- $definition->setClass(DomainRouteProvider::class);
-
- if ($container->hasParameter('renderer.config')) {
- $renderer_config = $container->getParameter('renderer.config');
-
- if (!in_array('url.site', $renderer_config['required_cache_contexts'])) {
- $renderer_config['required_cache_contexts'][] = 'url.site';
- }
-
- $container->setParameter('renderer.config', $renderer_config);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/src/Routing/DomainRouteProvider.php b/sites/all/modules/contrib/admin/domain/domain_config/src/Routing/DomainRouteProvider.php
deleted file mode 100644
index a5297e94b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/src/Routing/DomainRouteProvider.php
+++ /dev/null
@@ -1,38 +0,0 @@
-getCurrentLanguageCacheIdPart();
- return 'route:' . $request->getHost() . ':' . $language_part . ':' . $request->getPathInfo() . ':' . $request->getQueryString();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/src/Tests/DomainConfigTestBase.php b/sites/all/modules/contrib/admin/domain/domain_config/src/Tests/DomainConfigTestBase.php
deleted file mode 100644
index 04c9526ca..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/src/Tests/DomainConfigTestBase.php
+++ /dev/null
@@ -1,77 +0,0 @@
- 'Spanish'];
-
- /**
- * Modules to enable.
- *
- * @var array
- */
- public static $modules = [
- 'domain',
- 'language',
- 'domain_config_test',
- 'domain_config',
- ];
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- parent::setUp();
-
- // Create and login user.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
- $this->drupalLogin($admin_user);
-
- // Add language.
- $edit = [
- 'predefined_langcode' => 'es',
- ];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
-
- // Enable URL language detection and selection.
- $edit = ['language_interface[enabled][language-url]' => '1'];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
-
- $this->drupalLogout();
-
- // In order to reflect the changes for a multilingual site in the container
- // we have to rebuild it.
- $this->rebuildContainer();
-
- $es = \Drupal::entityTypeManager()->getStorage('configurable_language')->load('es');
- $this->assertTrue(!empty($es), 'Created test language.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.info.yml
deleted file mode 100644
index 86b70de9b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.info.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-name: "Domain config hook test"
-description: "Support module for domain config testing."
-type: module
-package: Testing
-# version: VERSION
-# core: 8.x
-hidden: TRUE
-
-dependencies: []
-
-# This module represents several services that could be provided by multiple modules in the Drupal community.
-# The following are not playing nice together:
-# - A page cache policy service that uses the config factory.
-# - A module that implements hook_module_implements.
-# - A random hook that hook_module_implements wishes to control.
-# - The domain_config module (and domain negotiator service, I believe).
-
-# When this module is functioning correctly, when a user logs in, there will not be a state key set.
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.module b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.module
deleted file mode 100644
index dfbfcf56e..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.module
+++ /dev/null
@@ -1,23 +0,0 @@
-set('domain_config_test__user_login', TRUE);
-}
-
-/**
- * Implements hook_module_implements_alter().
- */
-function domain_config_hook_test_module_implements_alter(&$implementations, $hook) {
- if ($hook == 'user_login') {
- // Turn off the domain_config_hook_test's hook_user_login (above).
- unset($implementations['domain_config_hook_test']);
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.services.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.services.yml
deleted file mode 100644
index 8cb02a0d8..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/domain_config_hook_test.services.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-services:
- domain_config_service.page_cache_request_policy:
- class: Drupal\domain_config_hook_test\PageCache\RequestPolicy\PageCacheRequestPolicy
- arguments: ['@config.factory']
- tags:
- - { name: page_cache_request_policy }
-
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/src/PageCache/RequestPolicy/PageCacheRequestPolicy.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/src/PageCache/RequestPolicy/PageCacheRequestPolicy.php
deleted file mode 100644
index 6d0cc4b4d..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_hook_test/src/PageCache/RequestPolicy/PageCacheRequestPolicy.php
+++ /dev/null
@@ -1,47 +0,0 @@
-configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public function check(Request $request) {
- // This line is important. You have to use this service for it to fail.
- $this->configFactory
- ->get('system.site');
-
- return NULL;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/install/domain_config_middleware_test.settings.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/install/domain_config_middleware_test.settings.yml
deleted file mode 100644
index 03c0bfdd1..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/install/domain_config_middleware_test.settings.yml
+++ /dev/null
@@ -1 +0,0 @@
-test_setting: false
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/schema/domain_config_middleware_test.schema.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/schema/domain_config_middleware_test.schema.yml
deleted file mode 100644
index 7fddd2369..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/config/schema/domain_config_middleware_test.schema.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# Schema for the configuration files of the Domain module.
-domain_config_middleware_test.settings:
- type: config_object
- label: 'Domain config middleware settings'
- mapping:
- test_setting:
- type: boolean
- label: 'A test setting'
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.info.yml
deleted file mode 100644
index 0ba18b603..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.info.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: "Domain config middleware module tests"
-description: "Support module for domain config middleware response testing."
-type: module
-package: Testing
-# version: VERSION
-# core: 8.x
-hidden: TRUE
-
-dependencies:
- - domain
- - domain_config
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.services.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.services.yml
deleted file mode 100644
index ecaa375c2..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/domain_config_middleware_test.services.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-services:
- domain_config_test.middleware:
- class: Drupal\domain_config_middleware_test\Middleware
- arguments: ['@config.factory']
- tags:
- # Ensure to come before page caching, so you don't serve cached pages to
- # banned users.
- - { name: http_middleware, priority: 250 }
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/src/Middleware.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/src/Middleware.php
deleted file mode 100644
index dd850098f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_middleware_test/src/Middleware.php
+++ /dev/null
@@ -1,51 +0,0 @@
-httpKernel = $http_kernel;
- $this->configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) {
- // This line should break hooks in our code.
- // @see https://www.drupal.org/node/2896434.
- $config = $this->configFactory->get('domain_config_middleware_test.settings');
- return $this->httpKernel->handle($request, $type, $catch);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.four_example_com.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.four_example_com.system.site.yml
deleted file mode 100644
index 320f9b0fe..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.four_example_com.system.site.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-name: 'Four'
-page:
- front: /node/2
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.one_example_com.en.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.one_example_com.en.system.site.yml
deleted file mode 100644
index 479549188..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.one_example_com.en.system.site.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: 'One'
-mail: admin@example.com
-slogan: ''
-page:
- 403: ''
- 404: ''
- front: /node/1
-admin_compact_mode: false
-weight_select_max: 100
-langcode: en
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.three_example_com.en.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.three_example_com.en.system.site.yml
deleted file mode 100644
index 4c7e58f3b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.three_example_com.en.system.site.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-mail: admin@example.com
-slogan: ''
-page:
- 403: ''
- 404: ''
- front: /node
-admin_compact_mode: false
-weight_select_max: 100
-langcode: en
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.en.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.en.system.site.yml
deleted file mode 100644
index 03791fb87..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.en.system.site.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: 'Two'
-mail: admin@example.com
-slogan: 'I have it'
-page:
- 403: ''
- 404: ''
- front: /node
-admin_compact_mode: false
-weight_select_max: 100
-langcode: en
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.es.system.site.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.es.system.site.yml
deleted file mode 100644
index 33f2ed30c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/config/install/domain.config.two_example_com.es.system.site.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-name: 'Dos'
-mail: admin@example.com
-slogan: 'Yo la tengo'
-page:
- 403: ''
- 404: ''
- front: /node
-admin_compact_mode: false
-weight_select_max: 100
-langcode: en
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.info.yml
deleted file mode 100644
index 0c1f3bbf0..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.info.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: "Domain config module tests"
-description: "Support module for domain config testing."
-type: module
-package: Testing
-# version: VERSION
-# core: 8.x
-hidden: TRUE
-
-dependencies:
- - domain
- - domain_config
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.module b/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.module
deleted file mode 100644
index 6c10b8ed0..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/modules/domain_config_test/domain_config_test.module
+++ /dev/null
@@ -1,30 +0,0 @@
-addProperty('config_test', 'aye');
-}
-
-/**
- * Implements hook_page_attachments_alter().
- */
-function domain_config_test_page_attachments_alter(array &$attachments) {
- /** @var \Drupal\domain\DomainNegotiatorInterface $Negotiator */
- $negotiator = \Drupal::service('domain.negotiator');
- $domain = $negotiator->getActiveDomain();
- if (!empty($domain) && $domain->get('config_test') == 'aye') {
- $attachments['#attached']['http_header'][] = [
- 'X-Domain-Config-Test-page-attachments-hook',
- 'invoked',
- ];
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigAlterHookTest.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigAlterHookTest.php
deleted file mode 100644
index b2b773380..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigAlterHookTest.php
+++ /dev/null
@@ -1,74 +0,0 @@
-domainCreateTestDomains();
-
- // Get the services.
- $this->negotiator = \Drupal::service('domain.negotiator');
- $this->moduleHandler = \Drupal::service('module_handler');
- }
-
- /**
- * Tests domain request alteration.
- */
- public function testHookDomainRequestAlter() {
- // Check for the count of hook implementations.
- $hooks = $this->moduleHandler->getImplementations('domain_request_alter');
- $this->assertCount(1, $hooks, 'One hook implementation found.');
-
- // Assert that the hook is also called on a request with a HTTP Middleware
- // that requests config thus triggering an early hook invocation (before
- // modules are loaded by the kernel).
- $this->drupalGet('');
- $this->assertEquals('invoked', $this->drupalGetHeader('X-Domain-Config-Test-page-attachments-hook'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHomepageTest.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHomepageTest.php
deleted file mode 100644
index d4eba5094..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHomepageTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-config('system.site');
- $site_config->set('page.front', '/node')->save();
-
- // No domains should exist.
- $this->domainTableIsEmpty();
- // Create four new domains programmatically.
- $this->domainCreateTestDomains(5);
- // Get the domain list.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $this->drupalCreateNode([
- 'type' => 'article',
- 'title' => 'Node 1',
- 'promoted' => TRUE,
- ]);
- $this->drupalCreateNode([
- 'type' => 'article',
- 'title' => 'Node 2',
- 'promoted' => TRUE,
- ]);
- $homepages = $this->getHomepages();
- foreach ($domains as $domain) {
- $home = $this->drupalGet($domain->getPath());
-
- // Check if this setting is picked up.
- $expected = $domain->getPath() . $homepages[$domain->id()];
- $expected_home = $this->drupalGet($expected);
-
- $this->assertTrue($home == $expected_home, 'Proper home page loaded (' . $domain->id() . ').');
- }
- }
-
- /**
- * Returns the expected homepage paths for each domain.
- */
- private function getHomepages() {
- $homepages = [
- 'example_com' => 'node',
- 'one_example_com' => 'node/1',
- 'two_example_com' => 'node',
- 'three_example_com' => 'node',
- 'four_example_com' => 'node/2',
- ];
- return $homepages;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHookProblemTest.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHookProblemTest.php
deleted file mode 100644
index c6fb7a11e..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigHookProblemTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-drupalGet('user/login');
- $user = $this->drupalCreateUser([]);
- $edit = ['name' => $user->getUserName(), 'pass' => $user->passRaw];
- $this->drupalPostForm(NULL, $edit, t('Log in'));
-
- $test = \Drupal::state()->get('domain_config_test__user_login', NULL);
- // When this test passes, it means domain_config_hook_test_user_login was
- // not run.
- $this->assertNull($test, 'The hook_user_login state message is set.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigOverriderTest.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigOverriderTest.php
deleted file mode 100644
index 160be3cb7..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigOverriderTest.php
+++ /dev/null
@@ -1,112 +0,0 @@
-domainTableIsEmpty();
- // Create five new domains programmatically.
- $this->domainCreateTestDomains(5);
- // Get the domain list.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- // Except for the default domain, the page title element should match what
- // is in the override files.
- // With a language context, based on how we have our files setup, we
- // expect the following outcomes:
- // - example.com name = 'Drupal' for English, 'Drupal' for Spanish.
- // - one.example.com name = 'One' for English, 'Drupal' for Spanish.
- // - two.example.com name = 'Two' for English, 'Dos' for Spanish.
- // - three.example.com name = 'Drupal' for English, 'Drupal' for Spanish.
- // - four.example.com name = 'Four' for English, 'Four' for Spanish.
- foreach ($domains as $domain) {
- // Test the login page, because our default homepages do not exist.
- foreach ($this->langcodes as $langcode => $language) {
- $path = $domain->getPath() . $langcode . '/user/login';
- $this->drupalGet($path);
- if ($domain->isDefault()) {
- $this->assertRaw('Log in | Drupal', 'Loaded the proper site name.');
- }
- else {
- $this->assertRaw('Log in | ' . $this->expectedName($domain, $langcode) . '', 'Loaded the proper site name.' . 'Log in | ' . $this->expectedName($domain, $langcode) . '');
- }
- }
- }
- }
-
- /**
- * Tests that domain-specific variable overrides in settings.php works.
- */
- public function testDomainConfigOverriderFromSettings() {
- // Set up overrides.
- $settings = [];
- $settings['config']['domain.config.one_example_com.en.system.site']['name'] = (object) [
- 'value' => 'First',
- 'required' => TRUE,
- ];
- $settings['config']['domain.config.four_example_com.system.site']['name'] = (object) [
- 'value' => 'Four overridden in settings',
- 'required' => TRUE,
- ];
- $this->writeSettings($settings);
-
- // Create five new domains programmatically.
- $this->domainCreateTestDomains(5);
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple(['one_example_com', 'four_example_com']);
-
- $domain_one = $domains['one_example_com'];
- $this->drupalGet($domain_one->getPath() . 'user/login');
- $this->assertRaw('Log in | First', 'Found overridden slogan for one.example.com.');
-
- $domain_four = $domains['four_example_com'];
- $this->drupalGet($domain_four->getPath() . 'user/login');
- $this->assertRaw('Log in | Four overridden in settings', 'Found overridden slogan for four.example.com.');
- }
-
- /**
- * Returns the expected site name value from our test configuration.
- *
- * @param \Drupal\domain\DomainInterface $domain
- * The Domain object.
- * @param string $langcode
- * A two-digit language code.
- *
- * @return string
- * The expected name.
- */
- private function expectedName(DomainInterface $domain, $langcode = NULL) {
- $name = '';
-
- switch ($domain->id()) {
- case 'one_example_com':
- $name = ($langcode == 'es') ? 'Drupal' : 'One';
- break;
-
- case 'two_example_com':
- $name = ($langcode == 'es') ? 'Dos' : 'Two';
- break;
-
- case 'three_example_com':
- $name = 'Drupal';
- break;
-
- case 'four_example_com':
- $name = 'Four';
- break;
- }
-
- return $name;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigTestBase.php b/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigTestBase.php
deleted file mode 100644
index e67e0395a..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_config/tests/src/Functional/DomainConfigTestBase.php
+++ /dev/null
@@ -1,73 +0,0 @@
- 'Spanish'];
-
- /**
- * Modules to enable.
- *
- * @var array
- */
- public static $modules = [
- 'domain',
- 'language',
- 'domain_config_test',
- 'domain_config',
- ];
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- parent::setUp();
-
- // Create and login user.
- $admin_user = $this->drupalCreateUser(['administer languages', 'access administration pages']);
- $this->drupalLogin($admin_user);
-
- // Add language.
- $edit = [
- 'predefined_langcode' => 'es',
- ];
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
-
- // Enable URL language detection and selection.
- $edit = ['language_interface[enabled][language-url]' => '1'];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
-
- $this->drupalLogout();
-
- // In order to reflect the changes for a multilingual site in the container
- // we have to rebuild it.
- $this->rebuildContainer();
-
- $es = \Drupal::entityTypeManager()->getStorage('configurable_language')->load('es');
- $this->assertTrue(!empty($es), 'Created test language.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_content.yml b/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_content.yml
deleted file mode 100644
index 6a332083c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_content.yml
+++ /dev/null
@@ -1,1298 +0,0 @@
-langcode: en
-status: true
-dependencies:
- config:
- - field.storage.node.field_domain_access
- - field.storage.node.field_domain_all_affiliates
- module:
- - domain_access
- - node
- - user
-id: affiliated_content
-label: 'Affiliated content'
-module: node
-description: 'Find and manage content.'
-tag: domain
-base_table: node_field_data
-base_field: nid
-core: 8.x
-display:
- default:
- display_options:
- access:
- type: domain_content_editor
- options: { }
- cache:
- type: tag
- query:
- type: views_query
- options:
- disable_sql_rewrite: true
- distinct: false
- replica: false
- query_comment: ''
- query_tags: { }
- exposed_form:
- type: basic
- options:
- submit_button: Filter
- reset_button: true
- reset_button_label: Reset
- exposed_sorts_label: 'Sort by'
- expose_sort_order: true
- sort_asc_label: Asc
- sort_desc_label: Desc
- pager:
- type: full
- options:
- items_per_page: 50
- tags:
- previous: '‹ Previous'
- next: 'Next ›'
- first: '« First'
- last: 'Last »'
- style:
- type: table
- options:
- grouping: { }
- row_class: ''
- default_row_class: true
- override: true
- sticky: true
- caption: ''
- summary: ''
- description: ''
- columns:
- node_bulk_form: node_bulk_form
- title: title
- type: type
- name: name
- status: status
- changed: changed
- operations: operations
- field_domain_access: field_domain_access
- field_domain_all_affiliates: field_domain_all_affiliates
- info:
- node_bulk_form:
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- title:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- type:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- name:
- sortable: false
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: priority-low
- status:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- changed:
- sortable: true
- default_sort_order: desc
- align: ''
- separator: ''
- empty_column: false
- responsive: priority-low
- operations:
- sortable: false
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- field_domain_access:
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- field_domain_all_affiliates:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- default: changed
- empty_table: true
- row:
- type: fields
- fields:
- node_bulk_form:
- id: node_bulk_form
- table: node
- field: node_bulk_form
- 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
- action_title: 'With selection'
- include_exclude: exclude
- selected_actions: { }
- plugin_id: node_bulk_form
- entity_type: node
- title:
- id: title
- table: node_field_data
- field: title
- label: Title
- exclude: false
- alter:
- alter_text: false
- element_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- entity_type: node
- entity_field: title
- type: string
- settings:
- link_to_entity: true
- plugin_id: field
- type:
- id: type
- table: node_field_data
- field: type
- relationship: none
- group_type: group
- admin_label: ''
- label: 'Content Type'
- 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: true
- 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: false
- 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: node
- entity_field: type
- plugin_id: field
- field_domain_access:
- id: field_domain_access
- table: node__field_domain_access
- field: field_domain_access
- relationship: none
- group_type: group
- admin_label: ''
- label: Domain(s)
- 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: true
- 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
- plugin_id: domain_access_field
- field_domain_all_affiliates:
- id: field_domain_all_affiliates
- table: node__field_domain_all_affiliates
- field: field_domain_all_affiliates
- relationship: none
- group_type: group
- admin_label: ''
- label: 'All affiliates'
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- click_sort_column: value
- type: boolean
- settings:
- format: yes-no
- format_custom_true: ''
- format_custom_false: ''
- group_column: value
- 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
- plugin_id: field
- name:
- id: name
- table: users_field_data
- field: name
- relationship: uid
- label: Author
- exclude: false
- alter:
- alter_text: false
- element_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- plugin_id: field
- type: user_name
- entity_type: user
- entity_field: name
- status:
- id: status
- table: node_field_data
- field: status
- label: Status
- exclude: false
- alter:
- alter_text: false
- element_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- type: boolean
- settings:
- format: custom
- format_custom_true: Published
- format_custom_false: Unpublished
- plugin_id: field
- entity_type: node
- entity_field: status
- changed:
- id: changed
- table: node_field_data
- field: changed
- label: Updated
- exclude: false
- alter:
- alter_text: false
- element_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- type: timestamp
- settings:
- date_format: short
- custom_date_format: ''
- timezone: ''
- plugin_id: field
- entity_type: node
- entity_field: changed
- operations:
- id: operations
- table: node
- field: operations
- relationship: none
- group_type: group
- admin_label: ''
- label: Operations
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- destination: true
- plugin_id: entity_operations
- filters:
- status:
- id: status
- table: node_field_data
- field: status
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '1'
- group: 1
- exposed: true
- expose:
- operator_id: ''
- label: Status
- description: ''
- use_operator: false
- operator: status_op
- identifier: status
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- is_grouped: true
- group_info:
- label: 'Published status'
- description: ''
- identifier: status
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items:
- 1:
- title: Published
- operator: '='
- value: '1'
- 2:
- title: Unpublished
- operator: '='
- value: '0'
- plugin_id: boolean
- entity_type: node
- entity_field: status
- type:
- id: type
- table: node_field_data
- field: type
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: type_op
- label: Type
- description: ''
- use_operator: false
- operator: type_op
- identifier: type
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: bundle
- entity_type: node
- entity_field: type
- title:
- id: title
- table: node_field_data
- field: title
- relationship: none
- group_type: group
- admin_label: ''
- operator: contains
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: title_op
- label: Title
- description: ''
- use_operator: false
- operator: title_op
- identifier: title
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: string
- entity_type: node
- entity_field: title
- langcode:
- id: langcode
- table: node_field_data
- field: langcode
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: langcode_op
- label: Language
- description: ''
- use_operator: false
- operator: langcode_op
- identifier: langcode
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: language
- entity_type: node
- entity_field: langcode
- field_domain_all_affiliates_value:
- id: field_domain_all_affiliates_value
- table: node__field_domain_all_affiliates
- field: field_domain_all_affiliates_value
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value:
- min: ''
- max: ''
- value: '1'
- 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: { }
- plugin_id: numeric
- sorts: { }
- title: 'Content assigned to All affiliates'
- empty:
- area_text_custom:
- id: area_text_custom
- table: views
- field: area_text_custom
- empty: true
- content: 'No content available.'
- plugin_id: text_custom
- arguments:
- field_domain_access_target_id:
- id: field_domain_access_target_id
- table: node__field_domain_access
- field: field_domain_access_target_id
- relationship: none
- group_type: group
- admin_label: ''
- default_action: 'not found'
- exception:
- value: all
- title_enable: false
- title: All
- title_enable: true
- title: '{{ arguments.field_domain_access_target_id }} content'
- 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: true
- validate:
- type: 'entity:domain'
- fail: 'not found'
- validate_options:
- operation: view
- multiple: 0
- access: false
- bundles: { }
- glossary: false
- limit: 0
- case: none
- path_case: none
- transform_dash: false
- break_phrase: false
- plugin_id: string
- relationships:
- uid:
- id: uid
- table: node_field_data
- field: uid
- admin_label: author
- required: true
- plugin_id: standard
- show_admin_links: false
- filter_groups:
- operator: AND
- groups:
- 1: AND
- display_extenders: { }
- display_plugin: default
- display_title: Master
- id: default
- position: 0
- cache_metadata:
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - user
- - 'user.node_grants:view'
- max-age: 0
- tags:
- - 'config:field.storage.node.field_domain_access'
- - 'config:field.storage.node.field_domain_all_affiliates'
- page_1:
- display_options:
- path: admin/content/domain-content/%
- menu:
- type: none
- title: Content
- description: ''
- expanded: false
- parent: ''
- weight: -10
- context: '0'
- menu_name: admin
- tab_options:
- type: normal
- title: Content
- description: 'Find and manage content'
- menu_name: admin
- weight: -10
- display_extenders: { }
- display_description: 'Default page for content per domain'
- filters:
- status:
- id: status
- table: node_field_data
- field: status
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '1'
- group: 1
- exposed: true
- expose:
- operator_id: ''
- label: Status
- description: ''
- use_operator: false
- operator: status_op
- identifier: status
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- is_grouped: true
- group_info:
- label: 'Published status'
- description: ''
- identifier: status
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items:
- 1:
- title: Published
- operator: '='
- value: '1'
- 2:
- title: Unpublished
- operator: '='
- value: '0'
- plugin_id: boolean
- entity_type: node
- entity_field: status
- type:
- id: type
- table: node_field_data
- field: type
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: type_op
- label: Type
- description: ''
- use_operator: false
- operator: type_op
- identifier: type
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: bundle
- entity_type: node
- entity_field: type
- title:
- id: title
- table: node_field_data
- field: title
- relationship: none
- group_type: group
- admin_label: ''
- operator: contains
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: title_op
- label: Title
- description: ''
- use_operator: false
- operator: title_op
- identifier: title
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: string
- entity_type: node
- entity_field: title
- langcode:
- id: langcode
- table: node_field_data
- field: langcode
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: langcode_op
- label: Language
- description: ''
- use_operator: false
- operator: langcode_op
- identifier: langcode
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: language
- entity_type: node
- entity_field: langcode
- defaults:
- filters: false
- filter_groups: false
- title: false
- filter_groups:
- operator: AND
- groups:
- 1: AND
- title: Content
- display_plugin: page
- display_title: 'Domain content page'
- id: page_1
- position: 1
- cache_metadata:
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - user
- - 'user.node_grants:view'
- max-age: 0
- tags:
- - 'config:field.storage.node.field_domain_access'
- - 'config:field.storage.node.field_domain_all_affiliates'
- page_2:
- display_plugin: page
- id: page_2
- display_title: 'All affiliates page'
- position: 2
- display_options:
- display_extenders: { }
- display_description: 'Lists content assigned to all affiliates'
- arguments: { }
- defaults:
- arguments: false
- filters: false
- filter_groups: false
- path: admin/content/domain-content/all_affiliates
- filters:
- status:
- id: status
- table: node_field_data
- field: status
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '1'
- group: 1
- exposed: true
- expose:
- operator_id: ''
- label: Status
- description: ''
- use_operator: false
- operator: status_op
- identifier: status
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- is_grouped: true
- group_info:
- label: 'Published status'
- description: ''
- identifier: status
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items:
- 1:
- title: Published
- operator: '='
- value: '1'
- 2:
- title: Unpublished
- operator: '='
- value: '0'
- plugin_id: boolean
- entity_type: node
- entity_field: status
- type:
- id: type
- table: node_field_data
- field: type
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: type_op
- label: Type
- description: ''
- use_operator: false
- operator: type_op
- identifier: type
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: bundle
- entity_type: node
- entity_field: type
- title:
- id: title
- table: node_field_data
- field: title
- relationship: none
- group_type: group
- admin_label: ''
- operator: contains
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: title_op
- label: Title
- description: ''
- use_operator: false
- operator: title_op
- identifier: title
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: string
- entity_type: node
- entity_field: title
- langcode:
- id: langcode
- table: node_field_data
- field: langcode
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: langcode_op
- label: Language
- description: ''
- use_operator: false
- operator: langcode_op
- identifier: langcode
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: language
- entity_type: node
- entity_field: langcode
- field_domain_all_affiliates_value:
- id: field_domain_all_affiliates_value
- table: node__field_domain_all_affiliates
- field: field_domain_all_affiliates_value
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '1'
- 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: { }
- plugin_id: numeric
- field_domain_access_target_id:
- id: field_domain_access_target_id
- table: node__field_domain_access
- field: field_domain_access_target_id
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: field_domain_access_target_id_op
- label: Domain
- description: ''
- use_operator: false
- operator: field_domain_access_target_id_op
- identifier: field_domain_access_target_id
- required: false
- remember: true
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: domain_access_filter
- filter_groups:
- operator: AND
- groups:
- 1: AND
- cache_metadata:
- max-age: 0
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - user
- - 'user.node_grants:view'
- tags:
- - 'config:field.storage.node.field_domain_access'
- - 'config:field.storage.node.field_domain_all_affiliates'
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_editors.yml b/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_editors.yml
deleted file mode 100644
index fd65a6d27..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/config/optional/views.view.affiliated_editors.yml
+++ /dev/null
@@ -1,1454 +0,0 @@
-langcode: en
-status: true
-dependencies:
- config:
- - field.storage.user.field_domain_access
- - field.storage.user.field_domain_all_affiliates
- module:
- - domain_access
- - user
-id: affiliated_editors
-label: 'Affiliated editors'
-module: user
-description: 'Find and manage people interacting with your site.'
-tag: domain
-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: domain_content_admin
- options: { }
- cache:
- type: tag
- 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: true
- reset_button_label: Reset
- exposed_sorts_label: 'Sort by'
- expose_sort_order: true
- sort_asc_label: Asc
- sort_desc_label: Desc
- pager:
- type: full
- options:
- items_per_page: 50
- offset: 0
- id: 0
- total_pages: 0
- tags:
- previous: '‹ Previous'
- next: 'Next ›'
- first: '« First'
- last: 'Last »'
- 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
- quantity: 9
- style:
- type: table
- options:
- grouping: { }
- row_class: ''
- default_row_class: true
- override: true
- sticky: false
- summary: ''
- columns:
- user_bulk_form: user_bulk_form
- name: name
- status: status
- rid: rid
- created: created
- access: access
- edit_node: edit_node
- dropbutton: dropbutton
- info:
- user_bulk_form:
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- name:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- status:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: priority-low
- rid:
- sortable: false
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: priority-low
- created:
- sortable: true
- default_sort_order: desc
- align: ''
- separator: ''
- empty_column: false
- responsive: priority-low
- access:
- sortable: true
- default_sort_order: desc
- align: ''
- separator: ''
- empty_column: false
- responsive: priority-low
- edit_node:
- align: ''
- separator: ''
- empty_column: false
- responsive: priority-low
- dropbutton:
- sortable: false
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- default: created
- empty_table: true
- row:
- type: fields
- fields:
- user_bulk_form:
- id: user_bulk_form
- table: users
- field: user_bulk_form
- relationship: none
- group_type: group
- admin_label: ''
- label: 'Bulk update'
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- plugin_id: user_bulk_form
- entity_type: user
- name:
- id: name
- table: users_field_data
- field: name
- relationship: none
- group_type: group
- admin_label: ''
- label: Username
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- plugin_id: field
- type: user_name
- entity_type: user
- entity_field: name
- status:
- id: status
- table: users_field_data
- field: status
- relationship: none
- group_type: group
- admin_label: ''
- label: Status
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- plugin_id: field
- type: boolean
- settings:
- format: custom
- format_custom_true: Active
- format_custom_false: Blocked
- entity_type: user
- entity_field: status
- roles_target_id:
- id: roles_target_id
- table: user__roles
- field: roles_target_id
- relationship: none
- group_type: group
- admin_label: ''
- label: Roles
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- type: ul
- separator: ', '
- plugin_id: user_roles
- field_domain_access:
- id: field_domain_access
- table: user__field_domain_access
- field: field_domain_access
- relationship: none
- group_type: group
- admin_label: ''
- label: Domain(s)
- 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: true
- 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: false
- 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
- plugin_id: domain_access_field
- field_domain_all_affiliates:
- id: field_domain_all_affiliates
- table: user__field_domain_all_affiliates
- field: field_domain_all_affiliates
- relationship: none
- group_type: group
- admin_label: ''
- label: 'All affiliates'
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- click_sort_column: value
- type: boolean
- settings:
- format: yes-no
- format_custom_true: ''
- format_custom_false: ''
- group_column: value
- 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
- plugin_id: field
- created:
- id: created
- table: users_field_data
- field: created
- relationship: none
- group_type: group
- admin_label: ''
- label: 'Member for'
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- type: timestamp_ago
- settings:
- future_format: '@interval'
- past_format: '@interval'
- granularity: 2
- plugin_id: field
- entity_type: user
- entity_field: created
- access:
- id: access
- table: users_field_data
- field: access
- relationship: none
- group_type: group
- admin_label: ''
- label: 'Last access'
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- type: timestamp_ago
- settings:
- future_format: '@interval hence'
- past_format: '@interval ago'
- granularity: 2
- plugin_id: field
- entity_type: user
- entity_field: access
- operations:
- id: operations
- table: users
- field: operations
- relationship: none
- group_type: group
- admin_label: ''
- label: Operations
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- destination: true
- entity_type: user
- plugin_id: entity_operations
- mail:
- id: mail
- table: users_field_data
- field: mail
- relationship: none
- group_type: group
- admin_label: ''
- label: ''
- exclude: true
- 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: value
- type: basic_string
- settings: { }
- group_column: value
- 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
- plugin_id: field
- entity_type: user
- entity_field: mail
- filters:
- combine:
- id: combine
- table: views
- field: combine
- relationship: none
- group_type: group
- admin_label: ''
- operator: contains
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: combine_op
- label: 'Name or email contains'
- description: ''
- use_operator: false
- operator: combine_op
- identifier: user
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- fields:
- name: name
- mail: mail
- plugin_id: combine
- roles_target_id:
- id: roles_target_id
- table: user__roles
- field: roles_target_id
- relationship: none
- group_type: group
- admin_label: ''
- operator: or
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: roles_target_id_op
- label: Role
- description: ''
- use_operator: false
- operator: roles_target_id_op
- identifier: role
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- reduce_duplicates: false
- plugin_id: user_roles
- permission:
- id: permission
- table: user__roles
- field: permission
- relationship: none
- group_type: group
- admin_label: ''
- operator: or
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: permission_op
- label: Permission
- description: ''
- use_operator: false
- operator: permission_op
- identifier: permission
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- reduce_duplicates: false
- plugin_id: user_permissions
- status:
- id: status
- table: users_field_data
- field: status
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '1'
- group: 1
- exposed: true
- expose:
- operator_id: ''
- label: ''
- description: ''
- use_operator: false
- operator: status_op
- identifier: status
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: true
- group_info:
- label: Status
- description: ''
- identifier: status
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items:
- 1:
- title: Active
- operator: '='
- value: '1'
- 2:
- title: Blocked
- operator: '='
- value: '0'
- plugin_id: boolean
- entity_type: user
- entity_field: status
- default_langcode:
- id: default_langcode
- table: users_field_data
- field: default_langcode
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '1'
- 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: default_langcode
- plugin_id: boolean
- uid_raw:
- id: uid_raw
- table: users_field_data
- field: uid_raw
- relationship: none
- group_type: group
- admin_label: ''
- operator: '!='
- value:
- min: ''
- max: ''
- value: '0'
- group: 1
- exposed: false
- expose:
- operator_id: '0'
- 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: { }
- plugin_id: numeric
- entity_type: user
- sorts:
- created:
- id: created
- table: users_field_data
- field: created
- relationship: none
- group_type: group
- admin_label: ''
- order: DESC
- exposed: false
- expose:
- label: ''
- granularity: second
- plugin_id: date
- entity_type: user
- entity_field: created
- title: People
- empty:
- area_text_custom:
- id: area_text_custom
- table: views
- field: area_text_custom
- relationship: none
- group_type: group
- admin_label: ''
- empty: true
- tokenize: false
- content: 'No people available.'
- plugin_id: text_custom
- use_more: false
- use_more_always: false
- use_more_text: more
- display_comment: ''
- use_ajax: false
- hide_attachment_summary: false
- show_admin_links: true
- group_by: false
- link_url: ''
- link_display: page_1
- css_class: ''
- filter_groups:
- operator: AND
- groups:
- 1: AND
- display_extenders: { }
- arguments:
- field_domain_access_target_id:
- id: field_domain_access_target_id
- table: user__field_domain_access
- field: field_domain_access_target_id
- plugin_id: string
- cache_metadata:
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - user
- max-age: 0
- tags:
- - 'config:field.storage.user.field_domain_access'
- - 'config:field.storage.user.field_domain_all_affiliates'
- page_1:
- display_plugin: page
- id: page_1
- display_title: 'Domain content editors'
- position: 1
- display_options:
- path: admin/content/domain-editors/%
- show_admin_links: false
- menu:
- type: none
- title: List
- description: 'Find and manage people interacting with your site.'
- expanded: false
- parent: ''
- weight: -10
- context: '0'
- menu_name: admin
- tab_options:
- type: normal
- title: People
- description: 'Manage user accounts, roles, and permissions.'
- menu_name: admin
- weight: 0
- defaults:
- show_admin_links: false
- arguments: false
- display_extenders: { }
- display_description: 'Default page for domain content editor lists.'
- arguments:
- field_domain_access_target_id:
- id: field_domain_access_target_id
- table: user__field_domain_access
- field: field_domain_access_target_id
- relationship: none
- group_type: group
- admin_label: ''
- default_action: 'not found'
- exception:
- value: all
- title_enable: false
- title: All
- title_enable: true
- title: '{{ arguments.field_domain_access_target_id }} editors'
- 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: true
- validate:
- type: 'entity:domain'
- fail: 'not found'
- validate_options:
- operation: view
- multiple: 0
- access: false
- bundles: { }
- glossary: false
- limit: 0
- case: none
- path_case: none
- transform_dash: false
- break_phrase: false
- plugin_id: string
- cache_metadata:
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - user
- max-age: 0
- tags:
- - 'config:field.storage.user.field_domain_access'
- - 'config:field.storage.user.field_domain_all_affiliates'
- page_2:
- display_plugin: page
- id: page_2
- display_title: 'All affiliates editors'
- position: 2
- display_options:
- display_extenders: { }
- path: admin/content/domain-editors/all_affiliates
- display_description: 'Lists editors with the All affiliates permission.'
- filters:
- combine:
- id: combine
- table: views
- field: combine
- relationship: none
- group_type: group
- admin_label: ''
- operator: contains
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: combine_op
- label: 'Name or email contains'
- description: ''
- use_operator: false
- operator: combine_op
- identifier: user
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- fields:
- name: name
- mail: mail
- plugin_id: combine
- roles_target_id:
- id: roles_target_id
- table: user__roles
- field: roles_target_id
- relationship: none
- group_type: group
- admin_label: ''
- operator: or
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: roles_target_id_op
- label: Role
- description: ''
- use_operator: false
- operator: roles_target_id_op
- identifier: role
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- reduce_duplicates: false
- plugin_id: user_roles
- permission:
- id: permission
- table: user__roles
- field: permission
- relationship: none
- group_type: group
- admin_label: ''
- operator: or
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: permission_op
- label: Permission
- description: ''
- use_operator: false
- operator: permission_op
- identifier: permission
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- reduce_duplicates: false
- plugin_id: user_permissions
- status:
- id: status
- table: users_field_data
- field: status
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '1'
- group: 1
- exposed: true
- expose:
- operator_id: ''
- label: ''
- description: ''
- use_operator: false
- operator: status_op
- identifier: status
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: true
- group_info:
- label: Status
- description: ''
- identifier: status
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items:
- 1:
- title: Active
- operator: '='
- value: '1'
- 2:
- title: Blocked
- operator: '='
- value: '0'
- plugin_id: boolean
- entity_type: user
- entity_field: status
- default_langcode:
- id: default_langcode
- table: users_field_data
- field: default_langcode
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '1'
- 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: default_langcode
- plugin_id: boolean
- uid_raw:
- id: uid_raw
- table: users_field_data
- field: uid_raw
- relationship: none
- group_type: group
- admin_label: ''
- operator: '!='
- value:
- min: ''
- max: ''
- value: '0'
- group: 1
- exposed: false
- expose:
- operator_id: '0'
- 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: { }
- plugin_id: numeric
- entity_type: user
- field_domain_access_target_id:
- id: field_domain_access_target_id
- table: user__field_domain_access
- field: field_domain_access_target_id
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: field_domain_access_target_id_op
- label: Domain
- description: ''
- use_operator: false
- operator: field_domain_access_target_id_op
- identifier: field_domain_access_target_id
- required: false
- remember: true
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: domain_access_filter
- field_domain_all_affiliates_value:
- id: field_domain_all_affiliates_value
- table: user__field_domain_all_affiliates
- field: field_domain_all_affiliates_value
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value:
- min: ''
- max: ''
- value: '1'
- 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: { }
- plugin_id: numeric
- defaults:
- filters: false
- filter_groups: false
- filter_groups:
- operator: AND
- groups:
- 1: AND
- cache_metadata:
- max-age: 0
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - user
- tags:
- - 'config:field.storage.user.field_domain_access'
- - 'config:field.storage.user.field_domain_all_affiliates'
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/config/schema/domain_content.views.schema.yml b/sites/all/modules/contrib/admin/domain/domain_content/config/schema/domain_content.views.schema.yml
deleted file mode 100644
index 16f223546..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/config/schema/domain_content.views.schema.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# Schema for the domain content plugins.
-
-views.access.domain_content_admin:
- type: mapping
- label: 'Domain Content: View domain-specific editors'
-views.access.domain_content_editor:
- type: mapping
- label: 'Domain Content: View domain-specific content'
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.info.yml b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.info.yml
deleted file mode 100644
index 1af7da3f7..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.info.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-name: Domain Content
-description: 'Review content by assigned domain.'
-type: module
-package: Domain
-# version: VERSION
-# core: 8.x
-dependencies:
- - drupal:node
- - drupal:user
- - drupal:views
- - domain:domain
- - domain:domain_access
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.install b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.install
deleted file mode 100644
index f7d1d7a7b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.install
+++ /dev/null
@@ -1,58 +0,0 @@
-getStorage('node_type')->loadMultiple();
- foreach ($node_types as $type => $info) {
- $list[$type] = 'node';
- }
- // Check for required fields.
- foreach ($list as $bundle => $entity_type) {
- $id = $entity_type . '.' . $bundle . '.' . DOMAIN_ACCESS_FIELD;
- if (!$field = \Drupal::entityTypeManager()->getStorage('field_config')->load($id)) {
- $allow = FALSE;
- break;
- }
- $id = $entity_type . '.' . $bundle . '.' . DOMAIN_ACCESS_ALL_FIELD;
- if (!$field = \Drupal::entityTypeManager()->getStorage('field_config')->load($id)) {
- $allow = FALSE;
- break;
- }
- }
- }
- if (!$allow) {
- $requirements['domain_content'] = [
- 'title' => t('Domain content'),
- 'description' => t('Domain content cannot be enabled until Domain access has installed its required fields.'),
- 'severity' => REQUIREMENT_ERROR,
- ];
- }
- return $requirements;
-}
-
-/**
- * Implements hook_uninstall().
- */
-function domain_content_uninstall() {
- $storage = \Drupal::entityTypeManager()->getStorage('view');
- $entities = [];
- foreach (['affiliated_content', 'affiliated_editors'] as $id) {
- if ($view = $storage->load($id)) {
- $entities[$id] = $view;
- }
- }
- if (!empty($entities)) {
- $storage->delete($entities);
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.links.menu.yml b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.links.menu.yml
deleted file mode 100644
index 5a4a025b6..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.links.menu.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-domain_content.content_list:
- title: Affiliated content
- route_name: domain_content.content_list
- parent: system.admin_content
- description: 'Lists content by domain assignment.'
- weight: 10
-domain_content.editors_list:
- title: Affiliated editors
- route_name: domain_content.editors_list
- parent: system.admin_content
- description: 'Lists editors by domain assignment.'
- weight: 10
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.module b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.module
deleted file mode 100644
index 836b788b0..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.module
+++ /dev/null
@@ -1,40 +0,0 @@
-getStorage('user')->load($account->id());
- $allowed = \Drupal::service('domain_access.manager')->getAccessValues($user);
- $id = $domain->id();
- if ($account->hasPermission('publish to any domain') || ($account->hasPermission('publish to any assigned domain') && isset($allowed[$domain->id()]))) {
- $operations['domain_content'] = [
- 'title' => t('Content'),
- 'url' => Url::fromUri("internal:/admin/content/domain-content/$id"),
- // Core operations start at 0 and increment by 10.
- 'weight' => 120,
- ];
- }
- if ($account->hasPermission('assign editors to any domain') || ($account->hasPermission('assign domain editors') && isset($allowed[$domain->id()]))) {
- $operations['domain_users'] = [
- 'title' => t('Editors'),
- 'url' => Url::fromUri("internal:/admin/content/domain-editors/$id"),
- // Core operations start at 0 and increment by 10.
- 'weight' => 120,
- ];
- }
-
- return $operations;
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.permissions.yml b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.permissions.yml
deleted file mode 100644
index 629da9e91..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.permissions.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-access domain content:
- title: 'Access domain content pages'
-access domain content editors:
- title: 'Access domain editors pages'
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.routing.yml b/sites/all/modules/contrib/admin/domain/domain_content/domain_content.routing.yml
deleted file mode 100644
index e352d0590..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/domain_content.routing.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-domain_content.content_list:
- path: '/admin/content/domain-content'
- defaults:
- _controller: 'Drupal\domain_content\Controller\DomainContentController::contentList'
- _title: 'Affiliated content'
- requirements:
- _permission: 'access domain content'
-domain_content.editors_list:
- path: '/admin/content/domain-editors'
- defaults:
- _controller: 'Drupal\domain_content\Controller\DomainContentController::editorsList'
- _title: 'Affiliated editors'
- requirements:
- _permission: 'access domain content editors'
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/src/Controller/DomainContentController.php b/sites/all/modules/contrib/admin/domain/domain_content/src/Controller/DomainContentController.php
deleted file mode 100644
index 385cc3531..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/src/Controller/DomainContentController.php
+++ /dev/null
@@ -1,124 +0,0 @@
-getUser();
- $build = [
- '#theme' => 'table',
- '#header' => [$this->t('Domain'), $options['column_header']],
- ];
- if ($account->hasPermission($options['all_permission'])) {
- $build['#rows'][] = [
- Link::fromTextAndUrl($this->t('All affiliates'), Url::fromUri('internal:/admin/content/' . $options['path'] . '/all_affiliates')),
- $this->getCount($options['type']),
- ];
- }
- // Loop through domains.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultipleSorted();
- $manager = \Drupal::service('domain_access.manager');
- /** @var \Drupal\domain\DomainInterface $domain */
- foreach ($domains as $domain) {
- if ($account->hasPermission($options['all_permission']) || $manager->hasDomainPermissions($account, $domain, [$options['permission']])) {
- $row = [
- Link::fromTextAndUrl($domain->label(), Url::fromUri('internal:/admin/content/' . $options['path'] . '/' . $domain->id())),
- $this->getCount($options['type'], $domain),
- ];
- $build['#rows'][] = $row;
- }
- }
- return $build;
- }
-
- /**
- * Generates a list of content by domain.
- */
- public function contentList() {
- $options = [
- 'type' => 'node',
- 'column_header' => $this->t('Content count'),
- 'permission' => 'publish to any assigned domain',
- 'all_permission' => 'publish to any domain',
- 'path' => 'domain-content',
- ];
-
- return $this->buildList($options);
- }
-
- /**
- * Generates a list of editors by domain.
- */
- public function editorsList() {
- $options = [
- 'type' => 'user',
- 'column_header' => $this->t('Editor count'),
- 'permission' => 'assign domain editors',
- 'all_permission' => 'assign editors to any domain',
- 'path' => 'domain-editors',
- ];
-
- return $this->buildList($options);
- }
-
- /**
- * Counts the content for a domain.
- *
- * @param string $entity_type
- * The entity type.
- * @param \Drupal\domain\DomainInterface $domain
- * The domain to query. If passed NULL, checks status for all affiliates.
- *
- * @return int
- * The content count for the given domain.
- */
- protected function getCount($entity_type = 'node', DomainInterface $domain = NULL) {
- if (is_null($domain)) {
- $field = DOMAIN_ACCESS_ALL_FIELD;
- $value = 1;
- }
- else {
- $field = DOMAIN_ACCESS_FIELD;
- $value = $domain->id();
- }
- // Note that we ignore node access so these queries work on any domain.
- $query = \Drupal::entityQuery($entity_type)
- ->condition($field, $value)
- ->accessCheck(FALSE);
-
- return count($query->execute());
- }
-
- /**
- * Returns a fully loaded user object for the current request.
- *
- * @return \Drupal\Core\Session\AccountInterface
- * The current user object.
- */
- protected function getUser() {
- $account = $this->currentUser();
- // Advanced grants for edit/delete require permissions.
- return \Drupal::entityTypeManager()->getStorage('user')->load($account->id());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainContentAccess.php b/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainContentAccess.php
deleted file mode 100644
index 10b1ff40f..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainContentAccess.php
+++ /dev/null
@@ -1,30 +0,0 @@
-setRequirement('_permission', 'access domain content');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainEditorAccess.php b/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainEditorAccess.php
deleted file mode 100644
index eed22abb1..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/src/Plugin/views/access/DomainEditorAccess.php
+++ /dev/null
@@ -1,30 +0,0 @@
-setRequirement('_permission', 'access domain content editors');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentActionsTest.php b/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentActionsTest.php
deleted file mode 100644
index 76559bbb6..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentActionsTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
-admin_user = $this->drupalCreateUser([
- 'administer domains',
- 'access administration pages',
- 'access domain content',
- 'access domain content editors',
- 'publish to any domain',
- 'assign editors to any domain',
- // Edit access is required. This is fastest.
- 'bypass node access',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Create users and content.
- $this->createDomainContent();
-
- $url = 'admin/content/domain-content/all_affiliates';
-
- $this->drupalGet($url);
-
- // All the content should be on domain one.
- $old_domain = $this->domains['one_example_com'];
- $new_domain = $this->domains['two_example_com'];
-
- // Domains are linked in the output.
- $this->assertRaw($old_domain->label() . '');
- $this->assertNoRaw($new_domain->label() . '');
-
- // Add some content to domain two.
- $edit = [
- 'node_bulk_form[0]' => TRUE,
- 'node_bulk_form[1]' => TRUE,
- 'action' => 'domain_access_add_action.two_example_com',
- ];
- $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
-
- // Both domains should be present.
- $this->assertRaw($old_domain->label() . '');
- $this->assertRaw($new_domain->label() . '');
-
- // Remove some content from domain two.
- $edit = [
- 'node_bulk_form[0]' => TRUE,
- 'node_bulk_form[1]' => TRUE,
- 'action' => 'domain_access_remove_action.two_example_com',
- ];
- $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
-
- // Domains are linked properly in the output.
- $this->assertRaw($old_domain->label() . '');
- $this->assertNoRaw($new_domain->label() . '');
-
- // There should be five elements.
- $this->assertRaw('node_bulk_form[4]');
-
- // Remove one from all affiliates.
- $edit = [
- 'node_bulk_form[0]' => TRUE,
- 'action' => 'domain_access_none_action',
- ];
- $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
-
- // There should be four elements.
- $this->assertRaw('node_bulk_form[3]');
- $this->assertNoRaw('node_bulk_form[4]');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentCountTest.php b/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentCountTest.php
deleted file mode 100644
index 4c23e98fb..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentCountTest.php
+++ /dev/null
@@ -1,52 +0,0 @@
-admin_user = $this->drupalCreateUser([
- 'administer domains',
- 'access administration pages',
- 'access domain content',
- 'access domain content editors',
- 'publish to any domain',
- 'assign editors to any domain',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Create users and content.
- $this->createDomainContent();
- $this->createDomainUsers();
-
- // Base Urls for our views.
- $urls = [
- 'admin/content/domain-content',
- 'admin/content/domain-editors',
- ];
- // Test the overview pages.
- foreach ($urls as $url) {
- $content = $this->drupalGet($url);
- $this->assertResponse(200);
- // Find the links.
- $this->findLink('All affiliates');
- foreach ($this->domains as $id => $domain) {
- $this->findLink($domain->label());
- $string = $domain->label() . "
';
- $this->checkContent($content, $string);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentPermissionsTest.php b/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentPermissionsTest.php
deleted file mode 100644
index 7b0b6b133..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentPermissionsTest.php
+++ /dev/null
@@ -1,176 +0,0 @@
-admin_user = $this->drupalCreateUser([
- 'administer domains',
- 'access administration pages',
- 'access domain content',
- 'access domain content editors',
- 'publish to any domain',
- 'assign editors to any domain',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Create users and content.
- $this->createDomainContent();
- $this->createDomainUsers();
-
- // Base Urls for our views.
- $urls = [
- 'admin/content/domain-content',
- 'admin/content/domain-editors',
- ];
- // Test the overview and domain-specific pages.
- foreach ($urls as $url) {
- $this->drupalGet($url);
- $this->assertResponse(200);
- // Find the links.
- $this->findLink('All affiliates');
- foreach ($this->domains as $id => $domain) {
- $this->findLink($domain->label());
- }
-
- // All affiliates link.
- $this->drupalGet($url . '/all_affiliates');
- $this->assertResponse(200);
-
- // Individual domain pages.
- foreach ($this->domains as $id => $domain) {
- $this->drupalGet($url . '/' . $id);
- $this->assertResponse(200);
- }
- }
- // This user should be able to see everything but all affiliates.
- $this->limited_user = $this->drupalCreateUser([
- 'administer domains',
- 'access administration pages',
- 'access domain content',
- 'access domain content editors',
- 'publish to any assigned domain',
- 'assign domain editors',
- ]);
- $this->addDomainsToEntity('user', $this->limited_user->id(), array_keys($this->domains), DOMAIN_ACCESS_FIELD);
-
- $this->drupalLogin($this->limited_user);
- // Test the overview and domain-specific pages.
- foreach ($urls as $url) {
- $this->drupalGet($url);
- $this->assertResponse(200);
- // Find the links.
- $this->assertNoRaw('All affiliates');
- foreach ($this->domains as $id => $domain) {
- $this->findLink($domain->label());
- }
-
- // All affiliates link.
- $this->drupalGet($url . '/all_affiliates');
- $this->assertResponse(403);
-
- // Individual domain pages.
- foreach ($this->domains as $id => $domain) {
- $this->drupalGet($url . '/' . $id);
- $this->assertResponse(200);
- }
- }
-
- // This user should be able to see everything but all affiliates and nothing
- // for editor assignments.
- $this->editor_user = $this->drupalCreateUser([
- 'access administration pages',
- 'access domain content',
- 'publish to any assigned domain',
- ]);
- $this->addDomainsToEntity('user', $this->editor_user->id(), array_keys($this->domains), DOMAIN_ACCESS_FIELD);
-
- $this->drupalLogin($this->editor_user);
- // Test the overview and domain-specific pages.
- foreach ($urls as $url) {
- $expected = 200;
- if ($url == 'admin/content/domain-editors') {
- $expected = 403;
- }
- $this->drupalGet($url);
- $this->assertResponse($expected);
- // Find the links.
- $this->assertNoRaw('All affiliates');
- foreach ($this->domains as $id => $domain) {
- if ($expected == 200) {
- $this->findLink($domain->label());
- }
- else {
- $this->findNoLink($domain->label());
- }
- }
-
- // All affiliates link will fail for both paths.
- $this->drupalGet($url . '/all_affiliates');
- $this->assertResponse(403);
-
- // Individual domain pages.
- foreach ($this->domains as $id => $domain) {
- $this->drupalGet($url . '/' . $id);
- $this->assertResponse($expected);
- }
- }
-
- // This user should be able to see one domain for editor assignments.
- $this->assign_user = $this->drupalCreateUser([
- 'access administration pages',
- 'access domain content editors',
- 'assign domain editors',
- ]);
- $ids = array_keys($this->domains);
- $assigned_id = end($ids);
- $this->addDomainsToEntity('user', $this->assign_user->id(), [$assigned_id], DOMAIN_ACCESS_FIELD);
-
- $this->drupalLogin($this->assign_user);
- // Test the overview and domain-specific pages.
- foreach ($urls as $url) {
- $expected = 200;
- if ($url == 'admin/content/domain-content') {
- $expected = 403;
- }
- $this->drupalGet($url);
- $this->assertResponse($expected);
- // Find the links.
- $this->assertNoRaw('All affiliates');
- foreach ($this->domains as $id => $domain) {
- if ($expected == 200 && $id == $assigned_id) {
- $this->findLink($domain->label());
- }
- else {
- $this->findNoLink($domain->label());
- }
- }
-
- // All affiliates link will fail for both paths.
- $this->drupalGet($url . '/all_affiliates');
- $this->assertResponse(403);
-
- // Individual domain pages.
- foreach ($this->domains as $id => $domain) {
- $this->drupalGet($url . '/' . $id);
- if ($expected == 200 && $id == $assigned_id) {
- $this->assertResponse(200);
- }
- else {
- $this->assertResponse(403);
- }
- }
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentTestBase.php b/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentTestBase.php
deleted file mode 100644
index 0ae5d4a38..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_content/tests/src/Functional/DomainContentTestBase.php
+++ /dev/null
@@ -1,111 +0,0 @@
-domainCreateTestDomains(5);
-
- $this->domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- }
-
- /**
- * Creates dummy content for testing.
- *
- * 25 nodes, 5 per domain and 5 to all affiliates.
- */
- public function createDomainContent() {
- foreach ($this->domains as $id => $domain) {
- for ($i = 0; $i < 5; $i++) {
- $this->drupalCreateNode([
- 'type' => 'article',
- DOMAIN_ACCESS_FIELD => [$id],
- DOMAIN_ACCESS_ALL_FIELD => ($id == 'one_example_com') ? 1 : 0,
- ]);
- }
- }
- // Rebuild node access rules.
- node_access_rebuild();
- }
-
- /**
- * Creates dummy content for testing.
- *
- * 25 users, 5 per domain and 5 to all affiliates.
- */
- public function createDomainUsers() {
- foreach ($this->domains as $id => $domain) {
- for ($i = 0; $i < 5; $i++) {
- $account[$id] = $this->drupalCreateUser([
- 'access administration pages',
- 'access domain content',
- 'access domain content editors',
- 'publish to any domain',
- 'assign editors to any domain',
- ]);
- $this->addDomainsToEntity('user', $account[$id]->id(), $id, DOMAIN_ACCESS_FIELD);
- if ($id == 'one_example_com') {
- $this->addDomainsToEntity('user', $account[$id]->id(), 1, DOMAIN_ACCESS_ALL_FIELD);
- }
- }
- }
- }
-
- /**
- * Strips whitespace from a page response and runs assertRaw() equivalent.
- *
- * In tests, we were having difficulty with spacing in tables. This method
- * takes some concepts from Mink and rearranges them to work for our tests.
- * Notably, we don't pull page content from the session request.
- *
- * @param string $content
- * The generated HTML, such as from drupalGet().
- * @param string $text
- * The text string to search for.
- */
- public function checkContent($content, $text) {
- // Convert all whitespace to spaces.
- $content = preg_replace('/\s+/u', ' ', $content);
- // Strip all whitespace between tags.
- $content = preg_replace('@>\\s+<@', '><', $content);
- $regex = '/' . preg_quote($text, '/') . '/ui';
- $message = sprintf('The text "%s" was found in the text of the current page.', $text);
- $this->assert((bool) preg_match($regex, $content), $message);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/README.md b/sites/all/modules/contrib/admin/domain/domain_source/README.md
deleted file mode 100644
index 7508eeba6..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-Domain Source
-======
-
-Allows content to be assigned a canonical domain when writing URLs. Domain Source will
-ensure that content that appears on multiple domains always links to one URL.
-
-When links are written to content from another domain, the links
-will go to the "source" domain specified for the node.
-
-Domain Source does not issue redirects. It rewrites links. The only time redirects may
-be involved is when content is saved.
-
-Domain Source Fields
------
-
-Domain Source adds a field to each content type that works with or without Domain Access.
-The field is optional. If Domain Access is present, only a selected domain may be
-assigned as the source domain.
-
-Domain Source configuration
------
-
-The module has a configuration option that allows administrators to disable link rewrites
-for specific Drupal paths. These paths are defined by Drupal's routing system. The default'
-set of routes are:
-
-* `canonical` -- the View page of a node
-* `delete_form` -- the delete form
-* `edit_form` -- the edit form
-* `version_history` -- the revisions page
-* `revision` -- the revision edit form
-* `create` -- not enforced
-
-Additional routes may be defined by other modules. Most notable Content Translation,
-which adds:
-
-* `content_translation_overview` -- the overview page
-* `content_translation_add` -- the add translation link
-* `content_translation_edit` -- the edit translation form
-* `content_translation_delete` -- the delete translation form
-
-Additional Entities
------
-
-Domain Source is designed to work for content (nodes) but should work with other content
-entities. You will need to configure the field for each entity type manually.
-
-Developer Notes
------
-
-Domain Source changes core's `redirect_response_subscriber` service to the
-`DomainSourceRedirectResponseSubscriber` class. This allows us to issue redirects to
-registered domains and aliases that would otherwise not be recognizes as internal Drupal
-links. These redirects typically occur on entity save when the source domain varies from
-the current domain.
-
-Domain Source also implements `OutboundPathProcessorInterface` to rewrite links to an
-entity assigned to a source domain.
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/config/install/domain_source.settings.yml b/sites/all/modules/contrib/admin/domain/domain_source/config/install/domain_source.settings.yml
deleted file mode 100644
index d63da0eb3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/config/install/domain_source.settings.yml
+++ /dev/null
@@ -1 +0,0 @@
-exclude_routes: {}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/config/install/field.storage.node.field_domain_source.yml b/sites/all/modules/contrib/admin/domain/domain_source/config/install/field.storage.node.field_domain_source.yml
deleted file mode 100644
index 9ae9937de..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/config/install/field.storage.node.field_domain_source.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - node
- enforced:
- module:
- - domain_source
-id: node.field_domain_source
-field_name: field_domain_source
-entity_type: node
-type: entity_reference
-settings:
- target_type: domain
-module: core
-locked: false
-cardinality: 1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.schema.yml b/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.schema.yml
deleted file mode 100644
index bbde9a45a..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.schema.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-domain_source.settings:
- type: config_object
- label: 'Domain Source settings'
- mapping:
- exclude_routes:
- type: sequence
- label: 'Disable link rewrites for specific entity routes.'
- sequence:
- type: string
- label: 'Route'
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.views.schema.yml b/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.views.schema.yml
deleted file mode 100644
index 5ce71d584..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/config/schema/domain_source.views.schema.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-views.field.domain_source:
- type: views_field
- label: 'Domain source'
-views.filter.domain_source:
- type: views.filter.in_operator
- label: 'Domain source'
-views.filter_value.domain_source:
- type: views.filter_value.in_operator
- label: 'Domain source'
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.api.php b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.api.php
deleted file mode 100644
index 709c6b337..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.api.php
+++ /dev/null
@@ -1,65 +0,0 @@
-getStorage('domain')->loadDefaultDomain();
-}
-
-/**
- * Allows modules to specify the target link for a Drupal path.
- *
- * Note: This hook is not meant to be used for node or entity paths, which
- * are handled by hook_domain_source_alter(). This hook is split
- * from hook_domain_source_alter() for better performance.
- *
- * Note that hook_domain_source_alter() only paths that are not content
- * entities.
- *
- * Currently, no modules in the package implement this hook.
- *
- * There is no return value for this hook. Modify $source by reference by
- * loading a valid domain record or set $source = NULL to discard an existing
- * $source value and not rewrite the path.
- *
- * @param array &$source
- * The domain array from domain_get_node_match(), passed by reference.
- * @param string $path
- * The outbound path request.
- * @param array $options
- * The options for the url, as defined by
- * \Drupal\Core\PathProcessor\OutboundPathProcessorInterface.
- */
-function hook_domain_source_path_alter(array &$source, $path, array $options) {
- // Always make admin links go to the primary domain.
- $parts = explode('/', $path);
- if (isset($parts[0]) && $parts[0] == 'admin') {
- $source = \Drupal::entityTypeManager()->getStorage('domain')->loadDefaultDomain();
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.info.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.info.yml
deleted file mode 100644
index 1ba6c6fd4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.info.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: Domain Source
-description: 'Domain-based path rewrites for content.'
-type: module
-package: Domain
-# version: VERSION
-# core: 8.x
-dependencies:
- - drupal:node
- - domain:domain
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.install b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.install
deleted file mode 100644
index 9bde50b57..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.install
+++ /dev/null
@@ -1,30 +0,0 @@
-getStorage('node_type')->loadMultiple();
- foreach ($node_types as $type => $info) {
- $list[$type] = 'node';
- }
- // Install our fields.
- foreach ($list as $bundle => $entity_type) {
- domain_source_confirm_fields($entity_type, $bundle);
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.libraries.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.libraries.yml
deleted file mode 100644
index a61d45d8e..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.libraries.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-drupal.domain_source:
- version: VERSION
- js:
- js/domain_source.js: {}
- dependencies:
- - core/jquery
- - core/drupal
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.menu.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.menu.yml
deleted file mode 100644
index e40865771..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.menu.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-domain_source.settings:
- title: Domain Source settings
- route_name: domain_source.settings
- parent: domain.admin
- description: 'Domain Source settings'
- weight: 15
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.task.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.task.yml
deleted file mode 100644
index a636149e3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.links.task.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-domain_source.settings:
- title: Domain Source settings
- route_name: domain_source.settings
- base_route: domain.admin
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.module b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.module
deleted file mode 100644
index 0e1f37a76..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.module
+++ /dev/null
@@ -1,302 +0,0 @@
-getStorage('field_config');
-
- if (!$field = $field_config_storage->load($id)) {
- $field = [
- 'field_name' => DOMAIN_SOURCE_FIELD,
- 'entity_type' => $entity_type,
- 'label' => 'Domain Source',
- 'bundle' => $bundle,
- 'required' => FALSE,
- 'description' => 'Select the canonical domain for this content.',
- 'settings' => [
- 'handler' => 'default:domain',
- // Handler_settings are deprecated but seem to be necessary here.
- 'handler_settings' => [
- 'target_bundles' => NULL,
- 'sort' => ['field' => 'weight', 'direction' => 'ASC'],
- ],
- 'target_bundles' => NULL,
- 'sort' => ['field' => 'weight', 'direction' => 'ASC'],
- ],
- ];
- $field_config = $field_config_storage->create($field);
- $field_config->save();
- }
-
- // Tell the form system how to behave. Default to radio buttons.
- $display = \Drupal::entityTypeManager()
- ->getStorage('entity_form_display')
- ->load($entity_type . '.' . $bundle . '.default');
- if ($display) {
- $display->setComponent(DOMAIN_SOURCE_FIELD, [
- 'type' => 'options_select',
- 'weight' => 42,
- ])->save();
- }
-}
-
-/**
- * Implements hook_ENTITY_TYPE_insert().
- *
- * Creates our fields when new node types are created.
- *
- * @TODO: Make this possible for all entity types.
- */
-function domain_source_node_type_insert(EntityInterface $entity) {
- /** @var \Drupal\Core\Config\Entity\ConfigEntityInterface $entity */
- if (!$entity->isSyncing()) {
- // Do not fire hook when config sync in progress.
- domain_source_confirm_fields('node', $entity->id());
- }
-}
-
-/**
- * Implements hook_ENTITY_TYPE_insert().
- *
- * In some cases, form display modes are not set when the node type is created.
- * be sure to update our field definitions on creation of form_display for
- * node types.
- */
-function domain_source_entity_form_display_insert(EntityInterface $entity) {
- if (!$entity->isSyncing() && $entity->getTargetEntityTypeId() == 'node' && $bundle = $entity->getTargetBundle()) {
- domain_source_confirm_fields('node', $bundle);
- }
-}
-
-/**
- * Returns the source domain associated to an entity.
- *
- * @param Drupal\Core\Entity\EntityInterface $entity
- * The entity to check.
- *
- * @return string|null
- * The value assigned to the entity, either a domain id string or NULL.
- */
-function domain_source_get(EntityInterface $entity) {
- $source = NULL;
-
- if (!isset($entity->{DOMAIN_SOURCE_FIELD})) {
- return $source;
- }
-
- $value = $entity->get(DOMAIN_SOURCE_FIELD)->offsetGet(0);
- if (!empty($value)) {
- $target_id = $value->target_id;
- if ($domain = \Drupal::entityTypeManager()->getStorage('domain')->load($target_id)) {
- $source = $domain->id();
- }
- }
- return $source;
-}
-
-/**
- * Implements hook_form_alter().
- *
- * Find forms that contain the domain source field and allow those to handle
- * redirects properly.
- */
-function domain_source_form_alter(&$form, &$form_state, $form_id) {
- $object = $form_state->getFormObject();
- // Set up our TrustedRedirect handler for form saves.
- if (isset($form[DOMAIN_SOURCE_FIELD]) && !empty($object) && is_callable([$object, 'getEntity']) && $entity = $object->getEntity()) {
- foreach ($form['actions'] as $key => $element) {
- // Redirect submit handlers, but not the preview button.
- if ($key != 'preview' && isset($element['#type']) && $element['#type'] == 'submit') {
- $form['actions'][$key]['#submit'][] = 'domain_source_form_submit';
- }
- }
- }
-}
-
-/**
- * Validate form submissions.
- */
-function domain_source_form_validate($element, FormStateInterface $form_state) {
- $values = $form_state->getValues();
- // This is only run if Domain Access is present.
- if (isset($values[DOMAIN_SOURCE_FIELD]) && is_array($values[DOMAIN_SOURCE_FIELD]) && isset($values[DOMAIN_ACCESS_FIELD])) {
- $access_values = $values[DOMAIN_ACCESS_FIELD];
- $source_value = current($values[DOMAIN_SOURCE_FIELD]);
- }
- // If no value is selected, that's acceptable. Else run through a check.
- // Note that the _none selection returns as [FALSE].
- $source_set = empty($source_value);
- foreach ($access_values as $value) {
- // Core is inconsistent depending on the field order.
- // See https://www.drupal.org/project/domain/issues/2945771#comment-12493199
- if (is_array($value) && $value == $source_value) {
- $source_set = TRUE;
- }
- elseif (is_string($value) && !empty($source_value['target_id']) && $value == $source_value['target_id']) {
- $source_set = TRUE;
- }
- }
- if (!$source_set) {
- $form_state->setError($element, t('The source domain must be selected as a publishing option.'));
- }
-}
-
-/**
- * Redirect form submissions to other domains.
- */
-function domain_source_form_submit(&$form, FormStateInterface $form_state) {
- // Ensure that we have saved an entity.
- if ($object = $form_state->getFormObject()) {
- $url = $object->getEntity()->url();
- }
- // Validate that the URL will be considered "external" by Drupal, which means
- // that a scheme value will be present.
- if (!empty($url)) {
- $uri_parts = parse_url($url);
- // If necessary and secure, issue a TrustedRedirectResponse to the new URL.
- if (!empty($uri_parts['host'])) {
- // Pass a redirect if necessary.
- if (DomainRedirectResponse::checkTrustedHost($uri_parts['host'])) {
- $response = new TrustedRedirectResponse($url);
- $form_state->setResponse($response);
- }
- }
- }
-}
-
-/**
- * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.
- */
-function domain_source_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
- // Add the options hidden from the user silently to the form.
- $manager = \Drupal::service('domain_source.element_manager');
- $hide = TRUE;
- $form = $manager->setFormOptions($form, $form_state, DOMAIN_SOURCE_FIELD, $hide);
- // Check that our field is present and add validation if Domain Access is
- // installed. See https://www.drupal.org/node/2952535.
- if (isset($form[DOMAIN_SOURCE_FIELD]) && defined('DOMAIN_ACCESS_FIELD') && isset($form[DOMAIN_ACCESS_FIELD])) {
- $form[DOMAIN_SOURCE_FIELD]['#element_validate'] = ['domain_source_form_validate'];
- // If using a select field, load the JS to show/hide options.
- if ($form[DOMAIN_SOURCE_FIELD]['widget']['#type'] == 'select') {
- $form['#attached']['library'][] = 'domain_source/drupal.domain_source';
- }
- }
-}
-
-/**
- * Implements hook_views_data_alter().
- */
-function domain_source_views_data_alter(array &$data) {
- $table = 'node__' . DOMAIN_SOURCE_FIELD;
- $data[$table][DOMAIN_SOURCE_FIELD]['field']['id'] = 'domain_source';
- $data[$table][DOMAIN_SOURCE_FIELD . '_target_id']['filter']['id'] = 'domain_source';
- // Since domains are not stored in the database, relationships cannot be used.
- unset($data[$table][DOMAIN_SOURCE_FIELD]['relationship']);
-}
-
-/**
- * Implements hook_form_FORM_ID_alter().
- *
- * Add options for domain source when using Devel Generate.
- */
-function domain_source_form_devel_generate_form_content_alter(&$form, &$form_state, $form_id) {
- // Add our element to the Devel generate form.
- $list = ['_derive' => t('Derive from domain selection')];
- $list += \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList();
- $form['domain_source'] = [
- '#title' => t('Domain source'),
- '#type' => 'checkboxes',
- '#options' => $list,
- '#weight' => 4,
- '#multiple' => TRUE,
- '#size' => count($list) > 5 ? 5 : count($list),
- '#default_value' => ['_derive'],
- '#description' => t('Sets the source domain for created nodes.'),
- ];
-}
-
-/**
- * Implements hook_ENTITY_TYPE_presave().
- *
- * Fires only if Devel Generate module is present, to assign test nodes to
- * domains.
- */
-function domain_source_node_presave(EntityInterface $node) {
- domain_source_presave_generate($node);
-}
-
-/**
- * Handles presave operations for devel generate.
- */
-function domain_source_presave_generate(EntityInterface $entity) {
- // Handle devel module settings.
- $exists = \Drupal::moduleHandler()->moduleExists('devel_generate');
- $values = [];
- $selections = [];
- if ($exists && isset($entity->devel_generate)) {
- // If set by the form.
- if (isset($entity->devel_generate['domain_access'])) {
- $selection = array_filter($entity->devel_generate['domain_access']);
- if (isset($selection['random-selection'])) {
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $selections = array_rand($domains, ceil(rand(1, count($domains))));
- }
- else {
- $selections = array_keys($selection);
- }
- }
- if (isset($entity->devel_generate['domain_source'])) {
- $selection = $entity->devel_generate['domain_source'];
- if ($selection == '_derive') {
- if (!empty($selections)) {
- $values[DOMAIN_SOURCE_FIELD] = current($selections);
- }
- else {
- $values[DOMAIN_SOURCE_FIELD] = NULL;
- }
- }
- foreach ($values as $name => $value) {
- $entity->set($name, $value);
- }
- }
- }
-}
-
-
-/**
- * Implements hook_hook_info().
- */
-function domain_source_hook_info() {
- $hooks['domain_source_alter'] = [
- 'group' => 'domain_source',
- ];
- $hooks['domain_source_path_alter'] = [
- 'group' => 'domain_source',
- ];
- return $hooks;
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.routing.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.routing.yml
deleted file mode 100644
index 551e37400..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-domain_source.settings:
- path: '/admin/config/domain/domain_source'
- defaults:
- _title: 'Domain Source settings'
- _form: '\Drupal\domain_source\Form\DomainSourceSettingsForm'
- requirements:
- _permission: 'administer domains'
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.services.yml b/sites/all/modules/contrib/admin/domain/domain_source/domain_source.services.yml
deleted file mode 100644
index 93c38cad4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/domain_source.services.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-services:
- domain_source.element_manager:
- class: Drupal\domain_source\DomainSourceElementManager
- arguments: ['@entity_type.manager']
- domain_source.path_processor:
- class: Drupal\domain_source\HttpKernel\DomainSourcePathProcessor
- arguments: ['@domain.negotiator', '@module_handler', '@entity_type.manager', '@path.alias_manager', '@config.factory']
- tags:
- - { name: path_processor_outbound, priority: 90 }
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/drush.services.yml b/sites/all/modules/contrib/admin/domain/domain_source/drush.services.yml
deleted file mode 100644
index 6c115c943..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/drush.services.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-services:
- domain_source.commands:
- class: \Drupal\domain_source\Commands\DomainSourceCommands
- tags:
- - { name: drush.command }
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/js/domain_source.js b/sites/all/modules/contrib/admin/domain/domain_source/js/domain_source.js
deleted file mode 100644
index 6e549663a..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/js/domain_source.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * @file
- * Attaches behaviors for the Domain Source module.
- *
- * If Domain Access is present, we show/hide selected publishing domains. This approach
- * currently only works with a select field.
- */
-(function ($) {
-
- "use strict";
-
- /**
- *
- * @type {Drupal~behavior}
- */
- Drupal.behaviors.domainSourceAllowed = {
- attach: function () {
-
- // Get the initial setting so that it can be reset.
- var initialOption = $("#edit-field-domain-source").val();
-
- // Onload, fire initial show/hide.
- getDomains();
-
- // Get the domains selected by the domain access field.
- function getDomains() {
- var domains = new Array();
- $("#edit-field-domain-access :checked").each(function(index, obj) {
- domains.push(obj.value);
- });
- setOptions(domains);
- }
-
- // Based on selected domains, show/hide the selection options.
- function setOptions(domains) {
- $("#edit-field-domain-source option").each(function(index, obj) {
- if (jQuery.inArray(obj.value, domains) == -1 && obj.value != '_none') {
- // If the current selection is removed, reset the selection to _none.
- if ($("#edit-field-domain-source").val() == obj.value) {
- $("#edit-field-domain-source").val('_none');
- }
- $("#edit-field-domain-source option[value=" + obj.value + "]").hide();
- }
- else {
- $("#edit-field-domain-source option[value=" + obj.value + "]").show();
- // If we reselected the initial value, reset the select option.
- if (obj.value == initialOption) {
- $("#edit-field-domain-source").val(obj.value);
- }
- }
- });
- }
-
- // When the selections change, recalculate the select options.
- $( "#edit-field-domain-access" ).on( "change", getDomains );
- }
- };
-
-})(jQuery);
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/Commands/DomainSourceCommands.php b/sites/all/modules/contrib/admin/domain/domain_source/src/Commands/DomainSourceCommands.php
deleted file mode 100644
index 452f0efd3..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/src/Commands/DomainSourceCommands.php
+++ /dev/null
@@ -1,79 +0,0 @@
-getFieldEntities(DOMAIN_SOURCE_FIELD);
-
- return $result;
- }
-
- /**
- * @hook option domain:delete
- */
- public function deleteOptions(Command $command, AnnotationData $annotationData) {
- $command->addOption(
- 'source-assign',
- '',
- InputOption::VALUE_OPTIONAL,
- 'Reassign content for Domain Source',
- null
- );
- }
-
- /**
- * @hook on-event domain-delete
- */
- public function domainSourceDomainDelete($target_domain, $options) {
- // Run our own deletion routine here.
- if (is_null($options['content-assign'])) {
- $policy_content = 'prompt';
- }
- if (!empty($options['content-assign'])) {
- if (in_array($options['content-assign'], $this->reassignment_policies, TRUE)) {
- $policy_content = $options['content-assign'];
- }
- }
-
- $delete_options = [
- 'entity_filter' => 'node',
- 'policy' => $policy_content,
- 'field' => DOMAIN_SOURCE_FIELD,
- ];
-
- return $this->doReassign($target_domain, $delete_options);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceElementManager.php b/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceElementManager.php
deleted file mode 100644
index 4568cdf2b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceElementManager.php
+++ /dev/null
@@ -1,28 +0,0 @@
-getBuildInfo();
- $entity = $form_state->getFormObject()->getEntity();
- $entity_values = $entity->get(DOMAIN_SOURCE_FIELD)->offsetGet(0);
- if (isset($field['widget']['#options']) && !empty($entity_values)) {
- $value = $entity_values->getValue('target_id');
- $options = array_diff_key(array_flip($value), $field['widget']['#options']);
- }
- return array_keys($options);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceServiceProvider.php b/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceServiceProvider.php
deleted file mode 100644
index ce3b00ae4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/src/DomainSourceServiceProvider.php
+++ /dev/null
@@ -1,21 +0,0 @@
-getDefinition('redirect_response_subscriber');
- $definition->setClass('Drupal\domain_source\EventSubscriber\DomainSourceRedirectResponseSubscriber');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/EventSubscriber/DomainSourceRedirectResponseSubscriber.php b/sites/all/modules/contrib/admin/domain/domain_source/src/EventSubscriber/DomainSourceRedirectResponseSubscriber.php
deleted file mode 100644
index 9510a26b6..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/src/EventSubscriber/DomainSourceRedirectResponseSubscriber.php
+++ /dev/null
@@ -1,68 +0,0 @@
-getResponse();
- if ($response instanceof RedirectResponse) {
- $request = $event->getRequest();
-
- // Let the 'destination' query parameter override the redirect target.
- // If $response is already a SecuredRedirectResponse, it might reject the
- // new target as invalid, in which case proceed with the old target.
- $destination = $request->query->get('destination');
- if ($destination) {
- // The 'Location' HTTP header must always be absolute.
- $destination = $this->getDestinationAsAbsoluteUrl($destination, $request->getSchemeAndHttpHost());
- try {
- $response->setTargetUrl($destination);
- }
- catch (\InvalidArgumentException $e) {
- }
- }
-
- // Regardless of whether the target is the original one or the overridden
- // destination, ensure that all redirects are safe.
- if (!($response instanceof SecuredRedirectResponse)) {
- try {
- // SecuredRedirectResponse is an abstract class that requires a
- // concrete implementation. Default to DomainRedirectResponse, which
- // considers only redirects to sites registered via Domain.
- $safe_response = DomainRedirectResponse::createFromRedirectResponse($response);
- $safe_response->setRequestContext($this->requestContext);
- }
- catch (\InvalidArgumentException $e) {
- // If the above failed, it's because the redirect target wasn't
- // local. Do not follow that redirect. Display an error message
- // instead. We're already catching one exception, so trigger_error()
- // rather than throw another one.
- // We don't throw an exception, because this is a client error rather
- // than a server error.
- $message = 'Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.';
- trigger_error($message, E_USER_ERROR);
- $safe_response = new Response($message, 400);
- }
- $event->setResponse($safe_response);
- }
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/Form/DomainSourceSettingsForm.php b/sites/all/modules/contrib/admin/domain/domain_source/src/Form/DomainSourceSettingsForm.php
deleted file mode 100644
index 332529b5c..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/src/Form/DomainSourceSettingsForm.php
+++ /dev/null
@@ -1,66 +0,0 @@
-getDefinition('node')->getLinkTemplates();
-
- $options = [];
- foreach ($routes as $route => $path) {
- // Some parts of the system prepend drupal:, which the routing
- // system doesn't use. The routing system also uses underscores instead
- // of dashes. Because Drupal.
- $route = str_replace(['-', 'drupal:'], ['_', ''], $route);
- $options[$route] = $route;
- }
- $config = $this->config('domain_source.settings');
- $form['exclude_routes'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('Disable link rewrites for the selected routes.'),
- '#default_value' => $config->get('exclude_routes') ?: [],
- '#options' => $options,
- '#description' => $this->t('Check the routes to disable. Any entity URL with a Domain Source field will be rewritten unless its corresponding route is disabled.'),
- ];
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->config('domain_source.settings')
- ->set('exclude_routes', $form_state->getValue('exclude_routes'))
- ->save();
-
- parent::submitForm($form, $form_state);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/HttpKernel/DomainSourcePathProcessor.php b/sites/all/modules/contrib/admin/domain/domain_source/src/HttpKernel/DomainSourcePathProcessor.php
deleted file mode 100644
index 799ececd4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/src/HttpKernel/DomainSourcePathProcessor.php
+++ /dev/null
@@ -1,294 +0,0 @@
-negotiator = $negotiator;
- $this->moduleHandler = $module_handler;
- $this->entityTypeManager = $entity_type_manager;
- $this->aliasManager = $alias_manager;
- $this->configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
- // Load the active domain if not set.
- if (empty($options['active_domain'])) {
- $active_domain = $this->getActiveDomain();
- }
-
- // Only act on valid internal paths and when a domain loads.
- if (empty($active_domain) || empty($path) || !empty($options['external'])) {
- return $path;
- }
-
- // Set the default source information.
- $source = NULL;
- $options['active_domain'] = $active_domain;
-
- // Get the current language.
- $langcode = NULL;
- if (!empty($options['language'])) {
- $langcode = $options['language']->getId();
- }
-
- // Get the URL object for this request.
- $alias = $this->aliasManager->getPathByAlias($path, $langcode);
- $url = Url::fromUserInput($alias, $options);
-
- // Check the route, if available. Entities can be configured to
- // only rewrite specific routes.
- if ($url->isRouted() && $this->allowedRoute($url->getRouteName())) {
- // Load the entity to check.
- if (!empty($options['entity'])) {
- $entity = $options['entity'];
- }
- else {
- $parameters = $url->getRouteParameters();
- if (!empty($parameters)) {
- $entity = $this->getEntity($parameters);
- }
- }
- }
-
- // One hook for entities.
- if (!empty($entity)) {
- // Enmsure we send the right translation.
- if (!empty($langcode) && method_exists($entity, 'hasTranslation') && $entity->hasTranslation($langcode) && $translation = $entity->getTranslation($langcode)) {
- $entity = $translation;
- }
- if (isset($options['domain_target_id'])) {
- $target_id = $options['domain_target_id'];
- }
- else {
- $target_id = domain_source_get($entity);
- }
- if (!empty($target_id)) {
- $source = $this->domainStorage()->load($target_id);
- }
- $options['entity'] = $entity;
- $options['entity_type'] = $entity->getEntityTypeId();
- $this->moduleHandler->alter('domain_source', $source, $path, $options);
- }
- // One for other, because the latter is resource-intensive.
- else {
- if (isset($options['domain_target_id'])) {
- $target_id = $options['domain_target_id'];
- $source = $this->domainStorage()->load($target_id);
- }
- $this->moduleHandler->alter('domain_source_path', $source, $path, $options);
- }
- // If a source domain is specified, rewrite the link.
- if (!empty($source)) {
- // Note that url rewrites add a leading /, which getPath() also adds.
- $options['base_url'] = trim($source->getPath(), '/');
- $options['absolute'] = TRUE;
- }
- return $path;
- }
-
- /**
- * Derive entity data from a given route's parameters.
- *
- * @param array $parameters
- * An array of route parameters.
- *
- * @return \Drupal\Core\Entity\EntityInterface|null
- * Returns the entity when available, otherwise NULL.
- */
- public function getEntity(array $parameters) {
- $entity = NULL;
- $entity_type = key($parameters);
- $entity_types = $this->getEntityTypes();
- foreach ($parameters as $entity_type => $value) {
- if (!empty($entity_type) && isset($entity_types[$entity_type])) {
- $entity = $this->entityTypeManager->getStorage($entity_type)->load($value);
- }
- }
- return $entity;
- }
-
- /**
- * Checks that a route's common name is not disallowed.
- *
- * Looks at the name (e.g. canonical) of the route without regard for
- * the entity type.
- *
- * @parameter $name
- * The route name being checked.
- *
- * @return bool
- * Returns TRUE when allowed, otherwise FALSE.
- */
- public function allowedRoute($name) {
- $excluded = $this->getExcludedRoutes();
- $parts = explode('.', $name);
- $route_name = end($parts);
- // Config is stored as an array. Empty items are not excluded.
- return !isset($excluded[$route_name]);
- }
-
- /**
- * Gets an array of content entity types, keyed by type.
- *
- * @return \Drupal\Core\Entity\EntityTypeInterface[]
- * An array of content entity types, keyed by type.
- */
- public function getEntityTypes() {
- if (!isset($this->entityTypes)) {
- foreach ($this->entityTypeManager->getDefinitions() as $type => $definition) {
- if ($definition->getGroup() == 'content') {
- $this->entityTypes[$type] = $type;
- }
- }
- }
- return $this->entityTypes;
- }
-
- /**
- * Gets the settings for domain source path rewrites.
- *
- * @return array
- * The settings for domain source path rewrites.
- */
- public function getExcludedRoutes() {
- if (!isset($this->excludedRoutes)) {
- $config = $this->configFactory->get('domain_source.settings');
- $routes = $config->get('exclude_routes');
- if (is_array($routes)) {
- $this->excludedRoutes = array_flip($routes);
- }
- else {
- $this->excludedRoutes = [];
- }
- }
- return $this->excludedRoutes;
- }
-
- /**
- * Gets the active domain.
- *
- * @return \Drupal\domain\DomainInterface
- * The active domain.
- */
- public function getActiveDomain() {
- if (!isset($this->activeDomain)) {
- // Ensure that the loader has run.
- // In some tests, the kernel event has not.
- $active = $this->negotiator->getActiveDomain();
- if (empty($active)) {
- $active = $this->negotiator->getActiveDomain(TRUE);
- }
- $this->activeDomain = $active;
- }
- return $this->activeDomain;
- }
-
- /**
- * Retrieves the domain storage handler.
- *
- * @return \Drupal\domain\DomainStorageInterface
- * The domain storage handler.
- */
- protected function domainStorage() {
- if (!$this->domainStorage) {
- $this->domainStorage = $this->entityTypeManager->getStorage('domain');
- }
- return $this->domainStorage;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/field/DomainSource.php b/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/field/DomainSource.php
deleted file mode 100644
index aedfcf8d6..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/field/DomainSource.php
+++ /dev/null
@@ -1,50 +0,0 @@
-options['settings']['link'])) {
- foreach ($items as &$item) {
- $object = $item['raw'];
- $entity = $object->getEntity();
- $url = $entity->toUrl()->toString();
- $domain = $item['rendered']['#options']['entity'];
- $item['rendered']['#type'] = 'markup';
- $item['rendered']['#markup'] = '' . $domain->label() . '';
- }
- uasort($items, [$this, 'sort']);
- }
-
- return $items;
- }
-
- /**
- * Sort the domain list, if possible.
- */
- private function sort($a, $b) {
- $domainA = isset($a['rendered']['#options']['entity']) ? $a['rendered']['#options']['entity'] : 0;
- $domainB = isset($b['rendered']['#options']['entity']) ? $b['rendered']['#options']['entity'] : 0;
- if ($domainA !== 0) {
- return $domainA->getWeight() > $domainB->getWeight();
- }
- // We don't have a domain object so sort as best we can.
- return $a['rendered']['#plain_text'] > $b['rendered']['#plain_text'];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/filter/DomainSource.php b/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/filter/DomainSource.php
deleted file mode 100644
index 1983bfbf4..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/src/Plugin/views/filter/DomainSource.php
+++ /dev/null
@@ -1,42 +0,0 @@
-valueOptions)) {
- $this->valueTitle = $this->t('Domains');
- $this->valueOptions = [
- '_active' => $this->t('Active domain'),
- ] + \Drupal::entityTypeManager()->getStorage('domain')->loadOptionsList();
- }
- return $this->valueOptions;
- }
-
- /**
- * {@inheritdoc}
- */
- public function query() {
- $active_index = array_search('_active', (array) $this->value);
- if ($active_index !== FALSE) {
- $active_id = \Drupal::service('domain.negotiator')->getActiveId();
- $this->value[$active_index] = $active_id;
- }
-
- parent::query();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/config/optional/views.view.domain_format_test.yml b/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/config/optional/views.view.domain_format_test.yml
deleted file mode 100644
index 098153fb0..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/config/optional/views.view.domain_format_test.yml
+++ /dev/null
@@ -1,212 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - node
- - rest
- - serialization
- - user
-id: domain_format_test
-label: 'Domain format test'
-module: views
-description: ''
-tag: ''
-base_table: node_field_data
-base_field: nid
-core: 8.x
-display:
- default:
- display_plugin: default
- id: default
- display_title: Master
- position: 0
- display_options:
- access:
- type: perm
- options:
- perm: 'access content'
- 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: Apply
- 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:
- title:
- id: title
- table: node_field_data
- field: title
- entity_type: node
- entity_field: title
- label: ''
- alter:
- alter_text: false
- make_link: false
- absolute: false
- trim: false
- word_boundary: false
- ellipsis: false
- strip_tags: false
- html: false
- hide_empty: false
- empty_zero: false
- settings:
- link_to_entity: true
- plugin_id: field
- relationship: none
- group_type: group
- admin_label: ''
- exclude: false
- element_type: ''
- element_class: ''
- element_label_type: ''
- element_label_class: ''
- element_label_colon: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_alter_empty: true
- click_sort_column: value
- type: string
- group_column: value
- 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
- filters:
- status:
- value: '1'
- table: node_field_data
- field: status
- plugin_id: boolean
- entity_type: node
- entity_field: status
- id: status
- expose:
- operator: ''
- group: 1
- sorts:
- created:
- id: created
- table: node_field_data
- field: created
- order: DESC
- entity_type: node
- entity_field: created
- plugin_id: date
- relationship: none
- group_type: group
- admin_label: ''
- exposed: false
- expose:
- label: ''
- granularity: second
- header: { }
- footer: { }
- empty: { }
- relationships: { }
- arguments: { }
- display_extenders: { }
- cache_metadata:
- max-age: -1
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url.query_args
- - 'user.node_grants:view'
- - user.permissions
- tags: { }
- page_1:
- display_plugin: page
- id: page_1
- display_title: Page
- position: 2
- display_options:
- display_extenders: { }
- path: domain-format-test
- cache_metadata:
- max-age: -1
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url.query_args
- - 'user.node_grants:view'
- - user.permissions
- tags: { }
- rest_export_1:
- display_plugin: rest_export
- id: rest_export_1
- display_title: 'REST export'
- position: 1
- display_options:
- display_extenders: { }
- path: domain-format-test
- row:
- type: data_field
- options:
- field_options:
- title:
- alias: ''
- raw_output: false
- cache_metadata:
- max-age: -1
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - request_format
- - 'user.node_grants:view'
- - user.permissions
- tags: { }
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.info.yml b/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.info.yml
deleted file mode 100644
index b30a708ef..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.info.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: "Domain Source module tests"
-description: "Support module for domain source testing."
-type: module
-package: Testing
-# version: VERSION
-# core: 8.x
-hidden: TRUE
-
-dependencies:
- - domain
- - domain_source
- - node
- - rest
- - serialization
- - user
-
-# Information added by Drupal.org packaging script on 2019-02-21
-version: '8.x-1.0-alpha15'
-core: '8.x'
-project: 'domain'
-datestamp: 1550763190
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.module b/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.module
deleted file mode 100644
index 624ec3f62..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/modules/domain_source_test/domain_source_test.module
+++ /dev/null
@@ -1,13 +0,0 @@
-getStorage('domain')->loadDefaultDomain();
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceContentUrlsTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceContentUrlsTest.php
deleted file mode 100644
index 086a3921b..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceContentUrlsTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
- 'page',
- 'title' => 'foo',
- DOMAIN_ACCESS_FIELD => ['example_com', 'one_example_com', 'two_example_com'],
- DOMAIN_ACCESS_ALL_FIELD => 0,
- DOMAIN_SOURCE_FIELD => $id,
- ];
- $node = $this->createNode($nodes_values);
-
- // Variables for our tests.
- $path = 'node/1';
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $source = $domains[$id];
- $expected = $source->getPath() . $path;
- $route_name = 'entity.node.canonical';
- $route_parameters = ['node' => 1];
- $uri = 'entity:' . $path;
- $uri_path = '/' . $path;
- $options = [];
-
- // Get the link using Url::fromRoute().
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- $this->assertTrue($url == $expected, 'fromRoute');
-
- // Get the link using Url::fromUserInput()
- $url = URL::fromUserInput($uri_path, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUserInput');
-
- // Get the link using Url::fromUri()
- $url = URL::fromUri($uri, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUri');
-
- // Get the path processor service.
- $paths = \Drupal::service('domain_access.manager');
- $urls = $paths->getContentUrls($node);
- $expected = [
- $id => $domains[$id]->getPath() . 'node/1',
- 'example_com' => $domains['example_com']->getPath() . 'node/1',
- 'two_example_com' => $domains['two_example_com']->getPath() . 'node/1',
- ];
-
- $this->assertTrue($expected == $urls);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceElementTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceElementTest.php
deleted file mode 100644
index 981c2cbb9..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceElementTest.php
+++ /dev/null
@@ -1,184 +0,0 @@
-domainCreateTestDomains(5);
- }
-
- /**
- * Test runner.
- */
- public function testDomainSourceElement() {
- $this->runInstalledTest('article');
- $node_type = $this->createContentType(['type' => 'test']);
- $this->runInstalledTest('test');
- }
-
- /**
- * Basic test setup.
- */
- public function runInstalledTest($node_type) {
- $admin = $this->drupalCreateUser([
- 'bypass node access',
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- 'publish to any domain',
- ]);
- $this->drupalLogin($admin);
-
- $this->drupalGet('node/add/article');
- $this->assertSession()->statusCodeEquals(200);
-
- $nid = $node_type == 'article' ? 1 : 2;
-
- // Set the title, so the node can be saved.
- $this->fillField('title[0][value]', 'Test node');
-
- // We expect to find 5 domain options. We set two as selected.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $count = 0;
- $ids = ['example_com', 'one_example_com', 'two_example_com'];
- foreach ($domains as $domain) {
- $locator = DOMAIN_ACCESS_FIELD . '[' . $domain->id() . ']';
- $this->findField($locator);
- if (in_array($domain->id(), $ids)) {
- $this->checkField($locator);
- }
- }
- // Find the all affiliates field.
- $locator = DOMAIN_ACCESS_ALL_FIELD . '[value]';
- $this->findField($locator);
-
- // Set all affiliates to TRUE.
- $this->checkField($locator);
-
- // Find the Domain Source field.
- $locator = DOMAIN_SOURCE_FIELD;
- $this->findField($locator);
- // Set it to one_example_com.
- $this->selectFieldOption($locator, 'one_example_com');
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check the URL.
- $url = $this->geturl();
- $this->assert(strpos($url, 'node/' . $nid . '/edit') === FALSE, 'Form submitted.');
-
- // Edit the node.
- $this->drupalGet('node/' . $nid . '/edit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Set the domain source field to an unselected domain.
- $this->selectFieldOption($locator, 'three_example_com');
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->assertEscaped('The source domain must be selected as a publishing option.');
-
- // Check the URL.
- $url = $this->geturl();
- $this->assert(strpos($url, 'node/' . $nid . '/edit') > 0, 'Form not submitted.');
-
- // Set the field properly and save again.
- $this->selectFieldOption($locator, 'one_example_com');
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check the URL.
- $url = $this->geturl();
- $this->assert(strpos($url, 'node/' . $nid . '/edit') === FALSE, 'Form submitted.');
-
- // Save with no source.
- // Edit the node.
- $this->drupalGet('node/1/edit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Set the domain source field to an unselected domain.
- $this->selectFieldOption($locator, '_none');
-
- // Save the form.
- $this->pressButton('edit-submit');
- $this->assertSession()->statusCodeEquals(200);
-
- // Check the URL.
- $url = $this->geturl();
- $this->assert(strpos($url, 'node/' . $nid . '/edit') === FALSE, 'Form submitted.');
- }
-
- /**
- * Test for https://www.drupal.org/project/domain/issues/3010256.
- */
- public function testAnonForm() {
- // Editor with no domain permissions should not see the element.
- $editor = $this->drupalCreateUser([
- 'create article content',
- ]);
- $this->drupalLogin($editor);
-
- $this->drupalGet('node/add/article');
- $this->assertSession()->statusCodeEquals(200);
-
- $locator = DOMAIN_SOURCE_FIELD;
- $this->assertSession()->fieldNotExists($locator);
-
- // Editor with domain permissions should see the element once they
- // are assigned to domains.
- $editor2 = $this->drupalCreateUser([
- 'create article content',
- 'publish to any assigned domain',
- ]);
- $this->drupalLogin($editor2);
-
- $this->drupalGet('node/add/article');
- $this->assertSession()->statusCodeEquals(200);
-
- $locator = DOMAIN_SOURCE_FIELD;
- $this->assertSession()->fieldNotExists($locator);
-
- // Domain assignment.
- $ids = ['example_com', 'one_example_com'];
- $this->addDomainsToEntity('user', $editor2->id(), $ids, DOMAIN_ACCESS_FIELD);
-
- $this->drupalGet('node/add/article');
- $this->assertSession()->statusCodeEquals(200);
-
- $this->assertSession()->fieldExists($locator);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceEntityReferenceTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceEntityReferenceTest.php
deleted file mode 100644
index f4dc40982..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceEntityReferenceTest.php
+++ /dev/null
@@ -1,174 +0,0 @@
-admin_user = $this->drupalCreateUser([
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Visit the article field administration page.
- $this->drupalGet('admin/structure/types/manage/article/fields');
- $this->assertResponse(200, 'Manage fields page sourceed.');
-
- // Check for a domain field.
- $this->assertText('Domain Source', 'Domain form field found.');
-
- // Visit the article field display administration page.
- $this->drupalGet('admin/structure/types/manage/article/display');
- $this->assertResponse(200, 'Manage field display page sourceed.');
-
- // Check for a domain field.
- $this->assertText('Domain Source', 'Domain form field found.');
- }
-
- /**
- * Tests the storage of the domain source field.
- */
- public function testDomainSourceFieldStorage() {
- $this->admin_user = $this->drupalCreateUser([
- 'administer content types',
- 'administer node fields',
- 'administer node display',
- 'administer domains',
- 'administer menu',
- ]);
- $this->drupalLogin($this->admin_user);
-
- // Create 5 domains.
- $this->domainCreateTestDomains(5);
-
- // Visit the article field display administration page.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200);
-
- // Check the new field exists on the page.
- $this->assertText('Domain Source', 'Found the domain field instance.');
-
- // We expect to find 5 domain options + none.
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- foreach ($domains as $domain) {
- $string = 'value="' . $domain->id() . '"';
- $this->assertRaw($string, 'Found the domain option.');
- if (!isset($one)) {
- $one = $domain->id();
- continue;
- }
- if (!isset($two)) {
- $two = $domain->id();
- $two_path = $domain->getPath();
- }
- }
- $this->assertRaw('value="_none"', 'Found the _none_ option.');
-
- $node_storage = \Drupal::entityTypeManager()->getStorage('node');
-
- // Try to post a node, assigned to the second domain.
- $edit['title[0][value]'] = 'Test node';
- $edit['field_domain_source'] = $two;
- $this->drupalPostForm('node/add/article', $edit, 'Save');
- $this->assertResponse(200);
- $node = $node_storage->load(1);
- // Check that the value is set.
- $value = domain_source_get($node);
- $this->assertTrue($value == $two, 'Node saved with proper source record.');
-
- // Test the URL.
- $url = $node->toUrl()->toString();
- $expected_url = $two_path . 'node/1';
- $this->assertTrue($expected_url == $url, 'URL rewritten correctly.');
-
- // Try to post a node, assigned to no domain.
- $edit['title[0][value]'] = 'Test node';
- $edit["field_domain_source"] = '_none';
- $this->drupalPostForm('node/add/article', $edit, 'Save');
- $this->assertResponse(200);
- $node = $node_storage->load(2);
- // Check that the value is set.
- $value = domain_source_get($node);
- $this->assertNull($value, 'Node saved with proper source record.');
-
- // Test the url.
- $url = $node->toUrl()->toString();
- $expected_url = base_path() . 'node/2';
- $this->assertTrue($expected_url == $url, 'URL rewritten correctly.');
-
- // Place the menu block.
- $this->drupalPlaceBlock('system_menu_block:main');
-
- // Enable main menu as available menu.
- $edit = [
- 'menu_options[main]' => 1,
- 'menu_parent' => 'main:',
- ];
- $this->drupalPostForm('admin/structure/types/manage/article', $edit, t('Save content type'));
-
- // Create a third node that is assigned to a menu.
- $edit = [
- 'title[0][value]' => 'Node 3',
- 'menu[enabled]' => 1,
- 'menu[title]' => 'Test preview',
- 'field_domain_source' => $two,
- ];
- $this->drupalPostForm('node/add/article', $edit, 'Save');
- // Test the URL against expectations, and the rendered menu link.
- $node = $node_storage->load(3);
- $url = $node->toUrl()->toString();
- $expected_url = $two_path . 'node/3';
- $this->assertTrue($expected_url == $url, 'URL rewritten correctly.');
- // Load the page with a menu and check that link.
- $this->drupalGet('node/3');
- $this->assertRaw('href="' . $url, 'Menu link rewritten correctly.');
-
- // Remove the field from the node type and make sure nothing breaks.
- // See https://www.drupal.org/node/2892612
- $id = 'node.article.field_domain_source';
- if ($field = \Drupal::entityManager()->getStorage('field_config')->load($id)) {
- $field->delete();
- field_purge_batch(10, $field->uuid());
- drupal_flush_all_caches();
- }
- // Visit the article field display administration page.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200);
- // Try to post a node, assigned to no domain.
- $edit2['title[0][value]'] = 'Test node';
- $this->drupalPostForm('node/add/article', $edit2, 'Save');
- // Test the URL against expectations, and the rendered menu link.
- $node = $node_storage->load(4);
- $url = $node->toUrl()->toString();
- $expected_url = '/node/4';
- $this->assertTrue($expected_url == $url, 'No URL rewrite performed.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceExcludeTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceExcludeTest.php
deleted file mode 100644
index ae0570954..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceExcludeTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
- 'page',
- 'title' => 'foo',
- DOMAIN_SOURCE_FIELD => $id,
- ];
- $node = $this->createNode($node_values);
-
- // Variables for our tests.
- $path = 'node/1';
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $source = $domains[$id];
- $expected = $source->getPath() . $path;
- $route_name = 'entity.node.canonical';
- $route_parameters = ['node' => 1];
- $uri = 'entity:' . $path;
- $uri_path = '/' . $path;
- $options = [];
-
- // Get the link using Url::fromRoute().
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- $this->assertTrue($url == $expected, 'fromRoute');
-
- // Get the link using Url::fromUserInput()
- $url = URL::fromUserInput($uri_path, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUserInput');
-
- // Get the link using Url::fromUri()
- $url = URL::fromUri($uri, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUri');
-
- // Exclude the edit path from rewrites.
- $config = $this->config('domain_source.settings');
- $config->set('exclude_routes', ['edit_form' => 'edit_form'])->save();
-
- // Variables for our tests.
- $path = 'node/1/edit';
- $expected = '/' . $path;
- $route_name = 'entity.node.edit_form';
- $route_parameters = ['node' => 1];
- $uri = 'internal:/' . $path;
- $uri_path = '/' . $path;
- $options = [];
-
- // Because of path cache, we have to flush here.
- drupal_flush_all_caches();
-
- // Get the link using Url::fromRoute().
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- $this->assertTrue($url == $expected, 'fromRoute' . $url);
-
- // Get the link using Url::fromUserInput()
- $url = URL::fromUserInput($uri_path, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUserInput');
-
- // Get the link using Url::fromUri()
- $url = URL::fromUri($uri, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUri');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceLanguageTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceLanguageTest.php
deleted file mode 100644
index 977f1d293..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceLanguageTest.php
+++ /dev/null
@@ -1,127 +0,0 @@
-save();
- ConfigurableLanguage::createFromLangcode('af')->save();
-
- // Enable content translation for the current entity type.
- \Drupal::service('content_translation.manager')->setEnabled('node', 'page', TRUE);
-
- }
-
- /**
- * Tests domain source language.
- */
- public function testDomainSourceLanguage() {
- // Create a node, assigned to a source domain.
- $id = 'one_example_com';
- // Create one node with no language.
- $node = $this->drupalCreateNode([
- 'body' => [[]],
- 'status' => 1,
- DOMAIN_SOURCE_FIELD => $id,
- ]);
-
- // Programmatically create a translation.
- $storage = \Drupal::entityTypeManager()->getStorage('node');
- // Reload the node.
- $node = $storage->load(1);
- // Create an Afrikaans translation assigned to domain 2.
- $id2 = 'two_example_com';
- $translation = $node->addTranslation('af');
- $translation->title->value = $this->randomString();
- $translation->{DOMAIN_SOURCE_FIELD} = $id2;
- $translation->status = 1;
- $node->save();
-
- // Variables for our tests.
- $path = 'node/1';
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $source = $domains[$id];
- $expected = $source->getPath() . $path;
- $route_name = 'entity.node.canonical';
- $route_parameters = ['node' => 1];
- $uri = 'entity:' . $path;
- $uri_path = '/' . $path;
- $options = [];
-
- // Get the link using Url::fromRoute().
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- $this->assertTrue($url == $expected, 'fromRoute');
-
- // Get the link using Url::fromUserInput()
- $url = URL::fromUserInput($uri_path, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUserInput');
-
- // Get the link using Url::fromUri()
- $url = URL::fromUri($uri, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUri');
-
- // Now test the same for the Arfrikaans translation.
- $path = 'node/1';
- $source = $domains[$id2];
- $expected = $source->getPath() . 'af/' . $path;
- $route_name = 'entity.node.canonical';
- $route_parameters = ['node' => 1];
- $uri = 'entity:' . $path;
- $uri_path = '/' . $path;
- $language = \Drupal::entityTypeManager()->getStorage('configurable_language')->load('af');
- $options = ['language' => $language];
-
- $translation = $node->getTranslation('af');
- $this->assertTrue(domain_source_get($translation) == $id2, domain_source_get($translation));
-
- // Because of path cache, we have to flush here.
- drupal_flush_all_caches();
-
- // Get the link using Url::fromRoute().
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- $this->assertTrue($url == $expected, 'fromRoute');
-
- // Get the link using Url::fromUserInput()
- $url = URL::fromUserInput($uri_path, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUserInput');
-
- // Get the link using Url::fromUri()
- $url = URL::fromUri($uri, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUri');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceParameterTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceParameterTest.php
deleted file mode 100644
index af6fd6701..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceParameterTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-createNode(['type' => 'page', 'title' => 'foo', DOMAIN_SOURCE_FIELD => $id]);
-
- // Variables for our tests.
- $path = 'domain-format-test';
- $options = ['query' => ['_format' => 'json']];
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- foreach ($domains as $domain) {
- $this->drupalGet($domain->getPath() . $path, $options);
- }
- $source = $domains[$id];
- $uri_path = '/' . $path;
- $expected = $uri_path . '?_format=json';
-
- // Get the link using Url::fromUserInput()
- $url = URL::fromUserInput($uri_path, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUserInput: ' . $url . ' expected: ' . $expected);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceTrustedHostTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceTrustedHostTest.php
deleted file mode 100644
index 612f9ca06..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceTrustedHostTest.php
+++ /dev/null
@@ -1,84 +0,0 @@
- 'page',
- 'title' => 'foo',
- DOMAIN_SOURCE_FIELD => $id,
- ];
- $node = $this->createNode($node_values);
-
- // Variables for our tests.
- $path = 'node/1';
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $source = $domains[$id];
- $expected = $source->getPath() . $path;
- $route_name = 'entity.node.canonical';
- $route_parameters = ['node' => 1];
- $options = [];
-
- // Get the link using Url::fromRoute().
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- $this->assertTrue($url == $expected, 'fromRoute');
-
- // Set up two additional domains.
- $domain2 = $domains['two_example_com'];
-
- // Check against trusted host patterns.
- $settings['settings']['trusted_host_patterns'] = (object) [
- 'value' => ['^' . $this->prepareTrustedHostname($domain2->getHostname()) . '$'],
- 'required' => TRUE,
- ];
- $this->writeSettings($settings);
- // This URL should fail due to trusted host omission.
- $this->drupalGet($url);
- $this->assertRaw('The provided host name is not valid for this server.');
-
- // Now switch the node to a domain that is trusted.
- $node->{DOMAIN_SOURCE_FIELD} = $domain2->id();
- $node->save();
- // Get the link using Url::fromRoute().
- $expected = $domain2->getPath() . $path;
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- // Assert that the URL is what we expect.
- $this->assertTrue($url == $expected, 'fromRoute');
- $this->drupalGet($url);
- $this->assertResponse(200, 'Url is validated by trusted host settings.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceUrlTest.php b/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceUrlTest.php
deleted file mode 100644
index 03c5b344e..000000000
--- a/sites/all/modules/contrib/admin/domain/domain_source/tests/src/Functional/DomainSourceUrlTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
- 'page',
- 'title' => 'foo',
- DOMAIN_SOURCE_FIELD => $id,
- ];
- $node = $this->createNode($nodes_values);
-
- // Variables for our tests.
- $path = 'node/1';
- $domains = \Drupal::entityTypeManager()->getStorage('domain')->loadMultiple();
- $source = $domains[$id];
- $expected = $source->getPath() . $path;
- $route_name = 'entity.node.canonical';
- $route_parameters = ['node' => 1];
- $uri = 'entity:' . $path;
- $uri_path = '/' . $path;
- $options = [];
-
- // Get the link using Url::fromRoute().
- $url = URL::fromRoute($route_name, $route_parameters, $options)->toString();
- $this->assertTrue($url == $expected, 'fromRoute');
-
- // Get the link using Url::fromUserInput()
- $url = URL::fromUserInput($uri_path, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUserInput');
-
- // Get the link using Url::fromUri()
- $url = URL::fromUri($uri, $options)->toString();
- $this->assertTrue($url == $expected, 'fromUri');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/LICENSE.txt b/sites/all/modules/contrib/admin/domain_menu_access/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/config/install/domain_menu_access.settings.yml b/sites/all/modules/contrib/admin/domain_menu_access/config/install/domain_menu_access.settings.yml
deleted file mode 100644
index a144636ee..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/config/install/domain_menu_access.settings.yml
+++ /dev/null
@@ -1 +0,0 @@
-menu_enabled: []
\ No newline at end of file
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_access.yml b/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_access.yml
deleted file mode 100644
index bbdb9fee6..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_access.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - menu_link_content
-id: menu_link_content.field_domain_access
-field_name: field_domain_access
-entity_type: menu_link_content
-type: entity_reference
-settings:
- target_type: domain
-module: core
-locked: false
-cardinality: -1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_all_affiliates.yml b/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_all_affiliates.yml
deleted file mode 100644
index 47842d3ce..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/config/install/field.storage.menu_link_content.field_domain_all_affiliates.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - domain
- - menu_link_content
-id: menu_link_content.field_domain_all_affiliates
-field_name: field_domain_all_affiliates
-entity_type: menu_link_content
-type: boolean
-settings: { }
-module: core
-locked: false
-cardinality: 1
-translatable: true
-indexes: { }
-persist_with_no_fields: false
-custom_storage: false
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/config/schema/domain_menu_access.scheme.yml b/sites/all/modules/contrib/admin/domain_menu_access/config/schema/domain_menu_access.scheme.yml
deleted file mode 100644
index 49c9ece81..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/config/schema/domain_menu_access.scheme.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-domain_menu_access.menu_enabled:
- type: sequence
- label: 'Menu enabled'
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.info.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.info.yml
deleted file mode 100644
index c8d1ec748..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.info.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: Domain Menu Access
-description: 'Domain-based access control for menu link.'
-type: module
-package: Domain
-# core: 8.x
-dependencies:
- - domain:domain
- - domain:domain_access
-
-# Information added by Drupal.org packaging script on 2018-10-25
-version: '8.x-1.0-alpha2+2-dev'
-core: '8.x'
-project: 'domain_menu_access'
-datestamp: 1540442284
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.install b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.install
deleted file mode 100644
index 7b88e5388..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.install
+++ /dev/null
@@ -1,38 +0,0 @@
- 'menu_link_content',
- 'label' => 'Send for all affiliates',
- 'description' => 'Make this menu entry available on all domains.',
- ];
- domain_access_confirm_fields('menu_link_content', 'menu_link_content', $text);
-}
-
-/**
- * Implements hook_uninstall().
- *
- * Removes access control fields on uninstall.
- */
-function domain_menu_access_uninstall() {
- $field_storage_config = \Drupal::entityTypeManager()
- ->getStorage('field_storage_config');
-
- $id = 'menu_link_content.' . DOMAIN_ACCESS_FIELD;
- if ($field = $field_storage_config->load($id)) {
- $field->delete();
- }
- $id = 'menu_link_content.' . DOMAIN_ACCESS_ALL_FIELD;
- if ($field = $field_storage_config->load($id)) {
- $field->delete();
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.menu.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.menu.yml
deleted file mode 100644
index 99368c36b..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.menu.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-domain_menu_access.domain_menu:
- title: Domain menu settings
- route_name: domain_menu_access.settings
- description: 'Manage menu settings for specific domains.'
- parent: domain.admin
- weight: 10
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.task.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.task.yml
deleted file mode 100644
index 1df099e6a..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.links.task.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-domain_menu_access.admin:
- title: Domain menu settings
- route_name: domain_menu_access.settings
- base_route: domain.admin
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.module b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.module
deleted file mode 100644
index 46c5d83ca..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.module
+++ /dev/null
@@ -1,54 +0,0 @@
-getFormObject();
- /** @var \Drupal\menu_link_content\Entity\MenuLinkContent $entity */
- $entity = $form_object->getEntity();
-
- $config = \Drupal::config('domain_menu_access.settings')->get('menu_enabled');
-
- if (!empty($config) && in_array($entity->getMenuName(), $config)) {
- $form['domain'] = [
- '#type' => 'details',
- '#title' => t('Domain'),
- '#open' => TRUE,
- '#weight' => 25,
- ];
-
- $form[DOMAIN_ACCESS_FIELD]['#group'] = 'domain';
- $form[DOMAIN_ACCESS_ALL_FIELD]['#group'] = 'domain';
-
- // Add the options hidden from the user silently to the form.
- $manager = \Drupal::service('domain.element_manager');
- $form = $manager->setFormOptions($form, $form_state, DOMAIN_ACCESS_FIELD);
- }
- else {
- $form[DOMAIN_ACCESS_FIELD]['#access'] = FALSE;
- $form[DOMAIN_ACCESS_ALL_FIELD]['#access'] = FALSE;
- }
-}
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.routing.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.routing.yml
deleted file mode 100644
index db9a5386d..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-domain_menu_access.settings:
- path: '/admin/config/domain/domain_menu_access/config'
- defaults:
- _form: '\Drupal\domain_menu_access\Form\DomainMenuAccessSettingsForm'
- _title: 'Domain menu configuration'
- requirements:
- _permission: 'administer domains'
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.services.yml b/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.services.yml
deleted file mode 100644
index d7e0f971e..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/domain_menu_access.services.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-services:
- domain_menu_access.default_tree_manipulators:
- class: Drupal\domain_menu_access\Menu\DomainMenuLinkTreeManipulators
- arguments: ['@entity_type.manager', '@domain.negotiator', '@language_manager']
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/src/Form/DomainMenuAccessSettingsForm.php b/sites/all/modules/contrib/admin/domain_menu_access/src/Form/DomainMenuAccessSettingsForm.php
deleted file mode 100644
index 30a9aa85a..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/src/Form/DomainMenuAccessSettingsForm.php
+++ /dev/null
@@ -1,78 +0,0 @@
-config('domain_menu_access.settings')->get('menu_enabled');
- if (!$config) {
- $config = [];
- }
-
- $menu = Menu::loadMultiple();
- if (empty($menu)) {
- $form['markup'] = [
- '#markup' => $this->t('Your menu list is empty. Please, try add the menu and return here.'),
- ];
- }
- else {
- $form['description'] = [
- '#markup' => $this->t('Please, select menu for enable control by domain records.'),
- ];
- /** @var \Drupal\system\Entity\Menu $item */
- foreach ($menu as $key => $item) {
- $form[$key] = [
- '#type' => 'checkbox',
- '#title' => $item->label(),
- '#default_value' => in_array($key, $config) ? '1' : '',
- '#description' => $item->getDescription(),
- ];
- }
- }
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $config = $this->config('domain_menu_access.settings');
- $menu = array_keys(Menu::loadMultiple());
- if (!empty($menu) && !empty($form_state->getValues())) {
- $menu_enabled = [];
- $values = $form_state->getValues();
- foreach ($values as $key => $value) {
- if ($value && in_array($key, $menu)) {
- $menu_enabled[] = $key;
- }
- }
- $config->set('menu_enabled', $menu_enabled);
- $config->save();
- }
- parent::submitForm($form, $form_state);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php b/sites/all/modules/contrib/admin/domain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php
deleted file mode 100644
index 3f8b3577b..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php
+++ /dev/null
@@ -1,194 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->domainNegotiator = $domain_negotiator;
- $this->languageManager = $language_manager;
- }
-
- /**
- * Performs access checking for menu link content in an optimized way.
- *
- * This manipulator should be added after the generic ::checkAccess().
- *
- * @param \Drupal\Core\Menu\MenuLinkTreeElement[] $tree
- * The menu link tree to manipulate.
- *
- * @return \Drupal\Core\Menu\MenuLinkTreeElement[]
- * The manipulated menu link tree.
- */
- public function checkDomain(array $tree) {
- $current_language = $this->languageManager->getCurrentLanguage();
-
- foreach ($tree as $key => $element) {
- // Other menu tree manipulators may already have calculated access, do not
- // overwrite the existing value in that case if already forbidden.
- if (!isset($element->access) || $tree[$key]->access->isAllowed()) {
- if ($access = $this->menuLinkCheckAccess($element->link, $current_language)) {
- if ($access->isForbidden()) {
- $tree[$key]->access = $access;
- // Secure unavailable menu link.
- $tree[$key]->link = new InaccessibleMenuLink($tree[$key]->link);
- $tree[$key]->subtree = [];
- }
- elseif ($tree[$key]->subtree) {
- $tree[$key]->subtree = $this->checkDomain($tree[$key]->subtree);
- }
- }
- }
-
- if (isset($tree[$key]->access)) {
- $tree[$key]->access->addCacheContexts(['url.site']);
- }
- }
-
- return $tree;
- }
-
- /**
- * Checks access for one menu link instance.
- *
- * @param \Drupal\Core\Menu\MenuLinkInterface $instance
- * The menu link instance.
- * @param \Drupal\Core\Language\LanguageInterface $current_language
- * The current language.
- *
- * @return \Drupal\Core\Access\AccessResultInterface|NULL
- * The access result.
- */
- protected function menuLinkCheckAccess(MenuLinkInterface $instance, LanguageInterface $current_language) {
- // Default access.
- $access_result = AccessResult::allowed();
-
- /** @var MenuLinkContent $entity */
- if ($entity = $this->loadMenuLinkContentEntity($instance)) {
- if ($entity->hasTranslation($current_language->getId())) {
- $entity = $entity->getTranslation($current_language->getId());
- }
-
- if (!$this->isAvailableOnAllAffiliates($entity)) {
- $domain_access = [];
- foreach ($entity->get(DOMAIN_ACCESS_FIELD)->getValue() as $reference) {
- $domain_access[] = $reference['target_id'];
- }
-
- $active_domain = $this->domainNegotiator->getActiveDomain();
- if (($active_domain instanceof DomainInterface) && !in_array($active_domain->getOriginalId(), $domain_access)) {
- $access_result = AccessResult::forbidden();
- }
- }
- }
-
- return $access_result->cachePerPermissions();
- }
-
- /**
- * Check if menu link content is allowed on all affiliates.
- *
- * @param \Drupal\menu_link_content\Entity\MenuLinkContent $entity
- * Menu link content.
- *
- * @return bool
- */
- protected function isAvailableOnAllAffiliates(MenuLinkContent $entity) {
- if ($entity->get(DOMAIN_ACCESS_ALL_FIELD)->isEmpty()) {
- return FALSE;
- }
-
- $all_affiliates = $entity->get(DOMAIN_ACCESS_ALL_FIELD)
- ->first()
- ->getString();
-
- return !empty($all_affiliates);
- }
-
- /**
- * Load menu link content from menu link entry.
- *
- * @param \Drupal\Core\Menu\MenuLinkInterface $instance
- * The menu link instance.
- *
- * @return \Drupal\menu_link_content\Entity\MenuLinkContent
- * The menu link entity.
- */
- protected function loadMenuLinkContentEntity(MenuLinkInterface $instance) {
- $storage = $this->entityTypeManager->getStorage('menu_link_content');
- $entity = NULL;
-
- if (!empty($instance->getPluginDefinition()['metadata']['entity_id'])) {
- $entity_id = $instance->getPluginDefinition()['metadata']['entity_id'];
- // Make sure the current ID is in the list, since each plugin empties
- // the list after calling loadMultiple(). Note that the list may include
- // multiple IDs added earlier in each plugin's constructor.
- static::$entityIdsToLoad[$entity_id] = $entity_id;
- $entities = $storage->loadMultiple(array_values(static::$entityIdsToLoad));
- $entity = isset($entities[$entity_id]) ? $entities[$entity_id] : NULL;
- static::$entityIdsToLoad = [];
- }
-
- if (!$entity) {
- // Fallback to the loading by the UUID.
- if ($uuid = $instance->getDerivativeId()) {
- $loaded_entities = $storage->loadByProperties(['uuid' => $uuid]);
- $entity = reset($loaded_entities);
- }
- }
-
- return $entity;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php b/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php
deleted file mode 100644
index 61a084c6c..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php
+++ /dev/null
@@ -1,81 +0,0 @@
-getDerivativeId();
-
- // Fallback on default menu if not restricted by domain.
- if (!$this->isDomainRestricted($menu_name)) {
- return parent::build();
- }
- $parameters = $this->menuTree->getCurrentRouteMenuTreeParameters($menu_name);
-
- // Adjust the menu tree parameters based on the block's configuration.
- $level = $this->configuration['level'];
- $depth = $this->configuration['depth'];
- $parameters->setMinDepth($level);
-
- // When the depth is configured to zero, there is no depth limit. When depth
- // is non-zero, it indicates the number of levels that must be displayed.
- // Hence this is a relative depth that we must convert to an actual
- // (absolute) depth, that may never exceed the maximum depth.
- if ($depth > 0) {
- $parameters->setMaxDepth(min($level + $depth - 1, $this->menuTree->maxDepth()));
- }
-
- $tree = $this->menuTree->load($menu_name, $parameters);
- $manipulators = [
- ['callable' => 'menu.default_tree_manipulators:checkAccess'],
- ['callable' => 'domain_menu_access.default_tree_manipulators:checkDomain'],
- ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
- ];
- $tree = $this->menuTree->transform($tree, $manipulators);
-
- return $this->menuTree->build($tree);
- }
-
- /**
- * Check if domain access has been enabled on this menu.
- *
- * @param string $menu_name
- * Menu name.
- *
- * @return bool
- * Config enabled.
- */
- protected function isDomainRestricted($menu_name) {
- $config = \Drupal::config('domain_menu_access.settings')
- ->get('menu_enabled');
-
- return in_array($menu_name, $config);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCacheContexts() {
- return Cache::mergeContexts(parent::getCacheContexts(), ['url.site']);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Derivative/DomainMenuAccessMenuBlock.php b/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Derivative/DomainMenuAccessMenuBlock.php
deleted file mode 100644
index 499fc4c92..000000000
--- a/sites/all/modules/contrib/admin/domain_menu_access/src/Plugin/Derivative/DomainMenuAccessMenuBlock.php
+++ /dev/null
@@ -1,65 +0,0 @@
-config = $config;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, $base_plugin_id) {
- return new static(
- $container->get('entity.manager')->getStorage('menu'),
- $container->get('config.factory')->get('domain_menu_access.settings')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDerivativeDefinitions($base_plugin_definition) {
- $menu_enabled = $this->config->get('menu_enabled');
-
- foreach ($this->menuStorage->loadMultiple() as $menu => $entity) {
- if (in_array($menu, $menu_enabled)) {
- $this->derivatives[$menu] = $base_plugin_definition;
- $this->derivatives[$menu]['admin_label'] = $entity->label();
- $this->derivatives[$menu]['config_dependencies']['config'] = [$entity->getConfigDependencyName()];
- }
- }
-
- return $this->derivatives;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/2930391-21.patch b/sites/all/modules/contrib/admin/domain_site_settings/2930391-21.patch
deleted file mode 100644
index e362363d2..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/2930391-21.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff --git a/domain_site_settings.services.yml b/domain_site_settings.services.yml
-index 65e9113..6ebd87d 100644
---- a/domain_site_settings.services.yml
-+++ b/domain_site_settings.services.yml
-@@ -1,6 +1,6 @@
- services:
- domain_site_settings.overrider:
- class: \Drupal\domain_site_settings\Configuration\DomainConfigOverride
-- arguments: ['@domain.negotiator', '@config.factory']
-+ arguments: ['@config.factory']
- tags:
- - {name: config.factory.override, priority: 5}
-diff --git a/src/Configuration/DomainConfigOverride.php b/src/Configuration/DomainConfigOverride.php
-index 272e052..8497e2a 100644
---- a/src/Configuration/DomainConfigOverride.php
-+++ b/src/Configuration/DomainConfigOverride.php
-@@ -16,13 +16,6 @@ use Drupal\Core\Config\ConfigFactoryInterface;
- class DomainConfigOverride implements ConfigFactoryOverrideInterface {
-
- /**
-- * The Domain negotiator.
-- *
-- * @var \Drupal\domain\DomainNegotiatorInterface
-- */
-- protected $negotiator;
--
-- /**
- * The config factory.
- *
- * @var \Drupal\Core\Config\ConfigFactoryInterface
-@@ -32,15 +25,10 @@ class DomainConfigOverride implements ConfigFactoryOverrideInterface {
- /**
- * Constructs a DomainSourcePathProcessor object.
- *
-- * @param \Drupal\domain\DomainNegotiatorInterface $negotiator
-- * The domain negotiator.
- * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
- * The module handler service.
- */
-- public function __construct(
-- DomainNegotiatorInterface $negotiator,
-- ConfigFactoryInterface $config_factory) {
-- $this->negotiator = $negotiator;
-+ public function __construct(ConfigFactoryInterface $config_factory) {
- $this->configFactory = $config_factory;
- }
-
-@@ -57,7 +45,9 @@ class DomainConfigOverride implements ConfigFactoryOverrideInterface {
- public function loadOverrides($names = []) {
- $overrides = [];
- if (in_array('system.site', $names)) {
-- $domain = $this->negotiator->getActiveDomain();
-+ /* @var \Drupal\domain\DomainNegotiator $negotiator */
-+ $negotiator = \Drupal::service('domain.negotiator');
-+ $domain = $negotiator->getActiveDomain();
- if (!empty($domain)) {
- $domain_key = $domain->id();
- $configFactory = $this->configFactory->get('domain_site_settings.domainconfigsettings');
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/LICENSE.txt b/sites/all/modules/contrib/admin/domain_site_settings/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/README.md b/sites/all/modules/contrib/admin/domain_site_settings/README.md
deleted file mode 100644
index 3987015b1..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-Domain Site Settings
-====================
-
-Domain Site Settings module for Drupal 8 community users.
-
-* This module provide the administrator interface
-to manage the site basic setting for each domain.
-
-Configuration:
---------------
-Domain Site Settings module have configuration setting page
-to set site basic setting against each domains
-like 'Site name', 'Slogan', 'Email', 'Front page', '404 page' and '403 page'.
-
-Configuration page path:
-/admin/config/domain/domain_site_settings
-
-Dependencies:
--------------
-- domain
-- domain_config
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/composer.json b/sites/all/modules/contrib/admin/domain_site_settings/composer.json
deleted file mode 100644
index f1c0beafd..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/composer.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "name": "drupal/domain_site_settings",
- "type": "drupal-module",
- "description": "Basic Site Setting for Domains.",
- "keywords": ["Drupal"],
- "license": "GPL-2.0+",
- "homepage": "https://www.drupal.org/project/domain_site_settings",
- "minimum-stability": "dev",
- "support": {
- "issues": "https://www.drupal.org/project/issues/domain_site_settings",
- "source": "http://cgit.drupalcode.org/domain_site_settings"
- },
- "require": { }
-}
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/config/install/domain_site_settings.domainconfigsettings.yml b/sites/all/modules/contrib/admin/domain_site_settings/config/install/domain_site_settings.domainconfigsettings.yml
deleted file mode 100644
index d267dfd6b..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/config/install/domain_site_settings.domainconfigsettings.yml
+++ /dev/null
@@ -1 +0,0 @@
-domain_site_settings:
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.info.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.info.yml
deleted file mode 100644
index cc1b1a98c..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.info.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Domain Site Settings
-type: module
-description: 'Basic Site Setting for Domains.'
-dependencies:
- - domain:domain
- - domain:domain_config
-
-package: Domain
-# core: 8.x
-configure: domain_site_settings.list
-
-# Information added by Drupal.org packaging script on 2018-09-23
-version: '8.x-1.3'
-core: '8.x'
-project: 'domain_site_settings'
-datestamp: 1537684984
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.menu.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.menu.yml
deleted file mode 100644
index 80d81683b..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.menu.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-domain_site_settings.menu_domain_list:
- title: Domains site settings
- route_name: domain_site_settings.list
- description: 'Change domains site name, email address, slogan, default front page, and error pages.'
- parent: domain.admin
- weight: 10
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.task.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.task.yml
deleted file mode 100644
index fbabcf834..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.links.task.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-domain_site_settings.admin:
- title: Domains site settings
- route_name: domain_site_settings.list
- base_route: domain.admin
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.permissions.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.permissions.yml
deleted file mode 100644
index 00700cb42..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.permissions.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-domain site settings:
- title: 'Domain site settings'
- description: 'Allow to access the domain site settings'
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.routing.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.routing.yml
deleted file mode 100644
index ddde0d9e8..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.routing.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-domain_site_settings.list:
- path: '/admin/config/domain/domain_site_settings'
- defaults:
- _controller: '\Drupal\domain_site_settings\Controller\DomainSiteSettingsController::domainList'
- _title: 'Domains sites list'
- requirements:
- _permission: 'domain site settings'
- options:
- _admin_route: TRUE
-domain_site_settings.config_form:
- path: '/admin/config/domain/domain_site_settings/{domain_id}/edit'
- defaults:
- _form: '\Drupal\domain_site_settings\Form\DomainConfigSettingsForm'
- _title: 'Domain site settings'
- requirements:
- _permission: 'domain site settings'
- options:
- _admin_route: TRUE
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.services.yml b/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.services.yml
deleted file mode 100644
index 6ebd87db9..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/domain_site_settings.services.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-services:
- domain_site_settings.overrider:
- class: \Drupal\domain_site_settings\Configuration\DomainConfigOverride
- arguments: ['@config.factory']
- tags:
- - {name: config.factory.override, priority: 5}
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/src/Configuration/DomainConfigOverride.php b/sites/all/modules/contrib/admin/domain_site_settings/src/Configuration/DomainConfigOverride.php
deleted file mode 100644
index 8497e2a2a..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/src/Configuration/DomainConfigOverride.php
+++ /dev/null
@@ -1,131 +0,0 @@
-configFactory = $config_factory;
- }
-
- /**
- * Returns config overrides.
- *
- * @param array $names
- * A list of configuration names that are being loaded.
- *
- * @return array
- * An array keyed by configuration name of override data. Override data
- * contains a nested array structure of overrides.
- */
- public function loadOverrides($names = []) {
- $overrides = [];
- if (in_array('system.site', $names)) {
- /* @var \Drupal\domain\DomainNegotiator $negotiator */
- $negotiator = \Drupal::service('domain.negotiator');
- $domain = $negotiator->getActiveDomain();
- if (!empty($domain)) {
- $domain_key = $domain->id();
- $configFactory = $this->configFactory->get('domain_site_settings.domainconfigsettings');
- if ($configFactory->get($domain_key) !== NULL) {
- $site_name = $configFactory->get($domain_key . '.site_name');
- $site_slogan = $configFactory->get($domain_key . '.site_slogan');
- $site_mail = $configFactory->get($domain_key . '.site_mail');
- $site_403 = $configFactory->get($domain_key . '.site_403');
- $site_404 = $configFactory->get($domain_key . '.site_404');
- $site_front = $configFactory->get($domain_key . '.site_frontpage');
- $front = ($site_front !== \NULL) ? $site_front : '/node';
-
- // Create the new settings array to override the configuration.
- $overrides['system.site'] = [
- 'name' => $site_name,
- 'slogan' => $site_slogan,
- 'mail' => $site_mail,
- 'page' => [
- '403' => $site_403,
- '404' => $site_404,
- 'front' => $front,
- ],
- ];
- }
- }
- }
- return $overrides;
- }
-
- /**
- * The string to append to the configuration static cache name.
- *
- * @return string
- * A string to append to the configuration static cache name.
- */
- public function getCacheSuffix() {
- return 'MultiSiteConfigurationOverrider';
- }
-
- /**
- * Gets the cacheability metadata associated with the config factory override.
- *
- * @param string $name
- * The name of the configuration override to get metadata for.
- *
- * @return \Drupal\Core\Cache\CacheableMetadata
- * A cacheable metadata object.
- */
- public function getCacheableMetadata($name) {
- return new CacheableMetadata();
- }
-
- /**
- * Creates a configuration object for use during install and synchronization.
- *
- * If the overrider stores its overrides in configuration collections then
- * it can have its own implementation of
- * \Drupal\Core\Config\StorableConfigBase. Configuration overriders can link
- * themselves to a configuration collection by listening to the
- * \Drupal\Core\Config\ConfigEvents::COLLECTION_INFO event and adding the
- * collections they are responsible for. Doing this will allow installation
- * and synchronization to use the overrider's implementation of
- * StorableConfigBase.
- *
- * @see \Drupal\Core\Config\ConfigCollectionInfo
- * @see \Drupal\Core\Config\ConfigImporter::importConfig()
- * @see \Drupal\Core\Config\ConfigInstaller::createConfiguration()
- *
- * @param string $name
- * The configuration object name.
- * @param string $collection
- * The configuration collection.
- *
- * @return \Drupal\Core\Config\StorableConfigBase
- * The configuration object for the provided name and collection.
- */
- public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) {
- return NULL;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/src/Controller/DomainSiteSettingsController.php b/sites/all/modules/contrib/admin/domain_site_settings/src/Controller/DomainSiteSettingsController.php
deleted file mode 100644
index b5a3d512c..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/src/Controller/DomainSiteSettingsController.php
+++ /dev/null
@@ -1,84 +0,0 @@
-domainLoader = $domain_loader;
- }
-
- /**
- * Create function return static domain loader configuration.
- *
- * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
- * Load the ContainerInterface.
- *
- * @return \static
- * return domain loader configuration.
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('domain.loader')
- );
- }
-
- /**
- * Function Provide the list of modules.
- *
- * @return typearray
- * Domain list.
- */
- public function domainList() {
- $domains = $this->domainLoader->loadMultipleSorted();
- $rows = [];
- /** @var \Drupal\domain\DomainInterface $domain */
- foreach ($domains as $domain) {
- $row = [
- $domain->label(),
- $domain->getCanonical(),
- Link::fromTextAndUrl($this->t('Edit'), Url::fromRoute('domain_site_settings.config_form', ['domain_id' => $domain->id()])),
- ];
- $rows[] = $row;
- }
- // Build a render array which will be themed as a table.
- $build['pager_example'] = [
- '#rows' => $rows,
- '#header' => [
- $this->t('Name'),
- $this->t('Hostname'),
- $this->t('Edit Settings'),
- ],
- '#type' => 'table',
- '#empty' => $this->t('No domain record found.'),
- ];
- return $build;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/src/Form/DomainConfigSettingsForm.php b/sites/all/modules/contrib/admin/domain_site_settings/src/Form/DomainConfigSettingsForm.php
deleted file mode 100644
index 21b429035..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/src/Form/DomainConfigSettingsForm.php
+++ /dev/null
@@ -1,235 +0,0 @@
-aliasManager = $alias_manager;
- $this->pathValidator = $path_validator;
- $this->requestContext = $request_context;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('config.factory'), $container->get('path.alias_manager'), $container->get('path.validator'), $container->get('router.request_context')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getEditableConfigNames() {
- return [
- 'domain_site_settings.domainconfigsettings',
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'domain_config_settings_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $config = $this->config('domain_site_settings.domainconfigsettings');
- $domain_id = $this->getRequest()->get('domain_id');
- $site_config = $this->config('system.site');
- $site_mail = $site_config->get('mail');
- if (empty($site_mail)) {
- $site_mail = ini_get('sendmail_from');
- }
- if ($config->get($domain_id) != NULL) {
- $site_mail = $config->get($domain_id . '.site_mail');
- }
-
- $form['site_information'] = [
- '#type' => 'details',
- '#title' => $this->t('Site details'),
- '#open' => TRUE,
- ];
- $form['site_information']['site_name'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Site name'),
- '#default_value' => ($config->get($domain_id) != NULL) ? $config->get($domain_id . '.site_name') : $site_config->get('name'),
- '#required' => TRUE,
- ];
- $form['site_information']['site_slogan'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Slogan'),
- '#default_value' => ($config->get($domain_id) != NULL) ? $config->get($domain_id . '.site_slogan') : $site_config->get('slogan'),
- '#description' => $this->t("How this is used depends on your site's theme."),
- ];
- $form['site_information']['site_mail'] = [
- '#type' => 'email',
- '#title' => $this->t('Email address'),
- '#default_value' => $site_mail,
- '#description' => $this->t("The From address in automated emails sent during registration and new password requests, and other notifications. (Use an address ending in your site's domain to help prevent this email being flagged as spam.)"),
- '#required' => TRUE,
- ];
- $form['front_page'] = [
- '#type' => 'details',
- '#title' => $this->t('Front page'),
- '#open' => TRUE,
- ];
- $front_page = $site_config->get('page.front') != '/user/login' ? $this->aliasManager->getAliasByPath($site_config->get('page.front')) : '';
- $front_page = ($config->get($domain_id) != NULL) ? $config->get($domain_id . '.site_frontpage') : $front_page;
- $form['front_page']['site_frontpage'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Default front page'),
- '#default_value' => $front_page,
- '#size' => 40,
- '#description' => $this->t('Optionally, specify a relative URL to display as the front page. Leave blank to display the default front page.'),
- '#field_prefix' => $this->requestContext->getCompleteBaseUrl(),
- ];
- $form['error_page'] = [
- '#type' => 'details',
- '#title' => $this->t('Error pages'),
- '#open' => TRUE,
- ];
- $form['error_page']['site_403'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Default 403 (access denied) page'),
- '#default_value' => ($config->get($domain_id) !== NULL) ? $config->get($domain_id . '.site_403') : $site_config->get('page.403'),
- '#size' => 40,
- '#description' => $this->t('This page is displayed when the requested document is denied to the current user. Leave blank to display a generic "access denied" page.'),
- ];
- $form['error_page']['site_404'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Default 404 (not found) page'),
- '#default_value' => ($config->get($domain_id) !== NULL) ? $config->get($domain_id . '.site_404') : $site_config->get('page.404'),
- '#size' => 40,
- '#description' => $this->t('This page is displayed when no other content matches the requested document. Leave blank to display a generic "page not found" page.'),
- ];
- $form['domain_id'] = [
- '#type' => 'hidden',
- '#title' => $this->t('Domain ID'),
- '#default_value' => $domain_id,
- ];
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- // Check for empty front page path.
- if ($form_state->isValueEmpty('site_frontpage')) {
- // Set to default "user/login".
- $form_state->setValueForElement($form['front_page']['site_frontpage'], '/user/login');
- }
- else {
- // Get the normal path of the front page.
- $form_state->setValueForElement($form['front_page']['site_frontpage'], $this->aliasManager->getPathByAlias($form_state->getValue('site_frontpage')));
- }
- // Validate front page path.
- if (($value = $form_state->getValue('site_frontpage')) && $value[0] !== '/') {
- $form_state->setErrorByName('site_frontpage', $this->t("The path '%path' has to start with a slash.", ['%path' => $form_state->getValue('site_frontpage')]));
- }
- if (!$this->pathValidator->isValid($form_state->getValue('site_frontpage'))) {
- $form_state->setErrorByName('site_frontpage', $this->t("The path '%path' is either invalid or you do not have access to it.", ['%path' => $form_state->getValue('site_frontpage')]));
- }
- // Get the normal paths of both error pages.
- if (!$form_state->isValueEmpty('site_403')) {
- $form_state->setValueForElement($form['error_page']['site_403'], $this->aliasManager->getPathByAlias($form_state->getValue('site_403')));
- }
- if (!$form_state->isValueEmpty('site_404')) {
- $form_state->setValueForElement($form['error_page']['site_404'], $this->aliasManager->getPathByAlias($form_state->getValue('site_404')));
- }
- if (($value = $form_state->getValue('site_403')) && $value[0] !== '/') {
- $form_state->setErrorByName('site_403', $this->t("The path '%path' has to start with a slash.", ['%path' => $form_state->getValue('site_403')]));
- }
- if (($value = $form_state->getValue('site_404')) && $value[0] !== '/') {
- $form_state->setErrorByName('site_404', $this->t("The path '%path' has to start with a slash.", ['%path' => $form_state->getValue('site_404')]));
- }
- // Validate 403 error path.
- if (!$form_state->isValueEmpty('site_403') && !$this->pathValidator->isValid($form_state->getValue('site_403'))) {
- $form_state->setErrorByName('site_403', $this->t("The path '%path' is either invalid or you do not have access to it.", ['%path' => $form_state->getValue('site_403')]));
- }
- // Validate 404 error path.
- if (!$form_state->isValueEmpty('site_404') && !$this->pathValidator->isValid($form_state->getValue('site_404'))) {
- $form_state->setErrorByName('site_404', $this->t("The path '%path' is either invalid or you do not have access to it.", ['%path' => $form_state->getValue('site_404')]));
- }
-
- parent::validateForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- parent::submitForm($form, $form_state);
-
- $domain_id = $form_state->getValue('domain_id');
- $site_name = $form_state->getValue('site_name');
- $site_slogan = $form_state->getValue('site_slogan');
- $site_mail = $form_state->getValue('site_mail');
- $site_frontpage = $form_state->getValue('site_frontpage');
- $site_403 = $form_state->getValue('site_403');
- $site_404 = $form_state->getValue('site_404');
- $config = $this->config('domain_site_settings.domainconfigsettings');
- $config->set($domain_id . '.site_name', $site_name);
- $config->set($domain_id . '.site_slogan', $site_slogan);
- $config->set($domain_id . '.site_mail', $site_mail);
- $config->set($domain_id . '.site_frontpage', $site_frontpage);
- $config->set($domain_id . '.site_403', $site_403);
- $config->set($domain_id . '.site_404', $site_404);
- $config->save();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/domain_site_settings/src/Tests/LoadTest.php b/sites/all/modules/contrib/admin/domain_site_settings/src/Tests/LoadTest.php
deleted file mode 100644
index e80a943af..000000000
--- a/sites/all/modules/contrib/admin/domain_site_settings/src/Tests/LoadTest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-user = $this->drupalCreateUser(['administer site configuration']);
- $this->drupalLogin($this->user);
- }
-
- /**
- * Tests that the home page loads with a 200 response.
- */
- public function testLoad() {
- $this->drupalGet(Url::fromRoute(''));
- $this->assertResponse(200);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/features/LICENSE.txt b/sites/all/modules/contrib/admin/features/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/features/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/features/composer.json b/sites/all/modules/contrib/admin/features/composer.json
deleted file mode 100644
index de7ea040a..000000000
--- a/sites/all/modules/contrib/admin/features/composer.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "description": "Enables administrators to package configuration into modules",
- "license": "GPL-2.0+",
- "minimum-stability": "dev",
- "name": "drupal/features",
- "require": {
- "drupal/config_update": "^1.4"
- },
- "type": "drupal-module",
- "extra": {
- "drush": {
- "services": {
- "drush.services.yml": "^9"
- }
- }
- }
-}
diff --git a/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml b/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml
deleted file mode 100644
index ea4bb8819..000000000
--- a/sites/all/modules/contrib/admin/features/config/install/features.bundle.default.yml
+++ /dev/null
@@ -1,98 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-name: Default
-machine_name: default
-description: ''
-assignments:
- alter:
- core: true
- uuid: true
- user_permissions: true
- enabled: true
- weight: 0
- base:
- types:
- config:
- comment_type: comment_type
- node_type: node_type
- content:
- user: user
- enabled: true
- weight: -2
- core:
- types:
- config:
- date_format: date_format
- field_storage_config: field_storage_config
- entity_form_mode: entity_form_mode
- image_style: image_style
- menu: menu
- responsive_image_style: responsive_image_style
- user_role: user_role
- entity_view_mode: entity_view_mode
- enabled: true
- weight: 5
- dependency:
- enabled: true
- weight: 15
- exclude:
- types:
- config:
- features_bundle: features_bundle
- curated: true
- module:
- installed: true
- profile: true
- namespace: true
- namespace_any: false
- enabled: true
- weight: -5
- existing:
- enabled: true
- weight: 12
- forward_dependency:
- enabled: true
- weight: 4
- namespace:
- enabled: true
- weight: 0
- optional:
- types:
- config: {}
- enabled: true
- weight: 0
- packages:
- enabled: true
- weight: -20
- profile:
- curated: true
- standard:
- files: true
- dependencies: true
- types:
- config:
- block: block
- language_content_settings: language_content_settings
- configurable_language: configurable_language
- migration: migration
- shortcut_set: shortcut_set
- tour: tour
- enabled: true
- weight: 10
- site:
- types:
- config:
- action: action
- contact_form: contact_form
- block_content_type: block_content_type
- rdf_mapping: rdf_mapping
- search_page: search_page
- taxonomy_vocabulary: taxonomy_vocabulary
- editor: editor
- filter_format: filter_format
- enabled: true
- weight: 7
-profile_name: ''
-is_profile: false
-
diff --git a/sites/all/modules/contrib/admin/features/config/install/features.settings.yml b/sites/all/modules/contrib/admin/features/config/install/features.settings.yml
deleted file mode 100644
index ed8b37a57..000000000
--- a/sites/all/modules/contrib/admin/features/config/install/features.settings.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-export:
- folder: 'custom'
-langcode: en
diff --git a/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml b/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml
deleted file mode 100644
index 3d53f1d9f..000000000
--- a/sites/all/modules/contrib/admin/features/config/schema/features.schema.yml
+++ /dev/null
@@ -1,188 +0,0 @@
-features.settings:
- type: config_entity
- label: 'Features settings'
- mapping:
- export:
- type: mapping
- label: "Export settings"
- mapping:
- folder:
- type: string
- label: "Folder"
- langcode:
- type: string
- label: "Language Code"
-
-features.bundle.*:
- type: config_entity
- label: 'Features bundle'
- mapping:
- machine_name:
- type: string
- label: "Machine name"
- name:
- type: string
- label: "Name"
- description:
- type: string
- label: "Description"
- assignments:
- type: sequence
- label: "Assignment"
- sequence:
- type: features.assignment.[%key]
- profile_name:
- type: string
- label: "Profile name"
- is_profile:
- type: boolean
- label: "Is install profile"
-
-features.assignment.settings:
- type: mapping
- label: "Assignment settings"
- mapping:
- enabled:
- type: boolean
- label: "Enabled"
- weight:
- type: integer
- label: "Weight"
-
-features.assignment.*:
- type: features.assignment.settings
-
-features.assignment.base:
- type: features.assignment.settings
- label: "Base type"
- mapping:
- types:
- type: mapping
- label: "Types"
- mapping:
- config:
- type: sequence
- label: "Configuration Types"
- sequence:
- type: string
- content:
- type: sequence
- label: "Content entity types"
- sequence:
- type: string
-
-features.assignment.core:
- type: features.assignment.settings
- label: "Core type"
- mapping:
- types:
- type: mapping
- label: "Types"
- mapping:
- config:
- type: sequence
- label: "Configuration Types"
- sequence:
- type: string
-
-features.assignment.exclude:
- type: features.assignment.settings
- label: "Exclude"
- mapping:
- types:
- type: mapping
- label: "Types"
- mapping:
- config:
- type: sequence
- label: "Configuration Types"
- sequence:
- type: string
- curated:
- type: boolean
- label: "Exclude designated site-specific configuration"
- module:
- type: mapping
- label: "Module"
- mapping:
- installed:
- type: boolean
- label: "Exclude installed module-provided entity configuration"
- profile:
- type: boolean
- label: "Don't exclude install profile's configuration"
- namespace:
- type: boolean
- label: "Don't exclude non-installed configuration by namespace"
- namespace_any:
- type: boolean
- label: "Don't exclude ANY configuration by namespace"
-
-features.assignment.optional:
- type: features.assignment.settings
- label: "Optional"
- mapping:
- types:
- type: mapping
- label: "Types"
- mapping:
- config:
- type: sequence
- label: "Configuration Types"
- sequence:
- type: string
-
-features.assignment.profile:
- type: features.assignment.settings
- label: "Profile"
- mapping:
- curated:
- type: boolean
- label: "Add commonly-needed configuration"
- standard:
- type: mapping
- label: "Standard"
- mapping:
- files:
- type: boolean
- label: "Add configuration and files from Standard profile"
- dependencies:
- type: boolean
- label: "Add module and theme dependencies from Standard profile"
- types:
- type: mapping
- label: "Types"
- mapping:
- config:
- type: sequence
- label: "Configuration Types"
- sequence:
- type: string
-
-features.assignment.site:
- type: features.assignment.settings
- label: "Site"
- mapping:
- types:
- type: mapping
- label: "Types"
- mapping:
- config:
- type: sequence
- label: "Configuration Types"
- sequence:
- type: string
-
-features.assignment.alter:
- type: features.assignment.settings
- label: "Alter"
- mapping:
- core:
- type: boolean
- label: "Core"
- uuid:
- type: boolean
- label: "UUID"
- user_permissions:
- type: boolean
- label: "User permissions"
diff --git a/sites/all/modules/contrib/admin/features/drush.services.yml b/sites/all/modules/contrib/admin/features/drush.services.yml
deleted file mode 100644
index 16b0f29c8..000000000
--- a/sites/all/modules/contrib/admin/features/drush.services.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-services:
- features.commands:
- class: \Drupal\features\Commands\FeaturesCommands
- arguments:
- - '@features_assigner'
- - '@features.manager'
- - '@features_generator'
- - '@config_update.config_diff'
- - '@config.storage'
- tags:
- - { name: drush.command }
diff --git a/sites/all/modules/contrib/admin/features/drush/features.drush8.inc b/sites/all/modules/contrib/admin/features/drush/features.drush8.inc
deleted file mode 100644
index 35a76abe8..000000000
--- a/sites/all/modules/contrib/admin/features/drush/features.drush8.inc
+++ /dev/null
@@ -1,912 +0,0 @@
- 'Display current Features settings.',
- 'aliases' => ['fs'],
- ];
-
- $items['features-list-packages'] = [
- 'description' => 'Display a list of all existing features and packages available to be generated. If a package name is provided as an argument, then all of the configuration objects assigned to that package will be listed.',
- 'examples' => [
- "drush features-list-packages" => 'Display a list of all existing featurea and packages available to be generated.',
- "drush features-list-packages 'example_article'" => "Display a list of all configuration objects assigned to the 'example_article' package.",
- ],
- 'arguments' => [
- 'package' => 'The package to list. Optional; if specified, lists all configuration objects assigned to that package. If no package is specified, lists all of the features.',
- ],
- 'outputformat' => [
- 'default' => 'table',
- 'pipe-format' => 'list',
- 'field-labels' => [
- 'name' => 'Name',
- 'machine_name' => 'Machine name',
- 'status' => 'Status',
- 'version' => 'Version',
- 'state' => 'State',
- 'object' => 'Configuration object',
- ],
- 'output-data-type' => 'format-table',
- ],
- 'aliases' => ['fl'],
- ];
-
- $items['features-import-all'] = [
- 'description' => 'Import module config from all installed features.',
- 'examples' => [
- "drush features-import-all" => 'Import module config from all installed features.',
- ],
- 'aliases' => ['fra', 'fia', 'fim-all'],
- ];
-
- $items['features-export'] = [
- 'description' => "Export the configuration on your site into a custom module.",
- 'arguments' => [
- 'package' => 'A space delimited list of features to export.',
- ],
- 'options' => [
- 'add-profile' => 'Package features into an install profile.',
- ],
- 'examples' => [
- "drush features-export" => 'Export all available packages.',
- "drush features-export example_article example_page" => "Export the example_article and example_page packages.",
- "drush features-export --add-profile" => "Export all available packages and add them to an install profile.",
- ],
- // Add previous "fu" alias for compatibility.
- 'aliases' => ['fex', 'fu', 'fua', 'fu-all'],
- ];
-
- $items['features-add'] = [
- 'description' => "Add a config item to a feature package.",
- 'arguments' => [
- 'feature' => 'Feature package to export and add config to.',
- 'components' => 'Patterns of config to add, see features-components for the format of patterns.',
- ],
- 'aliases' => ['fa', 'fe'],
- ];
-
- $items['features-components'] = [
- 'description' => 'List features components.',
- 'arguments' => [
- 'patterns' => 'The features components type to list. Omit this argument to list all components.',
- ],
- 'options' => [
- 'exported' => [
- 'description' => 'Show only components that have been exported.',
- ],
- 'not-exported' => [
- 'description' => 'Show only components that have not been exported.',
- ],
- ],
- 'aliases' => ['fc'],
- ];
-
- $items['features-diff'] = [
- 'description' => "Show the difference between the active config and the default config stored in a feature package.",
- 'arguments' => [
- 'feature' => 'The feature in question.',
- ],
- 'options' => [
- 'ctypes' => 'Comma separated list of component types to limit the output to. Defaults to all types.',
- 'lines' => 'Generate diffs with lines of context instead of the usual two.',
- ],
- 'aliases' => ['fd'],
- ];
-
- $items['features-import'] = [
- 'description' => "Import a module config into your site.",
- 'arguments' => [
- 'feature' => 'A space delimited list of features or feature:component pairs to import.',
- ],
- 'options' => [
- 'force' => "Force import even if config is not overridden.",
- ],
- 'examples' => [
- 'drush features-import foo:node.type.page foo:taxonomy.vocabulary.tags bar' => 'Import node and taxonomy config of feature "foo". Import all config of feature "bar".',
- ],
- 'aliases' => ['fim', 'fr'],
- ];
-
- foreach ($items as $name => &$item) {
- $item['options']['bundle'] = [
- 'description' => 'Use a specific bundle namespace.',
- ];
- }
-
- return $items;
-}
-
-/**
- * Applies global options for Features drush commands.
- *
- * The option --name="bundle_name" sets the bundle namespace.
- *
- * @return \Drupal\features\FeaturesAssignerInterface
-*/
-function _drush_features_options() {
- /** @var \Drupal\features\FeaturesAssignerInterface $assigner */
- $assigner = \Drupal::service('features_assigner');
- $bundle_name = drush_get_option('bundle');
- if (!empty($bundle_name)) {
- $bundle = $assigner->applyBundle($bundle_name);
- if ($bundle->getMachineName() != $bundle_name) {
- drush_log(dt('Bundle @name not found. Using default.', ['@name' => $bundle_name]), 'warning');
- }
- }
- else {
- $assigner->assignConfigPackages();
- }
- return $assigner;
-}
-
-/**
- * Provides Drush command callback for features-status.
- */
-function drush_features_status() {
- $args = func_get_args();
- $assigner = _drush_features_options();
-
-
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- $current_bundle = $assigner->getBundle();
- $export_settings = $manager->getExportSettings();
- $methods = $assigner->getEnabledAssigners();
- if ($current_bundle->isDefault()) {
- drush_print(dt('Current bundle: none'));
- }
- else {
- drush_print(dt('Current bundle: @name (@machine_name)',
- [
- '@name' => $current_bundle->getName(),
- '@machine_name' => $current_bundle->getMachineName(),
- ]));
- }
- drush_print(dt('Export folder: @folder', ['@folder' => $export_settings['folder']]));
- $dt_args = ['@methods' => implode(', ', array_keys($methods))];
- drush_print(dt('The following assignment methods are enabled:'));
- drush_print(dt(' @methods', $dt_args));
-
- if (!empty($args)) {
- $config = $manager->getConfigCollection();
- if (count($args) > 1) {
- print_r(array_keys($config));
- }
- else {
- print_r($config[$args[0]]);
- }
- }
-}
-
-/**
- * Drush command callback for features-list-packages.
- *
- * @param string $package_name
- * (optional) The package name.
- *
- * @return array|bool
- */
-function drush_features_list_packages($package_name = '') {
- $assigner = _drush_features_options();
- $current_bundle = $assigner->getBundle();
- $namespace = $current_bundle->isDefault() ? FeaturesBundleInterface::DEFAULT_BUNDLE : $current_bundle->getMachineName();
-
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- $packages = $manager->getPackages();
-
- $packages = $manager->filterPackages($packages, $namespace);
- $result = [];
-
- // If no package was specified, list all packages.
- if (empty($package_name)) {
- drush_hide_output_fields(['object']);
- foreach ($packages as $package) {
- $overrides = $manager->detectOverrides($package);
- $state = $package->getState();
- if (!empty($overrides) && ($package->getStatus() != FeaturesManagerInterface::STATUS_NO_EXPORT)) {
- $state = FeaturesManagerInterface::STATE_OVERRIDDEN;
- }
-
- $result[$package->getMachineName()] = [
- 'name' => $package->getName(),
- 'machine_name' => $package->getMachineName(),
- 'status' => $manager->statusLabel($package->getStatus()),
- 'version' => $package->getVersion(),
- 'state' => ($state != FeaturesManagerInterface::STATE_DEFAULT)
- ? $manager->stateLabel($state)
- : '',
- ];
- }
- return $result;
- }
- // If a valid package was listed, list its configuration.
- else {
- foreach ($packages as $package) {
- if ($package->getMachineName() == $package_name) {
- drush_hide_output_fields([
- 'machine_name',
- 'name',
- 'status',
- 'version',
- 'state',
- ]);
- foreach ($package->getConfig() as $item_name) {
- $result[$item_name] = [
- 'object' => $item_name,
- ];
- }
- return $result;
- }
- }
-
- }
-
- // If no matching package found, return an error.
- drush_log(dt('Package "@package" not found.', ['@package' => $package_name]), 'warning');
- return FALSE;
-}
-
-/**
- * Drush command callback for features-import-all.
- *
- */
-function drush_features_import_all() {
- $assigner = _drush_features_options();
- $current_bundle = $assigner->getBundle();
- $namespace = $current_bundle->isDefault() ? FeaturesBundleInterface::DEFAULT_BUNDLE : $current_bundle->getMachineName();
-
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- $packages = $manager->getPackages();
- $packages = $manager->filterPackages($packages, $namespace);
- $overridden = [];
-
- foreach ($packages as $package) {
- $overrides = $manager->detectOverrides($package);
- $missing = $manager->detectMissing($package);
- if ((!empty($missing) || !empty($overrides)) && ($package->getStatus() == FeaturesManagerInterface::STATUS_INSTALLED)) {
- $overridden[] = $package->getMachineName();
- }
- }
-
- if (!empty($overridden)) {
- call_user_func_array('drush_features_import', $overridden);
- }
- else {
- drush_log(dt('Current state already matches active config, aborting.'), 'ok');
- }
-}
-
-/**
- * Provides Drush command callback for features-export.
- */
-function drush_features_export($packages = NULL) {
- $packages = func_get_args();
- $assigner = _drush_features_options();
-
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- /** @var \Drupal\features\FeaturesGeneratorInterface $generator */
- $generator = \Drupal::service('features_generator');
-
- $current_bundle = $assigner->getBundle();
-
- if (drush_get_option('add-profile')) {
- if ($current_bundle->isDefault) {
- return drush_set_error('', dt("Must specify a profile name with --name"));
- }
- $current_bundle->setIsProfile(TRUE);
- }
-
- $all_packages = $manager->getPackages();
- foreach ($packages as $name) {
- if (!isset($all_packages[$name])) {
- return drush_set_error('', dt("The package @name does not exist.", ['@name' => $name]));
- }
- }
-
- if (empty($packages)) {
- $packages = $all_packages;
- $dt_args = ['@modules' => implode(', ', array_keys($packages))];
- drush_print(dt('The following extensions will be exported: @modules', $dt_args));
- if (!drush_confirm(dt('Do you really want to continue?'))) {
- return drush_user_abort('Aborting.');
- }
- }
-
- // If any packages exist, confirm before overwriting.
- if ($existing_packages = $manager->listPackageDirectories($packages, $current_bundle)) {
- foreach ($existing_packages as $name => $directory) {
- drush_print(dt("The extension @name already exists at @directory.", ['@name' => $name, '@directory' => $directory]));
- }
- // Apparently, format_plural is not always available.
- if (count($existing_packages) == 1) {
- $message = dt('Would you like to overwrite it?');
- }
- else {
- $message = dt('Would you like to overwrite them?');
- }
- if (!drush_confirm($message)) {
- return drush_user_abort();
- }
- }
-
- // Use the write generation method.
- $method_id = FeaturesGenerationWrite::METHOD_ID;
- $result = $generator->generatePackages($method_id, $current_bundle, $packages);
-
- foreach ($result as $message) {
- $type = $message['success'] ? 'success' : 'error';
- drush_log($message['message'], $message['variables'], $type);
- }
-}
-
-/**
- * Adds a component to a features module.
- *
- * @param
- * The selected components.
- */
-function drush_features_add() {
- if ($args = func_get_args()) {
- $assigner = _drush_features_options();
-
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- /** @var \Drupal\features\FeaturesGeneratorInterface $generator */
- $generator = \Drupal::service('features_generator');
-
- $current_bundle = $assigner->getBundle();
-
- $module = array_shift($args);
- if (empty($args)) {
- return drush_set_error('', 'No components supplied.');
- }
- $components = _drush_features_component_list();
- $options = [
- 'exported' => FALSE,
- ];
-
- $filtered_components = _drush_features_component_filter($components, $args, $options);
- $items = $filtered_components['components'];
-
- if (empty($items)) {
- return drush_set_error('', 'No components to add.');
- }
-
- $packages = [$module];
- // If any packages exist, confirm before overwriting.
- if ($existing_packages = $manager->listPackageDirectories($packages)) {
- foreach ($existing_packages as $name => $directory) {
- drush_print(dt("The extension @name already exists at @directory.", ['@name' => $name, '@directory' => $directory]));
- }
- // Apparently, format_plural is not always available.
- if (count($existing_packages) == 1) {
- $message = dt('Would you like to overwrite it?');
- }
- else {
- $message = dt('Would you like to overwrite them?');
- }
- if (!drush_confirm($message)) {
- return drush_user_abort();
- }
- }
- else {
- $package = $manager->initPackage($module, NULL, '', 'module', $current_bundle);
- list($full_name, $path) = $manager->getExportInfo($package, $current_bundle);
- drush_print(dt('Will create a new extension @name in @directory', ['@name' => $full_name, '@directory' => $path]));
- if (!drush_confirm(dt('Do you really want to continue?'))) {
- drush_die('Aborting.');
- }
- }
-
- $config = _drush_features_build_config($items);
-
- $manager->assignConfigPackage($module, $config);
-
- // Use the write generation method.
- $method_id = FeaturesGenerationWrite::METHOD_ID;
- $result = $generator->generatePackages($method_id, $current_bundle, $packages);
-
- foreach ($result as $message) {
- $type = $message['success'] ? 'success' : 'error';
- drush_log($message['message'], $message['variables'], $type);
- }
- }
- else {
- return drush_set_error('', 'No feature name given.');
- }
-}
-
-/**
- * Lists components, with pattern matching.
- */
-function drush_features_components() {
- $args = func_get_args();
- _drush_features_options();
-
- $components = _drush_features_component_list();
- ksort($components);
- // If no args supplied, prompt with a list.
- if (empty($args)) {
- $types = array_keys($components);
- array_unshift($types, 'all');
- $choice = drush_choice($types, 'Enter a number to choose which component type to list.');
- if ($choice === FALSE) {
- return;
- }
-
- $args = ($choice == 0) ? ['*'] : [$types[$choice]];
- }
- $options = [
- 'provided by' => TRUE,
- ];
- if (drush_get_option(['exported', 'e'], NULL)) {
- $options['not exported'] = FALSE;
- }
- elseif (drush_get_option(['not-exported', 'o'], NULL)) {
- $options['exported'] = FALSE;
- }
-
- $filtered_components = _drush_features_component_filter($components, $args, $options);
- if ($filtered_components) {
- _drush_features_component_print($filtered_components);
- }
-}
-
-/**
- * Lists the differences in the package config vs the active store.
- *
- * @param string $package
- * The machine name of a package.
- */
-function drush_features_diff() {
- if (!$args = func_get_args()) {
- drush_print_table(drush_features_list_packages());
- return;
- }
-
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- /** @var \Drupal\features\FeaturesAssignerInterface $assigner */
- $assigner = \Drupal::service('features_assigner');
- $assigner->assignConfigPackages();
-
- $module = $args[0];
- $filter_ctypes = drush_get_option("ctypes");
- if ($filter_ctypes) {
- $filter_ctypes = explode(',', $filter_ctypes);
- }
-
- $feature = $manager->loadPackage($module, TRUE);
- if (empty($feature)) {
- drush_log(dt('No such feature is available: @module', ['@module' => $module]), 'error');
- return;
- }
-
- $lines = drush_get_option('lines');
- $lines = isset($lines) ? $lines : 2;
-
- $formatter = new DiffFormatter();
- $formatter->leading_context_lines = $lines;
- $formatter->trailing_context_lines = $lines;
- $formatter->show_header = FALSE;
-
- if (drush_get_context('DRUSH_NOCOLOR')) {
- $red = $green = "%s";
- }
- else {
- $red = "\033[31;40m\033[1m%s\033[0m";
- $green = "\033[0;32;40m\033[1m%s\033[0m";
- }
-
- $overrides = $manager->detectOverrides($feature);
- $missing = $manager->reorderMissing($manager->detectMissing($feature));
- $overrides = array_merge($overrides, $missing);
-
- if (empty($overrides)) {
- drush_print(dt('Active config matches stored config for @module.', ['@module' => $module]));
- }
- else {
- /** @var \Drupal\config_update\ConfigDiffInterface $config_diff */
- $config_diff = \Drupal::service('config_update.config_diff');
- /** @var \Drupal\Core\Config\StorageInterface $active_storage */
- $active_storage = \Drupal::service('config.storage');
-
- // Print key for colors.
- drush_print(dt('Legend: '));
- drush_print(sprintf($red, dt('Code: drush features-import will replace the active config with the displayed code.')));
- drush_print(sprintf($green, dt('Active: drush features-export will update the exported feature with the displayed active config')));
-
- foreach ($overrides as $name) {
- $message = '';
- if (in_array($name, $missing)) {
- $message = sprintf($red, t('(missing from active)'));
- $extension = [];
- }
- else {
- $active = $manager->getActiveStorage()->read($name);
- $extension = $manager->getExtensionStorages()->read($name);
- if (empty($extension)) {
- $extension = [];
- $message = sprintf($green, t('(not exported)'));
- }
- $diff = $config_diff->diff($extension, $active);
- $rows = explode("\n", $formatter->format($diff));
- }
- drush_print();
- drush_print(dt("Config @name @message", ['@name' => $name, '@message' => $message]));
- if (!empty($extension)) {
- foreach ($rows as $row) {
- if (strpos($row, '>') === 0) {
- drush_print(sprintf($green, $row));
- }
- elseif (strpos($row, '<') === 0) {
- drush_print(sprintf($red, $row));
- }
- else {
- drush_print($row);
- }
- }
- }
- }
- }
-}
-
-/**
- * Imports module config into the active store.
- *
- * Same as the old "revert" functionality.
- */
-function drush_features_import() {
- if ($args = func_get_args()) {
- _drush_features_options();
-
- // Determine if revert should be forced.
- $force = drush_get_option('force');
- // Determine if -y was supplied. If so, we can filter out needless output
- // from this command.
- $skip_confirmation = drush_get_context('DRUSH_AFFIRMATIVE');
-
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
-
- // Parse list of arguments.
- $modules = [];
- foreach ($args as $arg) {
- $arg = explode(':', $arg);
- $module = array_shift($arg);
- $component = array_shift($arg);
-
- if (isset($module)) {
- if (empty($component)) {
- // If we received just a feature name, this means that we need all of
- // its components.
- $modules[$module] = TRUE;
- }
- elseif ($modules[$module] !== TRUE) {
- if (!isset($modules[$module])) {
- $modules[$module] = [];
- }
- $modules[$module][] = $component;
- }
- }
- }
-
- // Process modules.
- foreach ($modules as $module => $components_needed) {
-
- $dt_args['@module'] = $module;
- /** @var \Drupal\features\Package $feature */
- $feature = $manager->loadPackage($module, TRUE);
- if (empty($feature)) {
- drush_log(dt('No such feature is available: @module', $dt_args), 'error');
- return;
- }
-
- if ($feature->getStatus() != FeaturesManagerInterface::STATUS_INSTALLED) {
- drush_log(dt('No such feature is installed: @module', $dt_args), 'error');
- return;
- }
-
- // Forcefully revert all components of a feature.
- if ($force) {
- $components = $feature->getConfigOrig();
- }
- // Only revert components that are detected to be Overridden.
- else {
- $components = $manager->detectOverrides($feature);
- $missing = $manager->reorderMissing($manager->detectMissing($feature));
- // Be sure to import missing components first.
- $components = array_merge($missing, $components);
- }
-
- if (!empty($components_needed) && is_array($components_needed)) {
- $components = array_intersect($components, $components_needed);
- }
-
- if (empty($components)) {
- drush_log(dt('Current state already matches active config, aborting.'), 'ok');
- }
- else {
- // Determine which config the user wants to import/revert.
- $config_to_create = [];
- foreach ($components as $component) {
- $dt_args['@component'] = $component;
- $confirmation_message = 'Do you really want to import @module : @component?';
- if ($skip_confirmation || drush_confirm(dt($confirmation_message, $dt_args))) {
- $config_to_create[$component] = '';
- }
- }
-
- // Perform the import/revert.
- $config_imported = $manager->createConfiguration($config_to_create);
-
- // List the results.
- foreach ($components as $component) {
- $dt_args['@component'] = $component;
- if (isset($config_imported['new'][$component])) {
- drush_log(dt('Imported @module : @component.', $dt_args), 'ok');
- }
- elseif (isset($config_imported['updated'][$component])) {
- drush_log(dt('Reverted @module : @component.', $dt_args), 'ok');
- }
- elseif (!isset($config_to_create[$component])) {
- drush_log(dt('Skipping @module : @component.', $dt_args), 'ok');
- }
- else {
- drush_log(dt('Error importing @module : @component.', $dt_args), 'error');
- }
- }
- }
- }
- }
- else {
- drush_print_table(drush_features_list_packages());
- return;
- }
-}
-
-/**
- * Returns an array of full config names given a array[$type][$component].
- *
- * @param array $items
- * The items to return data for.
- */
-function _drush_features_build_config(array $items) {
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- $result = [];
- foreach ($items as $config_type => $item) {
- foreach ($item as $item_name => $title) {
- $result[] = $manager->getFullName($config_type, $item_name);
- }
- }
- return $result;
-}
-
-/**
- * Returns a listing of all known components, indexed by source.
- */
-function _drush_features_component_list() {
- $result = [];
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- $config = $manager->getConfigCollection();
- foreach ($config as $item_name => $item) {
- $result[$item->getType()][$item->getShortName()] = $item->getLabel();
- }
- return $result;
-}
-
-/**
- * Filters components by patterns.
- */
-function _drush_features_component_filter($all_components, $patterns = [], $options = []) {
- $options += [
- 'exported' => TRUE,
- 'not exported' => TRUE,
- 'provided by' => FALSE,
- ];
- $pool = [];
- // Maps exported components to feature modules.
- $components_map = _drush_features_get_component_map();
- // First filter on exported state.
- foreach ($all_components as $source => $components) {
- foreach ($components as $name => $title) {
- $exported = count($components_map[$source][$name]) > 0;
- if ($exported) {
- if ($options['exported']) {
- $pool[$source][$name] = $title;
- }
- }
- else {
- if ($options['not exported']) {
- $pool[$source][$name] = $title;
- }
- }
- }
- }
-
- $state_string = '';
-
- if (!$options['exported']) {
- $state_string = 'unexported';
- }
- elseif (!$options['not exported']) {
- $state_string = 'exported';
- }
-
- $selected = [];
- foreach ($patterns as $pattern) {
- // Rewrite * to %. Let users use both as wildcard.
- $pattern = strtr($pattern, ['*' => '%']);
- $sources = [];
- list($source_pattern, $component_pattern) = explode(':', $pattern, 2);
- // If source is empty, use a pattern.
- if ($source_pattern == '') {
- $source_pattern = '%';
- }
- if ($component_pattern == '') {
- $component_pattern = '%';
- }
-
- $preg_source_pattern = strtr(preg_quote($source_pattern, '/'), ['%' => '.*']);
- $preg_component_pattern = strtr(preg_quote($component_pattern, '/'), ['%' => '.*']);
- // If it isn't a pattern, but a simple string, we don't anchor the
- // pattern. This allows for abbreviating. Otherwise, we do, as this seems
- // more natural for patterns.
- if (strpos($source_pattern, '%') !== FALSE) {
- $preg_source_pattern = '^' . $preg_source_pattern . '$';
- }
- if (strpos($component_pattern, '%') !== FALSE) {
- $preg_component_pattern = '^' . $preg_component_pattern . '$';
- }
- $matches = [];
-
- // Find the sources.
- $all_sources = array_keys($pool);
- $matches = preg_grep('/' . $preg_source_pattern . '/', $all_sources);
- if (count($matches) > 0) {
- // If we have multiple matches and the source string wasn't a
- // pattern, check if one of the matches is equal to the pattern, and
- // use that, or error out.
- if (count($matches) > 1 and $preg_source_pattern[0] != '^') {
- if (in_array($source_pattern, $matches)) {
- $matches = [$source_pattern];
- }
- else {
- return drush_set_error('', dt('Ambiguous source "@source", matches @matches', [
- '@source' => $source_pattern,
- '@matches' => implode(', ', $matches),
- ]));
- }
- }
- // Loose the indexes preg_grep preserved.
- $sources = array_values($matches);
- }
- else {
- return drush_set_error('', dt('No @state sources match "@source"', ['@state' => $state_string, '@source' => $source_pattern]));
- }
-
- // Now find the components.
- foreach ($sources as $source) {
- // Find the components.
- $all_components = array_keys($pool[$source]);
- // See if there's any matches.
- $matches = preg_grep('/' . $preg_component_pattern . '/', $all_components);
- if (count($matches) > 0) {
- // If we have multiple matches and the components string wasn't a
- // pattern, check if one of the matches is equal to the pattern, and
- // use that, or error out.
- if (count($matches) > 1 and $preg_component_pattern[0] != '^') {
- if (in_array($component_pattern, $matches)) {
- $matches = [$component_pattern];
- }
- else {
- return drush_set_error('', dt('Ambiguous component "@component", matches @matches', [
- '@component' => $component_pattern,
- '@matches' => implode(', ', $matches),
- ]));
- }
- }
- if (!is_array($selected[$source])) {
- $selected[$source] = [];
- }
- $selected[$source] += array_intersect_key($pool[$source], array_flip($matches));
- }
- else {
- // No matches. If the source was a pattern, just carry on, else
- // error out. Allows for patterns like :*field*
- if ($preg_source_pattern[0] != '^') {
- return drush_set_error('', dt('No @state @source components match "@component"', [
- '@state' => $state_string,
- '@component' => $component_pattern,
- '@source' => $source,
- ]));
- }
- }
- }
- }
-
- // Lastly, provide feature module information on the selected components, if
- // requested.
- $provided_by = [];
- if ($options['provided by'] && $options['exported']) {
- foreach ($selected as $source => $components) {
- foreach ($components as $name => $title) {
- $exported = count($components_map[$source][$name]) > 0;
- if ($exported) {
- $provided_by[$source . ':' . $name] = implode(', ', $components_map[$source][$name]);
- }
- }
- }
- }
-
- return [
- 'components' => $selected,
- 'sources' => $provided_by,
- ];
-}
-
-/**
- * Provides a component to feature map (port of features_get_component_map).
- */
-function _drush_features_get_component_map() {
- $result = [];
- /** @var \Drupal\features\FeaturesManagerInterface $manager */
- $manager = \Drupal::service('features.manager');
- // Recalc full config list without running assignments.
- $config = $manager->getConfigCollection();
- $packages = $manager->getPackages();
-
- foreach ($config as $item_name => $item) {
- $type = $item->getType();
- $short_name = $item->getShortName();
- $name = $item->getName();
- if (!isset($result[$type][$short_name])) {
- $result[$type][$short_name] = [];
- }
- if (!empty($item->getPackage())) {
- $package = $packages[$item->getPackage()];
- $result[$type][$short_name][] = $package->getMachineName();
- }
- }
-
- return $result;
-}
-
-/**
- * Prints a list of filtered components.
- */
-function _drush_features_component_print($filtered_components) {
- $rows = [[dt('Available sources')]];
- foreach ($filtered_components['components'] as $source => $components) {
- foreach ($components as $name => $value) {
- $row = [$source . ':' . $name];
- if (isset($filtered_components['sources'][$source . ':' . $name])) {
- $row[] = dt('Provided by') . ': ' . $filtered_components['sources'][$source . ':' . $name];
- }
- $rows[] = $row;
- }
- }
-
- drush_print_table($rows, TRUE);
-}
diff --git a/sites/all/modules/contrib/admin/features/features.info.yml b/sites/all/modules/contrib/admin/features/features.info.yml
deleted file mode 100644
index 65cef8a96..000000000
--- a/sites/all/modules/contrib/admin/features/features.info.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: 'Features'
-type: module
-description: 'Enables administrators to package configuration into modules.'
-package: Development
-# core: 8.x
-dependencies:
- - drupal:config
- - config_update:config_update
-
-# Information added by Drupal.org packaging script on 2018-09-09
-version: '8.x-3.8'
-core: '8.x'
-project: 'features'
-datestamp: 1536512288
diff --git a/sites/all/modules/contrib/admin/features/features.install b/sites/all/modules/contrib/admin/features/features.install
deleted file mode 100644
index 5bb46f01f..000000000
--- a/sites/all/modules/contrib/admin/features/features.install
+++ /dev/null
@@ -1,31 +0,0 @@
-getStorage('features_bundle')->loadMultiple() as $bundle) {
- $bundle = \Drupal::configFactory()->getEditable('features.bundle.' . $bundle->id());
- $assignments = $bundle->get('assignments');
- $assignments['alter'] = [
- 'core' => TRUE,
- 'uuid' => TRUE,
- 'user_permissions' => TRUE,
- 'enabled' => TRUE,
- 'weight' => 0,
- ];
- $bundle->set('assignments', $assignments)->save();
- }
-}
diff --git a/sites/all/modules/contrib/admin/features/features.module b/sites/all/modules/contrib/admin/features/features.module
deleted file mode 100644
index 3bf4bf734..000000000
--- a/sites/all/modules/contrib/admin/features/features.module
+++ /dev/null
@@ -1,56 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('The Features module provides a user interface for exporting bundles of configuration into modules. For more information, see the online documentation for Features module', [
- ':url' => 'http://drupal.org/node/2404427',
- ]) . '
' . t('Custom features for use on a particular site.') . '
';
- $output .= '
' . t('The features of a given distribution.', [':distributions' => 'https://www.drupal.org/documentation/build/distributions']) . '
';
- $output .= '
';
- $output .= '
' . t('Use the form below to manage bundles. Each bundle comes with a set of assignment methods. By configuring and ordering the assignment methods, you can set the defaults for what does and doesn\'t get packaged into features for your bundle. Use the Bundle select to choose which bundle to edit, or chose --New-- to create a new bundle. The Default bundle does not include a namespace and cannot be deleted.') . '
',
- '#context' => array(
- 'title' => $perm_item['title'],
- ),
- );
- // Show the permission description.
- if (!$hide_descriptions) {
- $form['permissions'][$perm]['description']['#context']['description'] = $perm_item['description'];
- $form['permissions'][$perm]['description']['#context']['warning'] = $perm_item['warning'];
- }
- foreach ($role_names as $rid => $name) {
- $form['permissions'][$perm][$rid] = array(
- '#title' => $name . ': ' . $perm_item['title'],
- '#title_display' => 'invisible',
- '#wrapper_attributes' => array(
- 'class' => array('checkbox'),
- ),
- '#type' => 'checkbox',
- '#default_value' => in_array($perm, $role_permissions[$rid]) ? 1 : 0,
- '#attributes' => array('class' => array('rid-' . $rid, 'js-rid-' . $rid)),
- '#parents' => array($rid, $perm),
- );
- // Show a column of disabled but checked checkboxes.
- if ($admin_roles[$rid]) {
- $form['permissions'][$perm][$rid]['#disabled'] = TRUE;
- $form['permissions'][$perm][$rid]['#default_value'] = TRUE;
- }
- }
- }
- }
-
- $form['actions'] = array('#type' => 'actions');
- $form['actions']['submit'] = array(
- '#type' => 'submit',
- '#value' => $this->t('Save permissions'),
- '#button_type' => 'primary',
- );
-
- $form['#attached']['library'][] = 'user/drupal.user.permissions';
-
- return $form;
- }
-
- /**
- * Saves the roles and modules selection.
- */
- public function submitFormFilter(array &$form, FormStateInterface $form_state) {
- $this->saveFilterSettings($form_state->getValue('roles'), $form_state->getValue('modules'));
- }
-
- /**
- * Saves the filter settings for the current user.
- *
- * @param array $roles
- * The roles to filter by.
- * @param array $modules
- * The modules to filter by.
- */
- protected function saveFilterSettings(array $roles, array $modules) {
- $values = array('roles' => $roles, 'modules' => $modules);
- $this->keyValueExpirable->setWithExpire($this->currentUser()->id(), $values, 3600);
- }
-
- /**
- * Retrieve the filter settings for the current user.
- *
- * @return array
- * The filter setting for the current user.
- */
- protected function getFilterSettings() {
- $default = array('roles' => array(), 'modules' => array());
- return $this->keyValueExpirable->get($this->currentUser()->id(), $default);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsRoleSpecificForm.php b/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsRoleSpecificForm.php
deleted file mode 100644
index 14e594c6a..000000000
--- a/sites/all/modules/contrib/admin/filter_perms/src/Form/PermissionsRoleSpecificForm.php
+++ /dev/null
@@ -1,24 +0,0 @@
-saveFilterSettings((array) $user_role->id(), (array) self::ALL_OPTIONS);
- return $this->redirect('user.admin_permissions');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/filter_perms/src/Routing/RouteSubscriber.php b/sites/all/modules/contrib/admin/filter_perms/src/Routing/RouteSubscriber.php
deleted file mode 100644
index 7998c93fb..000000000
--- a/sites/all/modules/contrib/admin/filter_perms/src/Routing/RouteSubscriber.php
+++ /dev/null
@@ -1,25 +0,0 @@
-get('user.admin_permissions')) {
- $route->setDefault('_form', '\Drupal\filter_perms\Form\PermissionsForm');
- }
- if ($route = $collection->get('entity.user_role.edit_permissions_form')) {
- $route->setDefault('_form', '\Drupal\filter_perms\Form\PermissionsRoleSpecificForm');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/LICENSE.txt b/sites/all/modules/contrib/admin/login_destination/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/login_destination/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/login_destination/README.txt b/sites/all/modules/contrib/admin/login_destination/README.txt
deleted file mode 100644
index f83ee80d1..000000000
--- a/sites/all/modules/contrib/admin/login_destination/README.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-The Login Destination module provides a way to customize the destination that a
-user is redirected to after logging in, registering to the site, using a
-one-time login link or logging out.
-
-The configuration consists of specifying so called login destination rules that
-are evaluated when the login or logout takes place. Those rules are evaluated
-against certain conditions and the user is taken to the destination specified
-by the first matching rule. If the destination is empty, no redirect is
-performed aka user is taken to the default destination. You can define pages
-from which a user logs in/out to be a matching criterion. You can also select
-certain user roles that are matched against those of a user. Note that only one
-role has to match in order for the redirect to take place. If no roles are
-selected the redirect is performed regardless of user roles.
-
-The destination you specify can be an internal page or an external URL.
-Remember to precede the url with http://. You can also use the tag to
-redirect to the front page. In case of
-login/register form the page from which the user entered the form is treated as
-the current page. Note that if you provide your own login/logout links you have
-to add the 'current' GET parameter to them so Login Destination knows where
-your users come from.
-
-It also possible to set some advanced parameters on the setting page. Every
-time in Drupal you can specify the 'destination' GET parameter in url to
-redirect the user to a custom page. If you check the option
-'Preserve the destination parameter' Login Destination will give priority to
-this parameter over its own module settings. However with this option enabled
-the redirect from the login block will not work. In some rare cases you can
-also redirect the user just after using the one-time login link, before given
-the possibility to change their password. Do this by checking the
-'Redirect immediately after using one-time login link' option.
diff --git a/sites/all/modules/contrib/admin/login_destination/composer.json b/sites/all/modules/contrib/admin/login_destination/composer.json
deleted file mode 100644
index 339bfbab7..000000000
--- a/sites/all/modules/contrib/admin/login_destination/composer.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "name": "drupal/login_destination",
- "description": "The Login Destination module add possibility customize the destination that the user is redirected to after login.",
- "type": "drupal-module"
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/config/install/login_destination.settings.yml b/sites/all/modules/contrib/admin/login_destination/config/install/login_destination.settings.yml
deleted file mode 100644
index 8083316c1..000000000
--- a/sites/all/modules/contrib/admin/login_destination/config/install/login_destination.settings.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-preserve_destination: FALSE
-immediate_redirect: FALSE
diff --git a/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.schema.yml b/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.schema.yml
deleted file mode 100644
index 0bf05a874..000000000
--- a/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.schema.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-login_destination.destination.*:
- type: config_entity
- label: 'Login destination configuration entity'
- mapping:
- name:
- type: string
- label: 'Login destination rule machine name'
- label:
- type: string
- label: 'Short description of the rule'
- triggers:
- type: array
- label: 'Triggers'
- destination_path:
- type: string
- label: 'Destination'
- pages_type:
- type: integer
- label: 'Pages type'
- pages:
- type: string
- label: 'Pages'
- roles:
- type: array
- label: 'Roles'
- weight:
- type: integer
- label: 'Weight'
- enabled:
- type: boolean
- label: 'Enabled'
- uuid:
- type: string
- label: 'UUID'
diff --git a/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.settings.yml b/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.settings.yml
deleted file mode 100644
index cf22ec35b..000000000
--- a/sites/all/modules/contrib/admin/login_destination/config/schema/login_destination.settings.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-login_destination.settings:
- type: config_object
- label: 'Login destination settings'
- mapping:
- preserve_destination:
- type: boolean
- label: 'Preserve the destination parameter'
- immediate_redirect:
- type: boolean
- label: 'Redirect immediately after using one-time login link'
diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.info.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.info.yml
deleted file mode 100644
index 749c6ab6d..000000000
--- a/sites/all/modules/contrib/admin/login_destination/login_destination.info.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: Login Destination
-type: module
-description: Add possibility customize the destination that the user is redirected to after login.
-package: User
-# core: 8.x
-configure: login_destination.settings
-
-# Information added by Drupal.org packaging script on 2018-01-01
-version: '8.x-1.x-dev'
-core: '8.x'
-project: 'login_destination'
-datestamp: 1514805488
diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.links.action.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.links.action.yml
deleted file mode 100644
index f471bac56..000000000
--- a/sites/all/modules/contrib/admin/login_destination/login_destination.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-login_destination.add:
- route_name: login_destination.add
- title: 'Add Login Destination'
- appears_on:
- - login_destination.list
diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.links.menu.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.links.menu.yml
deleted file mode 100644
index ea72d5428..000000000
--- a/sites/all/modules/contrib/admin/login_destination/login_destination.links.menu.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-login_destination.list:
- title: 'Login destinations'
- parent: user.admin_index
- description: 'Customize the destination that the user is redirected to after login.'
- weight: -5
- route_name: login_destination.list
diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.links.task.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.links.task.yml
deleted file mode 100644
index 1f10816f6..000000000
--- a/sites/all/modules/contrib/admin/login_destination/login_destination.links.task.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-login_destination.list:
- title: 'Login destinations'
- route_name: login_destination.list
- base_route: login_destination.list
-
-login_destination.settings:
- title: 'Settings'
- route_name: login_destination.settings
- base_route: login_destination.list
diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.module b/sites/all/modules/contrib/admin/login_destination/login_destination.module
deleted file mode 100644
index 3fa5a08da..000000000
--- a/sites/all/modules/contrib/admin/login_destination/login_destination.module
+++ /dev/null
@@ -1,148 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('The Login Destination module allows you to customize the destination that the user is redirected to after logging in, registering to the site, using a one-time login link or logging out. The destination can be an internal page or an external URL. You may specify certain conditions like pages or user roles and make the destination depend upon them.') . '
';
- $output .= '
' . t('Uses') . '
';
- $output .= '
';
- $output .= '
' . t('Creating login destinations') . '
';
- $output .= '
' . t('Users with sufficient permissions can create login destination through the !link. The page listing the login destinations provides an interface to add, edit and delete them', [
- '!link' => (string) \Drupal::l('Login destination page', Url::fromRoute('login_destination.list')),
- ]) . '
';
- $output .= '
' . t('Assigning destinations') . '
';
- $output .= '
' . t('You can add login destinations and specify the page where the user will be redirected when it logs in or logs out. You can also configure specific pages where the destination can work or not and select for what user roles the login destination applies') . '
' . t('Login destination rules are evaluated each time a user logs in, registers to the site, uses a one-time login link or logs out. Each rule consists of the destination, path conditions and user roles conditions. First matching rule gets executed.') . '
';
- return $output;
- }
-}
-
-/**
- * Implements hook_user_login().
- */
-function login_destination_user_login(AccountInterface $account) {
- if (isset($account->user_is_new) && $account->user_is_new) {
- // User is just registered.
- login_destination_perform_redirect('registration', $account);
- }
- elseif (\Drupal::service('current_route_match')->getRouteName() === 'user.reset.login') {
- // User is used a one-time login link.
- login_destination_perform_redirect('one-time-login', $account);
- }
- else {
- login_destination_perform_redirect('login', $account);
- }
-}
-
-/**
- * Implements hook_user_logout().
- */
-function login_destination_user_logout(AccountInterface $account) {
- login_destination_perform_redirect('logout', $account);
-}
-
-/**
- * Implements hook_toolbar_alter().
- */
-function login_destination_toolbar_alter(&$items) {
- if (empty($items['user']['tray']['user_links'])) {
- return;
- }
- // Disable cache for user links in toolbar, to be able set current param.
- $items['user']['tray']['user_links']['#cache']['context'] = [];
- $items['user']['tray']['user_links']['#cache']['max-age'] = 0;
-
- if (\Drupal::currentUser()->isAnonymous()) {
- $url_login = Url::fromRoute('user.login');
- // Change route name, since route "user.page" always redirects to "user.login".
- $items['user']['tray']['user_links']['#links']['login']['url'] = $url_login;
- $url = &$items['user']['tray']['user_links']['#links']['login']['url'];
- }
- else {
- $url = &$items['user']['tray']['user_links']['#links']['logout']['url'];
- }
- // Get current path.
- $current = \Drupal::service('path.current')->getPath();
-
- // Add current param to be able to evaluate previous page.
- $url->setOptions(['query' => ['current' => $current]]);
-}
-
-/**
- * Implements hook_link_alter().
- */
-function login_destination_link_alter(&$variables) {
- $routes = [
- 'user.login',
- 'user.logout'
- ];
- /* @var Drupal\Core\Url $url */
- $url = $variables['url'];
- if ($url->isExternal()) {
- return;
- }
-
- if ($url->isRouted() && !in_array($url->getRouteName(), $routes)) {
- return;
- }
-
- // Get current path.
- $current = \Drupal::service('path.current')->getPath();
- $variables['options']['query']['current'] = $current;
-}
-
-/**
- * Implements hook_entity_presave().
- */
-function login_destination_entity_presave(EntityInterface $entity) {
- // Verify that entity is a user entity, and this is new entity.
- if (!$entity instanceof UserInterface || !$entity->isNew()) {
- return;
- }
- // Save parameter to user entity, which will allow us understand that user
- // is just created. Do not need to save parameter, when needs verification
- // by administrator.
- $needs_verification = \Drupal::config('user.settings')->get('verify_mail');
- if ($needs_verification || !$entity->isActive()) {
- return;
- }
- $entity->user_is_new = TRUE;
-}
-
-/**
- * Evaluate rules and perform redirect.
- *
- * This function is intended to be used by external modules.
- *
- * @param string $trigger
- * Action of login destination rule.
- * @param \Drupal\Core\Session\AccountInterface $account
- * User Account.
- */
-function login_destination_perform_redirect($trigger, AccountInterface $account) {
- /* @var Drupal\login_destination\LoginDestinationManager $service */
- $service = \Drupal::service('login_destination.manager');
- $destination = $service->findDestination($trigger, $account);
- if ($destination) {
- $service->prepareDestination($destination);
- }
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.permissions.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.permissions.yml
deleted file mode 100644
index 03d6971af..000000000
--- a/sites/all/modules/contrib/admin/login_destination/login_destination.permissions.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-administer login destination settings:
- title: 'Administer Login Destination settings'
diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.routing.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.routing.yml
deleted file mode 100644
index ef926fe2c..000000000
--- a/sites/all/modules/contrib/admin/login_destination/login_destination.routing.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-login_destination.settings:
- path: '/admin/config/people/login-destination/settings'
- defaults:
- _form: '\Drupal\login_destination\Form\LoginDestinationSettingsForm'
- _title: 'Login destination Settings'
- requirements:
- _permission: 'administer login destination settings'
-
-login_destination.list:
- path: '/admin/config/people/login-destination'
- defaults:
- _content: '\Drupal\Core\Entity\Controller\EntityListController::listing'
- _entity_list: 'login_destination'
- _title: 'Login destinations'
- requirements:
- _permission: 'administer login destination settings'
-
-login_destination.add:
- path: '/admin/config/people/login-destination/add'
- defaults:
- _entity_form: login_destination.add
- _title: 'Add login destination rule'
- requirements:
- _permission: 'administer login destination settings'
-
-entity.login_destination.edit_form:
- path: '/admin/config/people/login-destination/{login_destination}/edit'
- defaults:
- _entity_form: login_destination.edit
- _title: 'Edit login destination rule'
- requirements:
- _permission: 'administer login destination settings'
-
-entity.login_destination.delete_form:
- path: '/admin/config/people/login-destination/{login_destination}/delete'
- defaults:
- _entity_form: login_destination.delete
- _title: 'Delete login destination rule'
- requirements:
- _permission: 'administer login destination settings'
diff --git a/sites/all/modules/contrib/admin/login_destination/login_destination.services.yml b/sites/all/modules/contrib/admin/login_destination/login_destination.services.yml
deleted file mode 100644
index 05248188a..000000000
--- a/sites/all/modules/contrib/admin/login_destination/login_destination.services.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-services:
- login_destination.manager:
- class: Drupal\login_destination\LoginDestinationManager
- arguments: ['@entity_type.manager', '@path.alias_manager', '@path.matcher', '@path.current', '@config.factory', '@request_stack']
diff --git a/sites/all/modules/contrib/admin/login_destination/src/Controller/LoginDestinationListBuilder.php b/sites/all/modules/contrib/admin/login_destination/src/Controller/LoginDestinationListBuilder.php
deleted file mode 100644
index 3a13309a4..000000000
--- a/sites/all/modules/contrib/admin/login_destination/src/Controller/LoginDestinationListBuilder.php
+++ /dev/null
@@ -1,92 +0,0 @@
- $this->t('Label'),
- 'destination' => $this->t('Destination'),
- 'triggers' => $this->t('Triggers'),
- 'pages' => $this->t('Pages'),
- 'roles' => $this->t('Roles'),
- 'enabled' => $this->t('Enabled'),
- ];
- return $header + parent::buildHeader();
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildRow(EntityInterface $entity) {
- /** @var LoginDestination $entity */
- $row['label'] = $entity->getLabel();
-
- if ($entity->isDestinationCurrent()) {
- $row['destination'] = [
- '#markup' => $entity->viewDestination(),
- ];
- }
- else {
- $row['destination'] = [
- '#type' => 'link',
- '#title' => $entity->viewDestination(),
- '#url' => Url::fromUri($entity->getDestination()),
- ];
- }
- $row['triggers'] = [
- '#markup' => $entity->viewTriggers(),
- ];
- $row['pages'] = [
- '#markup' => $entity->viewPages(),
- ];
- $row['roles'] = [
- '#markup' => $entity->viewRoles(),
- ];
- $row['enabled'] = [
- '#type' => 'checkbox',
- '#default_value' => $entity->isEnabled(),
- ];
- return $row + parent::buildRow($entity);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- parent::submitForm($form, $form_state);
- foreach ($form_state->getValue($this->entitiesKey) as $id => $value) {
- // Save entity only when its weight was changed.
- $this->entities[$id]->set('enabled', $value['enabled']);
- $this->entities[$id]->save();
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/src/Entity/LoginDestination.php b/sites/all/modules/contrib/admin/login_destination/src/Entity/LoginDestination.php
deleted file mode 100644
index 686459107..000000000
--- a/sites/all/modules/contrib/admin/login_destination/src/Entity/LoginDestination.php
+++ /dev/null
@@ -1,349 +0,0 @@
-name;
- }
-
- /**
- * @inheritdoc
- */
- public function getLabel() {
- return $this->label;
- }
-
- /**
- * @inheritdoc
- */
- public function getMachineName() {
- return $this->name;
- }
-
- /**
- * @inheritdoc
- */
- public function getTriggers() {
- return $this->triggers;
- }
-
- /**
- * @inheritdoc
- */
- public function getDestination() {
- return $this->destination_path;
- }
-
- /**
- * @inheritdoc
- */
- public function getPagesType() {
- return $this->pages_type;
- }
-
- /**
- * @inheritdoc
- */
- public function getPages() {
- return $this->pages;
- }
-
- /**
- * @inheritdoc
- */
- public function getRoles() {
- return $this->roles;
- }
-
- /**
- * @inheritdoc
- */
- public function getWeight() {
- return $this->weight;
- }
-
- /**
- * {@inheritdoc}
- */
- public function viewTriggers() {
- $items = [];
- foreach ($this->triggers as $trigger) {
- if (empty($trigger)) {
- continue;
- }
- switch ($trigger) {
- case LoginDestination::TRIGGER_REGISTRATION:
- $items[] = t('Registration');
- break;
-
- case LoginDestination::TRIGGER_LOGIN:
- $items[] = t('Login');
- break;
-
- case LoginDestination::TRIGGER_ONE_TIME_LOGIN:
- $items[] = t('One-time login link');
- break;
-
- case LoginDestination::TRIGGER_LOGOUT:
- $items[] = t('Logout');
- break;
- }
- }
- return $this->renderItemList($items, t('All triggers'));
- }
-
- /**
- * {@inheritdoc}
- */
- public function viewRoles() {
- $roles = $this->getAllSystemRoles();
- $items = array_values(array_intersect_key($roles, $this->roles));
- return $this->renderItemList($items, t('All roles'));
- }
-
- /**
- * {@inheritdoc}
- */
- public function viewPages() {
- $type = $this->pages_type;
- $pages = trim($this->pages);
-
- if (empty($pages)) {
- if ($type == self::REDIRECT_NOT_LISTED) {
- return t('All pages');
- }
- return t('No pages');
- }
-
- $pages = explode("\n", preg_replace('/\r/', '', $this->pages));
- $items = [];
- foreach ($pages as $page) {
- $items[] = $type == self::REDIRECT_NOT_LISTED ? '~ ' . $page : $page;
- }
-
- return $this->renderItemList($items, t('Empty'));
- }
-
- /**
- * {@inheritdoc}
- */
- public function viewDestination() {
- if ($this->isDestinationCurrent()) {
- $scheme = 'internal';
- }
- else {
- $url = Url::fromUri($this->destination_path);
- $label = $this->destination_path;
- if ($url->isExternal()) {
- return Html::escape($label);
- }
- $scheme = parse_url($this->destination_path, PHP_URL_SCHEME);
- }
- if ($scheme === 'internal') {
- return t('Internal destination');
- }
- if ($scheme === 'entity') {
- $params = $url->getRouteParameters();
- $entity = \Drupal::entityTypeManager()
- ->getStorage('node')
- ->load(reset($params));
- return $entity->get('title')->value;
- }
-
- return Html::escape($this->destination_path);
- }
-
- /**
- * Check is destination path links to a current page or not.
- *
- * @return bool
- * TRUE or FALSE.
- */
- public function isDestinationCurrent() {
- return Unicode::strpos($this->destination_path, '') !== FALSE;
- }
-
- /**
- * Render item list.
- *
- * @param array $array
- * List of items.
- * @param string $empty_message
- * Default empty message.
- *
- * @return string|\Drupal\Core\Render\Markup
- * List of items or empty message.
- */
- protected function renderItemList(array $array, $empty_message) {
- $items = [];
- foreach ($array as $value) {
- if (!empty($value)) {
- $items[] = Html::escape($value);
- }
- }
-
- if (count($items) === 0) {
- return $empty_message;
- }
-
- $item_list = [
- '#theme' => 'item_list',
- '#items' => $items,
- '#list_type' => 'ul',
- ];
- return \Drupal::service('renderer')->render($item_list);
- }
-
- /**
- * Get all roles in the system.
- *
- * @return array
- * List of system roles.
- */
- public function getAllSystemRoles() {
- $role_options = [];
- foreach (user_roles(TRUE) as $role) {
- $role_options[$role->id()] = $role->label();
- }
- return $role_options;
- }
-
- /**
- * {@inheritdoc}
- */
- public function isEnabled() {
- return $this->enabled;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationDeleteRuleForm.php b/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationDeleteRuleForm.php
deleted file mode 100644
index 0305fa194..000000000
--- a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationDeleteRuleForm.php
+++ /dev/null
@@ -1,52 +0,0 @@
-entity;
- return $this->t('Are you sure you want to delete the login destination "@destination"?', [
- '@destination' => $login_destination->getLabel(),
- ]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('login_destination.list');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Delete');
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- /** @var $login_destination \Drupal\login_destination\Entity\LoginDestination */
- $login_destination = $this->entity;
- $login_destination->delete();
- drupal_set_message($this->t('The login destination %destination has been deleted.', [
- '%destination' => $login_destination->getLabel(),
- ]));
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationRuleForm.php b/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationRuleForm.php
deleted file mode 100644
index 9ff5a9559..000000000
--- a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationRuleForm.php
+++ /dev/null
@@ -1,301 +0,0 @@
-loginDestinationStorage = $login_destination_storage;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static($container->get('entity_type.manager')
- ->getStorage('login_destination'));
- }
-
- /**
- * {@inheritdoc}
- */
- public function form(array $form, FormStateInterface $form_state) {
- /** @var $login_destination LoginDestination */
- $login_destination = $this->entity;
-
- $form['label'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Label'),
- '#default_value' => $login_destination->getLabel(),
- '#description' => $this->t('A short description of this login destination rule.'),
- '#required' => TRUE,
- ];
-
- $form['name'] = [
- '#type' => 'machine_name',
- '#machine_name' => [
- 'exists' => [$this->loginDestinationStorage, 'load'],
- ],
- '#disabled' => !$login_destination->isNew(),
- '#default_value' => $login_destination->id(),
- '#required' => TRUE,
- '#description' => $this->t('A unique machine-readable name for this login destination rule.'),
- ];
-
- $form['triggers'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('Redirect upon triggers'),
- '#options' => [
- LoginDestination::TRIGGER_REGISTRATION => $this->t('Registration'),
- LoginDestination::TRIGGER_LOGIN => $this->t('Login'),
- LoginDestination::TRIGGER_ONE_TIME_LOGIN => $this->t('One-time login link'),
- LoginDestination::TRIGGER_LOGOUT => $this->t('Logout'),
- ],
- '#required' => TRUE,
- '#default_value' => !empty($login_destination->triggers) ? $login_destination->getTriggers() : [],
- '#description' => $this->t('Redirect only upon selected trigger(s).'),
- ];
-
- $form['destination_path'] = [
- '#type' => 'entity_autocomplete',
- '#target_type' => 'node',
- '#placeholder' => '',
- '#attributes' => [
- 'data-autocomplete-first-character-blacklist' => '/#?',
- ],
- '#title' => $this->t('Redirect destination'),
- '#default_value' => $this->getUriAsDisplayableString($login_destination->getDestination()),
- '#element_validate' => [[$this, 'validateUriElement']],
- '#maxlength' => 2048,
- '#required' => TRUE,
- '#process_default_value' => FALSE,
- '#description' => $this->t('Start typing the title of a piece of content to select it. You can also enter an internal path such as %add-node or an external URL such as %url. Enter %front to link to the front page. Enter %current to link to a current page.', [
- '%front' => '',
- '%current' => '',
- '%add-node' => '/node/add',
- '%url' => 'http://example.com',
- ]),
- ];
-
- $form['pages_type'] = [
- '#type' => 'radios',
- '#title' => $this->t('Redirect from specific pages'),
- '#default_value' => $login_destination->getPagesType(),
- '#options' => [
- $login_destination::REDIRECT_NOT_LISTED => $this->t('All pages except those listed'),
- $login_destination::REDIRECT_LISTED => $this->t('Only the listed pages'),
- ],
- ];
-
- $form['pages'] = [
- '#type' => 'textarea',
- '#default_value' => $login_destination->getPages(),
- '#description' => $this->t('Specify pages by using their paths. Enter one path per line. The \'*\' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page. %login is the login form. %register is the registration form. %reset is the one-time login (e-mail validation).', [
- '%blog' => 'blog',
- '%blog-wildcard' => '/blog/*',
- '%front' => '',
- '%login' => '/user',
- '%register' => '/user/register',
- '%reset' => '/user/*/edit',
- ]),
- ];
-
- $form['roles'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('Redirect users with roles'),
- '#options' => $login_destination->getAllSystemRoles(),
- '#default_value' => $login_destination->getRoles(),
- '#description' => $this->t('Redirect only the selected role(s). If you select no roles, all users will be redirected.'),
- ];
-
- $form['uuid'] = [
- '#type' => 'value',
- '#value' => $login_destination->get('uuid'),
- ];
-
- return parent::form($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- parent::validateForm($form, $form_state);
- // Get selected roles.
- $roles = array_filter($form_state->getValue('roles'));
-
- // Set filtered values.
- $form_state->setValue('roles', $roles);
- $form_state->setValue('triggers', array_filter($form_state->getValue('triggers')));
-
- // Get entered by user destination path.
- $destination = $form_state->getValue('destination_path');
- // @todo verify that selected role has access to entered path.
- // @todo verify entered paths to specific pages.
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $form, FormStateInterface $form_state) {
- /* @var $login_destination \Drupal\login_destination\Entity\LoginDestination */
- $login_destination = $this->entity;
-
- if ($login_destination->save()) {
- drupal_set_message($this->t('Saved the %label login destination.', [
- '%label' => $login_destination->getLabel(),
- ]));
- }
- else {
- drupal_set_message($this->t('The %label login destination was not saved.', [
- '%label' => $login_destination->getLabel(),
- ]));
- }
- $form_state->setRedirect('login_destination.list');
- }
-
- /**
- * Form element validation handler for the 'uri' element.
- *
- * Disallows saving inaccessible or untrusted URLs.
- *
- * @see LinkWidget::validateUriElement()
- */
- public function validateUriElement($element, FormStateInterface $form_state, $form) {
- $uri = $this->getUserEnteredStringAsUri($element['#value']);
- $form_state->setValueForElement($element, $uri);
-
- // If getUserEnteredStringAsUri() mapped the entered value to a 'internal:'
- // URI , ensure the raw value begins with '/', '?' or '#'.
- // @todo '' is valid input for BC reasons, may be removed by
- // https://www.drupal.org/node/2421941
- if (parse_url($uri, PHP_URL_SCHEME) === 'internal' && !in_array($element['#value'][0], [
- '/',
- '?',
- '#',
- ], TRUE) && substr($element['#value'], 0, 7) !== ''
- && substr($element['#value'], 0, 9) !== ''
- ) {
- $form_state->setError($element, t('Manually entered paths should start with /, ? or #.'));
- return;
- }
- }
-
- /**
- * Gets the URI without the 'internal:' or 'entity:' scheme.
- *
- * The following two forms of URIs are transformed:
- * - 'entity:' URIs: to entity autocomplete ("label (entity id)") strings;
- * - 'internal:' URIs: the scheme is stripped.
- *
- * This method is the inverse of ::getUserEnteredStringAsUri().
- *
- * @param string $uri
- * The URI to get the displayable string for.
- *
- * @return string
- *
- * @see LinkWidget::getUriAsDisplayableString()
- */
- protected function getUriAsDisplayableString($uri) {
- $scheme = parse_url($uri, PHP_URL_SCHEME);
-
- // By default, the displayable string is the URI.
- $displayable_string = $uri;
-
- // A different displayable string may be chosen in case of the 'internal:'
- // or 'entity:' built-in schemes.
- if ($scheme === 'internal') {
- $uri_reference = explode(':', $uri, 2)[1];
-
- // @todo '' is valid input for BC reasons, may be removed by
- // https://www.drupal.org/node/2421941
- $path = parse_url($uri, PHP_URL_PATH);
- if ($path === '/') {
- $uri_reference = '' . substr($uri_reference, 1);
- }
-
- $displayable_string = $uri_reference;
- }
- elseif ($scheme === 'entity') {
- list($entity_type, $entity_id) = explode('/', substr($uri, 7), 2);
- // Show the 'entity:' URI as the entity autocomplete would.
- $entity_manager = \Drupal::entityTypeManager();
- if ($entity_manager->getDefinition($entity_type, FALSE) && $entity = \Drupal::entityTypeManager()
- ->getStorage($entity_type)
- ->load($entity_id)
- ) {
- $displayable_string = EntityAutocomplete::getEntityLabels(array($entity));
- }
- }
-
- return $displayable_string;
- }
-
- /**
- * Gets the user-entered string as a URI.
- *
- * The following two forms of input are mapped to URIs:
- * - entity autocomplete ("label (entity id)") strings: to 'entity:' URIs;
- * - strings without a detectable scheme: to 'internal:' URIs.
- *
- * This method is the inverse of ::getUriAsDisplayableString().
- *
- * @param string $string
- * The user-entered string.
- *
- * @return string
- * The URI, if a non-empty $uri was passed.
- *
- * @see LinkWidget::getUserEnteredStringAsUri()
- */
- protected function getUserEnteredStringAsUri($string) {
- // By default, assume the entered string is an URI.
- $uri = $string;
-
- // Detect entity autocomplete string, map to 'entity:' URI.
- $entity_id = EntityAutocomplete::extractEntityIdFromAutocompleteInput($string);
- if ($entity_id !== NULL) {
- // @todo Support entity types other than 'node'. Will be fixed in
- // https://www.drupal.org/node/2423093.
- $uri = 'entity:node/' . $entity_id;
- }
- // Detect a schemeless string, map to 'internal:' URI.
- elseif (!empty($string) && parse_url($string, PHP_URL_SCHEME) === NULL) {
- // @todo '' is valid input for BC reasons, may be removed by
- // https://www.drupal.org/node/2421941
- // - '' -> '/'
- // - '#foo' -> '/#foo'
- if (strpos($string, '') === 0) {
- $string = '/' . substr($string, strlen(''));
- }
- $uri = 'internal:' . $string;
- }
-
- return $uri;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationSettingsForm.php b/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationSettingsForm.php
deleted file mode 100644
index 1b9cfad74..000000000
--- a/sites/all/modules/contrib/admin/login_destination/src/Form/LoginDestinationSettingsForm.php
+++ /dev/null
@@ -1,60 +0,0 @@
-config('login_destination.settings');
- $form['settings']['preserve_destination'] = [
- '#type' => 'checkbox',
- '#default_value' => $config->get('preserve_destination'),
- '#title' => t('Preserve the destination parameter'),
- '#description' => t("The 'destination' GET parameter will have priority over the settings of this module. With this setting enabled, redirect from the user login block will not work."),
- ];
- $form['settings']['immediate_redirect'] = [
- '#type' => 'checkbox',
- '#default_value' => $config->get('immediate_redirect'),
- '#title' => t('Redirect immediately after using one-time login link'),
- '#description' => t('User will be redirected before given the possibility to change their password.'),
- ];
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * @inheritdoc
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $config = $this->config('login_destination.settings');
- $config->set('preserve_destination', $form_state->getValue('preserve_destination'));
- $config->set('immediate_redirect', $form_state->getValue('immediate_redirect'));
- $config->save();
-
- parent::submitForm($form, $form_state);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationInterface.php b/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationInterface.php
deleted file mode 100644
index 6bacf1767..000000000
--- a/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationInterface.php
+++ /dev/null
@@ -1,117 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->aliasManager = $alias_manager;
- $this->pathMatcher = $path_matcher;
- $this->currentPath = $current_path;
- $this->configFactory = $config_factory;
- $this->requestStack = $request_stack;
- }
-
- /**
- * {@inheritdoc}
- */
- public function findDestination($trigger, AccountInterface $account) {
- $destinations = $this->entityTypeManager->getStorage('login_destination')
- ->loadMultiple();
- uasort($destinations, '\Drupal\login_destination\Entity\LoginDestination::sort');
-
- $path = $this->getCurrentPath();
- $path_alias = Unicode::strtolower($this->aliasManager->getAliasByPath($path));
-
- // Get user roles.
- $user_roles = $account->getRoles();
-
- /** @var LoginDestination $destination */
- foreach ($destinations as $destination) {
- if (!$destination->isEnabled()) {
- continue;
- }
-
- // Determine if the trigger matches that of the login destination rule.
- $destination_triggers = $destination->getTriggers();
- if (!in_array($trigger, $destination_triggers)) {
- continue;
- }
- $destination_roles = $destination->getRoles();
-
- $role_match = array_intersect($user_roles, $destination_roles);
- // Ensure the user logging in has a role allowed by the login destination rule.
- // Or Login Destination Rule does not have any selected roles.
- if (empty($role_match) && !empty($destination_roles)) {
- continue;
- }
-
- $pages = Unicode::strtolower($destination->getPages());
- if (!empty($pages)) {
- $type = $destination->getPagesType();
- $page_match = $this->pathMatcher->matchPath($path_alias, $pages) || $this->pathMatcher->matchPath($path, $pages);
-
- // Make sure the page matches(or does not match if the rule specifies that).
- if (($page_match && $type == $destination::REDIRECT_LISTED) || (!$page_match && $type == $destination::REDIRECT_NOT_LISTED)) {
-
- return $destination;
- }
- continue;
- }
-
- return $destination;
- }
-
- return FALSE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function prepareDestination(LoginDestination $destination) {
- // Get config with settings.
- $config = $this->configFactory->get('login_destination.settings');
- if ($config->get('preserve_destination')) {
- // Get current destination value.
- $drupal_destination = $this->requestStack->getCurrentRequest()->query->get('destination');
- if (UrlHelper::isExternal($drupal_destination)) {
- $drupal_destination = NULL;
- }
- // Determine if a destination exist in the URL.
- if (!empty($drupal_destination)) {
- return;
- }
- }
-
- // Prepare destination path.
- $path = $destination->getDestination();
- // Check if rules refers to the current page.
- if ($destination->isDestinationCurrent()) {
- $request = $this->requestStack->getCurrentRequest();
- $query = $request->get('current');
- $path_destination = !empty($query) ? $query : '';
- }
- else {
- $path_destination = Url::fromUri($path)->toString();
- }
-
- // Set destination to current request.
- $this->requestStack->getCurrentRequest()->query->set('destination', $path_destination);
- }
-
- /**
- * Get current path.
- *
- * @return string
- */
- protected function getCurrentPath() {
- $current = $this->requestStack->getCurrentRequest()->get('current', '');
- if (empty($current)) {
- $current = $this->currentPath->getPath();
- }
- return $current;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationManagerInterface.php b/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationManagerInterface.php
deleted file mode 100644
index 46c1b7973..000000000
--- a/sites/all/modules/contrib/admin/login_destination/src/LoginDestinationManagerInterface.php
+++ /dev/null
@@ -1,33 +0,0 @@
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/matomo/README.txt b/sites/all/modules/contrib/admin/matomo/README.txt
deleted file mode 100644
index 9d5dd11a2..000000000
--- a/sites/all/modules/contrib/admin/matomo/README.txt
+++ /dev/null
@@ -1,109 +0,0 @@
-
-Module: Matomo Analytics
-Author: Alexander Hass
-
-
-Description
-===========
-Adds the Matomo tracking system to your website.
-
-Requirements
-============
-
-* Matomo installation
-* Matomo website ID
-
-
-Installation
-============
-* Copy the 'matomo' module directory in to your Drupal 'modules'
-directory as usual.
-
-
-Usage
-=====
-In the settings page enter your Matomo website ID.
-
-All pages will now have the required JavaScript added to the
-HTML footer can confirm this by viewing the page source from
-your browser.
-
-Page specific tracking
-====================================================
-The default is set to "Add to every page except the listed pages". By
-default the following pages are listed for exclusion:
-
-/admin
-/admin/*
-/batch
-/node/add*
-/node/*/*
-/user/*/*
-
-These defaults are changeable by the website administrator or any other
-user with 'Administer Matomo' permission.
-
-Like the blocks visibility settings in Drupal core, there is a choice for
-"Add if the following PHP code returns TRUE." Sample PHP snippets that can be
-used in this textarea can be found on the handbook page "Overview-approach to
-block visibility" at https://drupal.org/node/64135.
-
-Custom variables
-=================
-One example for custom variables tracking is the "User roles" tracking. Enter
-the below configuration data into the custom variables settings form under
-admin/config/system/matomo.
-
-Slot: 1
-Name: User roles
-Value: [current-user:matomo-role-names]
-Scope: Visitor
-
-Slot: 1
-Name: User ids
-Value: [current-user:matomo-role-ids]
-Scope: Visitor
-
-More details about custom variables can be found in the Matomo API documentation
-at https://matomo.org/docs/javascript-tracking/#toc-custom-variables.
-
-
-Advanced Settings
-=================
-You can include additional JavaScript snippets in the custom javascript
-code textarea. These can be found on various blog posts, or on the
-official Matomo pages. Support is not provided for any customisations
-you include.
-
-To speed up page loading you may also cache the Matomo "piwik.js"
-file locally.
-
-Known issues
-============
-Drupal requirements (https://drupal.org/requirements) tell you to configure
-PHP with "session.save_handler = user", but your Matomo installation may
-not work with this configuration and gives you a server error 500.
-
-1. You are able to workaround with the PHP default in your php.ini:
-
- [Session]
- session.save_handler = files
-
-2. With Apache you may overwrite the PHP setting for the Matomo directory only.
- If Matomo is installed in /matomo you are able to create a .htaccess file in
- this directory with the below code:
-
- # PHP 4, Apache 1.
-
- php_value session.save_handler files
-
-
- # PHP 4, Apache 2.
-
- php_value session.save_handler files
-
-
- # PHP 5, Apache 1 and 2.
-
- php_value session.save_handler files
-
diff --git a/sites/all/modules/contrib/admin/matomo/composer.json b/sites/all/modules/contrib/admin/matomo/composer.json
deleted file mode 100644
index 8799b1bfe..000000000
--- a/sites/all/modules/contrib/admin/matomo/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "drupal/matomo",
- "description": "Adds Matomo javascript tracking code to all your site's pages",
- "type": "drupal-module",
- "homepage": "https://www.drupal.org/project/matomo",
- "authors": [
- {
- "name": "hass",
- "homepage": "https://www.drupal.org/u/hass"
- },
- {
- "name": "See other contributors",
- "homepage":"https://www.drupal.org/node/247808/committers"
- }
- ],
- "support": {
- "issues": "https://www.drupal.org/project/issues/matomo",
- "source": "https://git.drupal.org/project/matomo.git"
- },
- "license": "GPL-2.0+",
- "require": {
- "drupal/core": "~8.5"
- }
-}
diff --git a/sites/all/modules/contrib/admin/matomo/config/install/matomo.settings.yml b/sites/all/modules/contrib/admin/matomo/config/install/matomo.settings.yml
deleted file mode 100644
index bb7df96fd..000000000
--- a/sites/all/modules/contrib/admin/matomo/config/install/matomo.settings.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-site_id: ''
-url_http: ''
-url_https: ''
-domain_mode: 0
-visibility:
- request_path_mode: 0
- request_path_pages: "/admin\n/admin/*\n/batch\n/node/add*\n/node/*/*\n/user/*/*"
- user_role_mode: 0
- user_role_roles: { }
- user_account_mode: 1
-track:
- mailto: true
- files: true
- files_extensions: '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip'
- colorbox: true
- userid: false
- messages: { }
- site_search: false
-privacy:
- donottrack: true
-custom:
- variable: { }
-codesnippet:
- before: ''
- after: ''
-translation_set: false
-cache: false
-page_title_hierarchy: false
-page_title_hierarchy_exclude_home: true
diff --git a/sites/all/modules/contrib/admin/matomo/config/schema/matomo.schema.yml b/sites/all/modules/contrib/admin/matomo/config/schema/matomo.schema.yml
deleted file mode 100644
index 1b9d213b6..000000000
--- a/sites/all/modules/contrib/admin/matomo/config/schema/matomo.schema.yml
+++ /dev/null
@@ -1,120 +0,0 @@
-# Schema for the configuration files of the matomo module.
-
-matomo.settings:
- type: config_object
- label: 'Matomo settings'
- mapping:
- site_id:
- type: string
- label: 'Matomo site ID'
- url_http:
- type: string
- label: 'Matomo HTTP URL'
- url_https:
- type: string
- label: 'Matomo HTTPS URL'
- domain_mode:
- type: integer
- label: 'What are you tracking?'
- visibility:
- type: mapping
- label: 'Visibility'
- mapping:
- request_path_mode:
- type: integer
- label: 'Add tracking to specific pages'
- request_path_pages:
- type: string
- label: 'Pages by their paths'
- user_role_mode:
- type: integer
- label: 'Add tracking for specific roles'
- user_role_roles:
- type: sequence
- label: 'Roles'
- sequence:
- type: string
- label: 'Role'
- user_account_mode:
- type: integer
- label: 'Allow users to customize tracking on their account page'
- track:
- type: mapping
- label: 'Links and downloads'
- mapping:
- mailto:
- type: boolean
- label: 'Track clicks on mailto links'
- files:
- type: boolean
- label: 'Track downloads'
- files_extensions:
- type: string
- label: 'File extension list'
- colorbox:
- type: boolean
- label: 'Track content in colorbox modal dialogs'
- userid:
- type: boolean
- label: 'Track User ID'
- messages:
- type: sequence
- label: 'Track messages of type'
- sequence:
- type: string
- label: 'Message type'
- site_search:
- type: boolean
- label: 'Track internal search'
- privacy:
- type: mapping
- label: 'Privacy'
- mapping:
- donottrack:
- type: boolean
- label: 'Universal web tracking opt-out'
- custom:
- type: mapping
- label: 'Custom variables'
- mapping:
- variable:
- type: sequence
- label: 'Custom variable'
- sequence:
- type: mapping
- label: 'Variable'
- mapping:
- slot:
- type: integer
- label: 'Slot number'
- name:
- type: string
- label: 'The custom variable name.'
- value:
- type: string
- label: 'The custom variable value.'
- scope:
- type: string
- label: 'The scope for the custom variable.'
- codesnippet:
- type: mapping
- label: 'Custom code snippets'
- mapping:
- before:
- type: string
- label: 'Code snippet (before)'
- after:
- type: string
- label: 'Code snippet (after)'
- translation_set:
- type: boolean
- label: 'Track translation sets as one unit'
- cache:
- type: boolean
- label: 'Locally cache tracking code file'
- page_title_hierarchy:
- type: boolean
- label: 'Show page titles as hierarchy like breadcrumbs'
- page_title_hierarchy_exclude_home:
- type: boolean
- label: 'Hide home page from hierarchy'
diff --git a/sites/all/modules/contrib/admin/matomo/js/matomo.admin.js b/sites/all/modules/contrib/admin/matomo/js/matomo.admin.js
deleted file mode 100644
index 2f68188fe..000000000
--- a/sites/all/modules/contrib/admin/matomo/js/matomo.admin.js
+++ /dev/null
@@ -1,141 +0,0 @@
-/**
- * @file
- * Matomo admin behaviors.
- */
-
-(function ($) {
-
- "use strict";
-
- /**
- * Provide the summary information for the tracking settings vertical tabs.
- */
- Drupal.behaviors.trackingSettingsSummary = {
- attach: function () {
- // Make sure this behavior is processed only if drupalSetSummary is defined.
- if (typeof jQuery.fn.drupalSetSummary === 'undefined') {
- return;
- }
-
- $('#edit-page-visibility-settings').drupalSetSummary(function (context) {
- var $radio = $('input[name="matomo_visibility_request_path_mode"]:checked', context);
- if ($radio.val() === '0') {
- if (!$('textarea[name="matomo_visibility_request_path_pages"]', context).val()) {
- return Drupal.t('Not restricted');
- }
- else {
- return Drupal.t('All pages with exceptions');
- }
- }
- else {
- return Drupal.t('Restricted to certain pages');
- }
- });
-
- $('#edit-role-visibility-settings').drupalSetSummary(function (context) {
- var vals = [];
- $('input[type="checkbox"]:checked', context).each(function () {
- vals.push($.trim($(this).next('label').text()));
- });
- if (!vals.length) {
- return Drupal.t('Not restricted');
- }
- else if ($('input[name="matomo_visibility_user_role_mode"]:checked', context).val() === '1') {
- return Drupal.t('Excepted: @roles', {'@roles': vals.join(', ')});
- }
- else {
- return vals.join(', ');
- }
- });
-
- $('#edit-user-visibility-settings').drupalSetSummary(function (context) {
- var $radio = $('input[name="matomo_visibility_user_account_mode"]:checked', context);
- if ($radio.val() === '0') {
- return Drupal.t('Not customizable');
- }
- else if ($radio.val() === '1') {
- return Drupal.t('On by default with opt out');
- }
- else {
- return Drupal.t('Off by default with opt in');
- }
- });
-
- $('#edit-linktracking').drupalSetSummary(function (context) {
- var vals = [];
- if ($('input#edit-matomo-trackmailto', context).is(':checked')) {
- vals.push(Drupal.t('Mailto links'));
- }
- if ($('input#edit-matomo-trackfiles', context).is(':checked')) {
- vals.push(Drupal.t('Outbound links'));
- vals.push(Drupal.t('Downloads'));
- }
- if ($('input#edit-matomo-trackcolorbox', context).is(':checked')) {
- vals.push(Drupal.t('Colorbox'));
- }
- if (!vals.length) {
- return Drupal.t('Not tracked');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
-
- $('#edit-messagetracking').drupalSetSummary(function (context) {
- var vals = [];
- $('input[type="checkbox"]:checked', context).each(function () {
- vals.push($.trim($(this).next('label').text()));
- });
- if (!vals.length) {
- return Drupal.t('Not tracked');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
-
- $('#edit-search').drupalSetSummary(function (context) {
- var vals = [];
- if ($('input#edit-matomo-site-search', context).is(':checked')) {
- vals.push(Drupal.t('Site search'));
- }
- if (!vals.length) {
- return Drupal.t('Not tracked');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
-
- $('#edit-domain-tracking').drupalSetSummary(function (context) {
- var $radio = $('input[name="matomo_domain_mode"]:checked', context);
- if ($radio.val() === '0') {
- return Drupal.t('A single domain');
- }
- else if ($radio.val() === '1') {
- return Drupal.t('One domain with multiple subdomains');
- }
- });
-
- $('#edit-page-title-hierarchy').drupalSetSummary(function (context) {
- var vals = [];
- if ($('input#edit-matomo-page-title-hierarchy', context).is(':checked')) {
- vals.push(Drupal.t('Show page titles'));
- }
- if ($('input#edit-matomo-page-title-hierarchy-exclude-home', context).is(':checked')) {
- vals.push(Drupal.t('Hide home page'));
- }
- if (!vals.length) {
- return Drupal.t('Not tracked');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
-
- $('#edit-privacy').drupalSetSummary(function (context) {
- var vals = [];
- if ($('input#edit-matomo-privacy-donottrack', context).is(':checked')) {
- vals.push(Drupal.t('Universal web tracking opt-out'));
- }
- if (!vals.length) {
- return Drupal.t('No privacy');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
- }
- };
-
-})(jQuery);
diff --git a/sites/all/modules/contrib/admin/matomo/js/matomo.js b/sites/all/modules/contrib/admin/matomo/js/matomo.js
deleted file mode 100644
index 9b3a7b34d..000000000
--- a/sites/all/modules/contrib/admin/matomo/js/matomo.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * @file
- * Attaches several event listener to a web page.
- */
-
-(function ($, drupalSettings) {
-
- "use strict";
-
- $(document).ready(function () {
-
- // Attach mousedown, keyup, touchstart events to document only and catch
- // clicks on all elements.
- $(document.body).bind("mousedown keyup touchstart", function (event) {
-
- // Catch the closest surrounding link of a clicked element.
- $(event.target).closest("a,area").each(function () {
-
- if (drupalSettings.matomo.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) {
- // Mailto link clicked.
- _paq.push(["trackEvent", "Mails", "Click", this.href.substring(7)]);
- }
-
- });
- });
-
- // Colorbox: This event triggers when the transition has completed and the
- // newly loaded content has been revealed.
- if (drupalSettings.matomo.trackColorbox) {
- $(document).bind("cbox_complete", function () {
- var href = $.colorbox.element().attr("href");
- if (href) {
- _paq.push(["setCustomUrl", href]);
- _paq.push(["trackPageView"]);
- }
- });
- }
-
- });
-
-})(jQuery, drupalSettings);
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.info.yml b/sites/all/modules/contrib/admin/matomo/matomo.info.yml
deleted file mode 100644
index 4bc2bc4aa..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.info.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: 'Matomo Analytics'
-type: module
-description: "Adds Matomo javascript tracking code to all your site's pages."
-package: Statistics
-# core: 8.x
-configure: matomo.admin_settings_form
-dependencies:
- - drupal:system (>= 8.5)
-test_dependencies:
- - php:php
- - token:token
-
-# Information added by Drupal.org packaging script on 2019-02-08
-version: '8.x-1.9'
-core: '8.x'
-project: 'matomo'
-datestamp: 1549615102
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.install b/sites/all/modules/contrib/admin/matomo/matomo.install
deleted file mode 100644
index b3f5a0b61..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.install
+++ /dev/null
@@ -1,55 +0,0 @@
-grantPermission('opt-in or out of matomo tracking');
- $success = $role->save();
- if ($success) {
- $messenger = \Drupal::messenger();
- $messenger->addMessage(t('Module %module granted %permission permission to authenticated users.', ['%module' => 'Matomo Analytics', '%permission' => t('Opt-in or out of tracking')]), 'status');
- }
-}
-
-/**
- * Implements hook_uninstall().
- *
- * Remove cache directory if module is uninstalled.
- */
-function matomo_uninstall() {
- matomo_clear_js_cache();
-}
-
-/**
- * Implements hook_requirements().
- */
-function matomo_requirements($phase) {
- $requirements = [];
-
- if ($phase == 'runtime') {
- $config = \Drupal::config('matomo.settings');
-
- // Raise warning if Matomo user account has not been set yet.
- if (!preg_match('/^\d{1,}$/', $config->get('site_id'))) {
- $requirements['matomo_site_id'] = [
- 'title' => t('Matomo module'),
- 'description' => t('Matomo module has not been configured yet. Please configure its settings from the Matomo settings page.', [':url' => Url::fromRoute('matomo.admin_settings_form')->toString()]),
- 'severity' => REQUIREMENT_WARNING,
- 'value' => t('Not configured'),
- ];
- }
- }
-
- return $requirements;
-}
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.libraries.yml b/sites/all/modules/contrib/admin/matomo/matomo.libraries.yml
deleted file mode 100644
index abcd74059..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.libraries.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-matomo:
- version: VERSION
- js:
- js/matomo.js: {}
- dependencies:
- - core/jquery
- - core/drupalSettings
-
-matomo.admin:
- version: VERSION
- js:
- js/matomo.admin.js: {}
- dependencies:
- - core/jquery
- - core/drupal
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.links.menu.yml b/sites/all/modules/contrib/admin/matomo/matomo.links.menu.yml
deleted file mode 100644
index c88165a25..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.links.menu.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-matomo.admin_settings_form:
- title: 'Matomo Analytics'
- parent: system.admin_config_system
- description: 'Configure the settings used to generate your Matomo tracking code.'
- route_name: matomo.admin_settings_form
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.links.task.yml b/sites/all/modules/contrib/admin/matomo/matomo.links.task.yml
deleted file mode 100644
index aa22e5a6e..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.links.task.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-matomo.admin_settings_form_tab:
- route_name: matomo.admin_settings_form
- title: Settings
- base_route: matomo.admin_settings_form
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.module b/sites/all/modules/contrib/admin/matomo/matomo.module
deleted file mode 100644
index 2c422ff4d..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.module
+++ /dev/null
@@ -1,729 +0,0 @@
-
- */
-
-use Drupal\Component\Serialization\Json;
-use Drupal\Component\Utility\Crypt;
-use Drupal\Component\Utility\Unicode;
-use Drupal\Component\Utility\UrlHelper;
-use Drupal\Core\Cache\Cache;
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\Core\Site\Settings;
-use Drupal\Core\Url;
-use Drupal\matomo\MatomoInterface;
-use Drupal\node\NodeInterface;
-use GuzzleHttp\Exception\RequestException;
-use Drupal\matomo\Component\Render\MatomoJavaScriptSnippet;
-
-/**
- * Implements hook_help().
- */
-function matomo_help($route_name, RouteMatchInterface $route_match) {
- switch ($route_name) {
- case 'matomo.admin_settings_form':
- return t('Matomo Analytics is an open source (GPL license) web analytics software. It gives interesting reports on your website visitors, your popular pages, the search engines keywords they used, the language they speak... and so much more. Matomo aims to be an open source alternative to Google Analytics.', [':pk_url' => 'https://www.matomo.org/']);
- }
-}
-
-/**
- * Implements hook_page_attachments().
- *
- * Insert JavaScript to the appropriate scope/region of the page.
- */
-function matomo_page_attachments(array &$page) {
- $account = \Drupal::currentUser();
- $config = \Drupal::config('matomo.settings');
- $id = $config->get('site_id');
- $request = \Drupal::request();
-
- // Add module cache tags.
- $page['#cache']['tags'] = Cache::mergeTags(isset($page['#cache']['tags']) ? $page['#cache']['tags'] : [], $config->getCacheTags());
-
- // Get page http status code for visibility filtering.
- $status = NULL;
- if ($exception = $request->attributes->get('exception')) {
- $status = $exception->getStatusCode();
- }
- $trackable_status_codes = [
- // "Forbidden" status code.
- '403',
- // "Not Found" status code.
- '404',
- ];
-
- // 1. Check if the matomo account number has a valid value.
- // 2. Track page views based on visibility value.
- // 3. Check if we should track the currently active user's role.
- if (preg_match('/^\d{1,}$/', $id) && (_matomo_visibility_pages() || in_array($status, $trackable_status_codes)) && _matomo_visibility_user($account)) {
-
- $url_http = $config->get('url_http');
- $url_https = $config->get('url_https');
-
- $set_custom_url = '';
- $set_document_title = '';
-
- // Add link tracking.
- $link_settings = [];
- $link_settings['trackMailto'] = $config->get('track.mailto');
-
- if ((\Drupal::moduleHandler()->moduleExists('colorbox')) && $track_colorbox = $config->get('track.colorbox')) {
- $link_settings['trackColorbox'] = $track_colorbox;
- }
-
- $page['#attached']['drupalSettings']['matomo'] = $link_settings;
- $page['#attached']['library'][] = 'matomo/matomo';
-
- // Matomo can show a tree view of page titles that represents the site
- // structure if setDocumentTitle() provides the page titles as a "/"
- // delimited list. This may makes it easier to browse through the statistics
- // of page titles on larger sites.
- if ($config->get('page_title_hierarchy') == TRUE) {
- $titles = _matomo_get_hierarchy_titles();
-
- // Remove all empty titles.
- $titles = array_filter($titles);
-
- if (!empty($titles)) {
- // Encode title, at least to keep "/" intact.
- $titles = array_map('rawurlencode', $titles);
-
- $set_document_title = Json::encode(implode('/', $titles));
- }
- }
-
- // Add messages tracking.
- $message_events = '';
- if ($message_types = $config->get('track.messages')) {
- $message_types = array_values(array_filter($message_types));
- $status_heading = [
- 'status' => t('Status message'),
- 'warning' => t('Warning message'),
- 'error' => t('Error message'),
- ];
-
- foreach (\Drupal::messenger()->all(NULL, FALSE) as $type => $messages) {
- // Track only the selected message types.
- if (in_array($type, $message_types)) {
- foreach ($messages as $message) {
- $message_events .= '_paq.push(["trackEvent", ' . Json::encode(t('Messages')) . ', ' . Json::encode($status_heading[$type]) . ', ' . Json::encode(strip_tags($message)) . ']);';
- }
- }
- }
- }
-
- // If this node is a translation of another node, pass the original
- // node instead.
- if (\Drupal::moduleHandler()->moduleExists('content_translation') && $config->get('translation_set')) {
- // Check if we have a node object, it has translation enabled, and its
- // language code does not match its source language code.
- if ($request->attributes->has('node')) {
- $node = $request->attributes->get('node');
- if ($node instanceof NodeInterface && \Drupal::service('entity.repository')->getTranslationFromContext($node) !== $node->getUntranslated()) {
- $set_custom_url = Json::encode(Url::fromRoute('entity.node.canonical', ['node' => $node->id()], ['language' => $node->getUntranslated()->language()])->toString());
- }
- }
- }
-
- // Track access denied (403) and file not found (404) pages.
- if ($status == '403') {
- $set_document_title = '"403/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)';
- }
- elseif ($status == '404') {
- $set_document_title = '"404/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)';
- }
-
- // #2693595: User has entered an invalid login and clicked on forgot
- // password link. This link contains the username or email address and may
- // get send to Matomo if we do not override it. Override only if 'name'
- // query param exists. Last custom url condition, this need to win.
- //
- // URLs to protect are:
- // - user/password?name=username
- // - user/password?name=foo@example.com
- if (\Drupal::routeMatch()->getRouteName() == 'user.pass' && $request->query->has('name')) {
- $set_custom_url = Json::encode(Url::fromRoute('user.pass')->toString());
- }
-
- // Add custom variables.
- $matomo_custom_vars = $config->get('custom.variable');
- $custom_variable = '';
- for ($i = 1; $i < 6; $i++) {
- $custom_var_name = !empty($matomo_custom_vars[$i]['name']) ? $matomo_custom_vars[$i]['name'] : '';
- if (!empty($custom_var_name)) {
- $custom_var_value = !empty($matomo_custom_vars[$i]['value']) ? $matomo_custom_vars[$i]['value'] : '';
- $custom_var_scope = !empty($matomo_custom_vars[$i]['scope']) ? $matomo_custom_vars[$i]['scope'] : 'visit';
-
- $types = [];
- if ($request->attributes->has('node')) {
- $node = $request->attributes->get('node');
- if ($node instanceof NodeInterface) {
- $types += ['node' => $node];
- }
- }
- $custom_var_name = \Drupal::token()->replace($custom_var_name, $types, ['clear' => TRUE]);
- $custom_var_value = \Drupal::token()->replace($custom_var_value, $types, ['clear' => TRUE]);
-
- // Suppress empty custom names and/or variables.
- if (!Unicode::strlen(trim($custom_var_name)) || !Unicode::strlen(trim($custom_var_value))) {
- continue;
- }
-
- // Custom variables names and values are limited to 200 characters in
- // length. It is recommended to store values that are as small as
- // possible to ensure that the Matomo Tracking request URL doesn't go
- // over the URL limit for the webserver or browser.
- $custom_var_name = rtrim(substr($custom_var_name, 0, 200));
- $custom_var_value = rtrim(substr($custom_var_value, 0, 200));
-
- // Add variables to tracker.
- $custom_variable .= '_paq.push(["setCustomVariable", ' . Json::encode($i) . ', ' . Json::encode($custom_var_name) . ', ' . Json::encode($custom_var_value) . ', ' . Json::encode($custom_var_scope) . ']);';
- }
- }
-
- // Add any custom code snippets if specified.
- $codesnippet_before = $config->get('codesnippet.before');
- $codesnippet_after = $config->get('codesnippet.after');
-
- // Build tracker code.
- // @see https://matomo.org/docs/javascript-tracking/#toc-asynchronous-tracking
- $script = 'var _paq = _paq || [];';
- $script .= '(function(){';
- $script .= 'var u=(("https:" == document.location.protocol) ? "' . UrlHelper::filterBadProtocol($url_https) . '" : "' . UrlHelper::filterBadProtocol($url_http) . '");';
- $script .= '_paq.push(["setSiteId", ' . Json::encode($id) . ']);';
- $script .= '_paq.push(["setTrackerUrl", u+"piwik.php"]);';
-
- // Track logged in users across all devices.
- if ($config->get('track.userid') && $account->isAuthenticated()) {
- $script .= '_paq.push(["setUserId", ' . Json::encode(matomo_user_id_hash($account->id())) . ']);';
- }
-
- // Set custom url.
- if (!empty($set_custom_url)) {
- $script .= '_paq.push(["setCustomUrl", ' . $set_custom_url . ']);';
- }
- // Set custom document title.
- if (!empty($set_document_title)) {
- $script .= '_paq.push(["setDocumentTitle", ' . $set_document_title . ']);';
- }
-
- // Custom file download extensions.
- if ($config->get('track.files') && !($config->get('track.files_extensions') == MatomoInterface::MATOMO_TRACKFILES_EXTENSIONS)) {
- $script .= '_paq.push(["setDownloadExtensions", ' . Json::encode($config->get('track.files_extensions')) . ']);';
- }
-
- // Disable tracking for visitors who have opted out from tracking via DNT
- // (Do-Not-Track) header.
- if ($config->get('privacy.donottrack')) {
- $script .= '_paq.push(["setDoNotTrack", 1]);';
- }
-
- // Domain tracking type.
- global $cookie_domain;
- $domain_mode = $config->get('domain_mode');
-
- // Per RFC 2109, cookie domains must contain at least one dot other than the
- // first. For hosts such as 'localhost' or IP Addresses we don't set a
- // cookie domain.
- if ($domain_mode == 1 && count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
- $script .= '_paq.push(["setCookieDomain", ' . Json::encode($cookie_domain) . ']);';
- }
-
- // Ordering $custom_variable before $codesnippet_before allows users to add
- // custom code snippets that may use deleteCustomVariable() and/or
- // getCustomVariable().
- if (!empty($custom_variable)) {
- $script .= $custom_variable;
- }
- if (!empty($codesnippet_before)) {
- $script .= $codesnippet_before;
- }
-
- // Site search tracking support.
- // NOTE: It's recommended not to call trackPageView() on the Site Search
- // Result page.
- if (\Drupal::moduleHandler()->moduleExists('search') && $config->get('track.site_search') && (strpos(\Drupal::routeMatch()->getRouteName(), 'search.view') === 0) && $keys = ($request->query->has('keys') ? trim($request->get('keys')) : '')) {
- // Parameters:
- // 1. Search keyword searched for. Example: "Banana"
- // 2. Search category selected in your search engine. If you do not need
- // this, set to false. Example: "Organic Food"
- // 3. Number of results on the Search results page. Zero indicates a
- // 'No Result Search Keyword'. Set to false if you don't know.
- //
- // hook_preprocess_search_results() is not executed if search result is
- // empty. Make sure the counter is set to 0 if there are no results.
- $script .= '_paq.push(["trackSiteSearch", ' . Json::encode($keys) . ', false, (window.matomo_search_results) ? window.matomo_search_results : 0]);';
- }
- else {
- $script .= '_paq.push(["trackPageView"]);';
- }
-
- // Add link tracking.
- if ($config->get('track.files')) {
- // Disable tracking of links with ".no-tracking" and ".colorbox" classes.
- $ignore_classes = [
- 'no-tracking',
- 'colorbox',
- ];
- // Disable the download & outlink tracking for specific CSS classes.
- // Custom code snippets with 'setIgnoreClasses' will override the value.
- // @see https://developer.matomo.org/api-reference/tracking-javascript#disable-the-download-amp-outlink-tracking-for-specific-css-classes
- $script .= '_paq.push(["setIgnoreClasses", ' . Json::encode($ignore_classes) . ']);';
-
- // Enable download & outlink link tracking.
- $script .= '_paq.push(["enableLinkTracking"]);';
- }
-
- if (!empty($message_events)) {
- $script .= $message_events;
- }
- if (!empty($codesnippet_after)) {
- $script .= $codesnippet_after;
- }
-
- $script .= 'var d=document,';
- $script .= 'g=d.createElement("script"),';
- $script .= 's=d.getElementsByTagName("script")[0];';
- $script .= 'g.type="text/javascript";';
- $script .= 'g.defer=true;';
- $script .= 'g.async=true;';
-
- // Should a local cached copy of the tracking code be used?
- if ($config->get('cache') && $url = _matomo_cache($url_http . 'piwik.js')) {
- // A dummy query-string is added to filenames, to gain control over
- // browser-caching. The string changes on every update or full cache
- // flush, forcing browsers to load a new copy of the files, as the
- // URL changed.
- $query_string = '?' . (\Drupal::state()->get('system.css_js_query_string') ?: '0');
-
- $script .= 'g.src="' . $url . $query_string . '";';
- }
- else {
- $script .= 'g.src=u+"piwik.js";';
- }
-
- $script .= 's.parentNode.insertBefore(g,s);';
- $script .= '})();';
-
- // Add tracker code.
- $page['#attached']['html_head'][] = [
- [
- '#tag' => 'script',
- '#value' => new MatomoJavaScriptSnippet($script),
- ],
- 'matomo_tracking_script',
- ];
- }
-}
-
-/**
- * Generate user id hash to implement USER_ID.
- *
- * The USER_ID value should be a unique, persistent, and non-personally
- * identifiable string identifier that represents a user or signed-in
- * account across devices.
- *
- * @param int $uid
- * User id.
- *
- * @return string
- * User id hash.
- */
-function matomo_user_id_hash($uid) {
- return Crypt::hmacBase64($uid, \Drupal::service('private_key')->get() . Settings::getHashSalt());
-}
-
-/**
- * Implements hook_entity_extra_field_info().
- */
-function matomo_entity_extra_field_info() {
- $extra['user']['user']['form']['matomo'] = [
- 'label' => t('Matomo settings'),
- 'description' => t('Matomo module form element.'),
- 'weight' => 3,
- ];
-
- return $extra;
-}
-
-/**
- * Implements hook_form_FORM_ID_alter().
- *
- * Allow users to decide if tracking code will be added to pages or not.
- */
-function matomo_form_user_form_alter(&$form, FormStateInterface $form_state) {
- $config = \Drupal::config('matomo.settings');
- $account = $form_state->getFormObject()->getEntity();
-
- if ($account->hasPermission('opt-in or out of matomo tracking') && ($visibility_users = $config->get('visibility.user_account_mode')) != 0 && _matomo_visibility_roles($account)) {
- $account_data_matomo = \Drupal::service('user.data')->get('matomo', $account->id());
-
- $form['matomo'] = [
- '#type' => 'details',
- '#title' => t('Matomo settings'),
- '#weight' => 3,
- '#open' => TRUE,
- ];
-
- switch ($visibility_users) {
- case 1:
- $description = t('Users are tracked by default, but you are able to opt out.');
- break;
-
- case 2:
- $description = t('Users are not tracked by default, but you are able to opt in.');
- break;
- }
-
- // Disable tracking for visitors who have opted out from tracking via DNT
- // (Do-Not-Track) header.
- $disabled = FALSE;
- if ($config->get('privacy.donottrack') && !empty($_SERVER['HTTP_DNT'])) {
- $disabled = TRUE;
-
- // Override settings value.
- $account_data_matomo['users'] = FALSE;
-
- $description .= '';
- $description .= ' ' . t('You have opted out from tracking via browser privacy settings.');
- $description .= '';
- }
-
- // Migrate old piwik settings to matomo.
- $account_data_piwik = \Drupal::service('user.data')->get('piwik', $account->id());
- if (isset($account_data_piwik['user_account_users'])) {
- $account_data_matomo['user_account_users'] = $account_data_piwik['user_account_users'];
- }
-
- $form['matomo']['user_account_users'] = [
- '#type' => 'checkbox',
- '#title' => t('Enable user tracking'),
- '#description' => $description,
- '#default_value' => isset($account_data_matomo['user_account_users']) ? $account_data_matomo['user_account_users'] : ($visibility_users == 1),
- '#disabled' => $disabled,
- ];
-
- // hook_user_update() is missing in D8, add custom submit handler.
- $form['actions']['submit']['#submit'][] = 'matomo_user_profile_form_submit';
- }
-}
-
-/**
- * Submit callback for user profile form to save the Matomo setting.
- */
-function matomo_user_profile_form_submit($form, FormStateInterface $form_state) {
- $account = $form_state->getFormObject()->getEntity();
- if ($account->id() && $form_state->hasValue('user_account_users')) {
- \Drupal::service('user.data')->set('matomo', $account->id(), 'user_account_users', (int) $form_state->getValue('user_account_users'));
- }
-
- // Remove old piwik setting to complete migration to matomo.
- $account_data_piwik = \Drupal::service('user.data')->get('piwik', $account->id());
- if (isset($account_data_piwik)) {
- \Drupal::service('user.data')->delete('piwik', $account->id());
- }
-}
-
-/**
- * Implements hook_cron().
- */
-function matomo_cron() {
- $config = \Drupal::config('matomo.settings');
- $request_time = \Drupal::time()->getRequestTime();
-
- // Regenerate the piwik.js every day.
- if ($request_time - \Drupal::state()->get('matomo.last_cache') >= 86400 && $config->get('cache')) {
- _matomo_cache($config->get('url_http') . 'piwik.js', TRUE);
- \Drupal::state()->set('matomo.last_cache', $request_time);
- }
-}
-
-/**
- * Implements hook_preprocess_item_list__search_results().
- *
- * Collects and adds the number of search results to the head.
- */
-function matomo_preprocess_item_list__search_results(&$variables) {
- $config = \Drupal::config('matomo.settings');
-
- // Only run on search results list.
- if ($config->get('track.site_search')) {
- // There is no search result $variable available that hold the number of
- // items found. The variable $variables['items'] has the current page items
- // only. But the pager item mumber can tell the number of search results.
- global $pager_total_items;
-
- $variables['#attached']['html_head'][] = [
- [
- '#tag' => 'script',
- '#value' => 'window.matomo_search_results = ' . intval($pager_total_items[0]) . ';',
- '#weight' => JS_LIBRARY - 1,
- ],
- 'matomo_search_script',
- ];
- }
-}
-
-/**
- * Download/Synchronize/Cache tracking code file locally.
- *
- * @param string $location
- * The full URL to the external javascript file.
- * @param bool $synchronize
- * Synchronize to local cache if remote file has changed.
- *
- * @return mixed
- * The path to the local javascript file on success, boolean FALSE on failure.
- */
-function _matomo_cache($location, $synchronize = FALSE) {
- $path = 'public://matomo';
- $file_destination = $path . '/' . basename($location);
-
- if (!file_exists($file_destination) || $synchronize) {
- // Download the latest tracking code.
- try {
- $data = \Drupal::httpClient()
- ->get($location)
- ->getBody(TRUE);
-
- if (file_exists($file_destination)) {
- // Synchronize tracking code and and replace local file if outdated.
- $data_hash_local = Crypt::hashBase64(file_get_contents($file_destination));
- $data_hash_remote = Crypt::hashBase64($data);
- // Check that the files directory is writable.
- if ($data_hash_local != $data_hash_remote && file_prepare_directory($path)) {
- // Save updated tracking code file to disk.
- file_unmanaged_save_data($data, $file_destination, FILE_EXISTS_REPLACE);
- // Based on Drupal Core class AssetDumper.
- if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) {
- file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE);
- }
- \Drupal::logger('matomo')->info('Locally cached tracking code file has been updated.');
-
- // Change query-strings on css/js files to enforce reload for all
- // users.
- _drupal_flush_css_js();
- }
- }
- else {
- // Check that the files directory is writable.
- if (file_prepare_directory($path, FILE_CREATE_DIRECTORY)) {
- // There is no need to flush JS here as core refreshes JS caches
- // automatically, if new files are added.
- file_unmanaged_save_data($data, $file_destination, FILE_EXISTS_REPLACE);
- // Based on Drupal Core class AssetDumper.
- if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) {
- file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE);
- }
- \Drupal::logger('matomo')->info('Locally cached tracking code file has been saved.');
-
- // Return the local JS file path.
- return file_url_transform_relative(file_create_url($file_destination));
- }
- }
- }
- catch (RequestException $exception) {
- watchdog_exception('matomo', $exception);
- }
- }
- else {
- // Return the local JS file path.
- return file_url_transform_relative(file_create_url($file_destination));
- }
-}
-
-/**
- * Delete cached files and directory.
- */
-function matomo_clear_js_cache() {
- $path = 'public://matomo';
- if (file_prepare_directory($path)) {
- file_scan_directory($path, '/.*/', ['callback' => 'file_unmanaged_delete']);
- \Drupal::service('file_system')->rmdir($path);
-
- // Change query-strings on css/js files to enforce reload for all users.
- _drupal_flush_css_js();
-
- \Drupal::logger('matomo')->info('Local cache has been purged.');
- }
-}
-
-/**
- * Tracking visibility check for an user object.
- *
- * @param object $account
- * A user object containing an array of roles to check.
- *
- * @return bool
- * TRUE if the current user is being tracked by Matomo, otherwise FALSE.
- */
-function _matomo_visibility_user($account) {
- $config = \Drupal::config('matomo.settings');
- $enabled = FALSE;
-
- // Is current user a member of a role that should be tracked?
- if (_matomo_visibility_roles($account)) {
-
- // Use the user's block visibility setting, if necessary.
- if (($visibility_user_account_mode = $config->get('visibility.user_account_mode')) != 0) {
- $user_data_matomo = \Drupal::service('user.data')->get('matomo', $account->id());
- if ($account->id() && isset($user_data_matomo['user_account_users'])) {
- $enabled = $user_data_matomo['user_account_users'];
- }
- else {
- $enabled = ($visibility_user_account_mode == 1);
- }
- }
- else {
- $enabled = TRUE;
- }
-
- }
-
- return $enabled;
-}
-
-/**
- * Tracking visibility check for user roles.
- *
- * Based on visibility setting this function returns TRUE if Matomo code should
- * be added for the current role and otherwise FALSE.
- *
- * @param object $account
- * A user object containing an array of roles to check.
- *
- * @return bool
- * TRUE if JS code should be added for the current role and otherwise FALSE.
- */
-function _matomo_visibility_roles($account) {
- $config = \Drupal::config('matomo.settings');
- $enabled = $visibility_user_role_mode = $config->get('visibility.user_role_mode');
- $user_role_roles = $config->get('visibility.user_role_roles');
-
- if (count($user_role_roles) > 0) {
- // One or more roles are selected.
- foreach (array_values($account->getRoles()) as $user_role) {
- // Is the current user a member of one of these roles?
- if (in_array($user_role, $user_role_roles)) {
- // Current user is a member of a role that should be tracked/excluded
- // from tracking.
- $enabled = !$visibility_user_role_mode;
- break;
- }
- }
- }
- else {
- // No role is selected for tracking, therefore all roles should be tracked.
- $enabled = TRUE;
- }
-
- return $enabled;
-}
-
-/**
- * Tracking visibility check for pages.
- *
- * Based on visibility setting this function returns TRUE if JS code should
- * be added to the current page and otherwise FALSE.
- */
-function _matomo_visibility_pages() {
- static $page_match;
-
- // Cache visibility result if function is called more than once.
- if (!isset($page_match)) {
- $config = \Drupal::config('matomo.settings');
- $visibility_request_path_mode = $config->get('visibility.request_path_mode');
- $visibility_request_path_pages = $config->get('visibility.request_path_pages');
-
- // Match path if necessary.
- if (!empty($visibility_request_path_pages)) {
- // Convert path to lowercase. This allows comparison of the same path
- // with different case. Ex: /Page, /page, /PAGE.
- $pages = Unicode::strtolower($visibility_request_path_pages);
- if ($visibility_request_path_mode < 2) {
- // Compare the lowercase path alias (if any) and internal path.
- $path = \Drupal::service('path.current')->getPath();
- $path_alias = Unicode::strtolower(\Drupal::service('path.alias_manager')->getAliasByPath($path));
- $page_match = \Drupal::service('path.matcher')->matchPath($path_alias, $pages) || (($path != $path_alias) && \Drupal::service('path.matcher')->matchPath($path, $pages));
- // When $visibility_request_path_mode has a value of 0, the tracking
- // code is displayed on all pages except those listed in $pages. When
- // set to 1, it is displayed only on those pages listed in $pages.
- $page_match = !($visibility_request_path_mode xor $page_match);
- }
- elseif (\Drupal::moduleHandler()->moduleExists('php')) {
- $page_match = php_eval($visibility_request_path_pages);
- }
- else {
- $page_match = FALSE;
- }
- }
- else {
- $page_match = TRUE;
- }
-
- }
- return $page_match;
-}
-
-/**
- * Get the page titles trail for the current page.
- *
- * Based on menu_get_active_breadcrumb().
- *
- * @return array
- * All page titles, including current page.
- */
-function _matomo_get_hierarchy_titles() {
- $titles = [];
- $path = Url::fromRoute('')->toString();
- $config = \Drupal::config('system.site');
- $matomo_conf = \Drupal::config('matomo.settings');
-
- // No breadcrumb for the front page.
- if (($path === Url::fromUserInput($config->get('page.front'))->toString())) {
- return $titles;
- }
-
- // Load up the menu tree.
- // TODO: Check this is a sane approach.
- $menu_tree = \Drupal::menuTree();
- $menu_name = \Drupal::config('system.menu.main')->get('id');
-
- // Build the typical default set of menu tree parameters.
- $parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_name);
-
- // Load the tree based on this set of parameters.
- $tree = $menu_tree->load($menu_name, $parameters);
-
- // Transform the tree using the manipulators.
- $manipulators = [
- // Only show links that are accessible for the current user.
- ['callable' => 'menu.default_tree_manipulators:checkAccess'],
- // Use the default sorting of menu links.
- ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
- // Fatten the menu.
- ['callable' => 'menu.default_tree_manipulators:flatten'],
- ];
- $tree = $menu_tree->transform($tree, $manipulators);
-
- if (!empty($tree)) {
- foreach ($tree as $menu_item) {
- // If the item is in the active trail and we don't have a front page link
- // when we have set to exclude home from the breadcrumbs then add the
- // title.
- if ($menu_item->inActiveTrail && !($matomo_conf->get('page_title_hierarchy_exclude_home') && $menu_item->link->getRouteName() == '')) {
- $titles[] = $menu_item->link->getTitle();
- }
- }
- }
-
- return $titles;
-}
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.permissions.yml b/sites/all/modules/contrib/admin/matomo/matomo.permissions.yml
deleted file mode 100644
index 27ad40274..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.permissions.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-administer matomo:
- title: 'Administer Matomo'
- description: 'Perform maintenance tasks for Matomo.'
-opt-in or out of matomo tracking:
- title: 'Opt-in or out of tracking'
- description: 'Allow users to decide if tracking code will be added to pages or not.'
-use php for matomo tracking visibility:
- title: 'Use PHP for tracking visibility'
- description: 'Enter PHP code in the field for tracking visibility settings.'
- restrict access: true
-add js snippets for matomo:
- title: 'Add JavaScript snippets'
- description: 'Enter JavaScript code snippets for advanced Matomo functionality.'
- restrict access: true
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.routing.yml b/sites/all/modules/contrib/admin/matomo/matomo.routing.yml
deleted file mode 100644
index 68c1f0ae0..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-matomo.admin_settings_form:
- path: '/admin/config/system/matomo'
- defaults:
- _form: '\Drupal\matomo\Form\MatomoAdminSettingsForm'
- _title: 'Matomo Analytics'
- requirements:
- _permission: 'administer matomo'
diff --git a/sites/all/modules/contrib/admin/matomo/matomo.tokens.inc b/sites/all/modules/contrib/admin/matomo/matomo.tokens.inc
deleted file mode 100644
index 1b4cafa3b..000000000
--- a/sites/all/modules/contrib/admin/matomo/matomo.tokens.inc
+++ /dev/null
@@ -1,60 +0,0 @@
- t('User role names'),
- 'description' => t('The role names the user account is a member of as comma separated list.'),
- 'needs-data' => 'user',
- ];
- $user['matomo-role-ids'] = [
- 'name' => t('User role ids'),
- 'description' => t('The role ids the user account is a member of as comma separated list.'),
- 'needs-data' => 'user',
- ];
-
- return [
- 'tokens' => ['user' => $user],
- ];
-}
-
-/**
- * Implements hook_tokens().
- */
-function matomo_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
- $sanitize = !empty($options['sanitize']);
- $replacements = [];
-
- if ($type == 'user' && !empty($data['user'])) {
- $account = $data['user'];
-
- foreach ($tokens as $name => $original) {
- switch ($name) {
- // Basic user account information.
- case 'matomo-role-names':
- $names = implode(',', $account->getRoles());
- $replacements[$original] = $sanitize ? Html::escape($names) : $names;
- $bubbleable_metadata->addCacheableDependency($account);
- break;
-
- case 'matomo-role-ids':
- $ids = implode(',', array_keys($account->getRoles()));
- $replacements[$original] = $sanitize ? Html::escape($ids) : $ids;
- $bubbleable_metadata->addCacheableDependency($account);
- break;
- }
- }
- }
-
- return $replacements;
-}
diff --git a/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_settings.yml b/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_settings.yml
deleted file mode 100644
index dd365ed48..000000000
--- a/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_settings.yml
+++ /dev/null
@@ -1,70 +0,0 @@
-id: d6_piwik_settings
-label: Piwik 6 configuration
-migration_tags:
- - Drupal 6
- - Configuration
-source:
- plugin: variable
- variables:
- - piwik_cache
- - piwik_codesnippet_after
- - piwik_codesnippet_before
- - piwik_custom
- - piwik_domain_mode
- - piwik_pages
- - piwik_privacy_donottrack
- - piwik_roles
- - piwik_site_id
- - piwik_site_search
- - piwik_trackmessages
- - piwik_track
- - piwik_trackfiles_extensions
- - piwik_trackmailto
- - piwik_trackuserid
- - piwik_translation_set
- - piwik_url_http
- - piwik_url_https
- - piwik_visibility_pages
- - piwik_visibility_roles
- - piwik_page_title_hierarchy
- - piwik_page_title_hierarchy_exclude_home
- source_module: piwik
-process:
- cache: piwik_cache
- 'codesnippet/after': piwik_codesnippet_after
- 'codesnippet/before': piwik_codesnippet_before
- domain_mode: piwik_domain_mode
- 'privacy/donottrack': piwik_privacy_donottrack
- site_id: piwik_site_id
- 'track/files': piwik_track
- 'track/files_extensions': piwik_trackfiles_extensions
- 'track/mailto': piwik_trackmailto
- 'track/messages': piwik_trackmessages
- 'track/site_search': piwik_site_search
- 'track/userid': piwik_trackuserid
- 'translation_set': piwik_translation_set
- url_http: piwik_url_http
- url_https: piwik_url_https
- 'visibility/user_account_mode': piwik_custom
- 'visibility/request_path_mode': piwik_visibility_pages
- 'visibility/request_path_pages':
- plugin: matomo_visibility_pages
- source:
- - piwik_visibility_pages
- - piwik_pages
- # If Piwik uses PHP visibility, don't migrate it unless the PHP module is
- # enabled.
- skip_php: true
- 'visibility/user_role_mode': piwik_visibility_roles
- 'visibility/user_role_roles':
- plugin: matomo_visibility_roles
- source:
- - piwik_roles
- page_title_hierarchy: piwik_page_title_hierarchy
- page_title_hierarchy_exclude_home: piwik_page_title_hierarchy_exclude_home
-destination:
- plugin: config
- config_name: matomo.settings
-migration_dependencies:
- optional:
- - d6_user_role
diff --git a/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_user_settings.yml b/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_user_settings.yml
deleted file mode 100644
index 65fcce9fd..000000000
--- a/sites/all/modules/contrib/admin/matomo/migrations/d6_matomo_user_settings.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-id: d6_piwik_user_settings
-label: Piwik user settings
-migration_tags:
- - Drupal 6
-source:
- plugin: d6_user
- constants:
- key: user_account_users
- module: piwik
-process:
- uid: uid
- key: 'constants/key'
- module: 'constants/module'
- settings:
- plugin: skip_row_if_not_set
- index: 'custom'
- source: data/piwik
-destination:
- plugin: user_data
-migration_dependencies:
- required:
- - d6_user
diff --git a/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_settings.yml b/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_settings.yml
deleted file mode 100644
index 601a69892..000000000
--- a/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_settings.yml
+++ /dev/null
@@ -1,77 +0,0 @@
-id: d7_matomo_settings
-label: Matomo 7 configuration
-migration_tags:
- - Drupal 7
- - Configuration
-source:
- plugin: variable
- variables:
- - matomo_cache
- - matomo_codesnippet_after
- - matomo_codesnippet_before
- - matomo_custom
- - matomo_custom_var
- - matomo_domain_mode
- - matomo_pages
- - matomo_privacy_donottrack
- - matomo_roles
- - matomo_site_id
- - matomo_site_search
- - matomo_track
- - matomo_trackcolorbox
- - matomo_trackfiles_extensions
- - matomo_trackmailto
- - matomo_trackmessages
- - matomo_trackuserid
- - matomo_translation_set
- - matomo_url_http
- - matomo_url_https
- - matomo_visibility_pages
- - matomo_visibility_roles
- - matomo_page_title_hierarchy
- - matomo_page_title_hierarchy_exclude_home
- source_module: matomo
-process:
- cache: matomo_cache
- 'codesnippet/after': matomo_codesnippet_after
- 'codesnippet/before': matomo_codesnippet_before
- 'custom/variable':
- plugin: matomo_custom_vars
- source:
- - matomo_custom_var
- domain_mode: matomo_domain_mode
- 'privacy/donottrack': matomo_privacy_donottrack
- site_id: matomo_site_id
- 'track/colorbox': matomo_trackcolorbox
- 'track/files': matomo_track
- 'track/files_extensions': matomo_trackfiles_extensions
- 'track/mailto': matomo_trackmailto
- 'track/messages': matomo_trackmessages
- 'track/site_search': matomo_site_search
- 'track/userid': matomo_trackuserid
- 'translation_set': matomo_translation_set
- url_http: matomo_url_http
- url_https: matomo_url_https
- 'visibility/user_account_mode': matomo_custom
- 'visibility/request_path_mode': matomo_visibility_pages
- 'visibility/request_path_pages':
- plugin: matomo_visibility_pages
- source:
- - matomo_visibility_pages
- - matomo_pages
- # If Matomo uses PHP visibility, don't migrate it unless the PHP module is
- # enabled.
- skip_php: true
- 'visibility/user_role_mode': matomo_visibility_roles
- 'visibility/user_role_roles':
- plugin: matomo_visibility_roles
- source:
- - matomo_roles
- page_title_hierarchy: matomo_page_title_hierarchy
- page_title_hierarchy_exclude_home: matomo_page_title_hierarchy_exclude_home
-destination:
- plugin: config
- config_name: matomo.settings
-migration_dependencies:
- optional:
- - d7_user_role
diff --git a/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_user_settings.yml b/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_user_settings.yml
deleted file mode 100644
index 676a9f792..000000000
--- a/sites/all/modules/contrib/admin/matomo/migrations/d7_matomo_user_settings.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-id: d7_matomo_user_settings
-label: Matomo user settings
-migration_tags:
- - Drupal 7
-source:
- plugin: d7_user
- constants:
- key: user_account_users
- module: matomo
-process:
- uid: uid
- key: 'constants/key'
- module: 'constants/module'
- settings:
- plugin: skip_row_if_not_set
- index: 'custom'
- source: data/matomo
-destination:
- plugin: user_data
-migration_dependencies:
- required:
- - d7_user
diff --git a/sites/all/modules/contrib/admin/matomo/src/Component/Render/MatomoJavaScriptSnippet.php b/sites/all/modules/contrib/admin/matomo/src/Component/Render/MatomoJavaScriptSnippet.php
deleted file mode 100644
index 3fd6ff84d..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Component/Render/MatomoJavaScriptSnippet.php
+++ /dev/null
@@ -1,43 +0,0 @@
-string = (string) $string;
- }
-
- /**
- * {@inheritdoc}
- */
- public function __toString() {
- return $this->string;
- }
-
- /**
- * {@inheritdoc}
- */
- public function jsonSerialize() {
- return $this->__toString();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Form/MatomoAdminSettingsForm.php b/sites/all/modules/contrib/admin/matomo/src/Form/MatomoAdminSettingsForm.php
deleted file mode 100644
index bd6e68722..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Form/MatomoAdminSettingsForm.php
+++ /dev/null
@@ -1,752 +0,0 @@
-currentUser = $currentUser;
- $this->moduleHandler = $moduleHandler;
- $this->httpClient = $httpClient;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'matomo_admin_settings';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getEditableConfigNames() {
- return ['matomo.settings'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $config = $this->config('matomo.settings');
-
- $form['general'] = [
- '#type' => 'details',
- '#title' => $this->t('General settings'),
- '#open' => TRUE,
- ];
-
- $form['general']['matomo_site_id'] = [
- '#default_value' => $config->get('site_id'),
- '#description' => $this->t('The user account number is unique to the websites domain. Click the Settings link in your Matomo account, then the Websites tab and enter the appropriate site ID into this field.'),
- '#maxlength' => 20,
- '#required' => TRUE,
- '#size' => 15,
- '#title' => $this->t('Matomo site ID'),
- '#type' => 'textfield',
- ];
- $form['general']['matomo_url_http'] = [
- '#default_value' => $config->get('url_http'),
- '#description' => $this->t('The URL to your Matomo base directory. Example: "http://www.example.com/matomo/".'),
- '#maxlength' => 255,
- '#required' => TRUE,
- '#size' => 80,
- '#title' => $this->t('Matomo HTTP URL'),
- '#type' => 'textfield',
- ];
- $form['general']['matomo_url_https'] = [
- '#default_value' => $config->get('url_https'),
- '#description' => $this->t('The URL to your Matomo base directory with SSL certificate installed. Required if you track a SSL enabled website. Example: "https://www.example.com/matomo/".'),
- '#maxlength' => 255,
- '#size' => 80,
- '#title' => $this->t('Matomo HTTPS URL'),
- '#type' => 'textfield',
- ];
- // Required for automated form save testing only.
- $form['general']['matomo_url_skiperror'] = [
- '#type' => 'hidden',
- '#default_value' => FALSE,
- ];
-
- // Visibility settings.
- $form['tracking_scope'] = [
- '#type' => 'vertical_tabs',
- '#title' => $this->t('Tracking scope'),
- '#attached' => [
- 'library' => [
- 'matomo/matomo.admin',
- ],
- ],
- ];
-
- $form['tracking']['domain_tracking'] = [
- '#type' => 'details',
- '#title' => $this->t('Domains'),
- '#group' => 'tracking_scope',
- ];
-
- global $cookie_domain;
- $multiple_sub_domains = [];
- foreach (['www', 'app', 'shop'] as $subdomain) {
- if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
- $multiple_sub_domains[] = $subdomain . $cookie_domain;
- }
- // IP addresses or localhost.
- else {
- $multiple_sub_domains[] = $subdomain . '.example.com';
- }
- }
-
- $form['tracking']['domain_tracking']['matomo_domain_mode'] = [
- '#type' => 'radios',
- '#title' => $this->t('What are you tracking?'),
- '#options' => [
- 0 => $this->t('A single domain (default)'),
- 1 => $this->t('One domain with multiple subdomains'),
- ],
- 0 => [
- '#description' => $this->t('Domain: @domain', ['@domain' => $_SERVER['HTTP_HOST']]),
- ],
- 1 => [
- '#description' => $this->t('Examples: @domains', ['@domains' => implode(', ', $multiple_sub_domains)]),
- ],
- '#default_value' => $config->get('domain_mode'),
- ];
-
- // Page specific visibility configurations.
- $account = $this->currentUser;
- $php_access = $account->hasPermission('use php for matomo tracking visibility');
- $visibility_request_path_pages = $config->get('visibility.request_path_pages');
-
- $form['tracking']['page_visibility_settings'] = [
- '#type' => 'details',
- '#title' => $this->t('Pages'),
- '#group' => 'tracking_scope',
- ];
-
- if ($config->get('visibility.request_path_mode') == 2 && !$php_access) {
- // No permission to change PHP snippets, but keep existing settings.
- $form['tracking']['page_visibility_settings'] = [];
- $form['tracking']['page_visibility_settings']['matomo_visibility_request_path_mode'] = ['#type' => 'value', '#value' => 2];
- $form['tracking']['page_visibility_settings']['matomo_visibility_request_path_pages'] = ['#type' => 'value', '#value' => $visibility_request_path_pages];
- }
- else {
- $options = [
- $this->t('Every page except the listed pages'),
- $this->t('The listed pages only'),
- ];
- $description = $this->t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", ['%blog' => '/blog', '%blog-wildcard' => '/blog/*', '%front' => '']);
-
- if ($this->moduleHandler->moduleExists('php') && $php_access) {
- $options[] = $this->t('Pages on which this PHP code returns TRUE (experts only)');
- $title = $this->t('Pages or PHP code');
- $description .= ' ' . $this->t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', ['%php' => '']);
- }
- else {
- $title = $this->t('Pages');
- }
- $form['tracking']['page_visibility_settings']['matomo_visibility_request_path_mode'] = [
- '#type' => 'radios',
- '#title' => $this->t('Add tracking to specific pages'),
- '#options' => $options,
- '#default_value' => $config->get('visibility.request_path_mode'),
- ];
- $form['tracking']['page_visibility_settings']['matomo_visibility_request_path_pages'] = [
- '#type' => 'textarea',
- '#title' => $title,
- '#title_display' => 'invisible',
- '#default_value' => !empty($visibility_request_path_pages) ? $visibility_request_path_pages : '',
- '#description' => $description,
- '#rows' => 10,
- ];
- }
-
- // Render the role overview.
- $visibility_user_role_roles = $config->get('visibility.user_role_roles');
-
- $form['tracking']['role_visibility_settings'] = [
- '#type' => 'details',
- '#title' => $this->t('Roles'),
- '#group' => 'tracking_scope',
- ];
-
- $form['tracking']['role_visibility_settings']['matomo_visibility_user_role_mode'] = [
- '#type' => 'radios',
- '#title' => $this->t('Add tracking for specific roles'),
- '#options' => [
- $this->t('Add to the selected roles only'),
- $this->t('Add to every role except the selected ones'),
- ],
- '#default_value' => $config->get('visibility.user_role_mode'),
- ];
- $form['tracking']['role_visibility_settings']['matomo_visibility_user_role_roles'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('Roles'),
- '#default_value' => !empty($visibility_user_role_roles) ? $visibility_user_role_roles : [],
- '#options' => array_map('\Drupal\Component\Utility\Html::escape', user_role_names()),
- '#description' => $this->t('If none of the roles are selected, all users will be tracked. If a user has any of the roles checked, that user will be tracked (or excluded, depending on the setting above).'),
- ];
-
- // Standard tracking configurations.
- $visibility_user_account_mode = $config->get('visibility.user_account_mode');
-
- $form['tracking']['user_visibility_settings'] = [
- '#type' => 'details',
- '#title' => $this->t('Users'),
- '#group' => 'tracking_scope',
- ];
- $t_permission = ['%permission' => $this->t('Opt-in or out of tracking')];
- $form['tracking']['user_visibility_settings']['matomo_visibility_user_account_mode'] = [
- '#type' => 'radios',
- '#title' => $this->t('Allow users to customize tracking on their account page'),
- '#options' => [
- 0 => $this->t('No customization allowed'),
- 1 => $this->t('Tracking on by default, users with %permission permission can opt out', $t_permission),
- 2 => $this->t('Tracking off by default, users with %permission permission can opt in', $t_permission),
- ],
- '#default_value' => !empty($visibility_user_account_mode) ? $visibility_user_account_mode : 0,
- ];
- $form['tracking']['user_visibility_settings']['matomo_trackuserid'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track User ID'),
- '#default_value' => $config->get('track.userid'),
- '#description' => $this->t('User ID enables the analysis of groups of sessions, across devices, using a unique, persistent, and non-personally identifiable ID string representing a user. Learn more about the benefits of using User ID.', [':url' => 'https://matomo.org/docs/user-id/']),
- ];
-
- // Link specific configurations.
- $form['tracking']['linktracking'] = [
- '#type' => 'details',
- '#title' => $this->t('Links and downloads'),
- '#group' => 'tracking_scope',
- ];
- $form['tracking']['linktracking']['matomo_trackmailto'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track clicks on mailto links'),
- '#default_value' => $config->get('track.mailto'),
- ];
- $form['tracking']['linktracking']['matomo_trackfiles'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track clicks on outbound links and downloads (clicks on file links) for the following extensions'),
- '#default_value' => $config->get('track.files'),
- ];
- $form['tracking']['linktracking']['matomo_trackfiles_extensions'] = [
- '#title' => $this->t('List of download file extensions'),
- '#title_display' => 'invisible',
- '#type' => 'textfield',
- '#default_value' => $config->get('track.files_extensions'),
- '#description' => $this->t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: @extensions', ['@extensions' => MatomoInterface::MATOMO_TRACKFILES_EXTENSIONS]),
- '#maxlength' => 500,
- '#states' => [
- 'enabled' => [
- ':input[name="matomo_trackfiles"]' => ['checked' => TRUE],
- ],
- // Note: Form required marker is not visible as title is invisible.
- 'required' => [
- ':input[name="matomo_trackfiles"]' => ['checked' => TRUE],
- ],
- ],
- ];
-
- $colorbox_dependencies = '
';
-
- $form['tracking']['search']['matomo_site_search'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track internal search'),
- '#description' => $this->t('If checked, internal search keywords are tracked.') . $site_search_dependencies,
- '#default_value' => $config->get('track.site_search'),
- '#disabled' => ($this->moduleHandler->moduleExists('search') ? FALSE : TRUE),
- ];
-
- // Privacy specific configurations.
- $form['tracking']['privacy'] = [
- '#type' => 'details',
- '#title' => $this->t('Privacy'),
- '#group' => 'tracking_scope',
- ];
- $form['tracking']['privacy']['matomo_privacy_donottrack'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Universal web tracking opt-out'),
- '#description' => $this->t('If enabled and your Matomo server receives the Do-Not-Track header from the client browser, the Matomo server will not track the user. Compliance with Do Not Track could be purely voluntary, enforced by industry self-regulation, or mandated by state or federal law. Please accept your visitors privacy. If they have opt-out from tracking and advertising, you should accept their personal decision.', [':donottrack' => 'https://www.eff.org/issues/do-not-track']),
- '#default_value' => $config->get('privacy.donottrack'),
- ];
-
- // Matomo page title tree view settings.
- $form['page_title_hierarchy'] = [
- '#type' => 'details',
- '#title' => $this->t('Page titles hierarchy'),
- '#description' => $this->t('This functionality enables a dynamically expandable tree view of your site page titles in your Matomo statistics. See in Matomo statistics under Actions > Page titles.'),
- '#group' => 'tracking_scope',
- ];
- $form['page_title_hierarchy']['matomo_page_title_hierarchy'] = [
- '#type' => 'checkbox',
- '#title' => $this->t("Show page titles as hierarchy like breadcrumbs"),
- '#description' => $this->t('By default Matomo tracks the current page title and shows you a flat list of the most popular titles. This enables a breadcrumbs like tree view.'),
- '#default_value' => $config->get('page_title_hierarchy'),
- ];
- $form['page_title_hierarchy']['matomo_page_title_hierarchy_exclude_home'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Hide home page from hierarchy'),
- '#description' => $this->t('If enabled, the "Home" item will be removed from the hierarchy to flatten the structure in the Matomo statistics. Hits to the home page will still be counted, but for other pages the hierarchy will start at level Home+1.'),
- '#default_value' => $config->get('page_title_hierarchy_exclude_home'),
- ];
-
- // Custom variables.
- $form['matomo_custom_var'] = [
- '#description' => $this->t('You can add Matomos Custom Variables here. These will be added to every page that Matomo tracking code appears on. Custom variable names and values are limited to 200 characters in length. Keep the names and values as short as possible and expect long values to get trimmed. You may use tokens in custom variable names and values. Global and user tokens are always available; on node pages, node tokens are also available.', [':custom_var_documentation' => 'https://matomo.org/docs/custom-variables/']),
- '#title' => $this->t('Custom variables'),
- '#tree' => TRUE,
- '#type' => 'details',
- ];
-
- $form['matomo_custom_var']['slots'] = [
- '#type' => 'table',
- '#header' => [
- ['data' => $this->t('Slot')],
- ['data' => $this->t('Name')],
- ['data' => $this->t('Value')],
- ['data' => $this->t('Scope')],
- ],
- ];
-
- $matomo_custom_vars = $config->get('custom.variable');
-
- // Matomo supports up to 5 custom variables.
- for ($i = 1; $i < 6; $i++) {
- $form['matomo_custom_var']['slots'][$i]['slot'] = [
- '#default_value' => $i,
- '#description' => $this->t('Slot number'),
- '#disabled' => TRUE,
- '#size' => 1,
- '#title' => $this->t('Custom variable slot #@slot', ['@slot' => $i]),
- '#title_display' => 'invisible',
- '#type' => 'textfield',
- ];
- $form['matomo_custom_var']['slots'][$i]['name'] = [
- '#default_value' => isset($matomo_custom_vars[$i]['name']) ? $matomo_custom_vars[$i]['name'] : '',
- '#description' => $this->t('The custom variable name.'),
- '#maxlength' => 100,
- '#size' => 20,
- '#title' => $this->t('Custom variable name #@slot', ['@slot' => $i]),
- '#title_display' => 'invisible',
- '#type' => 'textfield',
- ];
- $form['matomo_custom_var']['slots'][$i]['value'] = [
- '#default_value' => isset($matomo_custom_vars[$i]['value']) ? $matomo_custom_vars[$i]['value'] : '',
- '#description' => $this->t('The custom variable value.'),
- '#maxlength' => 255,
- '#title' => $this->t('Custom variable value #@slot', ['@slot' => $i]),
- '#title_display' => 'invisible',
- '#type' => 'textfield',
- '#element_validate' => [[get_class($this), 'tokenElementValidate']],
- '#token_types' => ['node'],
- ];
- if ($this->moduleHandler->moduleExists('token')) {
- $form['matomo_custom_var']['slots'][$i]['value']['#element_validate'][] = 'token_element_validate';
- }
- $form['matomo_custom_var']['slots'][$i]['scope'] = [
- '#default_value' => isset($matomo_custom_vars[$i]['scope']) ? $matomo_custom_vars[$i]['scope'] : '',
- '#description' => $this->t('The scope for the custom variable.'),
- '#title' => $this->t('Custom variable slot #@slot', ['@slot' => $i]),
- '#title_display' => 'invisible',
- '#type' => 'select',
- '#options' => [
- 'visit' => $this->t('Visit'),
- 'page' => $this->t('Page'),
- ],
- ];
- }
-
- $form['matomo_custom_var']['matomo_custom_var_description'] = [
- '#type' => 'item',
- '#description' => $this->t("You can supplement Matomos' basic IP address tracking of visitors by segmenting users based on custom variables. Make sure you will not associate (or permit any third party to associate) any data gathered from your websites (or such third parties' websites) with any personally identifying information from any source as part of your use (or such third parties' use) of the Matomo' service."),
- ];
- if ($this->moduleHandler->moduleExists('token')) {
- $form['matomo_custom_var']['matomo_custom_var_token_tree'] = [
- '#theme' => 'token_tree_link',
- '#token_types' => ['node'],
- ];
- }
-
- // Advanced feature configurations.
- $form['advanced'] = [
- '#type' => 'details',
- '#title' => $this->t('Advanced settings'),
- '#open' => FALSE,
- ];
-
- $form['advanced']['matomo_cache'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Locally cache tracking code file'),
- '#description' => $this->t('If checked, the tracking code file is retrieved from your Matomo site and cached locally. It is updated daily to ensure updates to tracking code are reflected in the local copy.'),
- '#default_value' => $config->get('cache'),
- ];
-
- // Allow for tracking of the originating node when viewing translation sets.
- if ($this->moduleHandler->moduleExists('content_translation')) {
- $form['advanced']['matomo_translation_set'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track translation sets as one unit'),
- '#description' => $this->t('When a node is part of a translation set, record statistics for the originating node instead. This allows for a translation set to be treated as a single unit.'),
- '#default_value' => $config->get('translation_set'),
- ];
- }
-
- $user_access_add_js_snippets = !$this->currentUser()->hasPermission('add js snippets for matomo');
- $user_access_add_js_snippets_permission_warning = $user_access_add_js_snippets ? ' ' . $this->t('This field has been disabled because you do not have sufficient permissions to edit it.') . '' : '';
- $form['advanced']['codesnippet'] = [
- '#type' => 'details',
- '#title' => $this->t('Custom JavaScript code'),
- '#open' => TRUE,
- '#description' => $this->t('You can add custom Matomo code snippets here. These will be added to every page that Matomo appears on. Do not include the <script> tags, and always end your code with a semicolon (;).', [':snippets' => 'https://matomo.org/docs/javascript-tracking/']),
- ];
- $form['advanced']['codesnippet']['matomo_codesnippet_before'] = [
- '#type' => 'textarea',
- '#title' => $this->t('Code snippet (before)'),
- '#default_value' => $config->get('codesnippet.before'),
- '#disabled' => $user_access_add_js_snippets,
- '#rows' => 5,
- '#description' => $this->t('Code in this textarea will be added before _paq.push(["trackPageView"]).') . $user_access_add_js_snippets_permission_warning,
- ];
- $form['advanced']['codesnippet']['matomo_codesnippet_after'] = [
- '#type' => 'textarea',
- '#title' => $this->t('Code snippet (after)'),
- '#default_value' => $config->get('codesnippet.after'),
- '#disabled' => $user_access_add_js_snippets,
- '#rows' => 5,
- '#description' => $this->t('Code in this textarea will be added after _paq.push(["trackPageView"]). This is useful if you\'d like to track a site in two accounts.') . $user_access_add_js_snippets_permission_warning,
- ];
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- parent::validateForm($form, $form_state);
-
- // Custom variables validation.
- foreach ($form_state->getValue(['matomo_custom_var', 'slots']) as $custom_var) {
- $form_state->setValue(['matomo_custom_var', 'slots', $custom_var['slot'], 'name'], trim($custom_var['name']));
- $form_state->setValue(['matomo_custom_var', 'slots', $custom_var['slot'], 'value'], trim($custom_var['value']));
-
- // Validate empty names/values.
- if (empty($custom_var['name']) && !empty($custom_var['value'])) {
- $form_state->setErrorByName("matomo_custom_var][slots][" . $custom_var['slot'] . "][name", $this->t('The custom variable @slot-number requires a Name if a Value has been provided.', ['@slot-number' => $custom_var['slot']]));
- }
- elseif (!empty($custom_var['name']) && empty($custom_var['value'])) {
- $form_state->setErrorByName("matomo_custom_var][slots][" . $custom_var['slot'] . "][value", $this->t('The custom variable @slot-number requires a Value if a Name has been provided.', ['@slot-number' => $custom_var['slot']]));
- }
- }
- $form_state->setValue('matomo_custom_var', $form_state->getValue(['matomo_custom_var', 'slots']));
-
- // Trim some text area values.
- $form_state->setValue('matomo_site_id', trim($form_state->getValue('matomo_site_id')));
- $form_state->setValue('matomo_visibility_request_path_pages', trim($form_state->getValue('matomo_visibility_request_path_pages')));
- $form_state->setValue('matomo_codesnippet_before', trim($form_state->getValue('matomo_codesnippet_before')));
- $form_state->setValue('matomo_codesnippet_after', trim($form_state->getValue('matomo_codesnippet_after')));
- $form_state->setValue('matomo_visibility_user_role_roles', array_filter($form_state->getValue('matomo_visibility_user_role_roles')));
- $form_state->setValue('matomo_trackmessages', array_filter($form_state->getValue('matomo_trackmessages')));
-
- if (!preg_match('/^\d{1,}$/', $form_state->getValue('matomo_site_id'))) {
- $form_state->setErrorByName('matomo_site_id', $this->t('A valid Matomo site ID is an integer only.'));
- }
-
- $url = $form_state->getValue('matomo_url_http') . 'piwik.php';
- try {
- $result = $this->httpClient->get($url);
- if ($result->getStatusCode() != 200 && $form_state->getValue('matomo_url_skiperror') == FALSE) {
- $form_state->setErrorByName('matomo_url_http', $this->t('The validation of "@url" failed with error "@error" (HTTP code @code).', [
- '@url' => UrlHelper::filterBadProtocol($url),
- '@error' => $result->getReasonPhrase(),
- '@code' => $result->getStatusCode(),
- ]));
- }
- }
- catch (RequestException $exception) {
- $form_state->setErrorByName('matomo_url_http', $this->t('The validation of "@url" failed with an exception "@error" (HTTP code @code).', [
- '@url' => UrlHelper::filterBadProtocol($url),
- '@error' => $exception->getMessage(),
- '@code' => $exception->getCode(),
- ]));
- }
-
- $matomo_url_https = $form_state->getValue('matomo_url_https');
- if (!empty($matomo_url_https)) {
- $url = $matomo_url_https . 'piwik.php';
- try {
- $result = $this->httpClient->get($url);
- if ($result->getStatusCode() != 200 && $form_state->getValue('matomo_url_skiperror') == FALSE) {
- $form_state->setErrorByName('matomo_url_https', $this->t('The validation of "@url" failed with error "@error" (HTTP code @code).', [
- '@url' => UrlHelper::filterBadProtocol($url),
- '@error' => $result->getReasonPhrase(),
- '@code' => $result->getStatusCode(),
- ]));
- }
- }
- catch (RequestException $exception) {
- $form_state->setErrorByName('matomo_url_https', $this->t('The validation of "@url" failed with an exception "@error" (HTTP code @code).', [
- '@url' => UrlHelper::filterBadProtocol($url),
- '@error' => $exception->getMessage(),
- '@code' => $exception->getCode(),
- ]));
- }
- }
-
- // Verify that every path is prefixed with a slash, but don't check PHP
- // code snippets and do not check for slashes if no paths configured.
- if ($form_state->getValue('matomo_visibility_request_path_mode') != 2 && !empty($form_state->getValue('matomo_visibility_request_path_pages'))) {
- $pages = preg_split('/(\r\n?|\n)/', $form_state->getValue('matomo_visibility_request_path_pages'));
- foreach ($pages as $page) {
- if (strpos($page, '/') !== 0 && $page !== '') {
- $form_state->setErrorByName('matomo_visibility_request_path_pages', $this->t('Path "@page" not prefixed with slash.', ['@page' => $page]));
- // Drupal forms show one error only.
- break;
- }
- }
- }
-
- // Clear obsolete local cache if cache has been disabled.
- if ($form_state->isValueEmpty('matomo_cache') && $form['advanced']['matomo_cache']['#default_value']) {
- matomo_clear_js_cache();
- }
-
- // This is for the Newbie's who cannot read a text area description.
- if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state->getValue('matomo_codesnippet_before'))) {
- $form_state->setErrorByName('matomo_codesnippet_before', $this->t('Do not include the <script> tags in the javascript code snippets.'));
- }
- if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state->getValue('matomo_codesnippet_after'))) {
- $form_state->setErrorByName('matomo_codesnippet_after', $this->t('Do not include the <script> tags in the javascript code snippets.'));
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $config = $this->config('matomo.settings');
- $config
- ->set('site_id', $form_state->getValue('matomo_site_id'))
- ->set('url_http', $form_state->getValue('matomo_url_http'))
- ->set('url_https', $form_state->getValue('matomo_url_https'))
- ->set('codesnippet.before', $form_state->getValue('matomo_codesnippet_before'))
- ->set('codesnippet.after', $form_state->getValue('matomo_codesnippet_after'))
- ->set('custom.variable', $form_state->getValue('matomo_custom_var'))
- ->set('domain_mode', $form_state->getValue('matomo_domain_mode'))
- ->set('track.files', $form_state->getValue('matomo_trackfiles'))
- ->set('track.files_extensions', $form_state->getValue('matomo_trackfiles_extensions'))
- ->set('track.colorbox', $form_state->getValue('matomo_trackcolorbox'))
- ->set('track.userid', $form_state->getValue('matomo_trackuserid'))
- ->set('track.mailto', $form_state->getValue('matomo_trackmailto'))
- ->set('track.messages', $form_state->getValue('matomo_trackmessages'))
- ->set('track.site_search', $form_state->getValue('matomo_site_search'))
- ->set('privacy.donottrack', $form_state->getValue('matomo_privacy_donottrack'))
- ->set('cache', $form_state->getValue('matomo_cache'))
- ->set('visibility.request_path_mode', $form_state->getValue('matomo_visibility_request_path_mode'))
- ->set('visibility.request_path_pages', $form_state->getValue('matomo_visibility_request_path_pages'))
- ->set('visibility.user_account_mode', $form_state->getValue('matomo_visibility_user_account_mode'))
- ->set('visibility.user_role_mode', $form_state->getValue('matomo_visibility_user_role_mode'))
- ->set('visibility.user_role_roles', $form_state->getValue('matomo_visibility_user_role_roles'))
- ->save();
-
- if ($form_state->hasValue('matomo_translation_set')) {
- $config->set('translation_set', $form_state->getValue('matomo_translation_set'))->save();
- }
-
- parent::submitForm($form, $form_state);
- }
-
- /**
- * Validate a form element that should have tokens in it.
- *
- * For example:
- * @code
- * $form['my_node_text_element'] = [
- * '#type' => 'textfield',
- * '#title' => $this->t('Some text to token-ize that has a node context.'),
- * '#default_value' => 'The title of this node is [node:title].',
- * '#element_validate' => [[get_class($this), 'tokenElementValidate']],
- * ];
- * @endcode
- */
- public static function tokenElementValidate(&$element, FormStateInterface $form_state) {
- $value = isset($element['#value']) ? $element['#value'] : $element['#default_value'];
-
- if (!Unicode::strlen($value)) {
- // Empty value needs no further validation since the element should depend
- // on using the '#required' FAPI property.
- return $element;
- }
-
- $tokens = \Drupal::token()->scan($value);
- $invalid_tokens = static::getForbiddenTokens($tokens);
- if ($invalid_tokens) {
- $form_state->setError($element, t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => $element['#title'], '@invalid-tokens' => implode(', ', $invalid_tokens)]));
- }
-
- return $element;
- }
-
- /**
- * Get an array of all forbidden tokens.
- *
- * @param array $value
- * An array of token values.
- *
- * @return array
- * A unique array of invalid tokens.
- */
- protected static function getForbiddenTokens(array $value) {
- $invalid_tokens = [];
- $value_tokens = is_string($value) ? \Drupal::token()->scan($value) : $value;
-
- foreach ($value_tokens as $tokens) {
- if (array_filter($tokens, 'static::containsForbiddenToken')) {
- $invalid_tokens = array_merge($invalid_tokens, array_values($tokens));
- }
- }
-
- array_unique($invalid_tokens);
- return $invalid_tokens;
- }
-
- /**
- * Validate if string contains forbidden tokens not allowed by privacy rules.
- *
- * @param string $token_string
- * A string with one or more tokens to be validated.
- *
- * @return bool
- * TRUE if blacklisted token has been found, otherwise FALSE.
- */
- protected static function containsForbiddenToken($token_string) {
- // List of strings in tokens with personal identifying information not
- // allowed for privacy reasons. See section 8.1 of the Google Analytics
- // terms of use for more detailed information.
- //
- // This list can never ever be complete. For this reason it tries to use a
- // regex and may kill a few other valid tokens, but it's the only way to
- // protect users as much as possible from admins with illegal ideas.
- //
- // User tokens are not prefixed with colon to catch 'current-user' and
- // 'user'.
- //
- // TODO: If someone have better ideas, share them, please!
- $token_blacklist = [
- ':account-name]',
- ':author]',
- ':author:edit-url]',
- ':author:url]',
- ':author:path]',
- ':current-user]',
- ':current-user:original]',
- ':display-name]',
- ':fid]',
- ':mail]',
- ':name]',
- ':uid]',
- ':one-time-login-url]',
- ':owner]',
- ':owner:cancel-url]',
- ':owner:edit-url]',
- ':owner:url]',
- ':owner:path]',
- 'user:cancel-url]',
- 'user:edit-url]',
- 'user:url]',
- 'user:path]',
- 'user:picture]',
- // addressfield_tokens.module
- ':first-name]',
- ':last-name]',
- ':name-line]',
- ':mc-address]',
- ':thoroughfare]',
- ':premise]',
- // realname.module
- ':name-raw]',
- // token.module
- ':ip-address]',
- ];
-
- return preg_match('/' . implode('|', array_map('preg_quote', $token_blacklist)) . '/i', $token_string);
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- // Load the service required to construct this class.
- $container->get('config.factory'),
- $container->get('current_user'),
- $container->get('module_handler'),
- $container->get('http_client')
- );
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/MatomoInterface.php b/sites/all/modules/contrib/admin/matomo/src/MatomoInterface.php
deleted file mode 100644
index db12818d6..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/MatomoInterface.php
+++ /dev/null
@@ -1,15 +0,0 @@
-moduleHandler = $module_handler;
- $this->migrationPlugin = $migration_plugin;
-
- if (isset($configuration['skip_php'])) {
- $this->skipPHP = $configuration['skip_php'];
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
- $migration_configuration = [
- 'migration' => [
- 'd6_user_role',
- 'd7_user_role',
- ],
- ];
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('module_handler'),
- $container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_configuration, $migration)
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
- list($old_visibility, $pages) = $value;
-
- $request_path_pages = '';
-
- if ($pages) {
- // 2 == BLOCK_VISIBILITY_PHP in Drupal 6 and 7.
- if ($old_visibility == 2) {
- // If the PHP module is present, migrate the visibility code unaltered.
- if ($this->moduleHandler->moduleExists('php')) {
- $request_path_pages = $pages;
- }
- // Skip the row if we're configured to. If not, we don't need to do
- // anything else -- the block will simply have no PHP or request_path
- // visibility configuration.
- elseif ($this->skipPHP) {
- throw new MigrateSkipRowException();
- }
- }
- else {
- $paths = preg_split("(\r\n?|\n)", $pages);
- foreach ($paths as $key => $path) {
- $paths[$key] = $path === '' ? $path : '/' . ltrim($path, '/');
- }
- $request_path_pages = implode("\n", $paths);
- }
- }
-
- return $request_path_pages;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoVisibilityRoles.php b/sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoVisibilityRoles.php
deleted file mode 100644
index d26907b46..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Plugin/migrate/process/MatomoVisibilityRoles.php
+++ /dev/null
@@ -1,87 +0,0 @@
-moduleHandler = $module_handler;
- $this->migrationPlugin = $migration_plugin;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
- $migration_configuration = [
- 'migration' => [
- 'd6_user_role',
- 'd7_user_role',
- ],
- ];
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('module_handler'),
- $container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_configuration, $migration)
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
- list($roles) = $value;
-
- // Remove role IDs disabled in D6/D7.
- $roles = array_filter($roles);
-
- $user_role_roles = [];
-
- if ($roles) {
- foreach ($roles as $key => $role_id) {
- $roles[$key] = $this->migrationPlugin->transform($role_id, $migrate_executable, $row, $destination_property);
- }
- $user_role_roles = array_combine($roles, $roles);
- }
-
- return $user_role_roles;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoBasicTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoBasicTest.php
deleted file mode 100644
index bddf51de6..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoBasicTest.php
+++ /dev/null
@@ -1,222 +0,0 @@
-noSnippetUser = $this->drupalCreateUser($permissions);
- $permissions[] = 'add js snippets for matomo';
- $this->admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->admin_user);
- }
-
- /**
- * Tests if configuration is possible.
- */
- public function testMatomoConfiguration() {
- // Check for setting page's presence.
- $this->drupalGet('admin/config/system/matomo');
- $this->assertRaw(t('Matomo site ID'), '[testMatomoConfiguration]: Settings page displayed.');
-
- // Check for account code validation.
- $edit['matomo_site_id'] = $this->randomMachineName(2);
- $edit['matomo_url_http'] = 'http://www.example.com/matomo/';
- $this->drupalPostForm('admin/config/system/matomo', $edit, 'Save configuration');
- $this->assertRaw(t('A valid Matomo site ID is an integer only.'), '[testMatomoConfiguration]: Invalid Matomo site ID number validated.');
-
- // Verify that invalid URLs throw a form error.
- $edit = [];
- $edit['matomo_site_id'] = 1;
- $edit['matomo_url_http'] = 'http://www.example.com/matomo/';
- $edit['matomo_url_https'] = 'https://www.example.com/matomo/';
- $this->drupalPostForm('admin/config/system/matomo', $edit, t('Save configuration'));
- $this->assertRaw('The validation of "http://www.example.com/matomo/piwik.php" failed with an exception', '[testMatomoConfiguration]: HTTP URL exception shown.');
- $this->assertRaw('The validation of "https://www.example.com/matomo/piwik.php" failed with an exception', '[testMatomoConfiguration]: HTTPS URL exception shown.');
-
- // User should have access to code snippets.
- $this->assertFieldByName('matomo_codesnippet_before');
- $this->assertFieldByName('matomo_codesnippet_after');
- $this->assertNoFieldByXPath("//textarea[@name='matomo_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is enabled.');
- $this->assertNoFieldByXPath("//textarea[@name='matomo_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is enabled.');
-
- // Login as user without JS permissions.
- $this->drupalLogin($this->noSnippetUser);
- $this->drupalGet('admin/config/system/matomo');
-
- // User should *not* have access to snippets, but create fields.
- $this->assertFieldByName('matomo_codesnippet_before');
- $this->assertFieldByName('matomo_codesnippet_after');
- $this->assertFieldByXPath("//textarea[@name='matomo_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is disabled.');
- $this->assertFieldByXPath("//textarea[@name='matomo_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is disabled.');
- }
-
- /**
- * Tests if page visibility works.
- */
- public function testMatomoPageVisibility() {
- $site_id = '1';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- // Show tracking on "every page except the listed pages".
- $this->config('matomo.settings')->set('visibility.request_path_mode', 0)->save();
- // Disable tracking one "admin*" pages only.
- $this->config('matomo.settings')->set('visibility.request_path_pages', "/admin\n/admin/*")->save();
- // Enable tracking only for authenticated users only.
- $this->config('matomo.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save();
-
- // Check tracking code visibility.
- $this->drupalGet('');
- $this->assertRaw('/matomo/js/matomo.js', '[testMatomoPageVisibility]: Custom tracking script is is displayed for authenticated users.');
- $this->assertRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is displayed for authenticated users.');
-
- // Test whether tracking code is not included on pages to omit.
- $this->drupalGet('admin');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is not displayed on admin page.');
- $this->drupalGet('admin/config/system/matomo');
- // Checking for tracking URI here, as $site_id is displayed in the form.
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is not displayed on admin subpage.');
-
- // Test whether tracking code display is properly flipped.
- $this->config('matomo.settings')->set('visibility.request_path_mode', 1)->save();
- $this->drupalGet('admin');
- $this->assertRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is displayed on admin page.');
- $this->drupalGet('admin/config/system/matomo');
- // Checking for tracking URI here, as $site_id is displayed in the form.
- $this->assertRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is displayed on admin subpage.');
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is NOT displayed on front page.');
-
- // Test whether tracking code is not display for anonymous.
- $this->drupalLogout();
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoPageVisibility]: Tracking code is NOT displayed for anonymous.');
-
- // Switch back to every page except the listed pages.
- $this->config('matomo.settings')->set('visibility.request_path_mode', 0)->save();
- // Enable tracking code for all user roles.
- $this->config('matomo.settings')->set('visibility.user_role_roles', [])->save();
-
- // Test whether 403 forbidden tracking code is shown if user has no access.
- $this->drupalGet('admin');
- $this->assertRaw('"403/URL = "', '[testMatomoPageVisibility]: 403 Forbidden tracking code shown if user has no access.');
-
- // Test whether 404 not found tracking code is shown on non-existent pages.
- $this->drupalGet($this->randomMachineName(64));
- $this->assertRaw('"404/URL = "', '[testMatomoPageVisibility]: 404 Not Found tracking code shown on non-existent page.');
- }
-
- /**
- * Tests if tracking code is properly added to the page.
- */
- public function testMatomoTrackingCode() {
- $site_id = '2';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- // Show tracking code on every page except the listed pages.
- $this->config('matomo.settings')->set('visibility.request_path_mode', 0)->save();
- // Enable tracking code for all user roles.
- $this->config('matomo.settings')->set('visibility.user_role_roles', [])->save();
-
- /* Sample JS code as added to page:
-
- */
-
- // Test whether tracking code uses latest JS.
- $this->config('matomo.settings')->set('cache', 0)->save();
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testMatomoTrackingCode]: Latest tracking code used.');
-
- // Test if tracking of User ID is enabled.
- $this->config('matomo.settings')->set('track.userid', 1)->save();
- $this->drupalGet('');
- $this->assertRaw('_paq.push(["setUserId", ', '[testMatomoTrackingCode]: Tracking code for User ID is enabled.');
-
- // Test if tracking of User ID is disabled.
- $this->config('matomo.settings')->set('track.userid', 0)->save();
- $this->drupalGet('');
- $this->assertNoRaw('_paq.push(["setUserId", ', '[testMatomoTrackingCode]: Tracking code for User ID is disabled.');
-
- // Test whether single domain tracking is active.
- $this->drupalGet('');
- $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testMatomoTrackingCode]: Single domain tracking is active.');
-
- // Enable "One domain with multiple subdomains".
- $this->config('matomo.settings')->set('domain_mode', 1)->save();
- $this->drupalGet('');
-
- // Test may run on localhost, an ipaddress or real domain name.
- // TODO: Workaround to run tests successfully. This feature cannot tested
- // reliable.
- global $cookie_domain;
- if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
- $this->assertRaw('_paq.push(["setCookieDomain"', '[testMatomoTrackingCode]: One domain with multiple subdomains is active on real host.');
- }
- else {
- // Special cases, Localhost and IP addresses don't show 'setCookieDomain'.
- $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testMatomoTrackingCode]: One domain with multiple subdomains may be active on localhost (test result is not reliable).');
- }
-
- // Test whether the BEFORE and AFTER code is added to the tracker.
- $this->config('matomo.settings')->set('codesnippet.before', '_paq.push(["setLinkTrackingTimer", 250]);')->save();
- $this->config('matomo.settings')->set('codesnippet.after', '_paq.push(["t2.setSiteId", 2]);if(1 == 1 && 2 < 3 && 2 > 1){console.log("Matomo: Custom condition works.");}_gaq.push(["t2.trackPageView"]);')->save();
- $this->drupalGet('');
- $this->assertRaw('setLinkTrackingTimer', '[testMatomoTrackingCode]: Before codesnippet has been found with "setLinkTrackingTimer" set.');
- $this->assertRaw('t2.trackPageView', '[testMatomoTrackingCode]: After codesnippet with "t2" tracker has been found.');
- $this->assertRaw('if(1 == 1 && 2 < 3 && 2 > 1){console.log("Matomo: Custom condition works.");}', '[testMatomoTrackingCode]: JavaScript code is not HTML escaped.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomUrls.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomUrls.php
deleted file mode 100644
index f3e08520a..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomUrls.php
+++ /dev/null
@@ -1,59 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Tests if user password page urls are overridden.
- */
- public function testMatomoUserPasswordPage() {
- $base_path = base_path();
- $site_id = '1';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- $this->drupalGet('user/password', ['query' => ['name' => 'foo']]);
- $this->assertRaw('_paq.push(["setCustomUrl", ' . Json::encode($base_path . 'user/password') . ']);');
-
- $this->drupalGet('user/password', ['query' => ['name' => 'foo@example.com']]);
- $this->assertRaw('_paq.push(["setCustomUrl", ' . Json::encode($base_path . 'user/password') . ']);');
-
- $this->drupalGet('user/password');
- $this->assertNoRaw('_paq.push(["setCustomUrl", "', '[testMatomoCustomUrls]: Custom url not set.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomVariablesTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomVariablesTest.php
deleted file mode 100644
index ad1d33e02..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoCustomVariablesTest.php
+++ /dev/null
@@ -1,133 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Tests if custom variables are properly added to the page.
- */
- public function testMatomoCustomVariables() {
- $site_id = '3';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- // Basic test if the feature works.
- $custom_vars = [
- 1 => [
- 'slot' => 1,
- 'name' => 'Foo 1',
- 'value' => 'Bar 1',
- 'scope' => 'visit',
- ],
- 2 => [
- 'slot' => 2,
- 'name' => 'Foo 2',
- 'value' => 'Bar 2',
- 'scope' => 'page',
- ],
- 3 => [
- 'slot' => 3,
- 'name' => 'Foo 3',
- 'value' => 'Bar 3',
- 'scope' => 'page',
- ],
- 4 => [
- 'slot' => 4,
- 'name' => 'Foo 4',
- 'value' => 'Bar 4',
- 'scope' => 'visit',
- ],
- 5 => [
- 'slot' => 5,
- 'name' => 'Foo 5',
- 'value' => 'Bar 5',
- 'scope' => 'visit',
- ],
- ];
- $this->config('matomo.settings')->set('custom.variable', $custom_vars)->save();
- $this->drupalGet('');
-
- foreach ($custom_vars as $slot) {
- $this->assertRaw('_paq.push(["setCustomVariable", ' . Json::encode($slot['slot']) . ', ' . Json::encode($slot['name']) . ', ' . Json::encode($slot['value']) . ', ' . Json::encode($slot['scope']) . ']);', '[testMatomoCustomVariables]: setCustomVariable ' . $slot['slot'] . ' is shown.');
- }
-
- // Test whether tokens are replaced in custom variable names.
- $site_slogan = $this->randomMachineName(16);
- $this->config('system.site')->set('slogan', $site_slogan)->save();
-
- $custom_vars = [
- 1 => [
- 'slot' => 1,
- 'name' => 'Name: [site:slogan]',
- 'value' => 'Value: [site:slogan]',
- 'scope' => 'visit',
- ],
- 2 => [
- 'slot' => 2,
- 'name' => '',
- 'value' => $this->randomMachineName(16),
- 'scope' => 'page',
- ],
- 3 => [
- 'slot' => 3,
- 'name' => $this->randomMachineName(16),
- 'value' => '',
- 'scope' => 'visit',
- ],
- 4 => [
- 'slot' => 4,
- 'name' => '',
- 'value' => '',
- 'scope' => 'page',
- ],
- 5 => [
- 'slot' => 5,
- 'name' => '',
- 'value' => '',
- 'scope' => 'visit',
- ],
- ];
- $this->config('matomo.settings')->set('custom.variable', $custom_vars)->save();
- $this->verbose('
' . print_r($custom_vars, TRUE) . '
');
-
- $this->drupalGet('');
- $this->assertRaw('_paq.push(["setCustomVariable", 1, ' . Json::encode("Name: $site_slogan") . ', ' . Json::encode("Value: $site_slogan") . ', "visit"]', '[testMatomoCustomVariables]: Tokens have been replaced in custom variable.');
- $this->assertNoRaw('_paq.push(["setCustomVariable", 2,', '[testMatomoCustomVariables]: Value with empty name is not shown.');
- $this->assertNoRaw('_paq.push(["setCustomVariable", 3,', '[testMatomoCustomVariables]: Name with empty value is not shown.');
- $this->assertNoRaw('_paq.push(["setCustomVariable", 4,', '[testMatomoCustomVariables]: Empty name and value is not shown.');
- $this->assertNoRaw('_paq.push(["setCustomVariable", 5,', '[testMatomoCustomVariables]: Empty name and value is not shown.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoPhpFilterTest.php.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoPhpFilterTest.php.php
deleted file mode 100644
index 47a43412d..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoPhpFilterTest.php.php
+++ /dev/null
@@ -1,107 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions_admin_user);
-
- // Administrator who cannot configure tracking visibility with PHP.
- $permissions_delegated_admin_user = [
- 'access administration pages',
- 'administer matomo',
- ];
- $this->delegated_admin_user = $this->drupalCreateUser($permissions_delegated_admin_user);
- }
-
- /**
- * Tests if PHP module integration works.
- */
- public function testMatomoPhpFilter() {
- $site_id = '1';
- $this->drupalLogin($this->admin_user);
-
- $edit = [];
- $edit['matomo_site_id'] = $site_id;
- $edit['matomo_url_http'] = 'http://www.example.com/matomo/';
- $edit['matomo_url_https'] = 'https://www.example.com/matomo/';
- // Skip url check errors in automated tests.
- $edit['matomo_url_skiperror'] = TRUE;
- $edit['matomo_visibility_request_path_mode'] = 2;
- $edit['matomo_visibility_request_path_pages'] = '';
- $this->drupalPostForm('admin/config/system/matomo', $edit, t('Save configuration'));
-
- // Compare saved setting with posted setting.
- $matomo_visibility_request_path_pages = \Drupal::config('matomo.settings')->get('visibility.request_path_pages');
- $this->assertEqual('', $matomo_visibility_request_path_pages, '[testMatomoPhpFilter]: PHP code snippet is intact.');
-
- // Check tracking code visibility.
- $this->config('matomo.settings')->set('visibility.request_path_pages', '')->save();
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testMatomoPhpFilter]: Tracking is displayed on frontpage page.');
- $this->drupalGet('admin');
- $this->assertRaw('u+"piwik.php"', '[testMatomoPhpFilter]: Tracking is displayed on admin page.');
-
- $this->config('matomo.settings')->set('visibility.request_path_pages', '')->save();
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoPhpFilter]: Tracking is not displayed on frontpage page.');
-
- // Test administration form.
- $this->config('matomo.settings')->set('visibility.request_path_pages', '')->save();
- $this->drupalGet('admin/config/system/matomo');
- $this->assertRaw(t('Pages on which this PHP code returns TRUE (experts only)'), '[testMatomoPhpFilter]: Permission to administer PHP for tracking visibility.');
- $this->assertRaw(Html::escape(''), '[testMatomoPhpFilter]: PHP code snippted is displayed.');
-
- // Login the delegated user and check if fields are visible.
- $this->drupalLogin($this->delegated_admin_user);
- $this->drupalGet('admin/config/system/matomo');
- $this->assertNoRaw(t('Pages on which this PHP code returns TRUE (experts only)'), '[testMatomoPhpFilter]: No permission to administer PHP for tracking visibility.');
- $this->assertRaw(Html::escape(''), '[testMatomoPhpFilter]: No permission to view PHP code snippted.');
-
- // Set a different value and verify that this is still the same after the
- // post.
- $this->config('matomo.settings')->set('visibility.request_path_pages', '')->save();
-
- $edit = [];
- $edit['matomo_site_id'] = $site_id;
- $edit['matomo_url_http'] = 'http://www.example.com/matomo/';
- $edit['matomo_url_https'] = 'https://www.example.com/matomo/';
- // Required for testing only.
- $edit['matomo_url_skiperror'] = TRUE;
- $this->drupalPostForm('admin/config/system/matomo', $edit, t('Save configuration'));
-
- // Compare saved setting with posted setting.
- $matomo_visibility_request_path_mode = $this->config('matomo.settings')->get('visibility.request_path_mode');
- $matomo_visibility_request_path_pages = $this->config('matomo.settings')->get('visibility.request_path_pages');
- $this->assertEqual(2, $matomo_visibility_request_path_mode, '[testMatomoPhpFilter]: Pages on which this PHP code returns TRUE is selected.');
- $this->assertEqual('', $matomo_visibility_request_path_pages, '[testMatomoPhpFilter]: PHP code snippet is intact.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoRolesTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoRolesTest.php
deleted file mode 100644
index 92c01bb9f..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoRolesTest.php
+++ /dev/null
@@ -1,107 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Tests if roles based tracking works.
- */
- public function testMatomoRolesTracking() {
- $site_id = '1';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- // Test if the default settings are working as expected.
- // Add to the selected roles only.
- $this->config('matomo.settings')->set('visibility.user_role_mode', 0)->save();
- // Enable tracking for all users.
- $this->config('matomo.settings')->set('visibility.user_role_roles', [])->save();
-
- // Check tracking code visibility.
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is displayed for anonymous users on frontpage with default settings.');
- $this->drupalGet('admin');
- $this->assertRaw('"403/URL = "', '[testMatomoRoleVisibility]: 403 Forbidden tracking code is displayed for anonymous users in admin section with default settings.');
-
- $this->drupalLogin($this->admin_user);
-
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is displayed for authenticated users on frontpage with default settings.');
- $this->drupalGet('admin');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is NOT displayed for authenticated users in admin section with default settings.');
-
- // Test if the non-default settings are working as expected.
- // Enable tracking only for authenticated users.
- $this->config('matomo.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save();
-
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is displayed for authenticated users only on frontpage.');
-
- $this->drupalLogout();
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is NOT displayed for anonymous users on frontpage.');
-
- // Add to every role except the selected ones.
- $this->config('matomo.settings')->set('visibility.user_role_mode', 1)->save();
- // Enable tracking for all users.
- $this->config('matomo.settings')->set('visibility.user_role_roles', [])->save();
-
- // Check tracking code visibility.
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is added to every role and displayed for anonymous users.');
- $this->drupalGet('admin');
- $this->assertRaw('"403/URL = "', '[testMatomoRoleVisibility]: 403 Forbidden tracking code is shown for anonymous users if every role except the selected ones is selected.');
-
- $this->drupalLogin($this->admin_user);
-
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is added to every role and displayed on frontpage for authenticated users.');
- $this->drupalGet('admin');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is added to every role and NOT displayed in admin section for authenticated users.');
-
- // Disable tracking for authenticated users.
- $this->config('matomo.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save();
-
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is NOT displayed on frontpage for excluded authenticated users.');
- $this->drupalGet('admin');
- $this->assertNoRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is NOT displayed in admin section for excluded authenticated users.');
-
- $this->drupalLogout();
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testMatomoRoleVisibility]: Tracking code is displayed on frontpage for included anonymous users.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoSearchTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoSearchTest.php
deleted file mode 100644
index 72c18358b..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoSearchTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
-
- $permissions = [
- 'access administration pages',
- 'administer matomo',
- 'search content',
- 'create page content',
- 'edit own page content',
- ];
-
- // User to set up matomo.
- $this->admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->admin_user);
- }
-
- /**
- * Tests if search tracking is properly added to the page.
- */
- public function testMatomoSearchTracking() {
- $site_id = '1';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- // Check tracking code visibility.
- $this->drupalGet('');
- $this->assertRaw($site_id, '[testMatomoSearch]: Tracking code is displayed for authenticated users.');
-
- $this->drupalGet('search/node');
- $this->assertNoRaw('_paq.push(["trackSiteSearch", ', '[testMatomoSearch]: Search tracker not added to page.');
-
- // Enable site search support.
- $this->config('matomo.settings')->set('track.site_search', 1)->save();
-
- // Search for random string.
- $search = [];
- $search['keys'] = $this->randomMachineName(8);
-
- // Create a node to search for.
- $edit = [];
- $edit['title[0][value]'] = 'This is a test title';
- $edit['body[0][value]'] = 'This test content contains ' . $search['keys'] . ' string.';
-
- // Fire a search, it's expected to get 0 results.
- $this->drupalPostForm('search/node', $search, t('Search'));
- $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testMatomoSearch]: Search results tracker is displayed.');
- $this->assertRaw('window.matomo_search_results = 0;', '[testMatomoSearch]: Search yielded no results.');
-
- // Save the node.
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
- $this->assertText(t('@type @title has been created.', ['@type' => 'Basic page', '@title' => $edit['title[0][value]']]), 'Basic page created.');
-
- // Index the node or it cannot found.
- $this->cronRun();
-
- $this->drupalPostForm('search/node', $search, t('Search'));
- $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testMatomoSearch]: Search results tracker is displayed.');
- $this->assertRaw('window.matomo_search_results = 1;', '[testMatomoSearch]: One search result found.');
-
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
- $this->assertText(t('@type @title has been created.', ['@type' => 'Basic page', '@title' => $edit['title[0][value]']]), 'Basic page created.');
-
- // Index the node or it cannot found.
- $this->cronRun();
-
- $this->drupalPostForm('search/node', $search, t('Search'));
- $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testMatomoSearch]: Search results tracker is displayed.');
- $this->assertRaw('window.matomo_search_results = 2;', '[testMatomoSearch]: Two search results found.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoStatusMessagesTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoStatusMessagesTest.php
deleted file mode 100644
index 2d4f0aa02..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoStatusMessagesTest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Tests if status messages tracking is properly added to the page.
- */
- public function testMatomoStatusMessages() {
- $site_id = '1';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- // Enable logging of errors only.
- $this->config('matomo.settings')->set('track.messages', ['error' => 'error'])->save();
-
- $this->drupalPostForm('user/login', [], t('Log in'));
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Username field is required."]);', '[testMatomoStatusMessages]: trackEvent "Username field is required." is shown.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Password field is required."]);', '[testMatomoStatusMessages]: trackEvent "Password field is required." is shown.');
-
- // Testing this Drupal::messenger() requires an extra test module.
- $this->drupalGet('matomo-test/drupal-messenger-add-message');
- $this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testMatomoStatusMessages]: Example status message is not enabled for tracking.');
- $this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testMatomoStatusMessages]: Example warning message is not enabled for tracking.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testMatomoStatusMessages]: Example error message is shown.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testMatomoStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.');
-
- // Enable logging of status, warnings and errors.
- $this->config('matomo.settings')->set('track.messages', [
- 'status' => 'status',
- 'warning' => 'warning',
- 'error' => 'error',
- ])->save();
-
- $this->drupalGet('matomo-test/drupal-messenger-add-message');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testMatomoStatusMessages]: Example status message is enabled for tracking.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testMatomoStatusMessages]: Example warning message is enabled for tracking.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testMatomoStatusMessages]: Example error message is shown.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testMatomoStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUninstallTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUninstallTest.php
deleted file mode 100644
index 2807e9649..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUninstallTest.php
+++ /dev/null
@@ -1,78 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->admin_user);
- }
-
- /**
- * Tests if the module cleans up the disk on uninstall.
- */
- public function testMatomoUninstall() {
- $cache_path = 'public://matomo';
- $site_id = '1';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- // Enable local caching of piwik.js.
- $this->config('matomo.settings')->set('cache', 1)->save();
-
- // Load front page to get the piwik.js downloaded into local cache. But
- // loading the piwik.js is not possible as "url_http" is a test dummy only.
- // Create a dummy file to complete the rest of the tests.
- file_prepare_directory($cache_path, FILE_CREATE_DIRECTORY);
- $data = $this->randomMachineName(128);
- $file_destination = $cache_path . '/piwik.js';
- file_unmanaged_save_data($data, $file_destination);
- file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE);
-
- // Test if the directory and piwik.js exists.
- $this->assertTrue(file_prepare_directory($cache_path), 'Cache directory "public://matomo" has been found.');
- $this->assertTrue(file_exists($cache_path . '/piwik.js'), 'Cached piwik.js tracking file has been found.');
- $this->assertTrue(file_exists($cache_path . '/piwik.js.gz'), 'Cached piwik.js.gz tracking file has been found.');
-
- // Uninstall the module.
- $edit = [];
- $edit['uninstall[matomo]'] = TRUE;
- $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall'));
- $this->assertNoText(\Drupal::translation()->translate('Configuration deletions'), 'No configuration deletions listed on the module install confirmation page.');
- $this->drupalPostForm(NULL, NULL, t('Uninstall'));
- $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.');
-
- // Test if the directory and all files have been removed.
- $this->assertFalse(file_scan_directory($cache_path, '/.*/'), 'Cached JavaScript files have been removed.');
- $this->assertFalse(file_prepare_directory($cache_path), 'Cache directory "public://matomo" has been removed.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUserFieldsTest.php b/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUserFieldsTest.php
deleted file mode 100644
index e56b3cda1..000000000
--- a/sites/all/modules/contrib/admin/matomo/src/Tests/MatomoUserFieldsTest.php
+++ /dev/null
@@ -1,73 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->admin_user);
- }
-
- /**
- * Tests if "allow users to customize tracking on their account page" works.
- */
- public function testMatomoUserFields() {
- $site_id = '1';
- $this->config('matomo.settings')->set('site_id', $site_id)->save();
- $this->config('matomo.settings')->set('url_http', 'http://www.example.com/matomo/')->save();
- $this->config('matomo.settings')->set('url_https', 'https://www.example.com/matomo/')->save();
-
- // Check if the pseudo field is shown on account forms.
- $this->drupalGet('admin/config/people/accounts/form-display');
- $this->assertResponse(200);
- $this->assertRaw(t('Matomo settings'), '[testMatomoUserFields]: Matomo settings field exists on Manage form display.');
-
- // No customization allowed.
- $this->config('matomo.settings')->set('visibility.user_account_mode', 0)->save();
- $this->drupalGet('user/' . $this->admin_user->id() . '/edit');
- $this->assertResponse(200);
- $this->assertNoRaw(t('Matomo settings'), '[testMatomoUserFields]: Matomo settings field does not exist on user edit page.');
-
- // Tracking on by default, users with opt-in or out of matomo tracking permission
- // can opt out.
- $this->config('matomo.settings')->set('visibility.user_account_mode', 1)->save();
- $this->drupalGet('user/' . $this->admin_user->id() . '/edit');
- $this->assertResponse(200);
- $this->assertRaw(t('Users are tracked by default, but you are able to opt out.'), '[testMatomoUserFields]: Matomo settings field exists on on user edit page');
-
- // Tracking off by default, users with opt-in or out of matomo tracking permission
- // can opt in.
- $this->config('matomo.settings')->set('visibility.user_account_mode', 2)->save();
- $this->drupalGet('user/' . $this->admin_user->id() . '/edit');
- $this->assertResponse(200);
- $this->assertRaw(t('Users are not tracked by default, but you are able to opt in.'), '[testMatomoUserFields]: Matomo settings field exists on on user edit page.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.info.yml b/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.info.yml
deleted file mode 100644
index 77399b4bd..000000000
--- a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.info.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: 'Matomo test'
-type: module
-description: 'Support module for Matomo testing.'
-package: Testing
-# core: 8.x
-
-# Information added by Drupal.org packaging script on 2019-02-08
-version: '8.x-1.9'
-core: '8.x'
-project: 'matomo'
-datestamp: 1549615102
diff --git a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.routing.yml b/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.routing.yml
deleted file mode 100644
index ad1fcf645..000000000
--- a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/matomo_test.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-matomo_test.drupal_messenger_add_message:
- path: '/matomo-test/drupal-messenger-add-message'
- defaults:
- _title: 'Add messages with Drupal::messenger()'
- _controller: '\Drupal\matomo_test\Controller\MatomoTestController::drupalAddMessageTest'
- requirements:
- _access: 'TRUE'
diff --git a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/src/Controller/MatomoTestController.php b/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/src/Controller/MatomoTestController.php
deleted file mode 100644
index a37b78342..000000000
--- a/sites/all/modules/contrib/admin/matomo/tests/modules/matomo_test/src/Controller/MatomoTestController.php
+++ /dev/null
@@ -1,28 +0,0 @@
-messenger()->addMessage($this->t('Example status message.'), 'status');
- $this->messenger()->addMessage($this->t('Example warning message.'), 'warning');
- $this->messenger()->addMessage($this->t('Example error message.'), 'error');
- $this->messenger()->addMessage($this->t('Example error message with html tags and link.'), 'error');
-
- return [];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/matomo/tests/src/Functional/AdminSettingsFormTest.php b/sites/all/modules/contrib/admin/matomo/tests/src/Functional/AdminSettingsFormTest.php
deleted file mode 100644
index af155f120..000000000
--- a/sites/all/modules/contrib/admin/matomo/tests/src/Functional/AdminSettingsFormTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
- }
-
- /**
- * Tests the fields that allow to configure tracking of specific pages.
- *
- * @param string $pages
- * A list of pages that should be tracked. One page per line.
- * @param bool $validation_error_expected
- * TRUE if a validation error should be thrown. FALSE otherwise.
- *
- * @dataProvider pageTrackingProvider
- */
- public function testPageTracking($pages, $validation_error_expected) {
- $edit = [
- 'matomo_visibility_request_path_mode' => 0,
- 'matomo_visibility_request_path_pages' => $pages,
- ];
- $this->drupalPostForm('admin/config/system/matomo', $edit, t('Save configuration'));
- $has_validation_error = (bool) $this->getSession()->getPage()->find('css', '#edit-matomo-visibility-request-path-pages.error');
- $this->assertEquals($validation_error_expected, $has_validation_error);
- }
-
- /**
- * Provides test data for ::testPageTracking().
- *
- * @return array
- * An array of test cases, each test case is an array with two values:
- * 0. A string containing a list of pages to track.
- * 1. A boolean indicating whether or not a validation error is expected to
- * be thrown.
- */
- public function pageTrackingProvider() {
- return [
- [
- // No validation error should be thrown for an empty page list.
- '',
- FALSE,
- ],
- [
- // No validation error should be thrown for a list of valid pages.
- <<
-TXT
- ,
- FALSE,
- ],
- [
- // A validation error should be thrown if one of the pages doesn't start
- // with a slash.
- <<
-TXT
- ,
- TRUE,
- ],
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/LICENSE.txt b/sites/all/modules/contrib/admin/menu_admin_per_menu/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/README.txt b/sites/all/modules/contrib/admin/menu_admin_per_menu/README.txt
deleted file mode 100644
index e757cbbd1..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/README.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-
-MENU ADMIN PER MENU
-http://drupal.org/project/menu_admin_per_menu
-
-DESCRIPTION
-By default, Drupal 7 allows only users with "Administer menus and menu items" to add, modify or delete menu items.
-In case you want for instance to let certain users manage Main menu or Navigation menu but not Management menu, this module provides this functionality.
-
-INSTALLATION
-Please read instructions at: http://drupal.org/project/menu_admin_per_menu
-
-CONTACT
-Henri MEDOT
-http://www.absyx.fr
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.api.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.api.php
deleted file mode 100644
index f6a96f978..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.api.php
+++ /dev/null
@@ -1,42 +0,0 @@
-id()) {
- $perm_menus['administer custom-menu menu items'] = 'custom-menu';
- }
-}
-
-/**
- * @} End of "addtogroup hooks".
- */
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.info.yml b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.info.yml
deleted file mode 100644
index a3edbaa5a..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: Menu Admin per Menu
-type: module
-description: Allows to give roles per menu admin permissions without giving them full administer menu permission.
-package: Administration
-# core: 8.x
-dependencies:
- - menu_ui
-
-# Information added by Drupal.org packaging script on 2017-10-05
-version: '8.x-1.0'
-core: '8.x'
-project: 'menu_admin_per_menu'
-datestamp: 1507184951
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.install b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.install
deleted file mode 100644
index 5ffe8a702..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.install
+++ /dev/null
@@ -1,14 +0,0 @@
-getFormObject();
- if ($form_object instanceof MenuLinkEditForm
- || $form_object instanceof MenuLinkContentForm) {
- $account = \Drupal::currentUser();
- if (!$account->hasPermission('administer menu')) {
- $options = $form['menu_parent']['#options'];
- $form['menu_parent']['#options'] = menu_admin_per_menu_filter_parent_options($account, $options);
- }
- }
- if ($form_object instanceof MenuForm) {
- $account = \Drupal::currentUser();
- if (!$account->hasPermission('administer menu')) {
- $form['id']['#access'] = FALSE;
- $form['label']['#access'] = FALSE;
- $form['description']['#access'] = FALSE;
- $form['langcode']['#access'] = FALSE;
- }
- }
-}
-
-/**
- * Implements hook_form_BASE_FORM_ID_alter() for node_form.
- */
-function menu_admin_per_menu_form_node_form_alter(&$form, FormStateInterface $form_state) {
- $account = \Drupal::currentUser();
- if (!$account->hasPermission('administer menu')) {
- /** @var \Drupal\menu_admin_per_menu\MenuAdminPerMenuAccessInterface $allowedMenusService */
- $allowedMenusService = \Drupal::service('menu_admin_per_menu.allowed_menus');
- $allowed_menus = $allowedMenusService->getPerMenuPermissions($account);
-
- $default_value = &$form['menu']['link']['menu_parent']['#default_value'];
- list($current_menu, ) = explode(':', $default_value, 2);
- // Disallow editing the menu item if there is a pre-existing menu item
- // belonging to a menu the user does not have permission to access.
- if (!empty($current_menu) && !in_array($current_menu, $allowed_menus)) {
- $form['menu']['#access'] = FALSE;
- return;
- }
-
- $options = &$form['menu']['link']['menu_parent']['#options'];
- $options = menu_admin_per_menu_filter_parent_options($account, $options ? $options : []);
- $form['menu']['#access'] = count($options) > 0;
- }
-}
-
-/**
- * Removes menu items for menus a user does not have permission to access.
- *
- * @param \Drupal\Core\Session\AccountInterface
- * The user to check for access.
- * @param array $options
- * An array of menu item labels keyed by menu item ID.
- *
- * @return array
- * Filtered menu item labels keyed by menu item ID.
- */
-function menu_admin_per_menu_filter_parent_options(AccountInterface $account, array $options) {
- /** @var \Drupal\menu_admin_per_menu\MenuAdminPerMenuAccessInterface $allowedMenusService */
- $allowedMenusService = \Drupal::service('menu_admin_per_menu.allowed_menus');
- $allowed_menus = $allowedMenusService->getPerMenuPermissions($account);
-
- foreach ($options as $key => $option) {
- list($menu, ) = explode(':', $key, 2);
- if (!in_array($menu, $allowed_menus)) {
- unset($options[$key]);
- }
- }
-
- return $options;
-}
-
-/**
- * Implements hook_ENTITY_TYPE_access() for entity type "menu_link_content".
- */
-function menu_admin_per_menu_menu_link_content_access(EntityInterface $entity, $operation, AccountInterface $account) {
- /** @var \Drupal\menu_admin_per_menu\MenuAdminPerMenuAccessInterface $allowedMenusService */
- $allowedMenusService = \Drupal::service('menu_admin_per_menu.allowed_menus');
- return $allowedMenusService->menuItemAccess($account, $entity);
-}
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.permissions.yml b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.permissions.yml
deleted file mode 100644
index abc56f298..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.permissions.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-permission_callbacks:
- - \Drupal\menu_admin_per_menu\MenuAdminPerMenuPermissions::permissions
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.services.yml b/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.services.yml
deleted file mode 100644
index 9cfed907b..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/menu_admin_per_menu.services.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-services:
- menu_admin_per_menu.route_subscriber:
- class: Drupal\menu_admin_per_menu\Routing\RouteSubscriber
- tags:
- - { name: event_subscriber }
- menu_admin_per_menu.allowed_menus:
- class: Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Access/MenuAdminPerMenuAccess.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Access/MenuAdminPerMenuAccess.php
deleted file mode 100644
index c5f3f366c..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Access/MenuAdminPerMenuAccess.php
+++ /dev/null
@@ -1,91 +0,0 @@
- $title) {
- $permission = 'administer ' . $name . ' menu items';
- if ($account->hasPermission($permission)) {
- $perms_menu[$permission] = $name;
- }
- }
- \Drupal::moduleHandler()->alter('menu_admin_per_menu_get_permissions', $perms_menu, $account);
- }
-
-
- return $perms_menu;
- }
-
- /**
- * {@inheritdoc}
- */
- public function menusOverviewAccess(AccountInterface $account) {
- if ($account->hasPermission('administer menu')) {
- return AccessResult::allowed();
- }
- $permissions = $this::getPerMenuPermissions($account);
- if ($account->hasPermission('administer menu') || $permissions) {
- return AccessResult::allowed();
- }
- return AccessResult::neutral();
- }
-
- /**
- * {@inheritdoc}
- */
- public function menuAccess(AccountInterface $account, Menu $menu) {
- $permission = 'administer ' . $menu->get('id') . ' menu items';
- $permissions = $this::getPerMenuPermissions($account);
- if ($account->hasPermission('administer menu')
- || isset($permissions[$permission])) {
- return AccessResult::allowed();
- }
- return AccessResult::neutral();
- }
-
- /**
- * {@inheritdoc}
- */
- public function menuItemAccess(AccountInterface $account, MenuLinkContent $menu_link_content = NULL) {
- $permission = 'administer ' . $menu_link_content->getMenuName() . ' menu items';
- $permissions = $this::getPerMenuPermissions($account);
- if ($account->hasPermission('administer menu')
- || isset($permissions[$permission])) {
- return AccessResult::allowed();
- }
- return AccessResult::neutral();
- }
-
- /**
- * {@inheritdoc}
- */
- public function menuLinkAccess(AccountInterface $account, MenuLinkInterface $menu_link_plugin = NULL) {
- $permission = 'administer ' . $menu_link_plugin->getMenuName() . ' menu items';
- $permissions = $this::getPerMenuPermissions($account);
- if ($account->hasPermission('administer menu')
- || isset($permissions[$permission])) {
- return AccessResult::allowed();
- }
- return AccessResult::neutral();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Controller/MenuAdminPerMenuController.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Controller/MenuAdminPerMenuController.php
deleted file mode 100644
index 233ccfb58..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Controller/MenuAdminPerMenuController.php
+++ /dev/null
@@ -1,67 +0,0 @@
-allowedMenusService = $allowed_menus;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('menu_admin_per_menu.allowed_menus')
- );
- }
-
- /**
- * Constructs menus overview page.
- */
- public function menuOverviewPage() {
- $account = $this->currentUser();
- $menu_table = $this->entityTypeManager()->getListBuilder('menu')->render();
- if ($account->hasPermission('administer menu')) {
- return $menu_table;
- }
- $allowed_menus = $this->allowedMenusService->getPerMenuPermissions($account);
- foreach ($menu_table['table']['#rows'] as $menu_key => $menu_item) {
- if (!isset($allowed_menus["administer $menu_key menu items"])) {
- unset($menu_table['table']['#rows'][$menu_key]);
- }
- else {
- $menu_row = &$menu_table['table']['#rows'][$menu_key];
- $menu_operations = &$menu_row['operations']['data']['#links'];
- $menu_operations['list']['title'] = $this->t('List links');
- $menu_operations['list']['url'] = Url::fromRoute('entity.menu.edit_form', ['menu' => $menu_key]);
- $menu_operations['add']['title'] = $this->t('Add link');
- $menu_operations['add']['url'] = Url::fromRoute('entity.menu.add_link_form', ['menu' => $menu_key]);
- }
- }
- return $menu_table;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/MenuAdminPerMenuAccessInterface.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/MenuAdminPerMenuAccessInterface.php
deleted file mode 100644
index 3deab4574..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/MenuAdminPerMenuAccessInterface.php
+++ /dev/null
@@ -1,76 +0,0 @@
-getExistingMenus();
- foreach ($menus as $name => $title) {
- $permission = 'administer ' . $name . ' menu items';
- $permissions[$permission] = [
- 'title' => $this->t('Administer @menu menu items', ['@menu' => $title]),
- ];
- }
- return $permissions;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Routing/RouteSubscriber.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Routing/RouteSubscriber.php
deleted file mode 100644
index 958ac0f25..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Routing/RouteSubscriber.php
+++ /dev/null
@@ -1,58 +0,0 @@
-all();
- foreach ($routes as $route_name => $route) {
- switch ($route_name) {
- case 'entity.menu.collection':
- $route->setDefaults(['_controller' => '\Drupal\menu_admin_per_menu\Controller\MenuAdminPerMenuController::menuOverviewPage']);
- $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menusOverviewAccess']);
- break;
-
- case 'entity.menu.edit_form':
- case 'entity.menu.add_link_form':
- $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menuAccess']);
- break;
-
- case 'menu_ui.link_edit':
- case 'menu_ui.link_reset':
- $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menuLinkAccess']);
- break;
-
- case 'entity.menu_link_content.canonical':
- case 'entity.menu_link_content.delete_form':
- case 'entity.menu_link_content.content_translation_overview':
- case 'entity.menu_link_content.content_translation_add':
- case 'entity.menu_link_content.content_translation_edit':
- case 'entity.menu_link_content.content_translation_delete':
- $route->setRequirements(['_custom_access' => '\Drupal\menu_admin_per_menu\Access\MenuAdminPerMenuAccess::menuItemAccess']);
- break;
-
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getSubscribedEvents() {
- // Run after content_translation, which has priority -210.
- $events[RoutingEvents::ALTER] = ['onAlterRoutes', -220];
- return $events;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Tests/MenuAdminPerMenuNodeSave.php b/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Tests/MenuAdminPerMenuNodeSave.php
deleted file mode 100644
index 5786ec3e5..000000000
--- a/sites/all/modules/contrib/admin/menu_admin_per_menu/src/Tests/MenuAdminPerMenuNodeSave.php
+++ /dev/null
@@ -1,116 +0,0 @@
-profile != 'standard') {
- $this->drupalCreateContentType([
- 'type' => 'page',
- 'name' => 'Basic page',
- 'display_submitted' => FALSE,
- ]);
- }
-
- $this->drupalPlaceBlock('system_menu_block:main');
-
- $this->contentOnlyUser = $this->drupalCreateUser([
- 'access content',
- 'administer content types',
- ]);
- $this->contentAndMenuUser = $this->drupalCreateUser([
- 'access content',
- 'administer content types',
- 'administer main menu items',
- ]);
- $this->anonymousUser = $this->drupalCreateUser([
- 'access content',
- ]);
- }
-
- /**
- * Test menu re-save by users without permission.
- *
- * Tests that a menu still exists and remains existing if a user without the
- * menu permissions resaves a node.
- */
- public function testResaveMenuLinkWithoutAccess() {
- $menu_link_title = $this->randomString();
-
- // Save the node with the menu.
- $this->drupalLogin($this->contentAndMenuUser);
- $edit = [
- 'title[0][value]' => $this->randomString(),
- 'body[0][value]' => $this->randomString(),
- 'menu[enabled]' => 1,
- 'menu[title]' => $menu_link_title,
- ];
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
-
- // Ensure the menu is in place.
- $this->assertLink($menu_link_title);
-
- // Logout.
- $this->drupalLogout();
-
- // Save the node again as someone without permission.
- $this->drupalLogin($this->contentOnlyUser);
- $edit = [
- 'title[0][value]' => $this->randomString(),
- 'body[0][value]' => $this->randomString(),
- ];
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
-
- // Ensure the menu is still in place.
- $this->assertLink($menu_link_title);
-
- // Ensure anonymous users with "access content" permission can see this
- // menu.
- $this->drupalLogout();
- $this->drupalGet('');
- $this->assertLink($menu_link_title);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/.codeclimate.yml b/sites/all/modules/contrib/admin/metatag/.codeclimate.yml
deleted file mode 100644
index e8b0bd077..000000000
--- a/sites/all/modules/contrib/admin/metatag/.codeclimate.yml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-engines:
- csslint:
- enabled: true
- duplication:
- enabled: true
- config:
- languages:
- - javascript
- - php
- eslint:
- enabled: true
- fixme:
- enabled: true
- phpmd:
- enabled: true
-ratings:
- paths:
- - "**.css"
- - "**.inc"
- - "**.install"
- - "**.js"
- - "**.module"
- - "**.php"
- - "**.test"
diff --git a/sites/all/modules/contrib/admin/metatag/.csslintrc b/sites/all/modules/contrib/admin/metatag/.csslintrc
deleted file mode 100644
index aacba956e..000000000
--- a/sites/all/modules/contrib/admin/metatag/.csslintrc
+++ /dev/null
@@ -1,2 +0,0 @@
---exclude-exts=.min.css
---ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes
diff --git a/sites/all/modules/contrib/admin/metatag/.eslintignore b/sites/all/modules/contrib/admin/metatag/.eslintignore
deleted file mode 100644
index 96212a359..000000000
--- a/sites/all/modules/contrib/admin/metatag/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-**/*{.,-}min.js
diff --git a/sites/all/modules/contrib/admin/metatag/.eslintrc b/sites/all/modules/contrib/admin/metatag/.eslintrc
deleted file mode 100644
index 9faa37508..000000000
--- a/sites/all/modules/contrib/admin/metatag/.eslintrc
+++ /dev/null
@@ -1,213 +0,0 @@
-ecmaFeatures:
- modules: true
- jsx: true
-
-env:
- amd: true
- browser: true
- es6: true
- jquery: true
- node: true
-
-# http://eslint.org/docs/rules/
-rules:
- # Possible Errors
- comma-dangle: [2, never]
- no-cond-assign: 2
- no-console: 0
- no-constant-condition: 2
- no-control-regex: 2
- no-debugger: 2
- no-dupe-args: 2
- no-dupe-keys: 2
- no-duplicate-case: 2
- no-empty: 2
- no-empty-character-class: 2
- no-ex-assign: 2
- no-extra-boolean-cast: 2
- no-extra-parens: 0
- no-extra-semi: 2
- no-func-assign: 2
- no-inner-declarations: [2, functions]
- no-invalid-regexp: 2
- no-irregular-whitespace: 2
- no-negated-in-lhs: 2
- no-obj-calls: 2
- no-regex-spaces: 2
- no-sparse-arrays: 2
- no-unexpected-multiline: 2
- no-unreachable: 2
- use-isnan: 2
- valid-jsdoc: 0
- valid-typeof: 2
-
- # Best Practices
- accessor-pairs: 2
- block-scoped-var: 0
- complexity: [2, 6]
- consistent-return: 0
- curly: 0
- default-case: 0
- dot-location: 0
- dot-notation: 0
- eqeqeq: 2
- guard-for-in: 2
- no-alert: 2
- no-caller: 2
- no-case-declarations: 2
- no-div-regex: 2
- no-else-return: 0
- no-empty-label: 2
- no-empty-pattern: 2
- no-eq-null: 2
- no-eval: 2
- no-extend-native: 2
- no-extra-bind: 2
- no-fallthrough: 2
- no-floating-decimal: 0
- no-implicit-coercion: 0
- no-implied-eval: 2
- no-invalid-this: 0
- no-iterator: 2
- no-labels: 0
- no-lone-blocks: 2
- no-loop-func: 2
- no-magic-number: 0
- no-multi-spaces: 0
- no-multi-str: 0
- no-native-reassign: 2
- no-new-func: 2
- no-new-wrappers: 2
- no-new: 2
- no-octal-escape: 2
- no-octal: 2
- no-proto: 2
- no-redeclare: 2
- no-return-assign: 2
- no-script-url: 2
- no-self-compare: 2
- no-sequences: 0
- no-throw-literal: 0
- no-unused-expressions: 2
- no-useless-call: 2
- no-useless-concat: 2
- no-void: 2
- no-warning-comments: 0
- no-with: 2
- radix: 2
- vars-on-top: 0
- wrap-iife: 2
- yoda: 0
-
- # Strict
- strict: 0
-
- # Variables
- init-declarations: 0
- no-catch-shadow: 2
- no-delete-var: 2
- no-label-var: 2
- no-shadow-restricted-names: 2
- no-shadow: 0
- no-undef-init: 2
- no-undef: 0
- no-undefined: 0
- no-unused-vars: 0
- no-use-before-define: 0
-
- # Node.js and CommonJS
- callback-return: 2
- global-require: 2
- handle-callback-err: 2
- no-mixed-requires: 0
- no-new-require: 0
- no-path-concat: 2
- no-process-exit: 2
- no-restricted-modules: 0
- no-sync: 0
-
- # Stylistic Issues
- array-bracket-spacing: 0
- block-spacing: 0
- brace-style: 0
- camelcase: 0
- comma-spacing: 0
- comma-style: 0
- computed-property-spacing: 0
- consistent-this: 0
- eol-last: 0
- func-names: 0
- func-style: 0
- id-length: 0
- id-match: 0
- indent: 0
- jsx-quotes: 0
- key-spacing: 0
- linebreak-style: 0
- lines-around-comment: 0
- max-depth: 0
- max-len: 0
- max-nested-callbacks: 0
- max-params: 0
- max-statements: [2, 30]
- new-cap: 0
- new-parens: 0
- newline-after-var: 0
- no-array-constructor: 0
- no-bitwise: 0
- no-continue: 0
- no-inline-comments: 0
- no-lonely-if: 0
- no-mixed-spaces-and-tabs: 0
- no-multiple-empty-lines: 0
- no-negated-condition: 0
- no-nested-ternary: 0
- no-new-object: 0
- no-plusplus: 0
- no-restricted-syntax: 0
- no-spaced-func: 0
- no-ternary: 0
- no-trailing-spaces: 0
- no-underscore-dangle: 0
- no-unneeded-ternary: 0
- object-curly-spacing: 0
- one-var: 0
- operator-assignment: 0
- operator-linebreak: 0
- padded-blocks: 0
- quote-props: 0
- quotes: 0
- require-jsdoc: 0
- semi-spacing: 0
- semi: 0
- sort-vars: 0
- space-after-keywords: 0
- space-before-blocks: 0
- space-before-function-paren: 0
- space-before-keywords: 0
- space-in-parens: 0
- space-infix-ops: 0
- space-return-throw-case: 0
- space-unary-ops: 0
- spaced-comment: 0
- wrap-regex: 0
-
- # ECMAScript 6
- arrow-body-style: 0
- arrow-parens: 0
- arrow-spacing: 0
- constructor-super: 0
- generator-star-spacing: 0
- no-arrow-condition: 0
- no-class-assign: 0
- no-const-assign: 0
- no-dupe-class-members: 0
- no-this-before-super: 0
- no-var: 0
- object-shorthand: 0
- prefer-arrow-callback: 0
- prefer-const: 0
- prefer-reflect: 0
- prefer-spread: 0
- prefer-template: 0
- require-yield: 0
diff --git a/sites/all/modules/contrib/admin/metatag/CHANGELOG.txt b/sites/all/modules/contrib/admin/metatag/CHANGELOG.txt
deleted file mode 100644
index 8955618d3..000000000
--- a/sites/all/modules/contrib/admin/metatag/CHANGELOG.txt
+++ /dev/null
@@ -1,518 +0,0 @@
-Metatag 8.x-1.8, 2019-02-20
----------------------------
-By samuel.mortenson, Berdir, DamienMcKenna: Fix data property definition.
-
-
-Metatag 8.x-1.7, 2018-08-31
----------------------------
-#2994979 by DamienMcKenna, dspachos, ynotpeanutbutter, oxy86, IT-Cru, kdeds,
- zenimagine: Fixed backwards compatibility break when support for multiple-
- value tags was added.
-#2990923 by th_tushar, DamienMcKenna: Fixed coding standards.
-
-
-Metatag 8.x-1.6, 2018-08-21
----------------------------
-#2961777 by thejimbirch, Baysaa: "Geographical position" (geo.position) should
- use semi-colon instead of comma.
-#2964626 by idebr: og:image:secure_url allows for multiple values.
-#2865267 by DamienMcKenna, okonvicka, aldibier: tags empty after
- installing Metatag.
-#2962426 by dragonwize: Image URL double encoded.
-#2973277 by mvantuch, DamienMcKenna: Support for og:image:alt.
-#2977002 by DamienMcKenna, maxoid: Enable testing on the two og product meta
- tags.
-#2977545 by pmelab, bappa.sarkar, DamienMcKenna: GraphQL throws an error due to
- Metatag's use of a custom data structure.
-#2925714 by acbramley, vakulrai, Berdir, nkoporec: Replace deprecated
- BaseFieldDefinition ::setQueryable.
-#2957411 by pmelab: Field item empty check on empty arrays.
-#2958743 by DamienMcKenna, AdamEvertsson, StepanISK, trong.nguyen.tcec,
- chiefme, quixxel, rjg, CProfessionals: Ignore update.php requests when
- loading entities; error message when updating from 8.x-1.0 to 8.x-1.5.
-#2961918 by thejimbirch, Michelle: Add the site.webmanifest meta tag.
-#2895577 by plopesc, drupallogic: Error loading
- /admin/config/search/metatag?page=1.
-#2943954 by thejimbirch, DamienMcKenna: Document an approach to simplify
- overriding meta tags on a per-entity basis.
-#2968902 by DamienMcKenna, Berdir: Default user page title token should use
- [user:display-name].
-#2977197 by justin., DamienMcKenna: Allow modules to override the entity used
- for token replacements.
-#2691313 by KarenS, carstenG, DamienMcKenna, Michelle, marysmech: New option to
- control which meta tag groups are used on each form.
-#2563657 by plopesc, scotthooker, dawehner, ryanissamson, KevinVb, dobrzyns,
- PieterDC, peter.keppert, piggito, DamienMcKenna, Grayle, kunal.kursija,
- Citizen Dan, al0a, kaushashah, yohanaraujo07@gmail.com, markandrewsutton,
- fuzzyjared, igalafate, PascoS, rybchynski: Panels / Page Manager
- integration.
-#2989295 by JKerschner: Coding style improvements.
-#2987852 by Chris Burge: Allow meta tags to be altered before page attachment.
-#2989543 by JKerschner: Remove unused variables and imports.
-#2753595 by sinn, thejimbirch: W3C validation error on xmlns attribute.
-#2988072 by juanolalla: Allow contex entity to be overriden in alter hook.
-#2628934 by nikunjkotecha, smaz, e.escribano, idebr, DamienMcKenna,
- ZapevalovAnton, caspervoogt: Full support for meta tags that allow multiple
- values.
-#2987904 by thejimbirch: Remove groups redundantly stored in the main module.
-#2987107 by ziomizar: Add support for bubbeable metadata in the MetatagToken
- service.
-#2978106 by Rolf van de Krol: Translated metatags not showing in normalized
- entity representations (i.e. REST).
-#2799861 by kalpaitch, DamienMcKenna, dmitry.yankouski, ckaotik: Canonical links
- repeated when using Panels pages.
-#2532596 by alzz, DamienMcKenna, thejimbirch: Add new meta tag: google.
-
-
-Metatag 8.x-1.5, 2018-03-29
----------------------------
-#2932596 by yo30, Punk_UnDeaD: Wrong method in abstract class LinkSizesBase.
-#2933940 by DamienMcKenna: og:image must be at least 200x200 otherwise it is
- ignored by Facebook.
-#2936371 by gaurav.kapoor: Unused variable in metatag defaults class revert
- function.
-#2923080 by DamienMcKenna, pingwin4eg, pazhyn: Undefined offset: 1 in
- metatag_mobile_page_attachments_alter.
-#2930037 by smurrayatwork, rbayliss, moshe weitzman: Missing ampersand with
- drupal_static causes multiple calls to metatag_get_tags_from_route().
-#2899234 by DamienMcKenna, JeffM2001, twang, heddn, edurenye, ShaunDychko:
- Missing dependency (drupal:serialization) / Fatal error: Class NormalizerBase
- not found.
-#2945799 by DamienMcKenna, webfaqtory: Undefined variable: tag_id in
- MetatagManager->sortedGroupsWithTags().
-#2953313 by DamienMcKenna: Add a function for getting the meta tags in a human
- readable format - metatag_generate_entity_metatags().
-#2953635 by DamienMcKenna: MetatagStringTest has the wrong @group.
-#2937683 by prafullsranjan, DamienMcKenna: Further improve module's coding
- standards compliance.
-#2939608 by alberto56: Invalid argument supplied for foreach() in
- MetatagNormalizer.
-#2936876 by bonus, DamienMcKenna: Add support for Pinterest meta namespace.
-#2938025 by DamienMcKenna, Oliver Eyton-Williams: Incorrect rel attribute on
- hreflang tags.
-#2954214 by DamienMcKenna: composer.json improvements.
-#2908119 by LEalex, DamienMcKenna, jeffam, BenStallings: Set "link" HTTP header
- for canonical URL and shortlink tags.
-#2954169 by yasmeensalah, DamienMcKenna: Translations of description meta tags
- shouldn't be limited to 128 characters.
-#2897450 by edurenye: Add product:price:amount and product:price:currency OG
- tags.
-#2922581 by roborew: Metatag causes error when used with Replication Modules to
- deploy content.
-#2947493 by DamienMcKenna, kala4ek: Adding forms of custom entities are broken.
-#2828607 by pingevt, DamienMcKenna: Add OG book meta tags.
-#2954522 by DamienMcKenna: Correct spelling of "meta tags".
-#2809351 by DamienMcKenna, thejimbirch: Add the advanced Dublin Core meta tags.
-#2956199 by DamienMcKenna: Remove separate admin pages for Views integration.
-#2956227 by DamienMcKenna: Test improvements from 2883718-20.
-#2900368 by plopesc: Don't allow certain defaults to be removed.
-#2840751 by ocastle, ElegguaDP, Wim Leers, keopx, adamzimmermann:
- Protocol-relative URLs are broken.
-#2925974 by keopx, ocastle, DamienMcKenna, Wim Leers, mangy.fox: Twitter Cards
- (and others) require absolute URLs.
-
-
-Metatag 8.x-1.4, 2017-12-21
----------------------------
-#2882769 by DamienMcKenna: Added a hook_requirements() message about the
- Schema.org Metatag module.
-#2864079 by DamienMcKenna: Resolve coding standards violations.
-#2928394 by DamienMcKenna, mattlt: Error: Trait metatag_views\
- MetatagViewsValuesCleanerTrait not found.
-#2932110 by thejimbirch: Update Description's meta description to 320 chars
- (for 2018).
-#2932285 by DamienMcKenna, Sophie.SK: After updating Redirect to 1.0, config
- import fails: route does not exist.
-#2932316 by DamienMcKenna, Sophie.SK: Error on main defaults page if no config
- objects exist.
-#2932361 by DamienMcKenna: Improve coding standards on Metatag 8.x-1.x.
-#2930001 by Aurif3x, DamienMcKenna: New meta tag: Set-Cookie.
-#2810635 by DamienMcKenna: Automatically add hreflang meta tags for each enabled
- language.
-
-
-Metatag 8.x-1.3, 2017-09-29
----------------------------
-#2898975 by DamienMcKenna: Correct restui entry in composer.json.
-#2899045 by DamienMcKenna: Fixed problems in MetatagNodeTranslationTest.
-#2899234 by DamienMcKenna: Expand Devel/WebProfiler tests to make sure they work
- when a content type and node are present.
-#2898805 by DamienMcKenna: Small improvements to the test suite, working
- towards fixing the 8.4.x support.
-#2898805 by DamienMcKenna: Fixes to MetatagNodeTranslationTest to make it work
- with 8.4.x.
-By DamienMcKenna: Reenable \Drupal\metatag\Tests\MetatagFrontpageTest::
- testFrontPageMetatagsEnabledConfig().
-#2905925 by DamienMcKenna: The Normalizer shouldn't assume all meta tags have a
- 'content' attribute; also support the 'href' attribute.
-#2906312 by DamienMcKenna: Added the twitter:dnt meta tag.
-#2909390/2894868 by Perignon, StijnStroobants: Small typo in MetatagToken.
-#2903661 by DamienMcKenna: Don't output 403/404 page node's meta tags on
- 403/404 pages.
-#2905769 by DamienMcKenna: Improved defaults for the canonical URL meta tag.
-#2899752 by DamienMcKenna, huzooka, deepak_zyxware, samuel.mortenson, wanjee,
- giangi.vigazzola: Creating a new field bundle inside
- hook_entity_base_field_info_alter() is a bad idea and causes problems.
-#2906180 by John Lawter: Incorrect Wikipedia link for Advanced > Geographical
- position.
-#2859111 by acbramley, DamienMcKenna: Remove the second canonical tag on
- taxonomy term pages because of a bug in core.
-By DamienMcKenna: Changed codebase to only use short array syntax, fixed some
- comments.
-#2911435 by DamienMcKenna, AdamPS: Streamline the HTML output logic.
-#2860088 by AdamPS, DamienMcKenna: Comma separated list in og:image breaks if
- one component is empty.
-#2905769 by DamienMcKenna: Added tests for how default meta tags are displayed.
-#2872382 by Vlad_Bo, DamienMcKenna: Error if there is no node object (custom
- node view implementation).
-#2217549 by Alan D., Kuldeep K, DamienMcKenna: Integration with the Diff module.
-
-
-Metatag 8.x-1.2, 2017-07-31
----------------------------
-#2882954 by DamienMcKenna: Added Devel as a test dependency.
-#2882954, #2877737 by DamienMcKenna, René-Marc Simard, a.henry: Fixed
- compatibility with WebProfiler, added tests to ensure site still works when it
- or Devel is enabled.
-#2878158 by DamienMcKenna: Listed Context Metadata as a related module.
-#2894566 by StijnStroobants: Make all routes start with a leading slash.
-By DamienMcKenna: Use ComposerCat to update composer.json.
-By DamienMcKenna: Don't list Drupal core as a dependency in composer.json.
-#2636852 by hanoii, DamienMcKenna, Grayside, pcho, skorzh, fjgarlin, vincic:
- Make Metatag fields available as JSON.
-#2893448 by Sam152: Add correct meta tags to latest-version route to support
- content moderation.
-
-
-Metatag 8.x-1.1, 2017-05-31
----------------------------
-#2852737 by DamienMcKenna: Added CodeClimate config files.
-#2853252 by dawehner: Ensure the meta tags are ordered correctly.
-#2856454 by dbungard: Improvements to UI text, meta tag descriptions, etc.
-#2781485 by kalpaitch: Changed MetatagManager to use the instance name rather
- than plugin ID to identify plugin instances.
-By DamienMcKenna: Ensure all drupalPostForm() calls are preceeded by a
- drupalGet() call, and that all drupalGet() calls have an assertResponse().
-#2858057 by nicrodgers: Wrong default values are displayed in the node form when
- adding a translation.
-#2855445 by rocket.man: Replace deprecated functions (database functions,
- format_string()).
-#2851582 by mtodor: Filled out missing attributes on the default configuration.
-#2862277 by DamienMcKenna: Fixed filename of the MsapplicationStartUrl plugin.
-#2864524 by JamesK: Improve field description for the abstract meta tag.
-#2848353 by DamienMcKenna, grisendo: Only output one shortlink tag; extended tag
- tests to cover an example entity.
-#2706941 by ckaotik, monika.de, DamienMcKenna, mariancalinro, adinac: Allow
- translations to be longer than 128 characters for tags which use textarea
- fields.
-#2868750 by DamienMcKenna: List Metatag Cxense as a related module.
-#2563633 by ziomizar, DamienMcKenna, ruloweb: Add all of the Favicon meta tags.
-#2853515 by ohthehugemanatee: Add default handling to metatag manager.
-#2857544 by fjgarlin: Default values not returned on REST default routes.
-#2636852 by Greyside: MetatagToken::replace() options array shouldn't assume the
- 'clear' attribute is always needed.
-By DamienMcKenna: Allow MetatagJsonOutputTest to run.
-#2563633 by ziomizar: Misc fixes for the Favicon meta tags.
-#2563647 by delta, tom_ek, DamienMcKenna, monika.de, ckaotik, martins.bertins,
- cgmonroe, danquah, blazey, paulmckibben, stijn.blomme, danquah, Alex Bukah,
- guarav.goyal, kducharm: Views integration.
-#2882769 by DamienMcKenna: List Schema Metatag as a related module.
-#2856416 by DamienMcKenna: List Metatag Google Scholar as a related module.
-#2848543 by DamienMcKenna: Add missing people to README.txt.
-
-
-Metatag 8.x-1.0, 2017-01-31
----------------------------
-#2841139 by jmolivas: Relocated commands services registration to
- console.services.yml file.
-#2844429 by DamienMcKenna: There's only one hreflang meta tag so far and it does
- not yet support custom tokens like the D7 version does.
-#2844504 by DamienMcKenna: Add project names to all dependencies.
-#2563631 by DamienMcKenna: Added all AppLinks meta tags.
-#2841737 by DamienMcKenna: Renamed the DrupalConsole commands.
-#2838175 by dawehner: Allow supported entity routes to be changed through the
- new hook_metatag_route_entity().
-#2825867 by Grayside: Improve support for the Typed Data API.
-#2649592 by ziomizar, DamienMcKenna: Write tests to cover apostrophe handling.
-By DamienMcKenna: Shortened some verbose variable syntax.
-#2835752 by DamienMcKenna: Improved hook_help().
-#2789511 by DamienMcKenna: It is a known issue that all Metatag fields must be
- removed prior to uninstalling the module.
-#2809915 by nicxvan, DamienMcKenna: Document how to programmatically assign
- meta tags when creating entities.
-#2563645 by DamienMcKenna, Michelle: Improved documentation.
-
-
-Metatag 8.x-1.0-beta12, 2017-01-03
-----------------------------------
-#2823811 by Michelle: metatag_open_graph_preprocess_html() was misspelled.
-#2654148 by penyaskito, DamienMcKenna: Not all entity.*.add paths are tied to a
- specific entity form, so don't assume they are; this fixes compatibility with
- the Lingotek module, possibly others.
-By DamienMcKenna: Fixed a typo in README.txt.
-#2824442 by jiff: image_src should be a 'link' tag.
-#2821476 by DamienMcKenna, Daniel_Rose: Added tests to confirm entity defaults
- inherit properly.
-#2836124 by DamienMcKenna: Fixed tests for the Dublin Core meta tags.
-#2786625 by DamienMcKenna: Added the hreflang=x-default meta tag.
-#2532588 by DamienMcKenna, renatog, cebasqueira: Added the Google CSE meta tags.
-#2563631 by DamienMcKenna: Added a placeholder to store the AppLinks meta tags.
-#2809351 by DamienMcKenna: Added a placeholder to store the DC Advanced meta
- tags.
-#2835925 by DamienMcKenna: Added a placeholder to store the OG Products meta
- tags.
-#2563633 by DamienMcKenna: Added a placeholder to store the favicon meta tags.
-#2532588 by DamienMcKenna: Follow-up to fix the group assignment of the Google
- CSE meta tags.
-#2786625 by DamienMcKenna: Follow-up to fix the group assignment of the hreflang
- x-default meta tag.
-#2563635 by jlbellido, DamienMcKenna: Ported all of the mobile meta tags to the
- new Metatag Mobile submodule.
-#2840222 by jmolivas: Update for Drupal Console rc13 namespace changes.
-
-
-Metatag 8.x-1.0-beta11, 2016-10-31
-----------------------------------
-#2786795 by agoradesign, heddn: Temporarily disable the DrupalConsole
- integration.
-#2709985 by DamienMcKenna: Moved the two FB meta tags into a new submodule,
- Metatag Facebook, added the fb_pages meta tag.
-#2709985 by DamienMcKenna: Fixed the fb:pages meta tag description.
-By DamienMcKenna: Updated the description of content-language to clarify its
- usage and the fact that Bing may still use it.
-#1865228 by DamienMcKenna: Moved the Author meta tag into the GoolgePlus
- submodule.
-#2797069 by Internet, DamienMcKenna: Corrected the URL to Wikipedia's ICBM page.
-#2801023 by trobey: Provide namespaces in dependencies to avoid ambiguity.
-#2563627 by gaurav.goyal, DamienMcKenna, cilefen: Added all of the basic Dublin
- Core meta tags.
-#2795983 by dbungard: Improved help message on the main configuration page.
-#2786795 by -enzo-: Fixed Drupal Console integration; now requires rc1.
-#2663974 by dawehmer, DamienMcKenna: Added the og:video meta tags.
-#2819549 by chr.fritsch: Fixed entity API changes in metatag_update_8103.
-#2817309 by chr.fritsch, DamienMcKenna: Fixed default value handling for all
- entity forms. Greatly extended the entity field tests for nodes, terms, users
- and the entity_test entity.
-#2654148 by bmcclure, DamienMcKenna, miiimooo, JeroenT, agoradesign: Improved
- support for all entities, exclude certain core entity types, only support
- ContentEntityType entities that have 'links' defined.
-#2816553 by andyrigby: Renamed article:tags to be article:tag.
-#2796701 by jiff, DamienMcKenna: Added tests to cover XSS via meta tag values.
-#2796701 by DamienMcKenna: Added tests to cover XSS on the page title and entity
- values.
-
-
-Metatag 8.x-1.0-beta10, 2016-08-22
-----------------------------------
-#2747793 by rajeshwari10, cilefen, DamienMcKenna: Removed the @file docblocks.
-#2764163 by chrisfree, markdorison: Allow the 'referrer' meta tag to not have a
- value selected.
-#2762981 by felribeiro, DamienMcKenna: Changed codebase to only use short array
- syntax.
-#2753595 by sylus: Moved the extra XML namespaces to the OpenGraph module.
-#2765137 by balsama: Don't display the installation message during site install,
- it looks funny.
-#2759843 by DamienMcKenna: Removed the Alexa verification tag.
-#2759855 by DamienMcKenna: Removed the Yahoo verification tag.
-#2759917 by Nikhilesh Gupta, cilefen: Remove unused imports / 'use' statements.
-#2759927 by Nikhilesh Gupta: Replace deprecated \Drupal::entityManager()
- with \Drupal::entityTypeManager().
-#2759919 by Nikhilesh Gupta: Replace deprecated entity->urlInfo() with
- entity->toUrl().
-#2755225 by jlbellido: Corrected the 'type' tag generator definition in
- tag.php.twig.
-#2759931 by Nikhilesh Gupta: Replace deprecated ConfigEntityListBuilder::
- getLabel() with entity->label().
-#2761231 by ashwin.shaharkar: Minor fix to image tag form selection logic.
-#2745177 by DamienMcKenna, cilefen: Added tests for each submodule to ensure
- they can be enabled and that each meta tag can be used.
-#2750705 by susannecoates, jalpesh: Updated description of the Google Play app
- ID meta tag.
-#2752239 by Saphyel, sylus, DamienMcKenna: Temporary fix for DrupalConsole
- integration.
-#2775245 by DamienMcKenna: Fix tests.
-#2776407 by cilefen: Module names must be wrapped in quotes if they contain
- certain characters.
-By DamienMcKenna: Renamed the custom routes module.
-#2745173 by jibellido: Tag generator now appends metatag_tag.schema.yml.
-#2673902 by DamienMcKenna: Confirm that forum posts can be loaded when the
- module is enabled and outputting meta tags.
-#2707791 by ashwin.shaharkar, DamienMcKenna, Shreya Shetty, MattDanger: Changed
- the Description and Abstract meta tags to use a textarea, matching the D7
- branch.
-#2780025 by DamienMcKenna: Basic tests for the output of every meta tag. Fixes
- the output of all Google Plus tags. Fixed the test route module.
-#2746031 by jalpesh, cilefen, DamienMcKenna, susannecoates: Fixed output of all
- Twitter Cards meta tags.
-#2780109 by DamienMcKenna: Always run drupalGet() before drupalPostForm() to
- ensure the form loads correctly.
-#2748615 by yannickoo, DamienMcKenna, agentrickard, SteffenR, paulmckibben: Try
- generating an empty entity on entity-add (e.g. node/add/*) so default values
- can be filled in.
-#2775441 by tom_ek, DamienMcKenna: Replace deprecated core entity APIs with the
- newer ones.
-#2762981 by DamienMcKenna: More codebase changes to only use short array syntax.
-#2774807 by DamienMcKenna, Berdir, hussainweb: Token browser showed items that
- were irrelevant, and didn't show the correct entities on default config forms.
-#2748615 by yannickoo, DamienMcKenna, SteffenR: The default configurations were
- not loading properly in entity form fields.
-#2752239 by DamienMcKenna: Fixes to Drupal:Console integration.
-#1865228 by DamienMcKenna, greggles: Added the Author meta tag.
-#2493711 by DamienMcKenna: Added the geographical meta tags.
-#1343914 by DamienMcKenna, Dave Reid: Added the (Google+) Publisher meta tag.
-By DamienMcKenna: Corrected the changelog comment for #2759927.
-
-
-Metatag 8.x-1.0-beta9, 2016-06-02
----------------------------------
-#2725895 by DamienMcKenna: Fixed the name of the Validation submodule to avoid
- YAML validation errors. Yes, somewhat ironic.
-#2725989 by dbt102, DamienMcKenna, neerusrijan: Improve hook_help().
-
-
-Metatag 8.x-1.0-beta8, 2016-05-14
----------------------------------
-#2723319 by itmaybejj: Fixed misspelling of 'its'.
-#2619450 by paulmckibben: Remove core's Canonical URL tag if Metatag is adding
- one.
-#2712277 by markdorison: Twitter Card Type meta tag wasn't updating.
-#2650408 by Raphael Apard, DamienMcKenna, gaurav.goyal, dpacassi, kyberman:
- A node's meta tags should not override the front page defaults unless the
- defaults are disabled/deleted.
-#2684479 by mikeyk, DamienMcKenna, aspilicious: Added 'secure' option as some
- meta tags require HTTPS URLs.
-#2699297 by DamienMcKenna: Added tests to ensure submodules can be enabled.
-#2663974 by IT-Cru, DamienMcKenna: Added the og 'article' meta tags.
-#2650848 by ivanjaros, DamienMcKenna: Only show appropriate entities in the
- token browser.
-#2705851 by vasi: Load field definitions, not field values, when getting a list
- of Metatag fields on an entity.
-#2708511 by DamienMcKenna: Added the referrer meta tag.
-#2563629 by Jim.M, DamienMcKenna: Added site verification tags.
-#2721857 by marvin_B8, DamienMcKenna: Added Google+ meta tags.
-
-
-Metatag 8.x-1.0-beta7, 2016-04-03
----------------------------------
-#2699173 by DamienMcKenna: Fixed OgUpdatedTime annotations.
-
-
-Metatag 8.x-1.0-beta6, 2016-04-02
----------------------------------
-#2689543 by kplanz: Fixed paths in image meta tags when the site is in a
- subdirectory.
-By DamienMcKenna: Added a CODE_OF_CONDUCT.txt file that references the Drupal
- code of conduct page.
-#2690973 by DamienMcKenna: Added schema.yml values for all meta tags to make
- them more easily translatable.
-#2688963 by DamienMcKenna: Added a note about the Yoast SEO module.
-#2696445 by DuaelFr, Simon Georges, DamienMcKenna: Added the twitter:image:alt
- meta tag.
-#2692117 by penyaskito, DamienMcKenna: Replaced the 'image' attribute with a
- general 'type' attribute.
-
-
-Metatag 8.x-1.0-beta5, 2016-03-11
----------------------------------
-#2563623/2674732/2675208 by DamienMcKenna, esclapes, NickWilde, achton: Quote
- submodule strings to avoid YAML compatibility problems.
-#2658242 by mr.baileys: Default meta tags were not translated into the entity's
- language.
-By DamienMcKenna: Added mr.baileys to the D8 contributors list :)
-#2664276 by DamienMcKenna, StevenPatz, rajeev_drupal: Wrong default base class
- for generated tag plugins.
-#2665790 by benjy, Sam152: Use StringTranslationTrait in MetaNameBase.
-#2666384 by mr.baileys, Rudrasis, danisha: Added 'configure' link to the module
- on the Extend page.
-#2563625 by mr.baileys, juliencarnot: All Twitter Cards have been ported.
-#2674078 by Raphael Apard: The Generator meta tag is a META tag, not a LINK tag.
-#2664448 by mr.baileys: DrupalConsole generator for meta tag groups.
-#2663650 by mr.baileys: Caught another small bug in the tag generator.
-#2672892 by borisson_: Replaced usage of LoggerChannelFactory with
- LoggerChannelFactoryInterface.
-#2678196 by mr.baileys: Simplified usage of isAdminRoute().
-#2631408 by mikeyk, juampynr, DamienMcKenna: Filter out HTML from meta tags and
- improve image meta tag handling.
-#2631826 by juampynr, DamienMcKenna, pguillard: Require the Token module.
-#2667850 by mikeyk: Token method was not renamed properly.
-By DamienMcKenna: Fixed group name on MetatagTranslationTest.
-#2684495 by mikeyk, DamienMcKenna: Fixed bug in translations that was causing
- the tests to fail. Also tidied up the tests a little.
-#2685355 by mikeyk: Fix image identification.
-
-
-Metatag 8.x-1.0-beta4, 2016-02-06
----------------------------------
-#2634844 by swentel: Only load entity meta tags on actual content entity pages.
-#2648752 by juampynr: Fixed the token browser integration.
-#2642430 by juampynr: Moved settings pages under admin/config.
-#2646706 by heykarthikwithu: Removed unused 'use' statements.
-#2645338 by Dane Powell: Fixed variable assumptions in MetatagFirehose.
-#2643370 by flocondetoile: Fixed hook_block().
-#2631408 by juampynr: Filter HTML from the meta tag output.
-#2653512 by DamienMcKenna, ivanjaros: Missing ampersand in drupal_static call.
-#2630068 by jaxxed, DamienMcKenna: Moved the meta tags fields into the
- 'advanced' section of the entity form.
-#2657142 by TravisCarden: Incorrect path in MetatagDefaults annotations.
-#2656494 by DamienMcKenna, webflo, cyb.tachyon, alexdmccabe: Added translation
- support for the default configs.
-#2634844 by mr.baileys: Ensure that the entity system doesn't break entity
- pages that don't have meta tags enabled.
-#2659854 by mr.baileys: The config inheritance info was displayed when not
- needed and was not translatable.
-#2624422 by mr.baileys: Added tests to confirm meta tag handling is loaded
- correctly when there is no default value available.
-#2658902 by swentel, DamienMcKenna: Renamed 'Add Metatag defaults' to something
- more easily understood.
-#2636348 by DamienMcKenna: Config entity not working correctly after updating
- from beta2.
-By DamienMcKenna: Note in the README.txt that Token is now required.
-#2663874 by mr.baileys: Fixed arguments to annotation translations for two
- Google meta tags.
-#2663650 by DamienMcKenna: Updated/fixed the DrupalConsole integration.
-#2663650 by mr.baileys: Further fixes to the DrupalConsole integration.
-#2563623 by DamienMcKenna: Moved OG tags to new submodule, added several more.
-
-
-Metatag 8.x-1.0-beta3, 2015-12-08
----------------------------------
-#2613654 by Michelle, DamienMcKenna: Automatically parse fields for images.
-#2563639 by juampynr, DamienMcKenna: Global configurations system.
-
-
-Metatag 8.x-1.0-beta2, 2015-11-23
----------------------------------
-#2572469 by Berdir, platinum1, rakesh.gectcr, DamienMcKenna: Fixed the
- composer.json file.
-
-
-Metatag 8.x-1.0-beta1, 2015-11-19
----------------------------------
-Initial port by Damien McKenna and Michelle Cox.
-#2563663 by kikoalonsob: Don't convert the title to a string.
-#2563621 by jmolivas: Fixed DrupalConsole integration.
-#2579865 by afi13: Fixed definition of MetatagEmptyFormatter::viewElements().
-#2563667 by vincic: MetatagManager should only be used for objects implementing
- ContentEntityInterface.
-#2569043 by Michelle: Field defaults weren't loading (core API change).
-#2579295 by Michelle: Fixed the field cardinality limitation.
-#2563667 by Michelle: Follow-up to add missing namespace.
-#2584835 by DamienMcKenna: Fixed double-HTML encoding of the page title.
-#2563637 by larowlan: Added some initial tests for the field type.
-#2596753 by Michelle: Don't encode apostrophes in the page title.
-#2576695 by Andrej Galuf, larowlan, DamienMcKenna: Double slashes in URLs were
- being replaced.
-#2603548 by DuaelFr: Clear our the head_title array to avoid the site name being
- added a second time.
-#2617192 by larowlan: Fixed tests due to a core API change.
-#2609138 by rakesh.gectcr: Removed unnecessary 'use' statements.
-#2593149 by larowlan: Inject dependencies into MetatagManager.
-#2593153 by larowlan: Inject dependencies into MetatagToken.
-#2593141 by larowlan: Add a MetatagManagerInterface to avoid type-hinting
- concrete implementation.
-#2581351 by Michelle, larowlan, DamienMcKenna: Don't save default values to the
- field, allow them to inherit from the default field settings.
-By DamienMcKenna: Updates to the README.txt file.
-#2572469 by rakesh.gectcr, DamienMcKenna, jaxxed, timmillwood: Added a
- composer.json file.
-By DamienMcKenna: Added a LICENSE.txt to enforce the license on git mirrors.
diff --git a/sites/all/modules/contrib/admin/metatag/CODE_OF_CONDUCT.txt b/sites/all/modules/contrib/admin/metatag/CODE_OF_CONDUCT.txt
deleted file mode 100644
index 587ba66b7..000000000
--- a/sites/all/modules/contrib/admin/metatag/CODE_OF_CONDUCT.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Contributor Code of Conduct
----------------------------
-See: https://www.drupal.org/dcoc
diff --git a/sites/all/modules/contrib/admin/metatag/LICENSE.txt b/sites/all/modules/contrib/admin/metatag/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/metatag/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/metatag/README.txt b/sites/all/modules/contrib/admin/metatag/README.txt
deleted file mode 100644
index da936bf71..000000000
--- a/sites/all/modules/contrib/admin/metatag/README.txt
+++ /dev/null
@@ -1,331 +0,0 @@
-Metatag
--------
-This module allows a site's builder to automatically provide structured
-metadata, aka "meta tags", about the site and individual pages.
-
-In the context of search engine optimization, providing an extensive set of
-meta tags may help improve the site's and pages' rankings, thus may aid with
-achieving a more prominent display of the content within search engine results.
-They can also be used to tailor how content is displayed when shared on social
-networks.
-
-For additional information, see the online documentation:
- https://www.drupal.org/docs/8/modules/metatag
-
-This version should work with all Drupal 8 releases, though it is always
-recommended to keep Drupal core installations up to date.
-
-
-Requirements
---------------------------------------------------------------------------------
-Metatag for Drupal 8 requires the following:
-
-* Token
- https://www.drupal.org/project/token
- Provides a popup browser to see the available tokens for use in meta tag
- fields.
-
-
-Features
---------------------------------------------------------------------------------
-The primary features include:
-
-* An administration interface to manage default meta tags.
-
-* Use of standard fields for entity support, allowing for translation and
- revisioning of meta tag values added for individual entities.
-
-* A large volume of meta tags available, covering commonly used tags, Open
- Graph tags, Twitter Cards tags, Dublin Core tags, Google+ tags, App Links
- tags, site verification tags and more; all but the basic meta tags are kept
- in separate submodules.
-
-* The fifteen Dublin Core Basic Element Set 1.1 meta tags may be added by
- enabling the "Metatag: Dublin Core" submodule.
-
-* Forty additional Dublin Core meta tags may be added by enabling the "Metatag:
- Dublin Core Advanced" submodule.
-
-* The Open Graph Protocol meta tags, as used by Facebook, Pinterest, LinkedIn
- and other sites, may be added by enabling the "Metatag: Open Graph" submodule.
-
-* The Twitter Cards meta tags may be added by enabling the "Metatag: Twitter
- Cards" submodule.
-
-* Certain meta tags used by Google+ may be added by enabling the "Metatag:
- Google+" submodule.
-
-* Facebook's fb:app_id, fb:admins and fb:pages meta tags may be added by
- enabling the "Metatag: Facebook" submodule. These are useful for sites which
- are using Facebook widgets or are building custom integration with Facebook's
- APIs, but they are not needed by most sites and have no bearing on the
- Open Graph meta tags.
-
-* The Pinterest meta tags may be added by enabling the "Metatag: Pinterest"
- submodule.
-
-* Site verification meta tags can be added, e.g. as used by the Google search
- engine to confirm ownership of the site; see the "Metatag: Verification"
- submodule.
-
-* The Metatag: Mobile & UI Adjustments submodule adds the MobileOptimized,
- HandheldFriendly, viewport, cleartype, theme-color, format-detection,
- apple-mobile-web-app-capable, apple-mobile-web-app-status-bar-style, the
- android-app and ios-app alternative link meta tags, and the Android manifest
- tag.
-
-* The hreflang meta tags are available via the Metatag:hreflang submodule.
-
-* The App Links meta tags may be added by enabling the Metatag: App Links
- submodule.
-
-* Support for meta tags specific to Google Custom Search Appliance are available
- in the "Metatag: Google Custom Search Engine (CSE)" submodule.
-
-* Meta tags specific to Facebook are included in the "Metatag: Facebook"
- submodule.
-
-* A plugin interface allowing for additional meta tags to be easily added via
- custom modules.
-
-* Integration with DrupalConsole [1] to provide a quick method of generating new
- meta tags.
-
-
-Standard usage scenario
---------------------------------------------------------------------------------
-1. Install the module.
-2. Open admin/config/search/metatag.
-3. Adjust global and entity defaults. Fill in reasonable default values for any
- of the meta tags that need to be customized. Tokens may be used to
- automatically assign values.
-4. Additional bundle defaults may be added by clicking on "Add metatag
- defaults" and filling out the form.
-5. To adjust meta tags for a specific entity, the Metatag field must be added
- first. Follow these steps:
-
- 5.1 Go to the "Manage fields" of the bundle where the Metatag field is to
- appear.
- 5.2 Select "Meta tags" from the "Add a new field" selector.
- 5.3 Fill in a label for the field, e.g. "Meta tags", and set an appropriate
- machine name, e.g. "meta_tags".
- 5.4 Click the "Save and continue" button.
- 5.5 If the site supports multiple languages, and translations have been
- enabled for this entity, select "Users may translate this field" to use
- Drupal's translation system.
-
-
-Simplify the content administration experience
---------------------------------------------------------------------------------
-This module and its submodules gives a site's content team the ability to add
-every meta tag ever. The standard meta tag form added by the Metatag field on
-content entities can be overwhelming to content creators and editors who just
-need to manage a few options.
-
-The easiest way of simplifying this for content teams is to add new fields to
-the content type for the meta data fields that are needed and skip adding the
-Metatag field entirely, then use tokens for those fields in the defaults
-(/admin/config/search/metatag). These fields can be used in the entity's
-display, or just left hidden.
-
-
-Alternative option to simplify the content administration experience
---------------------------------------------------------------------------------
-On the settings page (/admin/config/search/metatag/settings) are options to
-control which meta tag groups are available for each entity bundle. This allows
-e.g. the Favicon meta tags to be available for global configurations but to hide
-them on entity forms.
-
-
-Programmatically assign meta tags to an entity
---------------------------------------------------------------------------------
-There are two ways to assign an entity's meta tags in custom module. Both
-scenarios require a "Metatag" field be added to the entity's field settings, the
-field name "field_meta_tags" is used but this is completely arbitrary.
-
-Option 1:
-
- $entity_type = 'node';
- $values = [
- 'nid' => NULL,
- 'type' => 'article',
- 'title' => 'Testing metatag creation',
- 'uid' => 1,
- 'status' => TRUE,
- 'field_meta_tags' => serialize([
- 'title' => 'Some title',
- 'description' => 'Some description.',
- 'keywords' => 'Some,Keywords',
- ]),
- ];
- $node = \Drupal::entityTypeManager()
- ->getStorage($entity_type)
- ->create($values);
- $node->save();
-
-Option 2:
-
- $node = Node::create([
- 'type' => article,
- 'langcode' => 'en',
- 'status' => 1,
- 'uid' => 1,
- ]);
- $node->set('title', 'Testing metatag creation');
- $node->set('field_meta_tags', serialize([
- 'title' => 'Some title',
- 'description' => 'Some description.',
- 'keywords' => 'Some,Keywords',
- ]));
- $node->save();
-
-In both examples, the custom meta tag values will still be merged with the
-values defined via the global defaults prior to being output - it is not
-necessary to copy each value to the new record.
-
-
-Obtain meta tags for an entity
---------------------------------------------------------------------------------
-For developers needing to access the rendered meta tags for a given entity, a
-function is provided to make this easy to do:
-
- $metatags = metatag_generate_entity_metatags($entity);
-
-This will return an array with the following structure:
-
- [
- 'title' => [
- '#tag' => 'meta',
- '#attributes' => [
- 'name' => 'title',
- 'content' => 'The What | D8.4',
- ],
- ],
- 'canonical_url' => [
- '#tag' => 'link',
- '#attributes' => [
- 'rel' => 'canonical',
- 'href' => 'http://example.com/what',
- ],
- ],
- 'description' => [
- '#tag' => 'meta',
- '#attributes' => [
- 'name' => 'description',
- 'content' => 'I can't even.',
- ],
- ],
- 'generator' => [
- '#tag' => 'meta',
- '#attributes' => [
- 'name' => 'generator',
- 'content' => 'Drupal 8!',
- ],
- ],
- ]
-
-The meta tags are keyed off the meta tag plugin's ID, e.g. "generator". Each
-meta tag is then provided as arguments suitable for use in a render array with
-the type "html_tag". Extracting the value of the meta tag will depend upon the
-type of meta tag, e.g. the generator meta tag uses the "content" attribute while
-the link tag uses the "href" attribute.
-
-
-DrupalConsole integration
---------------------------------------------------------------------------------
-Using the DrupalConsole, it is possible to generate new meta tags, either for
-use in new custom modules that require custom meta tags, or to create patches
-for extending Metatag's options.
-
-To generate a new tag, install DrupalConsole and then use the following command:
-
- drupal generate:plugin:metatag:tag
-
-This will guide the site builder through the necessary steps to create a new
-meta tag plugin and add it to a module.
-
-There is also a command for generating meta tag groups:
-
- drupal generate:plugin:metatag:group
-
-Again, this provides a guided process to create a new group.
-
-
-Related modules
---------------------------------------------------------------------------------
-Some modules are available that extend Metatag with additional or complimentary
-functionality:
-
-* Schema.org Metatag
- https://www.drupal.org/project/schema_metatag
- Extensive solution for adding schema.org / JSON-LD support to Metatag.
-
-* Context Metadata
- https://www.drupal.org/project/context_metadata
- Allow assignment of meta tags based upon different system contexts, e.g. per
- path.
-
-* Real-time SEO for Drupal
- https://www.drupal.org/project/yoast_seo
- Uses the YoastSEO.js library and service (https://yoast.com/) to provide
- realtime feedback on the meta tags.
-
-* Metatag Cxense
- https://www.drupal.org/project/metatag_cxense
- Adds support for the Cxense meta tags used by their DMP and Insight services.
-
-* Metatag Google Scholar
- https://www.drupal.org/project/metatag_google_scholar
- Adds support for a number of meta tags used with the Google Scholar system.
-
-
-Known issues
---------------------------------------------------------------------------------
-* In order to uninstall the module any "Metatag" fields must first be removed
- from all entities. In order to see whether there are fields blocking the
- module from being uninstalled, load the module uninstall page
- (admin/modules/uninstall) and see if any are listed, it will look something
- like the following:
- The Meta tags field type is used in the following field:
- node.field_meta_tags
- In order to uninstall the module, go to the appropriate field settings pages
- and remove the Metatag field listed in the message. Once this is done it will
- be possible to uninstall the module.
-
-
-Credits / contact
---------------------------------------------------------------------------------
-Currently maintained by Damien McKenna [2] and Dave Reid [3]. Drupal 7 module
-originally written by Dave Reid. Early work on Drupal 8 port by Damien McKenna
-and Michelle Cox [4], and sponsored by Mediacurrent [5]; key improvements by
-Juampy Novillo Requena [6] with insights from Dave Reid and sponsorship by
-Lullabot [7] and Acquia [8]. Additional contributions to the 8.x-1.0 release
-from cilefen [9], Daniel Wehner [10], Jesus Manuel Olivas [11], Lee Rowlands
-[12], Michael Kandelaars [13], Ivo Van Geertruyen [14], Nikhilesh Gupta B [15],
-Rakesh James [16], and many others.
-
-Ongoing development is sponsored by Mediacurrent.
-
-The best way to contact the authors is to submit an issue, be it a support
-request, a feature request or a bug report, in the project issue queue:
- https://www.drupal.org/project/issues/metatag
-
-
-References
---------------------------------------------------------------------------------
-1: https://www.drupal.org/project/console
-2: https://www.drupal.org/u/damienmckenna
-3: https://www.drupal.org/u/dave-reid
-4: https://www.drupal.org/u/michelle
-5: https://www.mediacurrent.com/
-6: https://www.drupal.org/u/juampynr
-7: https://www.lullabot.com/
-8: https://www.acquia.com/
-9: https://www.drupal.org/u/cilefen
-10: https://www.drupal.org/u/dawehner
-11: https://www.drupal.org/u/jmolivas
-12: https://www.drupal.org/u/larowlan
-13: https://www.drupal.org/u/mikeyk
-14: https://www.drupal.org/u/mr.baileys
-15: https://www.drupal.org/u/nikhilesh-gupta
-16: https://www.drupal.org/u/rakeshgectcr
diff --git a/sites/all/modules/contrib/admin/metatag/composer.json b/sites/all/modules/contrib/admin/metatag/composer.json
deleted file mode 100644
index 0e7921859..000000000
--- a/sites/all/modules/contrib/admin/metatag/composer.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "drupal/metatag",
- "description": "Manage meta tags for all entities.",
- "type": "drupal-module",
- "license": "GPL-2.0+",
- "keywords": [
- "Drupal",
- "seo"
- ],
- "homepage": "https://www.drupal.org/project/metatag",
- "authors": [
- {
- "name": "See contributors",
- "homepage": "https://www.drupal.org/node/640498/committers",
- "role": "Developer"
- }
- ],
- "support": {
- "issues": "http://drupal.org/project/issues/metatag",
- "source": "http://cgit.drupalcode.org/metatag"
- },
- "require": {
- "drupal/token": "^1.0"
- },
- "require-dev": {
- "drupal/devel": "^1.0",
- "drupal/redirect": "^1.0",
- "drupal/restui": "^1.0",
- "drupal/page_manager": "^4.0",
- "drupal/schema_metatag": "^1.0"
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.403.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.403.yml
deleted file mode 100644
index 3f88243f1..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.403.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: '403'
-label: '403 access denied'
-tags:
- canonical_url: '[site:url]'
- shortlink: '[site:url]'
diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.404.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.404.yml
deleted file mode 100644
index 2e44127e9..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.404.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: '404'
-label: '404 page not found'
-tags:
- canonical_url: '[site:url]'
- shortlink: '[site:url]'
diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.front.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.front.yml
deleted file mode 100644
index 3d928f86f..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.front.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: front
-label: 'Front page'
-tags:
- canonical_url: '[site:url]'
- shortlink: '[site:url]'
diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.global.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.global.yml
deleted file mode 100644
index b0ccb81dd..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.global.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: global
-label: Global
-tags:
- canonical_url: '[current-page:url]'
- title: '[current-page:title] | [site:name]'
diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.node.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.node.yml
deleted file mode 100644
index 5e7841a46..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.node.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: node
-label: Content
-tags:
- title: '[node:title] | [site:name]'
- description: '[node:summary]'
- canonical_url: '[node:url]'
diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.taxonomy_term.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.taxonomy_term.yml
deleted file mode 100644
index a562d1fa1..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.taxonomy_term.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: taxonomy_term
-label: 'Taxonomy term'
-tags:
- canonical_url: '[term:url]'
- description: '[term:description]'
- title: '[term:name] | [site:name]'
diff --git a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.user.yml b/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.user.yml
deleted file mode 100644
index 06dfbe3d1..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/install/metatag.metatag_defaults.user.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-langcode: en
-status: true
-dependencies: { }
-id: user
-label: User
-tags:
- canonical_url: '[user:url]'
- description: '[site:name]'
- title: '[user:display-name] | [site:name]'
diff --git a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_defaults.schema.yml b/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_defaults.schema.yml
deleted file mode 100644
index 4d36bc927..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_defaults.schema.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-metatag.metatag_defaults.*:
- type: config_entity
- label: 'Metatag defaults'
- mapping:
- id:
- type: string
- label: 'ID'
- label:
- type: label
- label: 'Type'
- tags:
- type: sequence
- label: 'Tags'
- sequence:
- type: metatag.metatag_tag.[%key]
diff --git a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_tag.schema.yml
deleted file mode 100644
index 19c84e429..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.metatag_tag.schema.yml
+++ /dev/null
@@ -1,67 +0,0 @@
-# The 'type' should be "label" for short meta tags and "text" for ones which
-# could get longer, especially ones which use a textarea field instead of a
-# textfield.
-
-metatag.metatag_tag.abstract:
- type: text
- label: 'Abstract'
-metatag.metatag_tag.canonical_url:
- type: label
- label: 'Canonical URL'
-metatag.metatag_tag.content_language:
- type: label
- label: 'Content Language'
-metatag.metatag_tag.description:
- type: text
- label: 'Description'
-metatag.metatag_tag.generator:
- type: label
- label: 'Generator'
-metatag.metatag_tag.image_src:
- type: label
- label: 'Image SRC'
-metatag.metatag_tag.keywords:
- type: text
- label: 'Keywords'
-metatag.metatag_tag.news_keywords:
- type: label
- label: 'Google News Keywords'
-metatag.metatag_tag.original_source:
- type: label
- label: 'Original source'
-metatag.metatag_tag.rights:
- type: label
- label: 'Rights'
-metatag.metatag_tag.referrer:
- type: label
- label: 'Referrer policy'
-metatag.metatag_tag.robots:
- type: label
- label: 'Robots'
-metatag.metatag_tag.shortlink:
- type: label
- label: 'Shortlink'
-metatag.metatag_tag.standout:
- type: label
- label: 'Standout'
-metatag.metatag_tag.title:
- type: label
- label: 'Page title'
-metatag.metatag_tag.icbm:
- type: label
- label: 'ICBM'
-metatag.metatag_tag.geo_region:
- type: label
- label: 'Geographical region'
-metatag.metatag_tag.geo_placename:
- type: label
- label: 'Geographical place name'
-metatag.metatag_tag.geo_position:
- type: label
- label: 'Geographical position'
-metatag.metatag_tag.set_cookie:
- type: label
- label: 'Set Cookie'
-metatag.metatag_tag.google:
- type: label
- label: 'Google'
diff --git a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.schema.yml b/sites/all/modules/contrib/admin/metatag/config/schema/metatag.schema.yml
deleted file mode 100644
index 78c0d71be..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.schema.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# Schema for metatag.
-field.value.metatag:
- type: mapping
- label: 'Default value'
- mapping:
- value:
- type: string
- label: 'Metatags'
diff --git a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.settings.schema.yml b/sites/all/modules/contrib/admin/metatag/config/schema/metatag.settings.schema.yml
deleted file mode 100644
index e7dd55550..000000000
--- a/sites/all/modules/contrib/admin/metatag/config/schema/metatag.settings.schema.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-metatag.settings:
- type: mapping
- label: 'Metatag settings'
- mapping:
- entity_type_groups:
- type: mapping
- label: 'Metatag groups that apply to each entity type'
diff --git a/sites/all/modules/contrib/admin/metatag/console.services.yml b/sites/all/modules/contrib/admin/metatag/console.services.yml
deleted file mode 100644
index fd8622d31..000000000
--- a/sites/all/modules/contrib/admin/metatag/console.services.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-services:
- metatag.generate_tag:
- class: Drupal\metatag\Command\GenerateTagCommand
- arguments: ['@metatag.manager', '@metatag.tag_generator', '@?console.extension_manager', '@?console.string_converter', '@?console.chain_queue']
- tags:
- - { name: drupal.command }
-
- metatag.generate_group:
- class: Drupal\metatag\Command\GenerateGroupCommand
- arguments: ['@metatag.group_generator', '@?console.extension_manager', '@?console.chain_queue']
- tags:
- - { name: drupal.command }
-
- metatag.tag_generator:
- class: Drupal\metatag\Generator\MetatagTagGenerator
- arguments: ['@?console.extension_manager', '@?console.renderer']
- tags:
- - { name: drupal.generator }
-
- metatag.group_generator:
- class: Drupal\metatag\Generator\MetatagGroupGenerator
- arguments: ['@?console.extension_manager', '@?console.renderer']
- tags:
- - { name: drupal.generator }
diff --git a/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.group.yml b/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.group.yml
deleted file mode 100644
index a5c5c6a51..000000000
--- a/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.group.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-description: Generate a meta tag group.
-help: The generate:plugin:metatag:group command helps generate a new metatag group for use with the Metatag module.
-welcome: Welcome to the Metatag group generator
-options:
- label: The user-friendly name for this meta tag group.
- description: A long explanation of this meta tag group.
- plugin_id: Internal (machine) name for the meta tag group.
- class_name: Internal camel-case version of the meta tag group's name.
- weight: The sort order for this meta tag group.
-questions:
- base_class: Enter the base class to use
- class_name: Enter the class name for the meta tag group class
- module: common.questions.module
- weight: Enter the sort order for the meta tag group
- label: Enter the label for the meta tag group
- description: Enter a longer explanation of what the meta tag group is and how to use it
- plugin_id: Enter the internal (machine) name for the meta tag group plugin
diff --git a/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.tag.yml b/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.tag.yml
deleted file mode 100644
index 017c9e929..000000000
--- a/sites/all/modules/contrib/admin/metatag/console/translations/en/generate.metatag.tag.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-description: Generate a meta tag.
-help: The generate:plugin:metatag:tag command helps generate a new meta tag for use with the Metatag module.
-welcome: Welcome to the Metatag tag generator
-options:
- base_class: The base meta tag class to use.
- module: common.options.module
- name: Meta tag's HTML "name".
- label: The user-friendly name for this meta tag.
- description: A long explanation of this meta tag.
- plugin_id: Internal (machine) name for the meta tag.
- class_name: Internal camel-case version of the meta tag's name.
- group: The meta tag's group.
- weight: The sort order for this meta tag.
- type: Type of the data included in this meta tag value.
- secure: Whether this meta tag requires URLs be secure.
- multiple: Whether this meta tag allows multiple values.
- absolute_url: Whether this meta tag requires absolute URLs.
-questions:
- base_class: Enter the base class to use
- module: common.questions.module
- name: Enter the meta tag's formal name, e.g. for the Open Graph "Title" tag use "og:title"
- label: Enter a user-friendly version of the meta tag's name
- description: Enter a longer explanation of what the meta tag is and how to use it
- plugin_id: Enter the internal (machine) name for the meta tag plugin
- class_name: Enter a camel-case version of the meta tag's name
- group: Select the group the meta tag will use
- weight: Enter the sort order for the meta tag
- type: Which value type does this meta tag allow?
- secure: Must this meta tag for URLs be secure?
- multiple: Does this meta tag will allow multiple values?
- absolute_url: Does this meta tag require absolute URLs to work?
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.api.php b/sites/all/modules/contrib/admin/metatag/metatag.api.php
deleted file mode 100644
index cd2ad01d8..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.api.php
+++ /dev/null
@@ -1,59 +0,0 @@
-getRouteName() === 'example.test_route') {
- if ($node = $route_match->getParameter('node')) {
- return $node;
- }
- }
-}
-
-/**
- * Alter the meta tags for pages that are not of content entities.
- *
- * @param array $metatags
- * The special meta tags to be added to the page.
- * @param array $context
- * The context for the current meta tags being generated. Will contain the
- * following:
- * 'entity' - The entity being processed; passed by reference.
- */
-function hook_metatags_alter(array &$metatags, array &$context) {
- // Exclude meta tags on frontpage.
- if (\Drupal::service('path.matcher')->isFrontPage()) {
- $metatags = NULL;
- }
-}
-
-/**
- * Alter the meta tags for any page prior to page attachment.
- *
- * @param array $metatag_attachments
- * An array of metatag objects to be attached to the current page.
- */
-function hook_metatags_attachments_alter(array &$metatag_attachments) {
- if (\Drupal::service('path.matcher')->isFrontPage() && \Drupal::currentUser()->isAnonymous()) {
- foreach ($metatag_attachments['#attached']['html_head'] as $id => $attachment) {
- if ($attachment[1] == 'title') {
- $metatag_attachments['#attached']['html_head'][$id][0]['#attributes']['content'] = 'Front Page Title for Anonymous Users';
- }
- }
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.info.yml b/sites/all/modules/contrib/admin/metatag/metatag.info.yml
deleted file mode 100644
index e92edaa59..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.info.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-name: Metatag
-type: module
-description: Manage meta tags for all entities.
-# core: 8.x
-package: SEO
-configure: entity.metatag_defaults.collection
-dependencies:
- - drupal:field
- - token:token
-test_dependencies:
- - devel:devel
- - redirect:redirect
- - restui:restui
- - schema_metatag:schema_web_page
-
-# Information added by Drupal.org packaging script on 2019-02-20
-version: '8.x-1.8'
-core: '8.x'
-project: 'metatag'
-datestamp: 1550683387
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.install b/sites/all/modules/contrib/admin/metatag/metatag.install
deleted file mode 100644
index 2f96a4941..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.install
+++ /dev/null
@@ -1,376 +0,0 @@
-moduleExists('schema_metatag')) {
- $requirements['metatag_schema'] = [
- 'severity' => REQUIREMENT_INFO,
- 'title' => 'Metatag',
- 'value' => t('Schema.org Metatag is recommended'),
- 'description' => t('The Schema.org Metatag module is highly recommended to add JSON-LD -formatted schema.org compatible data structures to the site.', [
- '@module' => 'https://www.drupal.org/project/schema_metatag',
- '@jsonld' => 'https://json-ld.org',
- '@schema' => 'http://schema.org',
- ]),
- ];
- }
- else {
- $requirements['metatag_schema'] = [
- 'severity' => REQUIREMENT_OK,
- 'title' => 'Metatag',
- 'value' => t('Schema.org Metatag is installed'),
- 'description' => t('The Schema.org Metatag module is installed.', [
- '@module' => 'https://www.drupal.org/project/schema_metatag',
- ]),
- ];
- }
- }
-
- return $requirements;
-}
-
-/**
- * Remove tags in field storage that match default or are empty.
- */
-function metatag_update_8101() {
- // Get all of the field storage entities of type metatag.
- $field_storage_configs = \Drupal::entityTypeManager()
- ->getStorage('field_storage_config')
- ->loadByProperties(['type' => 'metatag']);
-
- foreach ($field_storage_configs as $field_storage) {
- $field_name = $field_storage->getName();
-
- // Get the individual fields (field instances) associated with bundles.
- $fields = \Drupal::entityTypeManager()
- ->getStorage('field_config')
- ->loadByProperties(['field_name' => $field_name]);
-
- // For each of the fields, delete all records that match the defaults.
- foreach ($fields as $field) {
- // Get the bundle this field is attached to.
- $bundle = $field->getTargetBundle();
-
- // Get the default value for this field on this bundle.
- $field_default_tags_value = $field->getDefaultValueLiteral();
- $field_default_tags_value = $field_default_tags_value[0]['value'];
-
- // Determine the table and "value" field names.
- $field_table = "node__" . $field_name;
- $field_value_field = $field_name . "_value";
-
- // Delete all records where the field value and default are identical.
- \Drupal::database()->delete($field_table)
- ->condition('bundle', $bundle, '=')
- ->condition($field_value_field, $field_default_tags_value, '=')
- ->execute();
- }
- }
-
- return t('Removed all default meta tag records so they can be automatically inherited when the page is loaded.');
-}
-
-/**
- * Remove tags in field storage that match default or are empty.
- */
-function metatag_update_8102(&$sandbox) {
- // This whole top section only needs to be done the first time.
- if (!isset($sandbox['records_processed'])) {
- $sandbox['records_processed'] = 0;
- $sandbox['total_records'] = 0;
- $sandbox['current_field'] = 0;
- $sandbox['current_record'] = 0;
-
- // Counter to enumerate the fields so we can access them in the array
- // by number rather than name.
- $field_counter = 0;
-
- // Get all of the field storage entities of type metatag.
- $field_storage_configs = \Drupal::entityTypeManager()
- ->getStorage('field_storage_config')
- ->loadByProperties(['type' => 'metatag']);
-
- foreach ($field_storage_configs as $field_storage) {
- $field_name = $field_storage->getName();
-
- // Get the individual fields (field instances) associated with bundles.
- $fields = \Drupal::entityTypeManager()
- ->getStorage('field_config')
- ->loadByProperties(['field_name' => $field_name]);
-
- // For each of the fields, do the mass delete of exact matches but
- // store the overridden records in the sandbox to be batch processed.
- foreach ($fields as $field) {
- // Get the bundle this field is attached to.
- $bundle = $field->getTargetBundle();
-
- // Get the default value for this field on this bundle.
- $field_default_tags_value = $field->getDefaultValueLiteral();
- $field_default_tags_value = $field_default_tags_value[0]['value'];
- $field_default_tags = unserialize($field_default_tags_value);
-
- // Determine the table and "value" field names.
- $field_table = "node__" . $field_name;
- $field_value_field = $field_name . "_value";
-
- // Get all records where the field data does not match the default.
- $query = \Drupal::database()->select($field_table);
- $query->addField($field_table, 'entity_id');
- $query->addField($field_table, 'revision_id');
- $query->addField($field_table, 'langcode');
- $query->addField($field_table, $field_value_field);
- $query->condition('bundle', $bundle, '=');
- $result = $query->execute();
- $records = $result->fetchAll();
-
- // Fill in all the sandbox information so we can batch the individual
- // record comparing and updating.
- $sandbox['fields'][$field_counter]['field_table'] = $field_table;
- $sandbox['fields'][$field_counter]['field_value_field'] = $field_value_field;
- $sandbox['fields'][$field_counter]['field_default_tags'] = $field_default_tags;
- $sandbox['fields'][$field_counter]['records'] = $records;
-
- $sandbox['total_records'] += count($sandbox['fields'][$field_counter]['records'] = $records);
- $field_counter++;
- }
- }
- }
-
- if ($sandbox['total_records'] == 0) {
- // No partially overridden fields so we can skip the whole batch process.
- $sandbox['#finished'] = 1;
- }
- else {
- // Begin the batch processing of individual field records.
- $max_per_batch = 10;
- $counter = 1;
-
- $current_field = $sandbox['current_field'];
- $current_field_records = $sandbox['fields'][$current_field]['records'];
- $current_record = $sandbox['current_record'];
-
- $field_table = $sandbox['fields'][$current_field]['field_table'];
- $field_value_field = $sandbox['fields'][$current_field]['field_value_field'];
- $field_default_tags = $sandbox['fields'][$current_field]['field_default_tags'];
-
- // Loop through the field(s) and remove any field data that matches the
- // field default for that bundle. Because the ability to override a default
- // with "nothing" didn't exist prior to this and because any tag that had
- // a default of "nothing" would have that also in the field data, we are
- // removing those as well.
- while ($counter <= $max_per_batch && $record = $current_field_records[$current_record]) {
- // Strip any empty tags or ones matching the field's defaults and leave
- // only the overridden tags in $new_tags.
- $current_tags = unserialize($record->$field_value_field);
- $new_tags = [];
- foreach ($current_tags as $key => $tag) {
- if (!empty($tag) && $field_default_tags[$key] != $tag) {
- $new_tags[$key] = $tag;
- }
- }
-
- if (empty($new_tags)) {
- // All tags were either empty or matched the default so the record can
- // be deleted.
- \Drupal::database()->delete($field_table)
- ->condition('entity_id', $record->entity_id)
- ->condition('revision_id', $record->revision_id)
- ->condition('langcode', $record->langcode)
- ->execute();
- }
- else {
- // There are some overridden tags so update the record with just those.
- $tags_string = serialize($new_tags);
- \Drupal::database()->update($field_table)
- ->fields([
- $field_value_field => $tags_string,
- ])
- ->condition('entity_id', $record->entity_id)
- ->condition('revision_id', $record->revision_id)
- ->condition('langcode', $record->langcode)
- ->execute();
- }
-
- $counter++;
- $current_record++;
- }
-
- // We ran out of records for the field so start the next batch out with the
- // next field.
- if (!isset($current_field_records[$current_record])) {
- $current_field++;
- $current_record = 0;
- }
-
- // We have finished all the fields. All done.
- if (!isset($sandbox['fields'][$current_field])) {
- $sandbox['records_processed'] += $counter - 1;
- $sandbox['#finished'] = 1;
- }
- // Update the sandbox values to prepare for the next round.
- else {
- $sandbox['current_field'] = $current_field;
- $sandbox['current_record'] = $current_record;
- $sandbox['records_processed'] += $counter - 1;
- $sandbox['#finished'] = $sandbox['records_processed'] / $sandbox['total_records'];
- }
- }
-
- if ($sandbox['total_records'] > 0) {
- return (string) t('Processed @processed of @total overridden Metatag records.', [
- '@processed' => $sandbox['records_processed'],
- '@total' => $sandbox['total_records'],
- ]);
- }
- else {
- return (string) t("There were no overridden Metatag records.");
- }
-}
-
-/**
- * Move field defaults to Metatag Defaults.
- */
-function metatag_update_8103() {
- $config_installer = \Drupal::service('config.installer');
- $entity_manager = \Drupal::entityTypeManager();
-
- // 1. Install cofiguration.
- $sync_status = $config_installer->isSyncing();
- if ($sync_status) {
- $source_storage = $config_installer->getSourceStorage();
- }
-
- // Clear plugin manager caches.
- \Drupal::getContainer()->get('plugin.cache_clearer')->clearCachedDefinitions();
- // Install default configuration of the module.
- if ($sync_status) {
- $config_installer
- ->setSyncing(TRUE)
- ->setSourceStorage($source_storage);
- }
-
- // Install new configuration for Metatag.
- $config_installer->installDefaultConfig('module', 'metatag');
-
- // Apply all entity definition changes.
- \Drupal::entityDefinitionUpdateManager()->applyUpdates();
-
- // 2. Extract Metatag field defaults.
- $entity_info = $entity_manager->getDefinitions();
- $tags = [];
-
- // Get all of the field storage entities of type metatag.
- $field_storage_configs = $entity_manager
- ->getStorage('field_storage_config')
- ->loadByProperties(['type' => 'metatag']);
-
- foreach ($field_storage_configs as $field_storage) {
- $field_name = $field_storage->getName();
-
- // Get the individual fields (field instances) associated with bundles.
- $fields = $entity_manager->getStorage('field_config')
- ->loadByProperties(['field_name' => $field_name]);
- foreach ($fields as $field) {
- // Adjust the config id depending on whether these are entity defaults
- // or bundle defaults.
- $entity_type = $field->getTargetEntityTypeId();
- $bundle = $field->getTargetBundle();
- $metatag_defaults_id = $entity_type;
- if ($entity_type != $bundle) {
- // This is a bundle override.
- $metatag_defaults_id = $entity_type . '__' . $bundle;
- }
- // Extract field default values.
- $field_default_tags_value = $field->getDefaultValueLiteral();
- $field_default_tags_value = unserialize($field_default_tags_value[0]['value']);
- $field_default_tags_value = array_filter($field_default_tags_value);
- // Don't bother copying empty values.
- if (!empty($field_default_tags_value)) {
- $tags[$metatag_defaults_id] = $field_default_tags_value;
- }
- }
- }
-
- // 3. Create Config entities with field default values.
- if (!empty($tags)) {
- $bundleInfoManager = \Drupal::service('entity_type.bundle.info');
- foreach ($tags as $metatag_defaults_id => $values) {
- list($entity_type, $entity_bundle) = explode('__', $metatag_defaults_id);
- $entity_label = (string) $entity_info[$entity_type]->get('label');
- $bundle_info = $bundleInfoManager->getBundleInfo($entity_type);
- $bundle_label = $bundle_info[$entity_bundle]['label'];
- $label = $entity_label . ': ' . $bundle_label;
-
- $metatags_global_manager = $entity_manager->getStorage('metatag_defaults');
-
- $entity = $metatags_global_manager->load($metatag_defaults_id);
- if ($entity) {
- // These are defaults for an existing config entity, such as User.
- $entity->set('tags', $values);
- }
- else {
- // These are bundle overrides.
- $entity = $metatags_global_manager->create([
- 'id' => $metatag_defaults_id,
- 'label' => $label,
- 'tags' => $values,
- ]);
- }
- $entity->save();
- }
- return (string) t("@count Metatag field defaults have been converted to using global entity defaults.", ['@count' => count($tags)]);
- }
- else {
- return (string) t("There were Metatag field configurations that needed to be converted.");
- }
-}
-
-/**
- * Rebuild routes after moving Metatag admin from Structure to Config.
- */
-function metatag_update_8104() {
- \Drupal::service('router.builder')->setRebuildNeeded();
-}
-
-/**
- * Rebuild routes after renaming.
- */
-function metatag_update_8105() {
- \Drupal::service('router.builder')->setRebuildNeeded();
-}
-
-/**
- * Add the metatag_defaults config entity to the site.
- */
-function metatag_update_8106() {
- \Drupal::entityDefinitionUpdateManager()->applyUpdates();
-}
-
-/**
- * Enable the new metatag_open_graph module.
- */
-function metatag_update_8107() {
- \Drupal::service('module_installer')->install(['metatag_open_graph']);
- return (string) t("The new Metatag: Open Graph module has been enabled.");
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.links.action.yml b/sites/all/modules/contrib/admin/metatag/metatag.links.action.yml
deleted file mode 100644
index 6ed508f60..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-entity.metatag_defaults.add_form:
- route_name: 'entity.metatag_defaults.add_form'
- title: 'Add default meta tags'
- appears_on:
- - entity.metatag_defaults.collection
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.links.menu.yml b/sites/all/modules/contrib/admin/metatag/metatag.links.menu.yml
deleted file mode 100644
index f1fef7187..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.links.menu.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-# Metatag defaults menu items definition
-entity.metatag_defaults.collection:
- title: 'Metatag'
- route_name: entity.metatag_defaults.collection
- description: 'Configure Metatag defaults.'
- parent: system.admin_config_search
-metatag.settings:
- title: 'Settings'
- route_name: metatag.settings
- description: 'Configure Metatag defaults.'
- parent: entity.metatag_defaults.collection
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.links.task.yml b/sites/all/modules/contrib/admin/metatag/metatag.links.task.yml
deleted file mode 100644
index 637e9beb5..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.links.task.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-metatag_defaults:
- route_name: 'entity.metatag_defaults.collection'
- base_route: 'entity.metatag_defaults.collection'
- title: 'Metatag defaults'
- weight: 0
-metatag.settings:
- route_name: 'metatag.settings'
- base_route: 'entity.metatag_defaults.collection'
- title: 'Settings'
- weight: 10
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.module b/sites/all/modules/contrib/admin/metatag/metatag.module
deleted file mode 100644
index b9fad84a6..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.module
+++ /dev/null
@@ -1,605 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('This module allows a site to automatically provide structured metadata, aka "meta tags", about the site and individual pages.');
- $output .= '
' . t('In the context of search engine optimization, providing an extensive set of meta tags may help improve the site\'s and pages\' rankings, thus may aid with achieving a more prominent display of the content within search engine results. They can also be used to tailor how content is displayed when shared on social networks. For additional information, see the online documentation for Metatag.', [':online' => 'https://www.drupal.org/node/1774342']) . '
';
- $output .= '
' . t('Intended worflow') . '
';
- $output .= '
' . t('The module uses "tokens" to automatically fill in values for different meta tags. Specific values may also be filled in.', [':tokens' => Url::fromRoute('help.page', ['name' => 'token'])->toString()]) . '
';
- $output .= '
' . t('The best way of using Metatag is as follows:') . '
';
- $output .= '';
- $output .= '
' . t('Customize the global defaults, fill in the specific values and tokens that every page should have.', [':defaults' => Url::fromRoute('entity.metatag_defaults.edit_form', ['metatag_defaults' => 'global'])->toString()]) . '
';
- $output .= '
' . t('Override each of the other defaults, fill in specific values and tokens that each item should have by default. This allows e.g. for all nodes to have different values than taxonomy terms.', [':defaults' => Url::fromRoute('entity.metatag_defaults.collection')->toString()]) . '
';
- $output .= '
' . t('Add more default configurations as necessary for different entity types and entity bundles, e.g. for different content types or different vocabularies.', [':add' => Url::fromRoute('entity.metatag_defaults.add_form')->toString()]) . '
';
- $output .= '
' . t('To override the meta tags for individual entities, e.g. for individual nodes, add the "Metatag" field via the field settings for that entity or bundle type.') . '
';
- $output .= '';
- return $output;
-
- // The main configuration page.
- case 'entity.metatag_defaults.collection':
- $output = '
' . t('Configure global meta tag default values below. Meta tags may be left as the default.') . '
';
- $output .= '
' . t('Meta tag patterns are passed down from one level to the next unless they are overridden. To view a summary of the individual meta tags and the pattern for a specific configuration, click on its name below.') . '
';
- $output .= '
' . t('If the top-level configuration is not specific enough, additional default meta tag configurations can be added for a specific entity type or entity bundle, e.g. for a specific content type.') . '
';
- $output .= '
' . t('Meta tags can be further refined on a per-entity basis, e.g. for individual nodes, by adding the "Metatag" field to that entity type through its normal field settings pages.') . '
';
- return $output;
-
- // The 'add default meta tags' configuration page.
- case 'entity.metatag_defaults.add_form':
- $output = '
' . t('Use the following form to override the global default meta tags for a specific entity type or entity bundle. In practical terms, this allows the meta tags to be customized for a specific content type or taxonomy vocabulary, so that its content will have different meta tags default values than others.') . '
';
- $output .= '
' . t('As a reminder, if the "Metatag" field is added to the entity type through its normal field settings, the meta tags can be further refined on a per entity basis; this allows each node to have its meta tags customized on an individual basis.') . '
';
- return $output;
- }
-}
-
-/**
- * Implements hook_form_FORM_ID_alter() for 'field_storage_config_edit_form'.
- */
-function metatag_form_field_storage_config_edit_form_alter(&$form, FormStateInterface $form_state) {
- if ($form_state->getFormObject()->getEntity()->getType() == 'metatag') {
- // Hide the cardinality field.
- $form['cardinality_container']['#access'] = FALSE;
- $form['cardinality_container']['#disabled'] = TRUE;
- }
-}
-
-/**
- * Implements hook_form_FORM_ID_alter() for 'field_config_edit_form'.
- *
- * Configuration defaults are handled via a different mechanism, so do not allow
- * any values to be saved.
- */
-function metatag_form_field_config_edit_form_alter(&$form, FormStateInterface $form_state) {
- if ($form_state->getFormObject()->getEntity()->getType() == 'metatag') {
- // Hide the required and default value fields.
- $form['required']['#access'] = FALSE;
- $form['required']['#disabled'] = TRUE;
- $form['default_value']['#access'] = FALSE;
- $form['default_value']['#disabled'] = TRUE;
-
- // Step through the default value structure and erase any '#default_value'
- // items that are found.
- foreach ($form['default_value']['widget'][0] as &$outer) {
- if (is_array($outer)) {
- foreach ($outer as &$inner) {
- if (is_array($inner) && isset($inner['#default_value'])) {
- if (is_array($inner['#default_value'])) {
- $inner['#default_value'] = [];
- }
- else {
- $inner['#default_value'] = NULL;
- }
- }
- }
- }
- }
- }
-}
-
-/**
- * Implements hook_page_attachments().
- *
- * Load all meta tags for this page.
- */
-function metatag_page_attachments(array &$attachments) {
- if (!metatag_is_current_route_supported()) {
- return NULL;
- }
-
- $metatag_attachments = &drupal_static('metatag_attachments');
-
- if (is_null($metatag_attachments)) {
- // Load the meta tags from the route.
- $metatag_attachments = metatag_get_tags_from_route();
- }
- if (!$metatag_attachments) {
- return NULL;
- }
-
- // Trigger hook_metatags_attachments_alter().
- // Allow modules to rendered metatags prior to attaching.
- \Drupal::service('module_handler')->alter('metatags_attachments', $metatag_attachments);
-
- // If any Metatag items were found, append them.
- if (!empty($metatag_attachments['#attached']['html_head'])) {
- if (empty($attachments['#attached'])) {
- $attachments['#attached'] = [];
- }
- if (empty($attachments['#attached']['html_head'])) {
- $attachments['#attached']['html_head'] = [];
- }
-
- $head_links = [];
- foreach ($metatag_attachments['#attached']['html_head'] as $item) {
- $attachments['#attached']['html_head'][] = $item;
-
- // Also add a HTTP header "Link:" for canonical URLs and shortlinks.
- // See HtmlResponseAttachmentsProcessor::processHtmlHeadLink() for the
- // implementation of the functionality in core.
- if (in_array($item[1], ['canonical_url', 'shortlink'])) {
- $attributes = $item[0]['#attributes'];
-
- $href = '<' . Html::escape($attributes['href']) . '>';
- unset($attributes['href']);
- if ($param = drupal_http_header_attributes($attributes)) {
- $href .= ';' . $param;
- }
- $head_links[] = $href;
- }
- }
-
- // If any HTTP Header items were found, add them too.
- if (!empty($head_links)) {
- $attachments['#attached']['http_header'][] = [
- 'Link',
- implode(', ', $head_links),
- FALSE,
- ];
- }
- }
-}
-
-/**
- * Implements hook_module_implements_alter().
- */
-function metatag_module_implements_alter(&$implementations, $hook) {
- if ($hook == 'page_attachments_alter') {
- // Move metatag_page_attachments_alter() to the end of the list. This is so
- // the canonical and shortlink tags can be removed that are added by
- // taxonomy_page_attachments_alter().
- // @todo Remove once https://www.drupal.org/node/2282029 is fixed.
- $group = $implementations['metatag'];
- unset($implementations['metatag']);
- $implementations['metatag'] = $group;
- }
-}
-
-/**
- * Implements hook_page_attachments_alter().
- */
-function metatag_page_attachments_alter(array &$attachments) {
- $route_match = \Drupal::routeMatch();
- // Can be removed once https://www.drupal.org/node/2282029 is fixed.
- if ($route_match->getRouteName() == 'entity.taxonomy_term.canonical' && ($term = $route_match->getParameter('taxonomy_term')) && $term instanceof TermInterface) {
- _metatag_remove_duplicate_entity_tags($attachments);
- }
-}
-
-/**
- * Implements hook_entity_view_alter().
- */
-function metatag_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
- // If this is a 403 or 404 page then don't output these meta tags.
- // @todo Make the default meta tags load properly so this is unnecessary.
- if ($display->getOriginalId() == 'node.403.default' || $display->getOriginalId() == 'node.404.default') {
- $build['#attached']['html_head_link'] = [];
- return;
- }
-
- // Panelized entities still use the original entity's controller, but with
- // custom built entities. In those cases hook_entity_view_alter might be
- // called too early, where meta links are not yet set.
- // @see \Drupal\node\Controller\NodeController::view
- if ($display->getThirdPartySetting('panelizer', 'enable', FALSE)) {
- $build['#pre_render'][] = '_metatag_panelizer_pre_render';
- return;
- }
-
- _metatag_remove_duplicate_entity_tags($build);
-}
-
-/**
- * Pre render callback for entities processed by Panelizer.
- *
- * @param array $element
- * The render array being processed.
- *
- * @return array
- * The filtered render array.
- */
-function _metatag_panelizer_pre_render(array $element) {
- _metatag_remove_duplicate_entity_tags($element);
- return $element;
-}
-
-/**
- * Remove duplicate entity tags from a build.
- *
- * @param array $build
- * The build.
- */
-function _metatag_remove_duplicate_entity_tags(array &$build) {
- // Some entities are built with a link rel="canonical" and/or link
- // rel="shortlink" tag attached.
- // If metatag provides them, remove the ones built with the entity.
- if (isset($build['#attached']['html_head_link'])) {
- $metatag_attachments = &drupal_static('metatag_attachments');
- if (is_null($metatag_attachments)) {
- // Load the meta tags from the route.
- $metatag_attachments = metatag_get_tags_from_route();
- }
-
- // Check to see if the page currently outputs a canonical and/or shortlink
- // tag.
- if (isset($metatag_attachments['#attached']['html_head'])) {
- foreach ($metatag_attachments['#attached']['html_head'] as $metatag_item) {
- if (in_array($metatag_item[1], ['canonical_url', 'shortlink'])) {
- // Metatag provides rel="canonical" and/or rel="shortlink" tags.
- foreach ($build['#attached']['html_head_link'] as $key => $item) {
- if (isset($item[0]['rel']) && in_array($item[0]['rel'], ['canonical', 'shortlink'])) {
- // Remove the link rel="canonical" or link rel="shortlink" tag
- // from the entity's build array.
- unset($build['#attached']['html_head_link'][$key]);
- }
- }
- }
- }
- }
- }
-}
-
-/**
- * Identify whether the current route is supported by the module.
- *
- * @return bool
- * TRUE if the current route is supported.
- */
-function metatag_is_current_route_supported() {
- // If upgrading, we need to wait for database updates to complete.
- $is_ready = \Drupal::service('entity_type.manager')
- ->getDefinition('metatag_defaults', FALSE);
- if (!$is_ready) {
- return FALSE;
- }
-
- // Ignore admin paths.
- if (\Drupal::service('router.admin_context')->isAdminRoute()) {
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Returns the entity of the current route.
- *
- * @return Drupal\Core\Entity\EntityInterface
- * The entity or NULL if this is not an entity route.
- */
-function metatag_get_route_entity() {
- $route_match = \Drupal::routeMatch();
- $route_name = $route_match->getRouteName();
-
- // Look for a canonical entity view page, e.g. node/{nid}, user/{uid}, etc.
- $matches = [];
- preg_match('/entity\.(.*)\.(latest[_-]version|canonical)/', $route_name, $matches);
- if (!empty($matches[1])) {
- $entity_type = $matches[1];
- return $route_match->getParameter($entity_type);
- }
-
- // Look for a rest entity view page, e.g. "node/{nid}?_format=json", etc.
- $matches = [];
- // Matches e.g. "rest.entity.node.GET.json".
- preg_match('/rest\.entity\.(.*)\.(.*)\.(.*)/', $route_name, $matches);
- if (!empty($matches[1])) {
- $entity_type = $matches[1];
- return $route_match->getParameter($entity_type);
- }
-
- // Look for entity object 'add' pages, e.g. "node/add/{bundle}".
- $route_name_matches = [];
- preg_match('/(entity\.)?(.*)\.add(_form)?/', $route_name, $route_name_matches);
- if (!empty($route_name_matches[2])) {
- $entity_type = $route_name_matches[2];
- $definition = Drupal::entityTypeManager()->getDefinition($entity_type, FALSE);
- if (!empty($definition)) {
- $type = $route_match->getRawParameter($definition->get('bundle_entity_type'));
- if (!empty($type)) {
- return \Drupal::entityTypeManager()
- ->getStorage($entity_type)
- ->create([
- $definition->get('entity_keys')['bundle'] => $type,
- ]);
- }
- }
- }
-
- // Look for entity object 'edit' pages, e.g. "node/{entity_id}/edit".
- $route_name_matches = [];
- preg_match('/entity\.(.*)\.edit_form/', $route_name, $route_name_matches);
- if (!empty($route_name_matches[1])) {
- $entity_type = $route_name_matches[1];
- $entity_id = $route_match->getRawParameter($entity_type);
-
- if (!empty($entity_id)) {
- return \Drupal::entityTypeManager()
- ->getStorage($entity_type)
- ->load($entity_id);
- }
- }
-
- // Look for entity object 'add content translation' pages, e.g.
- // "node/{nid}/translations/add/{source_lang}/{translation_lang}".
- $route_name_matches = [];
- preg_match('/(entity\.)?(.*)\.content_translation_add/', $route_name, $route_name_matches);
- if (!empty($route_name_matches[2])) {
- $entity_type = $route_name_matches[2];
- $definition = Drupal::entityTypeManager()->getDefinition($entity_type, FALSE);
- if (!empty($definition)) {
- $node = $route_match->getParameter($entity_type);
- $type = $node->bundle();
- if (!empty($type)) {
- return \Drupal::entityTypeManager()
- ->getStorage($entity_type)
- ->create([
- $definition->get('entity_keys')['bundle'] => $type,
- ]);
- }
- }
- }
-
- // Special handling for the admin user_create page. In this case, there's only
- // one bundle and it's named the same as the entity type, so some shortcuts
- // can be used.
- if ($route_name == 'user.admin_create') {
- $entity_type = $type = 'user';
- $definition = Drupal::entityTypeManager()->getDefinition($entity_type);
- if (!empty($type)) {
- return \Drupal::entityTypeManager()
- ->getStorage($entity_type)
- ->create([
- $definition->get('entity_keys')['bundle'] => $type,
- ]);
- }
- }
-
- // Trigger hook_metatag_route_entity().
- if ($entities = \Drupal::moduleHandler()->invokeAll('metatag_route_entity', [$route_match])) {
- return reset($entities);
- }
-
- return NULL;
-}
-
-/**
- * Implements template_preprocess_html().
- */
-function metatag_preprocess_html(&$variables) {
- if (!metatag_is_current_route_supported()) {
- return NULL;
- }
-
- $attachments = &drupal_static('metatag_attachments');
- if (is_null($attachments)) {
- $attachments = metatag_get_tags_from_route();
- }
-
- if (!$attachments) {
- return NULL;
- }
-
- // Load the page title.
- if (!empty($attachments['#attached']['html_head'])) {
- foreach ($attachments['#attached']['html_head'] as $key => $attachment) {
- if (!empty($attachment[1]) && $attachment[1] == 'title') {
- // Empty head_title to avoid the site name and slogan to be appended to
- // the meta title.
- $variables['head_title'] = [];
- $variables['head_title']['title'] = html_entity_decode($attachment[0]['#attributes']['content'], ENT_QUOTES);
- break;
- }
- }
- }
-}
-
-/**
- * Load the meta tags by processing the route parameters.
- *
- * @return mixed
- * Array of meta tags or NULL.
- */
-function metatag_get_tags_from_route($entity = NULL) {
- $metatag_manager = \Drupal::service('metatag.manager');
-
- // First, get defaults.
- $metatags = metatag_get_default_tags($entity);
- if (!$metatags) {
- return NULL;
- }
-
- // Then, set tag overrides for this particular entity.
- if (!$entity) {
- $entity = metatag_get_route_entity();
- }
-
- if (!empty($entity) && $entity instanceof ContentEntityInterface) {
- // If content entity does not have an ID the page is likely an "Add" page,
- // so do not generate meta tags for entity which has not been created yet.
- if (!$entity->id()) {
- return NULL;
- }
-
- foreach ($metatag_manager->tagsFromEntity($entity) as $tag => $data) {
- $metatags[$tag] = $data;
- }
- }
-
- // Trigger hook_metatags_alter().
- // Allow modules to override tags or the entity used for token replacements.
- $context = [
- 'entity' => &$entity,
- ];
- \Drupal::service('module_handler')->alter('metatags', $metatags, $context);
-
- // If the entity was changed above, use that for generating the meta tags.
- if (isset($context['entity'])) {
- $entity = $context['entity'];
- }
-
- return $metatag_manager->generateElements($metatags, $entity);
-}
-
-/**
- * Returns default tags for the current route.
- *
- * @return mixed
- * Array of tags or NULL;
- */
-function metatag_get_default_tags($entity = NULL) {
- /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $global_metatag_manager */
- $global_metatag_manager = \Drupal::entityTypeManager()->getStorage('metatag_defaults');
- // First we load global defaults.
- $metatags = $global_metatag_manager->load('global');
- if (!$metatags) {
- return NULL;
- }
-
- // Check if this is a special page.
- $special_metatags = \Drupal::service('metatag.manager')->getSpecialMetatags();
- if (isset($special_metatags)) {
- $metatags->overwriteTags($special_metatags->get('tags'));
- }
-
- // Next check if there is this page is an entity that has meta tags.
- else {
- if (!$entity) {
- $entity = metatag_get_route_entity();
- }
-
- if (!empty($entity) && $entity instanceof ContentEntityInterface) {
- $entity_metatags = $global_metatag_manager->load($entity->getEntityTypeId());
- if ($entity_metatags != NULL) {
- // Merge with global defaults.
- $metatags->overwriteTags($entity_metatags->get('tags'));
- }
-
- // Finally, check if bundle overrides should be added.
- $bundle_metatags = $global_metatag_manager->load($entity->getEntityTypeId() . '__' . $entity->bundle());
- if ($bundle_metatags != NULL) {
- // Merge with existing defaults.
- $metatags->overwriteTags($bundle_metatags->get('tags'));
- }
- }
- }
-
- return $metatags->get('tags');
-}
-
-/**
- * Implements hook_entity_base_field_info().
- */
-function metatag_entity_base_field_info(EntityTypeInterface $entity_type) {
- $fields = [];
- $base_table = $entity_type->getBaseTable();
- $canonical_template_exists = $entity_type->hasLinkTemplate('canonical');
- // Certain classes are just not supported.
- $original_class = $entity_type->getOriginalClass();
- $classes_to_skip = [
- 'Drupal\comment\Entity\Comment',
- ];
-
- // If the entity type doesn't have a base table, has no link template then
- // there's no point in supporting it.
- if (!empty($base_table) && $canonical_template_exists && !in_array($original_class, $classes_to_skip)) {
- $fields['metatag'] = BaseFieldDefinition::create('map')
- ->setLabel(t('Metatags'))
- ->setDescription(t('The meta tags for the entity.'))
- ->setClass('\Drupal\metatag\Plugin\Field\MetatagEntityFieldItemList')
- ->setComputed(TRUE)
- ->setTranslatable(TRUE)
- ->setTargetEntityTypeId($entity_type->id());
- }
-
- return $fields;
-}
-
-/**
- * Implements hook_entity_diff_options().
- */
-function metatag_entity_diff_options($entity_type) {
- if (metatag_entity_supports_metatags($entity_type)) {
- $options = [
- 'metatag' => t('Metatags'),
- ];
- return $options;
- }
-}
-
-/**
- * Implements hook_entity_diff().
- */
-function metatag_entity_diff($old_entity, $new_entity, $context) {
- $result = [];
- $entity_type = $context['entity_type'];
- $options = variable_get('diff_additional_options_' . $entity_type, []);
- if (!empty($options['metatag']) && metatag_entity_supports_metatags($entity_type)) {
- // Find meta tags that are set on either the new or old entity.
- $tags = [];
- foreach (['old' => $old_entity, 'new' => $new_entity] as $entity_key => $entity) {
- $language = metatag_entity_get_language($entity_type, $entity);
- if (isset($entity->metatags[$language])) {
- foreach ($entity->metatags[$language] as $key => $value) {
- $tags[$key][$entity_key] = $value['value'];
- }
- }
- }
-
- $init_weight = 100;
- foreach ($tags as $key => $values) {
- $id = ucwords('Meta ' . $key);
- // @todo Find the default values and show these if not set.
- $result[$id] = [
- '#name' => $id,
- '#old' => [empty($values['old']) ? '' : $values['old']],
- '#new' => [empty($values['new']) ? '' : $values['new']],
- '#weight' => $init_weight++,
- '#settings' => [
- 'show_header' => TRUE,
- ],
- ];
- }
- }
- return $result;
-}
-
-/**
- * Turn the meta tags for an entity into a human readable structure.
- *
- * @param object $entity
- * The entity object.
- *
- * @return array
- * All of the meta tags in a nested structure.
- */
-function metatag_generate_entity_metatags($entity) {
- $values = [];
- $raw = metatag_get_tags_from_route($entity);
- if (!empty($raw['#attached']['html_head'])) {
- foreach ($raw['#attached']['html_head'] as $tag) {
- $values[$tag[1]] = $tag[0];
- }
- }
- return $values;
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.permissions.yml b/sites/all/modules/contrib/admin/metatag/metatag.permissions.yml
deleted file mode 100644
index bdff82ed4..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.permissions.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-'administer meta tags':
- title: Administer meta tags
- description: Control the main settings pages and modify per-object meta tags.
- 'restrict access': TRUE
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.routing.yml b/sites/all/modules/contrib/admin/metatag/metatag.routing.yml
deleted file mode 100644
index d809e4dbc..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.routing.yml
+++ /dev/null
@@ -1,60 +0,0 @@
-# MetatagDefaults routing definition
-entity.metatag_defaults.collection:
- path: '/admin/config/search/metatag'
- defaults:
- _entity_list: 'metatag_defaults'
- _title: 'Metatag'
- requirements:
- _permission: 'administer meta tags'
- options:
- _admin_route: TRUE
-
-entity.metatag_defaults.add_form:
- path: '/admin/config/search/metatag/add'
- defaults:
- _entity_form: 'metatag_defaults.add'
- _title: 'Add default meta tags'
- requirements:
- _permission: 'administer meta tags'
- options:
- _admin_route: TRUE
-
-entity.metatag_defaults.edit_form:
- path: '/admin/config/search/metatag/{metatag_defaults}'
- defaults:
- _entity_form: 'metatag_defaults.edit'
- _title: 'Edit default meta tags'
- requirements:
- _permission: 'administer meta tags'
- options:
- _admin_route: TRUE
-
-entity.metatag_defaults.delete_form:
- path: '/admin/config/search/metatag/{metatag_defaults}/delete'
- defaults:
- _entity_form: 'metatag_defaults.delete'
- _title: 'Delete default meta tags'
- requirements:
- _permission: 'administer meta tags'
- options:
- _admin_route: TRUE
-
-entity.metatag_defaults.revert_form:
- path: '/admin/config/search/metatag/{metatag_defaults}/revert'
- defaults:
- _entity_form: 'metatag_defaults.revert'
- _title: 'Revert default meta tags'
- requirements:
- _permission: 'administer meta tags'
- options:
- _admin_route: TRUE
-
-metatag.settings:
- path: '/admin/config/search/metatag/settings'
- defaults:
- _form: '\Drupal\metatag\Form\MetatagSettingsForm'
- _title: 'Configure the Metatag module'
- requirements:
- _permission: 'administer meta tags'
- options:
- _admin_route: TRUE
diff --git a/sites/all/modules/contrib/admin/metatag/metatag.services.yml b/sites/all/modules/contrib/admin/metatag/metatag.services.yml
deleted file mode 100644
index c55377f13..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag.services.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-services:
- plugin.manager.metatag.tag:
- class: Drupal\metatag\MetatagTagPluginManager
- parent: default_plugin_manager
-
- plugin.manager.metatag.group:
- class: Drupal\metatag\MetatagGroupPluginManager
- parent: default_plugin_manager
-
- metatag.token:
- class: Drupal\metatag\MetatagToken
- arguments: ['@token']
-
- metatag.manager:
- class: Drupal\metatag\MetatagManager
- arguments: ['@plugin.manager.metatag.group', '@plugin.manager.metatag.tag', '@metatag.token', '@logger.factory', '@entity_type.manager']
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/config/schema/metatag_app_links.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_app_links/config/schema/metatag_app_links.metatag_tag.schema.yml
deleted file mode 100644
index d8eb413e8..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/config/schema/metatag_app_links.metatag_tag.schema.yml
+++ /dev/null
@@ -1,76 +0,0 @@
-# The 'type' should be "label" for short meta tags and "text" for ones which
-# could get longer, especially ones which use a textarea field instead of a
-# textfield.
-
-metatag.metatag_tag.al_android_app_name:
- type: label
- label: 'Android app name'
-metatag.metatag_tag.al_android_class:
- type: label
- label: 'Android app Activity Class'
-metatag.metatag_tag.al_android_package:
- type: label
- label: 'Android app package ID'
-metatag.metatag_tag.al_android_url:
- type: label
- label: 'Android app URL scheme'
-metatag.metatag_tag.al_ios_url:
- type: label
- label: 'iOS app URL scheme'
-metatag.metatag_tag.al_ios_app_store_id:
- type: label
- label: 'iOS app store ID'
-metatag.metatag_tag.al_ios_app_name:
- type: label
- label: 'iOS app name'
-metatag.metatag_tag.al_ipad_url:
- type: label
- label: 'iPad app URL scheme'
-metatag.metatag_tag.al_ipad_app_store_id:
- type: label
- label: 'iPad app store ID'
-metatag.metatag_tag.al_ipad_app_name:
- type: label
- label: 'iPad app name'
-metatag.metatag_tag.al_iphone_url:
- type: label
- label: 'iPhone app URL scheme'
-metatag.metatag_tag.al_iphone_app_store_id:
- type: label
- label: 'iPhone app store ID'
-metatag.metatag_tag.al_iphone_app_name:
- type: label
- label: 'iPhone app URL scheme'
-metatag.metatag_tag.al_windows_app_id:
- type: label
- label: 'Windows app GUID'
-metatag.metatag_tag.al_windows_app_name:
- type: label
- label: 'Windows app name'
-metatag.metatag_tag.al_windows_url:
- type: label
- label: 'Windows app URL scheme'
-metatag.metatag_tag.al_windows_phone_url:
- type: label
- label: 'Windows Phone app URL scheme'
-metatag.metatag_tag.al_windows_phone_app_id:
- type: label
- label: 'Windows Phone app GUID'
-metatag.metatag_tag.al_windows_phone_app_name:
- type: label
- label: 'Windows Phone app name'
-metatag.metatag_tag.al_windows_universal_url:
- type: label
- label: 'Windows Universal app URL scheme'
-metatag.metatag_tag.al_windows_universal_app_id:
- type: label
- label: 'Windows Universal app GUID'
-metatag.metatag_tag.al_windows_universal_app_name:
- type: label
- label: 'Windows Universal app name'
-metatag.metatag_tag.al_web_url:
- type: label
- label: 'Web URL'
-metatag.metatag_tag.al_web_should_fallback:
- type: label
- label: 'Should fallback'
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.info.yml
deleted file mode 100644
index 1f79a53f0..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: 'Metatag: App Links'
-type: module
-description: Provides support for applinks.org meta tags.
-# core: 8.x
-package: SEO
-dependencies:
- - metatag:metatag
-
-# Information added by Drupal.org packaging script on 2019-02-20
-version: '8.x-1.8'
-core: '8.x'
-project: 'metatag'
-datestamp: 1550683387
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.module b/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.module
deleted file mode 100644
index a350752bc..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/metatag_app_links.module
+++ /dev/null
@@ -1,24 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('Provides support for applinks.org meta tags.') . '
';
- return $output;
-
- default:
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Group/AppLinks.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Group/AppLinks.php
deleted file mode 100644
index 4f7aad531..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Group/AppLinks.php
+++ /dev/null
@@ -1,19 +0,0 @@
-applinks.org for details and documentation.", arguments = { ":url" = "http://applinks.org"}),
- * weight = 0,
- * )
- */
-class AppLinks extends GroupBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidAppName.php
deleted file mode 100644
index 6702f129b..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidAppName.php
+++ /dev/null
@@ -1,24 +0,0 @@
-This attribute is required by the App Links specification."),
- * name = "al:android:package",
- * group = "app_links",
- * weight = 1,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AlAndroidPackage extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidUrl.php
deleted file mode 100644
index bac535c56..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlAndroidUrl.php
+++ /dev/null
@@ -1,24 +0,0 @@
-This attribute is required by the app Links specification."),
- * name = "al:ios:url",
- * group = "app_links",
- * weight = 1,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AlIosUrl extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppName.php
deleted file mode 100644
index e9d2ce522..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIpadAppName.php
+++ /dev/null
@@ -1,24 +0,0 @@
-This attribute is required by the app Links specification."),
- * name = "al:ipad:url",
- * group = "app_links",
- * weight = 1,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AlIpadUrl extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppName.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppName.php
deleted file mode 100644
index 2538c6a57..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlIphoneAppName.php
+++ /dev/null
@@ -1,24 +0,0 @@
-This attribute is required by the app Links specification."),
- * name = "al:iphone:url",
- * group = "app_links",
- * weight = 1,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AlIphoneUrl extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebShouldFallback.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebShouldFallback.php
deleted file mode 100644
index cee2c4c47..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWebShouldFallback.php
+++ /dev/null
@@ -1,24 +0,0 @@
-This attribute is required by the app Links specification."),
- * name = "al:windows_phone:url",
- * group = "app_links",
- * weight = 1,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AlWindowsPhoneUrl extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppId.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppId.php
deleted file mode 100644
index 353c40087..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUniversalAppId.php
+++ /dev/null
@@ -1,24 +0,0 @@
-This attribute is required by the app Links specification."),
- * name = "al:windows_universal:url",
- * group = "app_links",
- * weight = 1,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AlWindowsUniversalUrl extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUrl.php
deleted file mode 100644
index 3aa22ab39..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Plugin/metatag/Tag/AlWindowsUrl.php
+++ /dev/null
@@ -1,24 +0,0 @@
-This attribute is required by the app Links specification."),
- * name = "al:windows:url",
- * group = "app_links",
- * weight = 1,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AlWindowsUrl extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Tests/MetatagAppLinksTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Tests/MetatagAppLinksTagsTest.php
deleted file mode 100644
index f791a5211..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_app_links/src/Tests/MetatagAppLinksTagsTest.php
+++ /dev/null
@@ -1,74 +0,0 @@
-Dublin Core Metadata Element Set 1.1 meta tags from the Dublin Core Metadata Institute.
-# core: 8.x
-package: SEO
-dependencies:
- - metatag:metatag
-
-# Information added by Drupal.org packaging script on 2019-02-20
-version: '8.x-1.8'
-core: '8.x'
-project: 'metatag'
-datestamp: 1550683387
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Group/DublinCore.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Group/DublinCore.php
deleted file mode 100644
index 0e0cb562f..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Group/DublinCore.php
+++ /dev/null
@@ -1,19 +0,0 @@
-Dublin Core Metadata Element Set 1.1 meta tags from the Dublin Core Metadata Institute", arguments = { ":docs" = "http://dublincore.org/documents/dces/", ":link" = "http://dublincore.org/"}),
- * weight = 4
- * )
- */
-class DublinCore extends GroupBase {
- // Inherits everything from Base.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Contributor.php b/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Contributor.php
deleted file mode 100644
index bba68928d..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_dc/src/Plugin/metatag/Tag/Contributor.php
+++ /dev/null
@@ -1,24 +0,0 @@
-Dublin Core Metadata Institute.'
-# core: 8.x
-package: SEO
-dependencies:
- - metatag:metatag
- - metatag:metatag_dc
-
-# Information added by Drupal.org packaging script on 2019-02-20
-version: '8.x-1.8'
-core: '8.x'
-project: 'metatag'
-datestamp: 1550683387
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.module b/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.module
deleted file mode 100644
index 5fbbb5e5e..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_dc_advanced/metatag_dc_advanced.module
+++ /dev/null
@@ -1,24 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('Provides support for the hreflang meta tag with some extra logic to simplify it.') . '
';
- return $output;
-
- default:
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php
deleted file mode 100644
index 0eeef79b3..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/Derivative/HreflangDeriver.php
+++ /dev/null
@@ -1,53 +0,0 @@
-getLanguages(LanguageInterface::STATE_ALL);
-
- // Now we loop over them and declare the derivatives.
- /** @var \Drupal\Core\Language\LanguageInterface $language */
- foreach ($languages as $langcode => $language) {
- // Ignore the global values.
- if ($langcode == Language::LANGCODE_NOT_SPECIFIED) {
- continue;
- }
- elseif ($langcode == Language::LANGCODE_NOT_APPLICABLE) {
- continue;
- }
-
- // The base definition includes the annotations defined in the plugin,
- // i.e. HreflangPerLanguage. Each one may be overridden.
- $derivative = $base_plugin_definition;
-
- // Here we fill in any missing keys on the layout annotation.
- $derivative['weight']++;
- $derivative['id'] = 'hreflang_' . $langcode;
- // The 'name' value is used as the value of the 'hreflang' attribute on
- // the HTML tag.
- $derivative['name'] = $langcode;
- $derivative['label'] = t("URL for a version of this page in %langcode", ['%langcode' => $language->getName()]);
- $derivative['description'] = '';
-
- // Reference derivatives based on their UUID instead of the record ID.
- $this->derivatives[$derivative['id']] = $derivative;
- }
-
- return $this->derivatives;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Group/Hreflang.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Group/Hreflang.php
deleted file mode 100644
index 6d1a25362..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Group/Hreflang.php
+++ /dev/null
@@ -1,19 +0,0 @@
- 'alternate',
- 'hreflang' => $this->name(),
- 'href' => $element['#attributes']['href'],
- ];
- }
-
- return $element;
- }
-
- /**
- * {@inheritdoc}
- */
- public function name() {
- return str_replace('hreflang_', '', parent::name());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangPerLanguage.php b/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangPerLanguage.php
deleted file mode 100644
index 958afdeb7..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_hreflang/src/Plugin/metatag/Tag/HreflangPerLanguage.php
+++ /dev/null
@@ -1,25 +0,0 @@
-save();
- }
- }
-
- /**
- * Each of these meta tags has a different tag name vs its internal name.
- */
- private function getTestTagName($tag_name) {
- return str_replace('hreflang_', '', $tag_name);
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'hreflang_xdefault'.
- */
- private function hreflangXdefaultTestOutputXpath() {
- return "//link[@hreflang='x-default']";
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'hreflang_en'.
- */
- private function hreflangEnTestOutputXpath() {
- return "//link[@hreflang='en']";
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'hreflang_es'.
- */
- private function hreflangEsTestOutputXpath() {
- return "//link[@hreflang='es']";
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'hreflang_fr'.
- */
- private function hreflangFrTestOutputXpath() {
- return "//link[@hreflang='fr']";
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/config/schema/metatag_mobile.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_mobile/config/schema/metatag_mobile.metatag_tag.schema.yml
deleted file mode 100644
index 6431aaa2b..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/config/schema/metatag_mobile.metatag_tag.schema.yml
+++ /dev/null
@@ -1,103 +0,0 @@
-# The 'type' should be "label" for short meta tags and "text" for ones which
-# could get longer, especially ones which use a textarea field instead of a
-# textfield.
-
-metatag.metatag_tag.android_app_link_alternative:
- type: label
- label: 'Android Mobile: Android App Link Alternative'
-metatag.metatag_tag.android_manifest:
- type: label
- label: 'Android Mobile: Manifest'
-metatag.metatag_tag.apple_itunes_app:
- type: label
- label: 'Apple Mobile: iTunes App'
-metatag.metatag_tag.apple_mobile_web_app_capable:
- type: label
- label: 'Apple Mobile: Web App Capable'
-metatag.metatag_tag.apple_mobile_web_app_status_bar_style:
- type: label
- label: 'Apple Mobile: Web App Status bar color'
-metatag.metatag_tag.apple_mobile_web_app_title:
- type: label
- label: 'Apple Mobile: Web App Title'
-metatag.metatag_tag.application_name:
- type: label
- label: 'Application name'
-metatag.metatag_tag.cleartype:
- type: label
- label: 'Mobile: Cleartype'
-metatag.metatag_tag.format_detection:
- type: label
- label: 'Apple Mobile: Format Detection'
-metatag.metatag_tag.handheldfriendly:
- type: label
- label: 'Mobile: Handheld-Friendly'
-metatag.metatag_tag.ios_app_link_alternative:
- type: label
- label: 'Apple Mobile: iOS App Link Alternative'
-metatag.metatag_tag.mobileoptimized:
- type: label
- label: 'Mobile: Mobile Optimized'
-metatag.metatag_tag.msapplication_allowDomainApiCalls:
- type: label
- label: 'MSApplication - Allow domain API calls'
-metatag.metatag_tag.msapplication_allowDomainMetaTags:
- type: label
- label: 'MSApplication - Allow domain meta tags'
-metatag.metatag_tag.msapplication_badge:
- type: label
- label: 'MSApplication - Badge'
-metatag.metatag_tag.msapplication_config:
- type: label
- label: 'MSApplication - Config'
-metatag.metatag_tag.msapplication_navbutton_color:
- type: label
- label: 'MSApplication - Nav button color'
-metatag.metatag_tag.msapplication_notification:
- type: label
- label: 'MSApplication - Notification'
-metatag.metatag_tag.msapplication_square150x150logo:
- type: label
- label: 'MSApplication - Square logo, 150px x 150px'
-metatag.metatag_tag.msapplication_square310x310logo:
- type: label
- label: 'MSApplication - Square logo, 310px x 310px'
-metatag.metatag_tag.msapplication_square70x70logo:
- type: label
- label: 'MSApplication - Square logo, 70px x 70px'
-metatag.metatag_tag.msapplication_starturl:
- type: label
- label: 'MSApplication - Start URL'
-metatag.metatag_tag.msapplication_task:
- type: label
- label: 'MSApplication - Task'
-metatag.metatag_tag.msapplication_task_separator:
- type: label
- label: 'MSApplication - Task separator'
-metatag.metatag_tag.msapplication_tilecolor:
- type: label
- label: 'MSApplication - Tile color'
-metatag.metatag_tag.msapplication_tileimage:
- type: label
- label: 'MSApplication - Tile image'
-metatag.metatag_tag.msapplication_tooltip:
- type: label
- label: 'MSApplication - Tooltip'
-metatag.metatag_tag.msapplication_wide310x150logo:
- type: label
- label: 'MSApplication - Wide logo, 310px x 150px'
-metatag.metatag_tag.msapplication_window:
- type: label
- label: 'MSApplication - Window'
-metatag.metatag_tag.theme_color:
- type: label
- label: 'Mobile: Theme Color'
-metatag.metatag_tag.viewport:
- type: label
- label: 'Mobile: Viewport'
-metatag.metatag_tag.web_manifest:
- type: label
- label: 'Mobile: Web Manifest'
-metatag.metatag_tag.x_ua_compatible:
- type: label
- label: 'X-UA-Compatible'
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.info.yml
deleted file mode 100644
index da52a0823..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: 'Metatag: Mobile & UI Adjustments'
-type: module
-description: Provides support for meta tags used to control the mobile browser experience.
-# core: 8.x
-package: SEO
-dependencies:
- - metatag:metatag
-
-# Information added by Drupal.org packaging script on 2019-02-20
-version: '8.x-1.8'
-core: '8.x'
-project: 'metatag'
-datestamp: 1550683387
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.module b/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.module
deleted file mode 100644
index dfe0ff94c..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/metatag_mobile.module
+++ /dev/null
@@ -1,106 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('Provides support for meta tags used to control the mobile browser experience.') . '
';
- return $output;
-
- default:
- }
-}
-
-/**
- * Implements hook_theme().
- */
-function metatag_mobile_theme() {
- $info['metatag_mobile_android_app'] = [
- 'render element' => 'element',
- ];
- $info['metatag_mobile_ios_app'] = [
- 'render element' => 'element',
- ];
-
- return $info;
-}
-
-/**
- * Implements hook_page_attachments_alter().
- */
-function metatag_mobile_page_attachments_alter(array &$attachments) {
- if (isset($attachments['#attached']['html_head'])) {
- // A list of core tags that will be replaced, in the format:
- // core tag => Metatag-supplied tag
- // This assumes that the module's meta tags are output *before* the core
- // tags, if this changes then We're Going To Have A Bad Time.
- $dupes = [
- 'MobileOptimized' => 'mobileoptimized',
- 'HandheldFriendly' => 'handheldfriendly',
- 'viewport' => 'viewport',
- ];
-
- // Keep track of when the Metatag-supplied meta tags are found, so if the
- // core tag is also found it can be removed.
- $found = [];
-
- foreach ($dupes as $core_tag => $meta_tag) {
- foreach ($attachments['#attached']['html_head'] as $key => $item) {
- if (isset($item[1])) {
- // The Metatag values are output before core's, so skip the first item
- // found so it can be picked up as the dupe; this is important for the
- // "viewport" meta tag where both core and Metatag use the same name.
- if ($item[1] == $meta_tag && !isset($found[$meta_tag])) {
- $found[$meta_tag] = $key;
- }
- elseif ($item[1] == $core_tag && isset($found[$meta_tag])) {
- // @todo This ought to work, but doesn't?
- // $attachments['#attached']['html_head'][$key]['#access'] = FALSE;
- unset($attachments['#attached']['html_head'][$key]);
- }
- }
- }
- }
- }
-}
-
-/**
- * Theme callback for an Android app link meta tag.
- *
- * The format is (all on oneline):
- *
- */
-function theme_metatag_mobile_android_app($variables) {
- // Pass everything through to the normal 'link' tag theme.
- $variables['element']['#name'] = 'alternative';
- $variables['element']['#value'] = 'android-app://' . $variables['element']['#value'];
-
- return theme('metatag_link_rel', $variables);
-}
-
-/**
- * Theme callback for an iOS app link meta tag.
- *
- * The format is:
- *
- */
-function theme_metatag_mobile_ios_app($variables) {
- // Pass everything through to the normal 'link' tag theme.
- $variables['element']['#name'] = 'alternative';
- $variables['element']['#value'] = 'ios-app://' . $variables['element']['#value'];
-
- return theme('metatag_link_rel', $variables);
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AndroidMobile.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AndroidMobile.php
deleted file mode 100644
index b1dfca6c8..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Group/AndroidMobile.php
+++ /dev/null
@@ -1,17 +0,0 @@
-JSON-based manifest provides developers with a centralized place to put metadata associated with a web application."),
- * name = "manifest",
- * group = "android_mobile",
- * weight = 92,
- * type = "uri",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AndroidManifest extends LinkRelBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleItunesApp.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleItunesApp.php
deleted file mode 100644
index b7bfdd730..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/AppleItunesApp.php
+++ /dev/null
@@ -1,24 +0,0 @@
-Badge Schema XML file. May also contain 'frequency=' value set to either 30, 60, 360, 720 or 1440 (default) which specifies (in minutes) how often the URL should be polled."),
- * name = "msapplication-badge",
- * group = "windows_mobile",
- * weight = 97,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class MsapplicationBadge extends MetaNameBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationConfig.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationConfig.php
deleted file mode 100644
index 4487b7c7c..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationConfig.php
+++ /dev/null
@@ -1,24 +0,0 @@
-Browser configuration schema file that further controls tile customizations."),
- * name = "msapplication-config",
- * group = "windows_mobile",
- * weight = 98,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class MsapplicationConfig extends MetaNameBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNavbuttonColor.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNavbuttonColor.php
deleted file mode 100644
index 8d116698b..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/MsapplicationNavbuttonColor.php
+++ /dev/null
@@ -1,24 +0,0 @@
-JSON-based manifest provides developers with a centralized place to put metadata associated with a web application."),
- * name = "manifest",
- * group = "mobile",
- * weight = 92,
- * type = "uri",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class WebManifest extends LinkRelBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/XUaCompatible.php b/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/XUaCompatible.php
deleted file mode 100644
index 99c93ee40..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_mobile/src/Plugin/metatag/Tag/XUaCompatible.php
+++ /dev/null
@@ -1,24 +0,0 @@
-randomMachineName();
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'android-app-link-alternative'.
- */
- private function androidAppLinkAlternativeTestOutputXpath() {
- return "//link[@rel='alternate' and starts-with(@href, 'android-app:')]";
- }
-
- /**
- * Implements {tag_name}TestValueAttribute().
- *
- * For 'android-app-link-alternative'.
- */
- private function androidAppLinkAlternativeTestValueAttribute() {
- return 'href';
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'android_manifest'.
- */
- private function androidManifestTestOutputXpath() {
- return "//link[@rel='manifest']";
- }
-
- /**
- * Implements {tag_name}TestValueAttribute() for 'android_manifest'.
- */
- private function androidManifestTestValueAttribute() {
- return 'href';
- }
-
- /**
- * Implements {tag_name}TestNameAttribute() for 'cleartype'.
- */
- private function cleartypeTestNameAttribute() {
- return 'http-equiv';
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'handheldfriendly'.
- */
- private function handheldfriendlyTestOutputXpath() {
- return "//meta[@name='HandheldFriendly']";
- }
-
- /**
- * Implements {tag_name}TestValue() for 'ios_app_link_alternative'.
- */
- private function iosAppLinkAlternativeTestValue() {
- return 'ios-app:' . $this->randomMachineName();
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'ios_app_link_alternative'.
- */
- private function iosAppLinkAlternativeTestOutputXpath() {
- return "//link[@rel='alternate' and starts-with(@href, 'ios-app:')]";
- }
-
- /**
- * Implements {tag_name}TestValueAttribute() for 'ios_app_link_alternative'.
- */
- private function iosAppLinkAlternativeTestValueAttribute() {
- return 'href';
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'mobileoptimized'.
- */
- private function mobileoptimizedTestOutputXpath() {
- return "//meta[@name='MobileOptimized']";
- }
-
- /**
- * Implements {tag_name}TestValue() for 'msapplication-square150x150logo'.
- */
- private function msapplicationSquare150x150logoTestValue() {
- return $this->randomImageUrl();
- }
-
- /**
- * Implements {tag_name}TestValue() for 'msapplication-square310x310logo'.
- */
- private function msapplicationSquare310x310logoTestValue() {
- return $this->randomImageUrl();
- }
-
- /**
- * Implements {tag_name}TestValue() for 'msapplication-square70x70logo'.
- */
- private function msapplicationSquare70x70logoTestValue() {
- return $this->randomImageUrl();
- }
-
- /**
- * Implements {tag_name}TestValue() for 'msapplication-tileimage'.
- */
- private function msapplicationTileimageTestValue() {
- return $this->randomImageUrl();
- }
-
- /**
- * Implements {tag_name}TestValue() for 'msapplication-wide310x150logo'.
- */
- private function msapplicationWide310x150logoTestValue() {
- return $this->randomImageUrl();
- }
-
- /**
- * Implements {tag_name}TestOutputXpath() for 'web_manifest'.
- */
- private function webManifestTestOutputXpath() {
- return "//link[@rel='manifest']";
- }
-
- /**
- * Implements {tag_name}TestValueAttribute() for 'web_manifest'.
- */
- private function webManifestTestValueAttribute() {
- return 'href';
- }
-
- /**
- * Implements {tag_name}TestNameAttribute() for 'x-ua-compatible'.
- */
- private function xUaCompatibleTestNameAttribute() {
- return 'http-equiv';
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml
deleted file mode 100644
index 593df480f..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/config/schema/metatag_open_graph.metatag_tag.schema.yml
+++ /dev/null
@@ -1,133 +0,0 @@
-# The 'type' should be "label" for short meta tags and "text" for ones which
-# could get longer, especially ones which use a textarea field instead of a
-# textfield.
-
-metatag.metatag_tag.og_country_name:
- type: label
- label: 'Open Graph: Country name'
-metatag.metatag_tag.og_description:
- type: text
- label: 'Open Graph: Description'
-metatag.metatag_tag.og_determiner:
- type: label
- label: 'Open Graph: Determiner'
-metatag.metatag_tag.og_email:
- type: label
- label: 'Open Graph: Email'
-metatag.metatag_tag.og_fax_number:
- type: label
- label: 'Open Graph: Fax number'
-metatag.metatag_tag.og_image:
- type: label
- label: 'Open Graph: Image'
-metatag.metatag_tag.og_image_alt:
- type: label
- label: 'Open Graph: Image alt'
-metatag.metatag_tag.og_image_height:
- type: label
- label: 'Open Graph: Image height'
-metatag.metatag_tag.og_image_secure_url:
- type: label
- label: 'Open Graph: Image secure URL'
-metatag.metatag_tag.og_image_type:
- type: label
- label: 'Open Graph: Image type'
-metatag.metatag_tag.og_image_url:
- type: label
- label: 'Open Graph: Image URL'
-metatag.metatag_tag.og_image_width:
- type: label
- label: 'Open Graph: Image width'
-metatag.metatag_tag.og_latitude:
- type: label
- label: 'Open Graph: Latitude'
-metatag.metatag_tag.og_locale:
- type: label
- label: 'Open Graph: Locale'
-metatag.metatag_tag.og_locale_alternative:
- type: label
- label: 'Open Graph: Alternative locale'
-metatag.metatag_tag.og_locality:
- type: label
- label: 'Open Graph: Locality'
-metatag.metatag_tag.og_longitude:
- type: label
- label: 'Open Graph: Longitude'
-metatag.metatag_tag.og_phone_number:
- type: label
- label: 'Open Graph: Phone number'
-metatag.metatag_tag.og_postal_code:
- type: label
- label: 'Open Graph: Postal code'
-metatag.metatag_tag.og_region:
- type: label
- label: 'Open Graph: Region'
-metatag.metatag_tag.og_see_also:
- type: label
- label: 'Open Graph: See also'
-metatag.metatag_tag.og_site_name:
- type: label
- label: 'Open Graph: Site name'
-metatag.metatag_tag.og_street_address:
- type: label
- label: 'Open Graph: Street address'
-metatag.metatag_tag.og_title:
- type: label
- label: 'Open Graph: Title'
-metatag.metatag_tag.og_type:
- type: label
- label: 'Open Graph: Type'
-metatag.metatag_tag.og_updated_time:
- type: label
- label: 'Open Graph: Updated time'
-metatag.metatag_tag.og_url:
- type: label
- label: 'Open Graph: URL'
-metatag.metatag_tag.og_video:
- type: label
- label: 'Open Graph: Video URL'
-metatag.metatag_tag.og_video_height:
- type: label
- label: 'Open Graph: Video height'
-metatag.metatag_tag.og_video_secure_url:
- type: label
- label: 'Open Graph: Video Secure URL'
-metatag.metatag_tag.og_video_type:
- type: label
- label: 'Open Graph: Video type'
-metatag.metatag_tag.og_video_width:
- type: label
- label: 'Open Graph: Video width'
-metatag.metatag_tag.article_author:
- type: label
- label: 'Article author'
-metatag.metatag_tag.article_expiration_time:
- type: label
- label: 'Article expiration time'
-metatag.metatag_tag.article_modified_time:
- type: label
- label: 'Article modified time'
-metatag.metatag_tag.article_published_time:
- type: label
- label: 'Article published time'
-metatag.metatag_tag.article_publisher:
- type: label
- label: 'Article publisher'
-metatag.metatag_tag.article_section:
- type: label
- label: 'Article section'
-metatag.metatag_tag.article_tag:
- type: label
- label: 'Article tag(s)'
-metatag.metatag_tag.book_author:
- type: label
- label: 'Book Author'
-metatag.metatag_tag.book_isbn:
- type: label
- label: 'Book ISBN'
-metatag.metatag_tag.book_release_date:
- type: label
- label: 'Book Release Date'
-metatag.metatag_tag.book_tag:
- type: label
- label: 'Book Tags'
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.info.yml
deleted file mode 100644
index 16ef28d0b..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: 'Metatag: Open Graph'
-type: module
-description: Provides support for Open Graph Protocol meta tags.
-# core: 8.x
-package: SEO
-dependencies:
- - metatag:metatag
-
-# Information added by Drupal.org packaging script on 2019-02-20
-version: '8.x-1.8'
-core: '8.x'
-project: 'metatag'
-datestamp: 1550683387
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.install b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.install
deleted file mode 100644
index 28baa7a4e..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.install
+++ /dev/null
@@ -1,127 +0,0 @@
-get('tags');
-
- if (array_key_exists("article_tags", $tags)) {
- $tags['article_tag'] = $tags['article_tags'];
- unset($tags['article_tags']);
- $config->set("tags", $tags);
- $config->save();
- }
- }
-}
-
-/**
- * The "article_tags" tag config was renamed "article_tag" on content entities.
- */
-function metatag_open_graph_update_8102(&$sandbox) {
- // Update existing content with reference to old article_tags.
- $etm = Drupal::entityTypeManager();
-
- if (empty($sandbox)) {
-
- $field_map = Drupal::getContainer()->get('entity_field.manager')->getFieldMap();
- $sandbox['todo'] = [];
- $sandbox['done'] = 0;
- $sandbox['max'] = 0;
- $sandbox['#finished'] = 0;
-
- foreach ($field_map as $entity_type => $fields) {
- foreach ($fields as $field_name => $field_def) {
- if ($field_def['type'] == "metatag") {
- // We found a metatag field, so query for all the entities of this
- // type that have "article_tags" in the serialized array.
- $q = \Drupal::entityQuery($entity_type);
- $q->condition($field_name, "article_tags", "CONTAINS");
- $count = $q->count()->execute();
-
- if ($count > 0) {
- $sandbox['todo'][$entity_type][$field_name] = 0;
- $sandbox['max'] += $count;
- }
- }
- }
- }
-
- if ($sandbox['max'] == 0) {
- // Nothing to do.
- $sandbox['#finished'] = 1;
- return;
- }
- }
-
- foreach ($sandbox['todo'] as $entity_type => $fields) {
-
- /* @var $def Drupal\Core\Entity\ContentEntityType */
- $def = Drupal::entityTypeManager()->getDefinition($entity_type);
-
- // Grab the primary key field for this entity type
- // so we can filter and order by it.
- $id_col = $def->getKey("id");
-
- foreach ($fields as $field_name => $last) {
- $q = \Drupal::entityQuery($entity_type);
- $q->condition($field_name, "article_tags", "CONTAINS");
- $q->condition($id_col, $last, ">");
- $q->sort($id_col);
- $q->pager(20);
- $res = $q->execute();
-
- if (empty($res)) {
- unset($sandbox['todo'][$entity_type][$field_name]);
- continue;
- }
-
- $entities = $etm->getStorage($entity_type)->loadMultiple($res);
-
- foreach ($entities as $entity) {
- /* @var $entity ContentEntityBase */
- if ($entity instanceof ContentEntityBase) {
- if ($entity->hasField($field_name)) {
- /* @var LanguageInterface $langcode */
- foreach ($entity->getTranslationLanguages() as $langcode) {
- // For each translation of this entity (including the source)...
- $trans = $entity->getTranslation($langcode->getId());
- $tags_serialized = $trans->get($field_name)->value;
- if ($tags_serialized) {
- // Change key from article_tags to article_tag.
- $tags = unserialize($tags_serialized);
- if (array_key_exists("article_tags", $tags)) {
- $tags['article_tag'] = $tags['article_tags'];
- unset($tags['article_tags']);
- $trans->set($field_name, serialize($tags));
- $trans->save();
- }
- }
- }
- }
- }
-
- // Store the last pk per entity type and field name.
- $sandbox['todo'][$entity_type][$field_name] = $entity->id();
- $sandbox['done']++;
- $sandbox['#finished'] = $sandbox['done'] / $sandbox['max'];
- }
- }
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.module b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.module
deleted file mode 100644
index fa5ffa707..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/metatag_open_graph.module
+++ /dev/null
@@ -1,38 +0,0 @@
-moduleExists('rdf')) {
- $namespaces = [
- 'prefix' => 'og: http://ogp.me/ns#',
- ];
- }
-
- // Namespaces for Google+.
- if (isset($variables['itemtype'])) {
- $namespaces['itemscope'] = '';
- $namespaces['itemtype'] = "http://schema.org/{$variables['itemtype']}";
- }
-
- // Append each namespace.
- foreach ($namespaces as $namespace => $uri) {
- $variables['html_attributes'][$namespace] = $uri;
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Group/OpenGraph.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Group/OpenGraph.php
deleted file mode 100644
index 3e5c8ac58..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Group/OpenGraph.php
+++ /dev/null
@@ -1,19 +0,0 @@
-Open Graph meta tags are used control how Facebook, Pinterest, LinkedIn and other social networking sites interpret the site's content."),
- * weight = 3
- * )
- */
-class OpenGraph extends GroupBase {
- // Inherits everything from Base.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleAuthor.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleAuthor.php
deleted file mode 100644
index 2318dcba6..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleAuthor.php
+++ /dev/null
@@ -1,24 +0,0 @@
-ISO 8601 format."),
- * name = "article:expiration_time",
- * group = "open_graph",
- * weight = 34,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class ArticleExpirationTime extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleModifiedTime.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleModifiedTime.php
deleted file mode 100644
index 92493f954..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticleModifiedTime.php
+++ /dev/null
@@ -1,24 +0,0 @@
-ISO 8601 format."),
- * name = "article:modified_time",
- * group = "open_graph",
- * weight = 33,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class ArticleModifiedTime extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublishedTime.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublishedTime.php
deleted file mode 100644
index c96cab0b7..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublishedTime.php
+++ /dev/null
@@ -1,24 +0,0 @@
-ISO 8601 format."),
- * name = "article:published_time",
- * group = "open_graph",
- * weight = 32,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class ArticlePublishedTime extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublisher.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublisher.php
deleted file mode 100644
index 727d85677..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/ArticlePublisher.php
+++ /dev/null
@@ -1,24 +0,0 @@
-IMDb."),
- * name = "og:site_name",
- * group = "open_graph",
- * weight = 1,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class OgSiteName extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgStreetAddress.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgStreetAddress.php
deleted file mode 100644
index 79795a94e..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgStreetAddress.php
+++ /dev/null
@@ -1,24 +0,0 @@
-The Rock."),
- * name = "og:title",
- * group = "open_graph",
- * weight = 4,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class OgTitle extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgType.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgType.php
deleted file mode 100644
index cc2fc11bf..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgType.php
+++ /dev/null
@@ -1,24 +0,0 @@
-movie."),
- * name = "og:type",
- * group = "open_graph",
- * weight = 2,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class OgType extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUpdatedTime.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUpdatedTime.php
deleted file mode 100644
index 6dd6e45a7..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUpdatedTime.php
+++ /dev/null
@@ -1,24 +0,0 @@
-ISO 8601 format. Can be the same as the 'Article modification date' tag."),
- * name = "og:updated_time",
- * group = "open_graph",
- * weight = 15,
- * type = "date",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class OgUpdatedTime extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUrl.php
deleted file mode 100644
index dd49eedf5..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgUrl.php
+++ /dev/null
@@ -1,25 +0,0 @@
-http://www.imdb.com/title/tt0117500/."),
- * name = "og:url",
- * group = "open_graph",
- * weight = 3,
- * type = "uri",
- * secure = FALSE,
- * multiple = FALSE,
- * absolute_url = TRUE
- * )
- */
-class OgUrl extends MetaPropertyBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideo.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideo.php
deleted file mode 100644
index f68831485..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph/src/Plugin/metatag/Tag/OgVideo.php
+++ /dev/null
@@ -1,25 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('Provides additional Open Graph Protocol meta tags for describing products.') . '
';
- return $output;
-
- default:
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Group/OpenGraphProducts.php b/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Group/OpenGraphProducts.php
deleted file mode 100644
index 3a254cb23..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_open_graph_products/src/Plugin/metatag/Group/OpenGraphProducts.php
+++ /dev/null
@@ -1,19 +0,0 @@
-attributes->get('_entity');
- if ($entity) {
-
- $key = $entity->getEntityType()->id() . '__' . $entity->id();
- // Get default metatags.
- $metatag_defaults = metatag_get_default_tags();
- // Load page variant metatags.
- $metatag_variant = MetatagDefaults::load($key);
- if ($metatag_variant) {
- // Overwrite the metatag defaults with the tags of the page variant.
- $metatag_defaults = array_merge($metatag_defaults, $metatag_variant->get('tags'));
-
- // Set the metatag in the static metatag attachments parameter so the
- // metatag module wouldn't overwrite them.
- $metatag_attachments = &drupal_static('metatag_attachments');
-
- $metatag_manager = \Drupal::service('metatag.manager');
- $metatag_attachments = $metatag_manager->generateElements($metatag_defaults, $entity);
-
- // If any Metatag items were found, append them.
- if (!empty($metatag_attachments['#attached']['html_head'])) {
- if (empty($attachments['#attached'])) {
- $attachments['#attached'] = [];
- }
- if (empty($attachments['#attached']['html_head'])) {
- $attachments['#attached']['html_head'] = [];
- }
- foreach ($metatag_attachments['#attached']['html_head'] as $item) {
- $attachments['#attached']['html_head'][] = $item;
- }
- }
- }
- }
-}
-
-/**
- * Returns all available page variants.
- *
- * @return string[]
- * A list of page variants keyed by label.
- */
-function _metatag_page_manager_get_variants() {
- /** @var \Drupal\page_manager\Entity\PageVariant[] $variants */
- $variants = PageVariant::loadMultiple();
- $variant_options = [];
- // Load all metatag defaults so we can filter the variants which already have
- // a metatag default configured.
- $metatag_defaults = MetatagDefaults::loadMultiple();
- foreach ($variants as $key => $variant) {
- $id = $variant->getEntityType()->id() . '__' . $key;
- if (!isset($metatag_defaults[$id])) {
- $label = $variant->getPage()->label() . ' : ' . $variant->label();
- $variant_options[$id] = $label;
- }
- }
- return $variant_options;
-}
-
-/**
- * Implements hook_metatag_alter().
- */
-function metatag_page_manager_metatags_alter(array &$metatags, array &$context) {
- if (!$context['entity'] instanceof PageVariant) {
- return;
- }
-
- $key = $context['entity']->getEntityType()->id() . '__' . $context['entity']->id();
- $metatag_variant = MetatagDefaults::load($key);
- if ($metatag_variant) {
- $metatags = array_merge($metatags, $metatag_variant->get('tags'));
- }
-}
-
-/**
- * Implements hook_metatag_route_entity().
- */
-function metatag_page_manager_metatag_route_entity(RouteMatchInterface $route_match) {
- if ($variant = $route_match->getParameter('page_manager_page_variant')) {
- return $variant;
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_page_manager/src/Tests/Functional/MetatagPageManagerTest.php b/sites/all/modules/contrib/admin/metatag/metatag_page_manager/src/Tests/Functional/MetatagPageManagerTest.php
deleted file mode 100644
index 14c228966..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_page_manager/src/Tests/Functional/MetatagPageManagerTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
-assertSession = $this->assertSession();
-
- Page::create([
- 'id' => 'metatag_page_manager_test',
- 'label' => 'Metatag Page',
- 'path' => '/metatag-test',
- ])->save();
- PageVariant::create([
- 'id' => 'metatag_page_manager_variant_test',
- 'variant' => 'block_display',
- 'label' => 'Metatag Variant',
- 'page' => 'metatag_page_manager_test',
- 'weight' => 10,
- ])->save();
-
- \Drupal::service("router.builder")->rebuild();
-
- // Log in as user 1.
- $this->loginUser1();
- }
-
- /**
- * Tests a single variant page.
- */
- public function testSingleVariantPage() {
- $this->drupalGet('/metatag-test');
- $this->assertSession->statusCodeEquals(200);
-
- // Confirm what the page title looks like by default.
- $this->assertSession->titleEquals('Metatag Page | Drupal');
-
- // Create the Metatag object through the UI to check the custom label.
- $edit = [
- 'id' => 'page_variant__metatag_page_manager_variant_test',
- 'title' => 'My title',
- ];
-
- $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save');
- $this->assertSession->pageTextContains('Page Variant: Metatag Page: Metatag Variant');
-
- // Clear caches to load the right metatags.
- drupal_flush_all_caches();
-
- $this->drupalGet('/metatag-test');
- $this->assertSession->statusCodeEquals(200);
-
- // Confirm what the page title is overridden.
- $this->assertSession->titleEquals('My title');
- }
-
- /**
- * Tests a single variant page.
- */
- public function testMultipleVariantPage() {
- // Add a new variant.
- $new_variant = PageVariant::create([
- 'id' => 'metatag_page_manager_multiple_variant_test',
- 'variant' => 'block_display',
- 'label' => 'Metatag Multiple Variant',
- 'page' => 'metatag_page_manager_test',
- 'weight' => 0,
- ]);
- $anonymous_selection = [
- 'id' => 'user_role',
- 'roles' => [
- 'anonymous' => 'anonymous',
- ],
- 'negate' => FALSE,
- 'context_mapping' => [
- 'user' => 'current_user',
- ],
- ];
- $new_variant->set('selection_criteria', [$anonymous_selection]);
- $new_variant->save();
-
- // Clear caches to load the right metatags.
- drupal_flush_all_caches();
-
- $this->drupalGet('/metatag-test');
- $this->assertSession->statusCodeEquals(200);
-
- // Confirm what the page title looks like by default.
- $this->assertSession->titleEquals('Metatag Page | Drupal');
-
- // Create the Metatag object through the UI to check the custom label.
- $edit = [
- 'id' => 'page_variant__metatag_page_manager_variant_test',
- 'title' => 'My title',
- ];
-
- $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save');
- $this->assertSession->pageTextContains('Page Variant: Metatag Page: Metatag Variant');
-
- // Clear caches to load the right metatags.
- drupal_flush_all_caches();
-
- $this->drupalGet('/metatag-test');
- $this->assertSession->statusCodeEquals(200);
-
- // Confirm what the page title is overridden.
- $this->assertSession->titleEquals('My title');
-
- // Visiting page as anon user, should get the default title.
- $this->drupalLogout();
- $this->drupalGet('/metatag-test');
- $this->assertSession->statusCodeEquals(200);
-
- // Confirm what the page title looks like by default.
- $this->assertSession->titleEquals('Metatag Page | Drupal');
-
- // Login and add custom metatag for anonymous user variant.
- $this->loginUser1();
- // Create the Metatag object through the UI to check the custom label.
- $edit = [
- 'id' => 'page_variant__metatag_page_manager_multiple_variant_test',
- 'title' => 'My title anonymous',
- ];
-
- $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save');
- $this->assertSession->pageTextContains('Page Variant: Metatag Page: Metatag Multiple Variant');
-
- // Clear caches to load the right metatags.
- drupal_flush_all_caches();
-
- // Visit page as logged in user and confirm the right title.
- $this->drupalGet('/metatag-test');
- $this->assertSession->statusCodeEquals(200);
- $this->assertSession->titleEquals('My title');
-
- // Visit page as anonymous user and confirm the right title.
- $this->drupalLogout();
- $this->drupalGet('/metatag-test');
- $this->assertSession->statusCodeEquals(200);
- $this->assertSession->titleEquals('My title anonymous');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/config/schema/metatag_pinterest.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/config/schema/metatag_pinterest.metatag_tag.schema.yml
deleted file mode 100644
index 979e744df..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/config/schema/metatag_pinterest.metatag_tag.schema.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-# The 'type' should be "label" for short meta tags and "text" for ones which
-# could get longer, especially ones which use a textarea field instead of a
-# textfield.
-
-metatag.metatag_tag.pinterest_description:
- type: text
- label: 'Pinterest: Description'
-metatag.metatag_tag.pinterest_id:
- type: label
- label: 'Pinterest: ID'
-metatag.metatag_tag.pinterest_media:
- type: label
- label: 'Pinterest: Media'
-metatag.metatag_tag.pinterest_nohover:
- type: label
- label: 'Pinterest: No hover'
-metatag.metatag_tag.pinterest_nopin:
- type: label
- label: 'Pinterest: No pin'
-metatag.metatag_tag.pinterest_nosearch:
- type: label
- label: 'Pinterest: No search'
-metatag.metatag_tag.pinterest_url:
- type: label
- label: 'Pinterest: URL'
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/metatag_pinterest.info.yml b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/metatag_pinterest.info.yml
deleted file mode 100644
index 3f9142325..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/metatag_pinterest.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: 'Metatag: Pinterest'
-type: module
-description: Provides support for Pinterest's custom meta tags.
-# core: 8.x
-package: SEO
-dependencies:
- - metatag:metatag
-
-# Information added by Drupal.org packaging script on 2019-02-20
-version: '8.x-1.8'
-core: '8.x'
-project: 'metatag'
-datestamp: 1550683387
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Group/Pinterest.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Group/Pinterest.php
deleted file mode 100644
index 975f5c3dd..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Group/Pinterest.php
+++ /dev/null
@@ -1,19 +0,0 @@
-Pinterest."),
- * weight = 4
- * )
- */
-class Pinterest extends GroupBase {
- // Inherits everything from Base.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestDescription.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestDescription.php
deleted file mode 100644
index bd3fe2e6c..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestDescription.php
+++ /dev/null
@@ -1,24 +0,0 @@
- 'checkbox',
- '#title' => $this->label(),
- '#description' => $this->description(),
- '#default_value' => ($this->value === 'nohover') ?: '',
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#element_validate' => [[get_class($this), 'validateTag']],
- '#return_value' => 'nohover',
- ];
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNopin.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNopin.php
deleted file mode 100644
index 5e0265340..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNopin.php
+++ /dev/null
@@ -1,41 +0,0 @@
- 'checkbox',
- '#title' => $this->label(),
- '#description' => $this->description(),
- '#default_value' => ($this->value === 'nopin') ?: '',
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#element_validate' => [[get_class($this), 'validateTag']],
- '#return_value' => 'nopin',
- ];
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNosearch.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNosearch.php
deleted file mode 100644
index 9c0c9437b..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestNosearch.php
+++ /dev/null
@@ -1,41 +0,0 @@
- 'checkbox',
- '#title' => $this->label(),
- '#description' => $this->description(),
- '#default_value' => ($this->value === 'nosearch') ?: '',
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#element_validate' => [[get_class($this), 'validateTag']],
- '#return_value' => 'nosearch',
- ];
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestUrl.php b/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestUrl.php
deleted file mode 100644
index 1ca92be5d..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_pinterest/src/Plugin/metatag/Tag/PinterestUrl.php
+++ /dev/null
@@ -1,24 +0,0 @@
-Twitter."),
- * weight = 4
- * )
- */
-class TwitterCards extends GroupBase {
- // Inherits everything from Base.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdGooglePlay.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdGooglePlay.php
deleted file mode 100644
index 2bb98f487..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsAppIdGooglePlay.php
+++ /dev/null
@@ -1,23 +0,0 @@
-stop Twitter from tracking visitors.", arguments = { ":url" = "https://dev.twitter.com/web/overview/privacy#what-privacy-options-do-website-publishers-have" }),
- * name = "twitter:dnt",
- * group = "twitter_cards",
- * weight = 5,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class TwitterCardsDoNotTrack extends MetaNameBase {
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage0.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage0.php
deleted file mode 100644
index d0545cdeb..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsGalleryImage0.php
+++ /dev/null
@@ -1,24 +0,0 @@
-RFC 4337.", arguments = { ":url" = "http://tools.ietf.org/rfc/rfc4337.txt" }),
- * name = "twitter:player:stream:content_type",
- * group = "twitter_cards",
- * weight = 404,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class TwitterCardsPlayerStreamContentType extends MetaNameBase {
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerWidth.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerWidth.php
deleted file mode 100644
index ec0895203..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Plugin/metatag/Tag/TwitterCardsPlayerWidth.php
+++ /dev/null
@@ -1,23 +0,0 @@
-
no other fields are required for a Summary card
Photo card requires the 'image' field
Media player card requires the 'title', 'description', 'media player URL', 'media player width', 'media player height' and 'image' fields,
Summary Card with Large Image card requires the 'Summary' field and the 'image' field,
Gallery Card requires all the 'Gallery Image' fields,
App Card requires the 'iPhone app ID' field, the 'iPad app ID' field and the 'Google Play app ID' field,
Product Card requires the 'description' field, the 'image' field, the 'Label 1' field, the 'Data 1' field, the 'Label 2' field and the 'Data 2' field.
"),
- * name = "twitter:card",
- * group = "twitter_cards",
- * weight = 1,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class TwitterCardsType extends MetaNameBase {
-
- /**
- * {@inheritdoc}
- */
- public function form(array $element = []) {
- $form = [
- '#type' => 'select',
- '#title' => $this->label(),
- '#description' => $this->description(),
- '#options' => [
- 'summary' => t('Summary Card'),
- 'summary_large_image' => t('Summary Card with large image'),
- 'photo' => t('Photo Card'),
- 'gallery' => t('Gallery Card'),
- 'app' => t('App Card'),
- 'player' => t('Player Card'),
- 'product' => t('Product Card'),
- ],
- '#empty_option' => t('- None -'),
- '#empty_value' => '',
- '#default_value' => $this->value(),
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#element_validate' => [[get_class($this), 'validateTag']],
- ];
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Tests/MetatagTwitterCardsTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Tests/MetatagTwitterCardsTagsTest.php
deleted file mode 100644
index b718d0156..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_twitter_cards/src/Tests/MetatagTwitterCardsTagsTest.php
+++ /dev/null
@@ -1,106 +0,0 @@
-Baidu.", arguments = { ":baidu" = "http://www.baidu.com/" }),
- * name = "baidu-site-verification",
- * group = "site_verification",
- * weight = 2,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Baidu extends MetaNameBase {
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Bing.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Bing.php
deleted file mode 100644
index 9679777de..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Bing.php
+++ /dev/null
@@ -1,23 +0,0 @@
-Bing, full details are available from the Bing online help.", arguments = { ":bing" = "http://www.bing.com/", ":verify_url" = "http://www.bing.com/webmaster/help/how-to-verify-ownership-of-your-site-afcfefc6" }),
- * name = "msvalidate.01",
- * group = "site_verification",
- * weight = 3,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Bing extends MetaNameBase {
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Google.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Google.php
deleted file mode 100644
index e502a785f..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Google.php
+++ /dev/null
@@ -1,23 +0,0 @@
-Google, full details are available from the Google online help.", arguments = { ":google" = "https://www.google.com/", ":verify_url" = "https://support.google.com/webmasters/answer/35179?hl=en" }),
- * name = "google-site-verification",
- * group = "site_verification",
- * weight = 4,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Google extends MetaNameBase {
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/NortonSafeWeb.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/NortonSafeWeb.php
deleted file mode 100644
index 94e086a34..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/NortonSafeWeb.php
+++ /dev/null
@@ -1,23 +0,0 @@
-Norton Safe Web, full details are available from the Norton Safe Web online help.", arguments = { ":norton" = "https://safeweb.norton.com/", ":verify_url" = "https://safeweb.norton.com/help/site_owners" }),
- * name = "norton-safeweb-site-verification",
- * group = "site_verification",
- * weight = 5,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class NortonSafeWeb extends MetaNameBase {
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Pinterest.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Pinterest.php
deleted file mode 100644
index 4c6512f79..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Pinterest.php
+++ /dev/null
@@ -1,23 +0,0 @@
-Pinterest, full details are available from the Pinterest online help.", arguments = { ":pinterest" = "https://www.pinterest.com/", ":verify_url" = "https://help.pinterest.com/en/articles/verify-your-website" }),
- * name = "p:domain_verify",
- * group = "site_verification",
- * weight = 6,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Pinterest extends MetaNameBase {
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Yandex.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Yandex.php
deleted file mode 100644
index 23c050428..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Plugin/metatag/Tag/Yandex.php
+++ /dev/null
@@ -1,23 +0,0 @@
-Yandex, full details are available from the Yandex online help.", arguments = { ":yandex" = "http://www.yandex.com/", ":verify_url" = "http://api.yandex.com/webmaster/doc/dg/reference/hosts-type.xml" }),
- * name = "yandex-verification",
- * group = "site_verification",
- * weight = 8,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Yandex extends MetaNameBase {
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Tests/MetatagVerificationTagsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Tests/MetatagVerificationTagsTest.php
deleted file mode 100644
index 940ede99d..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_verification/src/Tests/MetatagVerificationTagsTest.php
+++ /dev/null
@@ -1,60 +0,0 @@
-getEditable('views.settings');
- $display_extenders = $config->get('display_extenders') ?: [];
- $display_extenders[] = 'metatag_display_extender';
- $config->set('display_extenders', $display_extenders);
- $config->save();
-}
-
-/**
- * Implements hook_uninstall().
- */
-function metatag_views_uninstall() {
- // Disable metatag_display_extender plugin.
- $config = \Drupal::service('config.factory')->getEditable('views.settings');
- $display_extenders = $config->get('display_extenders') ?: [];
-
- $key = array_search('metatag_display_extender', $display_extenders);
- if ($key !== FALSE) {
- unset($display_extenders[$key]);
- $config->set('display_extenders', $display_extenders);
- $config->save();
- }
-}
-
-/**
- * Implementations of hook_update_N().
- */
-
-/**
- * Notify admins that the custom admin pages were (temporarily) disabled.
- */
-function metatag_views_update_8100() {
- return (string) t("The custom admin pages for managing Views meta tags at /admin/config/search/metatag/views have been disabled for now, hopefully they'll be back in a future release. Until then, the meta tags can be managed directly on each individual view via the \"Meta tags\" section.");
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.module b/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.module
deleted file mode 100644
index 02b9e9cd8..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/metatag_views.module
+++ /dev/null
@@ -1,76 +0,0 @@
-getExecutable();
- }
- elseif (is_string($view)) {
- $view = Views::getView($view);
- }
- if (!$view instanceof ViewExecutable) {
- return;
- }
- $view->setDisplay($display_id);
-
- // And get the list of extenders for this display.
- $extenders = $view->getDisplay()->getExtenders();
- if (!isset($extenders['metatag_display_extender'])) {
- // If the id of the plugin is not in the list then something is wrong.
- return;
- }
-
- // Retrieve the metatag settings from the extender.
- return $extenders['metatag_display_extender']->getMetatags();
-}
-
-/**
- * Implements hook_metatags_alter().
- */
-function metatag_views_metatags_alter(array &$metatags, array &$context) {
- if (!$context['entity'] instanceof ViewEntityInterface) {
- return;
- }
-
- $view = $context['entity']->getExecutable();
- // If display_id is not available, will default to Master display.
- $display_id = \Drupal::routeMatch()->getParameter('display_id');
- if ($tags = metatag_get_view_tags($view, $display_id)) {
- // Apply view overrides.
- $metatags = array_merge($metatags, $tags);
- }
-}
-
-/**
- * Implements hook_metatag_route_entity().
- */
-function metatag_views_metatag_route_entity(RouteMatchInterface $route_match) {
- if ($view_id = $route_match->getParameter('view_id')) {
- $entity = \Drupal::entityTypeManager()->getStorage('view')->load($view_id);
- return $entity;
- }
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsController.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsController.php
deleted file mode 100644
index 2ddf0b824..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsController.php
+++ /dev/null
@@ -1,246 +0,0 @@
-viewStorage = $viewStorage;
- $this->metatagManager = $metatagManager;
-
- // Generate the labels for views and displays.
- $this->labels = $this->getViewsAndDisplaysLabels();
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('entity_type.manager')->getStorage('view'),
- $container->get('metatag.manager')
- );
- }
-
- /**
- * Get meta tags for all of the views / displays that have them set.
- *
- * @return array
- * List of tags grouped by view and display.
- */
- public static function getTaggedViews() {
- $tagged_views = [];
- foreach (Views::getEnabledViews() as $view_id => $view) {
- $displays = $view->get('display');
- foreach (array_keys($displays) as $display_id) {
- if ($tags = metatag_get_view_tags($view_id, $display_id)) {
- $tagged_views[$view_id][$display_id] = $tags;
- }
- }
- }
- return $tagged_views;
- }
-
- /**
- * Generates the renderable array for views meta tags UI.
- *
- * @return array
- * The list of details.
- */
- public function listViews() {
- $elements = [];
-
- $elements['header'] = [
- '#markup' => '
' . $this->t("To view a list of displays with meta tags set up, click on a view name. To view a summary of meta tags configuration for a particular display, click on the display name. If you need to set meta tags for a specific view, choose Add views meta tags. Reverting the meta tags removes the specific configuration and falls back to defaults.") . '
',
- ];
-
- // Iterate over the values and build the whole UI.
- // 1. Top level is a collapsible fieldset with a view name (details)
- // 2. Inside each fieldset we have 2 columns -> Display and Operations.
- // Display contains point 3.
- // Operations contain edit and revert.
- // 3. In each display there is a table that has 2 columns: tag name and tag
- // value.
- $tagged_views = $this->getTaggedViews();
- foreach ($tagged_views as $view_id => $displays) {
- $elements[$view_id] = [
- '#type' => 'details',
- '#title' => $this->t($this->viewLabels[$view_id]['#label']),
- 'details' => $this->buildViewDetails($view_id, $displays),
- ];
- }
-
- return $elements;
- }
-
- /**
- * Builds the second "level" of the UI table with display fieldset and ops.
- *
- * @param string $view_id
- * The view display to use.
- * @param array $displays
- * The displays to process.
- *
- * @return array
- * Render array.
- */
- protected function buildViewDetails($view_id, array $displays) {
- $element = [
- '#type' => 'table',
- '#collapsible' => TRUE,
- '#header' => [
- $this->t('Display'),
- $this->t('Operations'),
- ],
- ];
-
- foreach ($displays as $display_id => $metatags) {
- $metatags = array_filter($metatags);
-
- $element[$display_id]['details'] = [
- '#type' => 'details',
- '#title' => $this->viewLabels[$view_id][$display_id],
- ];
-
- $params = [
- 'view_id' => $view_id,
- 'display_id' => $display_id,
- ];
-
- // Generate the operations.
- $element[$display_id]['ops'] = [
- '#type' => 'operations',
- '#links' => [
- 'edit' => [
- 'title' => $this->t('Edit'),
- 'url' => Url::fromRoute('metatag_views.metatags.edit', $params),
- ],
- 'translate' => [
- 'title' => $this->t('Translate'),
- 'url' => Url::fromRoute('metatag_views.metatags.translate_overview', $params),
- ],
- 'revert' => [
- 'title' => $this->t('Revert'),
- 'url' => Url::fromRoute('metatag_views.metatags.revert', $params),
- ],
- ],
- ];
-
- // Build the rows for each of the metatag types.
- $element[$display_id]['details']['table'] = $this->buildDisplayDetailsTable($metatags);
- }
-
- return $element;
- }
-
- /**
- * Build the table with metatag values summary.
- *
- * @param array $tags
- * The tags to process.
- *
- * @return array
- * The tag structure in a display element.
- */
- protected function buildDisplayDetailsTable(array $tags) {
- $element = [
- '#type' => 'table',
- ];
-
- $i = 0;
- foreach ($tags as $tag_name => $tag_value) {
- // This is for the case where we have a subarray.
- $tag_value = $this->prepareTagValue($tag_value);
- if (!$tag_value) {
- continue;
- }
-
- $element[$i]['tag_name'] = [
- '#type' => 'markup',
- '#markup' => $tag_name,
- ];
-
- $element[$i]['tag_value'] = [
- '#type' => 'markup',
- '#markup' => $tag_value,
- ];
- $i++;
- }
-
- return $element;
- }
-
- /**
- * Massage the tag value.
- *
- * @param string $value
- * The meta tag to output.
- *
- * @return string
- * An imploded string for meta tags that are nested, ex. robots.
- */
- protected function prepareTagValue($value) {
- if (is_array($value)) {
- $value = implode(', ', array_filter($value));
- }
-
- return $value;
- }
-
- /**
- * Gets label values for the views and their displays.
- */
- protected function getViewsAndDisplaysLabels() {
- /** @var \Drupal\views\ViewEntityInterface[] $views */
- $views = $this->viewStorage->loadByProperties(['status' => 1]);
-
- $labels = [];
-
- foreach ($views as $view_id => $view) {
- $displays = $view->get('display');
- $labels[$view_id]['#label'] = $view->label();
- foreach (array_keys($displays) as $display_id) {
- $labels[$view_id][$display_id] = $displays[$display_id]['display_title'];
- }
- }
-
- $this->viewLabels = $labels;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsTranslationController.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsTranslationController.php
deleted file mode 100644
index eec9afc6e..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Controller/MetatagViewsTranslationController.php
+++ /dev/null
@@ -1,151 +0,0 @@
-viewStorage = $viewStorage;
- $this->metatagManager = $metatagManager;
- $this->languageManager = $languageManager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('entity_type.manager')->getStorage('view'),
- $container->get('metatag.manager'),
- $container->get('language_manager')
- );
- }
-
- /**
- * Language translations overview page for a views.
- *
- * @return array
- * Page render array.
- */
- public function itemPage() {
- $view_id = \Drupal::request()->get('view_id');
- $display_id = \Drupal::request()->get('display_id');
-
- $view = $this->viewStorage->load($view_id);
- $original_langcode = $view->language()->getId();
-
- $config_name = $view->getConfigDependencyName();
- $config_path = 'display.' . $display_id . '.display_options.display_extenders.metatag_display_extender.metatags';
-
- $configuration = \Drupal::service('config.factory')->get($config_name);
- $config_source = $configuration->getOriginal($config_path, FALSE);
-
- $page['languages'] = [
- '#type' => 'table',
- '#header' => [$this->t('Language'), $this->t('Operations')],
- ];
-
- $languages = $this->languageManager->getLanguages();
- foreach ($languages as $language) {
- $langcode = $language->getId();
- $language_name = $language->getName();
- $operations = [];
-
- // Prepare the language name and the operations depending on whether this
- // is the original language or not.
- if ($langcode == $original_langcode) {
- $language_name = '' . $this->t('@language (original)', [
- '@language' => $language_name,
- ]) . '';
-
- // Default language can only be edited, no add/delete.
- $operations['edit'] = [
- 'title' => $this->t('Edit'),
- 'url' => Url::fromRoute('metatag_views.metatags.edit', [
- 'view_id' => $view_id,
- 'display_id' => $display_id,
- ]),
- ];
- }
- else {
- // Get the metatag translation for this language.
- $config_translation = $this->languageManager
- ->getLanguageConfigOverride($langcode, $config_name)
- ->get($config_path);
-
- // If no translation exists for this language, link to add one.
- if (!$config_translation || $config_translation == $config_source) {
- $operations['add'] = [
- 'title' => $this->t('Add'),
- 'url' => Url::fromRoute('metatag_views.metatags.translate', [
- 'view_id' => $view_id,
- 'display_id' => $display_id,
- 'langcode' => $langcode,
- ]),
- ];
- }
- else {
- // Otherwise, link to edit the existing translation.
- $operations['edit'] = [
- 'title' => $this->t('Edit'),
- 'url' => Url::fromRoute('metatag_views.metatags.translate', [
- 'view_id' => $view_id,
- 'display_id' => $display_id,
- 'langcode' => $langcode,
- ]),
- ];
- // @todo Operations delete.
- }
- }
-
- $page['languages'][$langcode]['language'] = [
- '#markup' => $language_name,
- ];
-
- $page['languages'][$langcode]['operations'] = [
- '#type' => 'operations',
- '#links' => $operations,
- // Even if the mapper contains multiple language codes, the source
- // configuration can still be edited.
- // '#access' => ($langcode == $original_langcode) || $operations_access,
- ];
- }
-
- return $page;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsAddForm.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsAddForm.php
deleted file mode 100644
index 476293df9..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsAddForm.php
+++ /dev/null
@@ -1,49 +0,0 @@
- $displays) {
- foreach (array_keys($displays) as $display_id) {
- unset($views[$view_id][$view_id . ':' . $display_id]);
- }
- }
- $views = array_filter($views);
-
- // Need to create that AFTER the $form['metatags'] as the whole form
- // is passed to the $metatagManager->form() which causes duplicated field.
- $form['view']['#type'] = 'select';
- $form['view']['#options'] = $views;
- $form['view']['#empty_option'] = $this->t('- Select a view -');
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsEditForm.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsEditForm.php
deleted file mode 100644
index 0e395e842..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsEditForm.php
+++ /dev/null
@@ -1,194 +0,0 @@
-metatagManager = $metatag_manager;
- $this->viewsManager = $entity_manager->getStorage('view');
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('metatag.manager'),
- $container->get('entity_type.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'metatag_views_edit_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- // Get the parameters from request.
- $view_id = \Drupal::request()->get('view_id');
- $display_id = \Drupal::request()->get('display_id');
-
- // Get meta tags from the view entity.
- $metatags = [];
- if ($view_id && $display_id) {
- $metatags = metatag_get_view_tags($view_id, $display_id);
- }
-
- $form['metatags'] = $this->metatagManager->form($metatags, $form, ['view']);
- $form['metatags']['#title'] = $this->t('Metatags');
- $form['metatags']['#type'] = 'fieldset';
-
- // Need to create that AFTER the $form['metatags'] as the whole form is
- // passed to the $metatagManager->form() which causes duplicated field.
- $form['view'] = [
- '#type' => 'value',
- '#title' => $this->t('View'),
- '#weight' => -100,
- '#default_value' => $view_id . ':' . $display_id,
- '#required' => TRUE,
- ];
-
- $form['actions']['submit'] = [
- '#type' => 'submit',
- '#value' => $this->t('Submit'),
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function form(array $values, array $element, array $token_types = [], array $included_groups = NULL, array $included_tags = NULL) {
- // Add the outer fieldset.
- $element += [
- '#type' => 'details',
- ];
-
- $element += $this->tokenService->tokenBrowser($token_types);
-
- $groups_and_tags = $this->sortedGroupsWithTags();
-
- $first = TRUE;
- foreach ($groups_and_tags as $group_id => $group) {
- // Only act on groups that have tags and are in the list of included
- // groups (unless that list is null).
- if (isset($group['tags']) && (is_null($included_groups) || in_array($group_id, $included_groups))) {
- // Create the fieldset.
- $element[$group_id]['#type'] = 'details';
- $element[$group_id]['#title'] = $group['label'];
- $element[$group_id]['#description'] = $group['description'];
- $element[$group_id]['#open'] = $first;
- $first = FALSE;
-
- foreach ($group['tags'] as $tag_id => $tag) {
- // Only act on tags in the included tags list, unless that is null.
- if (is_null($included_tags) || in_array($tag_id, $included_tags)) {
- // Make an instance of the tag.
- $tag = $this->tagPluginManager->createInstance($tag_id);
-
- // Set the value to the stored value, if any.
- $tag_value = isset($values[$tag_id]) ? $values[$tag_id] : NULL;
- $tag->setValue($tag_value);
-
- // Create the bit of form for this tag.
- $element[$group_id][$tag_id] = $tag->form($element);
- }
- }
- }
- }
-
- return $element;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- // Get the submitted form values.
- $view_name = $form_state->getValue('view');
- list($view_id, $display_id) = explode(':', $view_name);
-
- $metatags = $form_state->getValues();
- unset($metatags['view']);
- $metatags = $this->clearMetatagViewsDisallowedValues($metatags);
-
- /** @var \Drupal\views\ViewEntityInterface $view */
- $view = $this->viewsManager->load($view_id);
-
- // Store the meta tags on the view.
- $config_name = $view->getConfigDependencyName();
- $config_path = 'display.' . $display_id . '.display_options.display_extenders.metatag_display_extender.metatags';
-
- // Set configuration values based on form submission. This always edits the
- // original language.
- $configuration = $this->configFactory()->getEditable($config_name);
- if (empty($this->removeEmptyTags($metatags))) {
- $configuration->clear($config_path);
- }
- else {
- $configuration->set($config_path, $metatags);
- }
- $configuration->save();
-
- // Redirect back to the views list.
- $form_state->setRedirect('metatag_views.metatags.list');
-
- drupal_set_message($this->t('Metatags for @view : @display have been saved.', [
- '@view' => $view->label(),
- '@display' => $view->getDisplay($display_id)['display_title'],
- ]));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsRevertForm.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsRevertForm.php
deleted file mode 100644
index 1bd585929..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsRevertForm.php
+++ /dev/null
@@ -1,132 +0,0 @@
-viewsManager = $entity_manager->getStorage('view');
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('entity_type.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'metatag_views_revert_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getQuestion() {
- return $this->t('Do you want to revert meta tags for @view_name : @display_name?', [
- '@view_name' => $this->view->label(),
- '@display_name' => $this->view->getDisplay($this->displayId)['display_title'],
- ]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('metatag_views.metatags.list');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return $this->t('You are about to revert the custom meta tags for the %display_name display on the %view_name view. This action cannot be undone.', [
- '%view_name' => $this->view->label(),
- '%display_name' => $this->view->getDisplay($this->displayId)['display_title'],
- ]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Revert');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelText() {
- return $this->t('Cancel');
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state, $view_id = NULL, $display_id = NUL) {
- $this->view = $this->viewsManager->load($view_id);
- $this->displayId = $display_id;
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- // Removed meta tags from the view.
- $config_name = $this->view->getConfigDependencyName();
- $config_path = 'display.' . $this->displayId . '.display_options.display_extenders.metatag_display_extender.metatags';
-
- $this->configFactory()->getEditable($config_name)
- ->clear($config_path)
- ->save();
-
- // Redirect back to the views list.
- $form_state->setRedirect('metatag_views.metatags.list');
-
- drupal_set_message($this->t('Reverted meta tags for @view_name : @display_name', [
- '@view_name' => $this->view->label(),
- '@display_name' => $this->view->getDisplay($this->displayId)['display_title'],
- ]));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php
deleted file mode 100644
index 88875c0a6..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Form/MetatagViewsTranslationForm.php
+++ /dev/null
@@ -1,269 +0,0 @@
-metatagManager = $metatag_manager;
- $this->viewsManager = $entity_manager->getStorage('view');
- $this->tokenService = $token;
- $this->tagPluginManager = $tagPluginManager;
- $this->languageManager = $language_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('metatag.manager'),
- $container->get('entity_type.manager'),
- $container->get('metatag.token'),
- $container->get('plugin.manager.metatag.tag'),
- $container->get('language_manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'metatag_views_translate_form';
- }
-
- /**
- * Gets the translated values while storing a copy of the original values.
- */
- protected function prepareValues() {
- $config_name = $this->view->getConfigDependencyName();
- $config_path = 'display.' . $this->displayId . '.display_options.display_extenders.metatag_display_extender.metatags';
-
- $configuration = \Drupal::service('config.factory')->get($config_name);
- $this->baseData = $configuration->getOriginal($config_path, FALSE);
-
- // Set the translation target language on the configuration factory.
- $original_language = $this->languageManager->getConfigOverrideLanguage();
- $this->languageManager->setConfigOverrideLanguage($this->language);
-
- // Read in translated values.
- $configuration = \Drupal::service('config.factory')->get($config_name);
- $translated_values = $configuration->get($config_path);
-
- // Set the configuration language back.
- $this->languageManager->setConfigOverrideLanguage($original_language);
-
- return $translated_values;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- // Get the parameters from request.
- $this->viewId = \Drupal::request()->get('view_id');
- $this->displayId = \Drupal::request()->get('display_id');
- $langcode = \Drupal::request()->get('langcode');
-
- $this->view = $this->viewsManager->load($this->viewId);
- $this->language = $this->languageManager->getLanguage($langcode);
- $this->sourceLanguage = $this->view->language();
-
- // Get meta tags from the view entity.
- $form['#tree'] = TRUE;
- $form['#attached']['library'][] = 'config_translation/drupal.config_translation.admin';
-
- $form['#title'] = $this->t('Edit @language translation for %view: %display metatags', [
- '%view' => $this->view->label(),
- '%display' => $this->view->getDisplay($this->displayId)['display_title'],
- '@language' => $this->language->getName(),
- ]);
-
- $form['metatags'] = $this->form($form, $this->prepareValues());
- $form['metatags']['#title'] = t('Metatags');
- $form['metatags']['#type'] = 'fieldset';
-
- $form['submit'] = [
- '#type' => 'submit',
- '#value' => t('Submit'),
- ];
-
- return $form;
- }
-
- /**
- * Add the translation form element for meta tags available in the source.
- */
- public function form(array $element, array $translated_values) {
- $translated_values = $this->clearMetatagViewsDisallowedValues($translated_values);
- // Only offer form elements for tags present in the source language.
- $source_values = $this->removeEmptyTags($this->baseData);
-
- // Add the outer fieldset.
- $element += [
- '#type' => 'details',
- ];
- $element += $this->tokenService->tokenBrowser(['view']);
-
- foreach ($source_values as $tag_id => $value) {
- $tag = $this->tagPluginManager->createInstance($tag_id);
- $tag->setValue($translated_values[$tag_id]);
-
- $form_element = $tag->form($element);
- $element[$tag_id] = [
- '#theme' => 'config_translation_manage_form_element',
- 'source' => [
- '#type' => 'item',
- '#title' => $form_element['#title'],
- '#markup' => $value,
- ],
- 'translation' => $form_element,
- ];
- }
-
- return $element;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- // Get the values of metatags.
- $values = $form_state->getValue('metatags');
- $translated_values = array_combine(array_keys($values), array_column($values, 'translation'));
-
- $config_name = $this->view->getConfigDependencyName();
- $config_path = 'display.' . $this->displayId . '.display_options.display_extenders.metatag_display_extender.metatags';
-
- // Set configuration values based on form submission and source values.
- $base_config = $this->configFactory()->getEditable($config_name);
- $config_translation = $this->languageManager->getLanguageConfigOverride($this->language->getId(), $config_name);
-
- // Save the configuration values, if they are different from the source
- // values in the base configuration. Otherwise remove the override.
- $source_values = $this->removeEmptyTags($base_config->get($config_path));
- if ($source_values !== $translated_values) {
- $config_translation->set($config_path, $translated_values);
- }
- else {
- $config_translation->clear($config_path);
- }
-
- // If no overrides, delete language specific configuration file.
- $saved_config = $config_translation->get();
- if (empty($saved_config)) {
- $config_translation->delete();
- }
- else {
- $config_translation->save();
- }
-
- // Redirect back to the views list.
- $form_state->setRedirect('metatag_views.metatags.translate_overview', [
- 'view_id' => $this->viewId,
- 'display_id' => $this->displayId,
- ]);
-
- drupal_set_message($this->t('Successfully updated @language translation.', [
- '@language' => $this->language->getName(),
- ]));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/MetatagViewsValuesCleanerTrait.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/MetatagViewsValuesCleanerTrait.php
deleted file mode 100644
index a13f8a2bd..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/MetatagViewsValuesCleanerTrait.php
+++ /dev/null
@@ -1,44 +0,0 @@
-metatagManager->sortedTags();
-
- // Return only common elements.
- $metatags = array_intersect_key($metatags, $tags);
-
- return $metatags;
- }
-
- /**
- * Removes tags that are empty.
- */
- public function removeEmptyTags($metatags) {
- $metatags = array_filter($metatags, function ($value) {
- if (is_array($value)) {
- return count(array_filter($value)) > 0;
- }
- else {
- return $value !== '';
- }
- });
- return $metatags;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php b/sites/all/modules/contrib/admin/metatag/metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php
deleted file mode 100644
index c31a4e825..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/src/Plugin/views/display_extender/MetatagDisplayExtender.php
+++ /dev/null
@@ -1,187 +0,0 @@
-metatagTagManager = $metatag_plugin_manager;
- $this->metatagManager = $metatag_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('plugin.manager.metatag.tag'),
- $container->get('metatag.manager')
- );
- }
-
- /**
- * Provide a form to edit options for this plugin.
- */
- public function buildOptionsForm(&$form, FormStateInterface $form_state) {
-
- if ($form_state->get('section') == 'metatags') {
- $form['#title'] .= t('The meta tags for this display');
- $metatags = $this->getMetatags();
-
- // Build/inject the Metatag form.
- $form['metatags'] = $this->metatagManager->form($metatags, $form, ['view']);
- }
- }
-
- /**
- * Validate the options form.
- */
- public function validateOptionsForm(&$form, FormStateInterface $form_state) {
- }
-
- /**
- * Handle any special handling on the validate form.
- */
- public function submitOptionsForm(&$form, FormStateInterface $form_state) {
- if ($form_state->get('section') == 'metatags') {
- // Process submitted metatag values and remove empty tags.
- $tag_values = [];
- $metatags = $form_state->cleanValues()->getValues();
- foreach ($metatags as $tag_id => $tag_value) {
- // Some plugins need to process form input before storing it.
- // Hence, we set it and then get it.
- $tag = $this->metatagTagManager->createInstance($tag_id);
- $tag->setValue($tag_value);
- if (!empty($tag->value())) {
- $tag_values[$tag_id] = $tag->value();
- }
- }
- $this->options['metatags'] = $tag_values;
- }
- }
-
- /**
- * Set up any variables on the view prior to execution.
- */
- public function preExecute() {
- }
-
- /**
- * Inject anything into the query that the display_extender handler needs.
- */
- public function query() {
- }
-
- /**
- * Provide the default summary for options in the views UI.
- *
- * This output is returned as an array.
- */
- public function optionsSummary(&$categories, &$options) {
- $categories['metatags'] = [
- 'title' => t('Meta tags'),
- 'column' => 'second',
- ];
- $options['metatags'] = [
- 'category' => 'metatags',
- 'title' => t('Meta tags'),
- 'value' => $this->hasMetatags() ? t('Overridden') : t('Using defaults'),
- ];
- }
-
- /**
- * Lists defaultable sections and items contained in each section.
- */
- public function defaultableSections(&$sections, $section = NULL) {
- }
-
- /**
- * Identify whether or not the current display has custom meta tags defined.
- *
- * @return bool
- * Whether or not the view has overridden metatags.
- */
- protected function hasMetatags() {
- $metatags = $this->getMetatags();
- return !empty($metatags);
-
- }
-
- /**
- * Get the Metatag configuration for this display.
- *
- * @return array
- * The meta tag values.
- */
- public function getMetatags() {
- $metatags = [];
-
- if (!empty($this->options['metatags'])) {
- $metatags = $this->options['metatags'];
- }
-
- return $metatags;
- }
-
- /**
- * Sets the meta tags for the given view.
- *
- * @param array $metatags
- * Metatag arrays as suitable for storage.
- */
- public function setMetatags(array $metatags) {
- $this->options['metatags'] = $metatags;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/templates/config_translation_manage_form_element.html.twig b/sites/all/modules/contrib/admin/metatag/metatag_views/templates/config_translation_manage_form_element.html.twig
deleted file mode 100644
index 4c1459be8..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/templates/config_translation_manage_form_element.html.twig
+++ /dev/null
@@ -1,23 +0,0 @@
-{#
-/**
- * @file
- * Default theme implementation for a form element in config_translation.
- *
- * Available variables:
- * - element: Array that represents the element shown in the form.
- * - source: The source of the translation.
- * - translation: The translation for the target language.
- *
- * @see template_preprocess()
- *
- * @ingroup themeable
- */
-#}
-
-
- {{ element.source }}
-
-
- {{ element.translation }}
-
-
diff --git a/sites/all/modules/contrib/admin/metatag/metatag_views/tests/src/Functional/MetatagViewsBasicsTest.php b/sites/all/modules/contrib/admin/metatag/metatag_views/tests/src/Functional/MetatagViewsBasicsTest.php
deleted file mode 100644
index 3aa3e80aa..000000000
--- a/sites/all/modules/contrib/admin/metatag/metatag_views/tests/src/Functional/MetatagViewsBasicsTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-install([$theme]);
- \Drupal::service('theme_handler')->setDefault($theme);
-
- // Place the local actions block in the theme so that we can assert the
- // presence of local actions and such.
- $this->drupalPlaceBlock('local_actions_block', [
- 'region' => 'content',
- 'theme' => $theme,
- ]);
- }
-
- /**
- * Confirm the site isn't broken.
- */
- public function testSiteStillWorks() {
- // Load the front page.
- $this->drupalGet('');
- $this->assertResponse(200);
-
- // With nothing else configured the front page just has a login form.
- $this->assertText('Enter your Drupal username.');
-
- // Log in as user 1.
- $this->loginUser1();
-
- // Load the main Views admin page.
- $this->drupalGet('/admin/structure/views');
- $this->assertResponse(200);
-
- // Enable the Archive view. This should be the first such link while the
- // gallery is the second.
- $this->clickLink('Enable', 0);
-
- // Confirm the archive page works.
- $this->drupalGet('/archive');
- $this->assertResponse(200);
-
- // Confirm what the page title looks like by default.
- $this->assertTitle('Monthly archive | Drupal');
-
- // Load the Arcive view.
- $this->drupalGet('/admin/structure/views/view/archive');
- $this->assertResponse(200);
-
- // Confirm that the Metatag options are present.
- $this->assertText('Meta tags:');
-
- // Confirm that the page is currently using defaults.
- $this->assertText('Using defaults');
-
- // Open the 'page' configuration.
- $this->clickLink('Page');
-
- // Confirm that no changes have been made yet.
- $this->assertNoText('Overridden');
-
- // Open the settings dialog.
- $this->clickLink('Using defaults');
-
- // Confirm the settings opened and it has some basic fields.
- $this->assertText('Configure the meta tags below.');
- $this->assertFieldByName('title');
- $this->assertFieldByName('description');
- $this->assertFieldByName('op');
- $edit = [
- 'title' => 'Metatag title',
- 'description' => 'Metatag description.',
- ];
- $this->drupalPostForm(NULL, $edit, 'Apply');
-
- // Confirm the Metatag settings are now overridden.
- $this->assertText('Overridden');
-
- // @todo Confirm there's now a "save" button.
- // Save the changes.
- $edit = [];
- $this->drupalPostForm(NULL, $edit, 'Save');
-
- // @todo Confirm the page saved.
- // Load the archives page again.
- $this->drupalGet('/archive');
- $this->assertResponse(200);
-
- // Confirm what the page title looks like now.
- $this->assertTitle('Metatag title');
-
- // Load the Metatag admin page to confirm it still works.
- $this->drupalGet('admin/config/search/metatag');
- $this->assertResponse(200);
- $this->assertText('Add default meta tags');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagGroup.php b/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagGroup.php
deleted file mode 100644
index 873cdb078..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Annotation/MetatagGroup.php
+++ /dev/null
@@ -1,44 +0,0 @@
-generator = $generator;
- $this->extensionManager = $extensionManager;
- $this->chainQueue = $chainQueue;
-
- parent::__construct();
- }
-
- /**
- * {@inheritdoc}
- */
- protected function configure() {
- $this
- ->setName('generate:plugin:metatag:group')
- ->setDescription($this->trans('commands.generate.metatag.group.description'))
- ->setHelp($this->trans('commands.generate.metatag.group.help'))
- ->addOption('base_class', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.common.options.base_class'))
- ->addOption('module', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.common.options.module'))
- ->addOption('label', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.group.options.label'))
- ->addOption('description', '', InputOption::VALUE_OPTIONAL,
- $this->trans('commands.generate.metatag.group.options.description'))
- ->addOption('plugin-id', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.group.options.plugin_id'))
- ->addOption('class-name', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.group.options.class_name'))
- ->addOption('weight', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.group.options.weight'));
- }
-
- /**
- * {@inheritdoc}
- */
- protected function execute(InputInterface $input, OutputInterface $output) {
- $io = new DrupalStyle($input, $output);
-
- // @see Drupal\Console\Command\ConfirmationTrait::confirmGeneration
- if (!$this->confirmGeneration($io)) {
- return 1;
- }
-
- $base_class = $input->getOption('base_class');
- $module = $input->getOption('module');
- $label = $input->getOption('label');
- $description = $input->getOption('description');
- $plugin_id = $input->getOption('plugin-id');
- $class_name = $input->getOption('class-name');
- $weight = $input->getOption('weight');
-
- $this->generator
- ->generate($base_class, $module, $label, $description, $plugin_id, $class_name, $weight);
-
- $this->chainQueue->addCommand('cache:rebuild', ['cache' => 'discovery']);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function interact(InputInterface $input, OutputInterface $output) {
- $io = new DrupalStyle($input, $output);
-
- // --base_class option.
- // @todo Turn this into a choice() option.
- $base_class = $input->getOption('base_class');
- if (empty($base_class)) {
- $base_class = $io->ask(
- $this->trans('commands.generate.metatag.group.questions.base_class'),
- 'GroupBase'
- );
- }
- $input->setOption('base_class', $base_class);
-
- // --module option.
- $module = $input->getOption('module');
- if (empty($module)) {
- // @see Drupal\AppConsole\Command\Helper\ModuleTrait::moduleQuestion
- $module = $this->moduleQuestion($io);
- }
- $input->setOption('module', $module);
-
- // --label option.
- $label = $input->getOption('label');
- if (empty($label)) {
- $label = $io->ask(
- $this->trans('commands.generate.metatag.group.questions.label')
- );
- }
- $input->setOption('label', $label);
-
- // --description option.
- $description = $input->getOption('description');
- if (empty($description)) {
- $description = $io->ask(
- $this->trans('commands.generate.metatag.group.questions.description')
- );
- }
- $input->setOption('description', $description);
-
- // --plugin-id option.
- $plugin_id = $input->getOption('plugin-id');
- if (empty($plugin_id)) {
- $plugin_id = $io->ask(
- $this->trans('commands.generate.metatag.group.questions.plugin_id')
- );
- }
- $input->setOption('plugin-id', $plugin_id);
-
- // --class-name option.
- $class_name = $input->getOption('class-name');
- if (empty($class_name)) {
- $class_name = $io->ask(
- $this->trans('commands.generate.metatag.group.questions.class_name')
- );
- }
- $input->setOption('class-name', $class_name);
-
- // --weight option.
- // @todo Automatically get the next int value based upon the current group.
- $weight = $input->getOption('weight');
- if (is_null($weight)) {
- $weight = $io->ask(
- $this->trans('commands.generate.metatag.group.questions.weight'),
- 0
- );
- }
- $input->setOption('weight', $weight);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Command/GenerateTagCommand.php b/sites/all/modules/contrib/admin/metatag/src/Command/GenerateTagCommand.php
deleted file mode 100644
index f5a829aed..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Command/GenerateTagCommand.php
+++ /dev/null
@@ -1,367 +0,0 @@
-metatagManager = $metatagManager;
- $this->generator = $generator;
- $this->extensionManager = $extensionManager;
- $this->stringConverter = $stringConverter;
- $this->chainQueue = $chainQueue;
-
- parent::__construct();
- }
-
- /**
- * {@inheritdoc}
- */
- protected function configure() {
- $this
- ->setName('generate:plugin:metatag:tag')
- ->setDescription($this->trans('commands.generate.metatag.tag.description'))
- ->setHelp($this->trans('commands.generate.metatag.tag.help'))
- ->addOption('base_class', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.common.options.base_class'))
- ->addOption('module', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.common.options.module'))
- ->addOption('name', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.name'))
- ->addOption('label', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.label'))
- ->addOption('description', '', InputOption::VALUE_OPTIONAL,
- $this->trans('commands.generate.metatag.tag.options.description'))
- ->addOption('plugin-id', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.plugin_id'))
- ->addOption('class-name', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.class_name'))
- ->addOption('group', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.group'))
- ->addOption('weight', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.weight'))
- ->addOption('type', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.type'))
- ->addOption('secure', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.secure'))
- ->addOption('multiple', '', InputOption::VALUE_REQUIRED,
- $this->trans('commands.generate.metatag.tag.options.multiple'));
- }
-
- /**
- * {@inheritdoc}
- */
- protected function execute(InputInterface $input, OutputInterface $output) {
- $io = new DrupalStyle($input, $output);
-
- // @see Drupal\Console\Command\ConfirmationTrait::confirmGeneration
- if (!$this->confirmGeneration($io)) {
- return 1;
- }
-
- $base_class = $input->getOption('base_class');
- $module = $input->getOption('module');
- $name = $input->getOption('name');
- $label = $input->getOption('label');
- $description = $input->getOption('description');
- $plugin_id = $input->getOption('plugin-id');
- $class_name = $input->getOption('class-name');
- $group = $input->getOption('group');
- $weight = $input->getOption('weight');
- $type = $input->getOption('type');
- $secure = $input->getOption('secure');
- $multiple = $input->getOption('multiple');
-
- $this->generator
- ->generate($base_class, $module, $name, $label, $description, $plugin_id, $class_name, $group, $weight, $type, $secure, $multiple);
-
- $this->chainQueue->addCommand('cache:rebuild', ['cache' => 'discovery']);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function interact(InputInterface $input, OutputInterface $output) {
-
- $io = new DrupalStyle($input, $output);
-
- $boolean_options = [
- 'FALSE',
- 'TRUE',
- ];
-
- // @todo Take this from typed data, so it can be extended?
- $type_options = [
- 'integer',
- 'string',
- 'label',
- 'uri',
- 'image',
- ];
-
- // --base_class option.
- // @todo Turn this into a choice() option.
- $base_class = $input->getOption('base_class');
- if (empty($base_class)) {
- $base_class = $io->ask(
- $this->trans('commands.generate.metatag.tag.questions.base_class'),
- 'MetaNameBase'
- );
- }
- $input->setOption('base_class', $base_class);
-
- // --module option.
- $module = $input->getOption('module');
- if (empty($module)) {
- // @see Drupal\AppConsole\Command\Helper\ModuleTrait::moduleQuestion
- $module = $this->moduleQuestion($io);
- }
- $input->setOption('module', $module);
-
- // --name option.
- // @todo Add validation.
- $name = $input->getOption('name');
- if (empty($name)) {
- $name = $io->ask(
- $this->trans('commands.generate.metatag.tag.questions.name')
- );
- }
- $input->setOption('name', $name);
-
- // --label option.
- $label = $input->getOption('label');
- if (empty($label)) {
- $label = $io->ask(
- $this->trans('commands.generate.metatag.tag.questions.label'),
- $name
- );
- }
- $input->setOption('label', $label);
-
- // --description option.
- $description = $input->getOption('description');
- if (empty($description)) {
- $description = $io->ask(
- $this->trans('commands.generate.metatag.tag.questions.description')
- );
- }
- $input->setOption('description', $description);
-
- // --plugin-id option.
- $plugin_id = $input->getOption('plugin-id');
- if (empty($plugin_id)) {
- $plugin_id = $this->nameToPluginId($name);
- $plugin_id = $io->ask(
- $this->trans('commands.generate.metatag.tag.questions.plugin_id'),
- $plugin_id
- );
- }
- $input->setOption('plugin-id', $plugin_id);
-
- // --class-name option.
- $class_name = $input->getOption('class-name');
- if (empty($class_name)) {
- $class_name = $this->nameToClassName($name);
- $class_name = $io->ask(
- $this->trans('commands.generate.metatag.tag.questions.class_name'),
- $class_name
- );
- }
- $input->setOption('class-name', $class_name);
-
- // --group option.
- $group = $input->getOption('group');
- if (empty($group)) {
- $groups = $this->getGroups();
- $group = $io->choice(
- $this->trans('commands.generate.metatag.tag.questions.group'),
- $groups
- );
- }
- $input->setOption('group', $group);
-
- // --weight option.
- // @todo Automatically get the next int value based upon the current group.
- $weight = $input->getOption('weight');
- if (is_null($weight)) {
- $weight = $io->ask(
- $this->trans('commands.generate.metatag.tag.questions.weight'),
- 0
- );
- }
- $input->setOption('weight', $weight);
-
- // --type option.
- // @todo Turn this into an option.
- $type = $input->getOption('type');
- if (is_null($type)) {
- $type = $io->choice(
- $this->trans('commands.generate.metatag.tag.questions.type'),
- $type_options,
- 0
- );
- }
- $input->setOption('type', $type);
-
- // --secure option.
- // @todo Turn this into an option.
- $secure = $input->getOption('secure');
- if (is_null($secure)) {
- $secure = $io->choice(
- $this->trans('commands.generate.metatag.tag.questions.secure'),
- $boolean_options,
- 0
- );
- }
- $input->setOption('secure', $secure);
-
- // --multiple option.
- $multiple = $input->getOption('multiple');
- if (is_null($multiple)) {
- $multiple = $io->choice(
- $this->trans('commands.generate.metatag.tag.questions.multiple'),
- $boolean_options,
- 0
- );
- }
- $input->setOption('multiple', $multiple);
- }
-
- /**
- * Convert the meta tag's name to a plugin ID.
- *
- * @param string $name
- * The meta tag name to convert.
- *
- * @return string
- * The original string with all non-alphanumeric characters converted to
- * underline chars.
- */
- private function nameToPluginId($name) {
- return $this->stringConverter->createMachineName($name);
- }
-
- /**
- * Convert the meta tag's name to a class name.
- *
- * @param string $name
- * The meta tag name to convert.
- *
- * @return string
- * The original string with all non-alphanumeric characters removed and
- * converted to CamelCase.
- */
- private function nameToClassName($name) {
- return $this->stringConverter->humanToCamelCase($name);
- }
-
- /**
- * All of the meta tag groups.
- *
- * @return array
- * A list of the available groups.
- */
- private function getGroups() {
- return array_keys($this->metatagManager->sortedGroups());
- }
-
- /**
- * Confirm that a requested group exists.
- *
- * @param string $group
- * A group's machine name.
- *
- * @return string
- * The group's name, if available, otherwise an empty string.
- */
- private function validateGroupExist($group) {
- $groups = $this->getGroups();
- if (isset($groups[$group])) {
- return $group;
- }
- return '';
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Entity/MetatagDefaults.php b/sites/all/modules/contrib/admin/metatag/src/Entity/MetatagDefaults.php
deleted file mode 100644
index da9a8efbb..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Entity/MetatagDefaults.php
+++ /dev/null
@@ -1,146 +0,0 @@
-tags);
- }
-
- /**
- * Returns the value of a tag.
- *
- * @param string $tag_id
- * The identifier of the tag.
- *
- * @return array|null
- * Array containing the tag values or NULL if not found.
- */
- public function getTag($tag_id) {
- if (!$this->hasTag($tag_id)) {
- return NULL;
- }
- return $this->tags[$tag_id];
- }
-
- /**
- * Reverts an entity to its default values.
- */
- public function revert() {
- $default_install_path = drupal_get_path('module', 'metatag') . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;
- $storage = new FileStorage($default_install_path, StorageInterface::DEFAULT_COLLECTION);
- $default_config_data = $storage->read('metatag.metatag_defaults.' . $this->id());
- if ($default_config_data) {
- $this->set('tags', $default_config_data['tags']);
- $this->save();
- }
- }
-
- /**
- * Overwrite the current tags with new values.
- */
- public function overwriteTags(array $new_tags = []) {
- if (!empty($new_tags)) {
- // Get the existing tags.
- $combined_tags = $this->get('tags');
-
- // Loop over the new tags, adding them to the existing tags.
- foreach ($new_tags as $tag_name => $data) {
- $combined_tags[$tag_name] = $data;
- }
-
- // Save the combination of the existing tags + the new tags.
- $this->set('tags', $combined_tags);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) {
- // Put always Global in 1st place and front page later if available.
- if ($a->id() == 'global') {
- return -1;
- }
- elseif ($b->id() == 'global') {
- return 1;
- }
- elseif ($a->id() == 'front') {
- return -1;
- }
- elseif ($b->id() == 'front') {
- return 1;
- }
-
- // Use the default sort function.
- return parent::sort($a, $b);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsDeleteForm.php b/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsDeleteForm.php
deleted file mode 100644
index 1bc150d52..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsDeleteForm.php
+++ /dev/null
@@ -1,52 +0,0 @@
-t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('entity.metatag_defaults.collection');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Delete');
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->entity->delete();
-
- drupal_set_message(
- $this->t('Deleted @label defaults.',
- [
- '@label' => $this->entity->label(),
- ]
- )
- );
-
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsForm.php b/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsForm.php
deleted file mode 100644
index ee2997237..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsForm.php
+++ /dev/null
@@ -1,319 +0,0 @@
-entity;
- $metatag_manager = \Drupal::service('metatag.manager');
-
- $form['#ajax_wrapper_id'] = 'metatag-defaults-form-ajax-wrapper';
- $ajax = [
- 'wrapper' => $form['#ajax_wrapper_id'],
- 'callback' => '::rebuildForm',
- ];
- $form['#prefix'] = '
';
- $form['#suffix'] = '
';
-
- $default_type = NULL;
- if (!empty($metatag_defaults)) {
- $default_type = $metatag_defaults->getOriginalId();
- }
- else {
- $form_state->set('default_type', $default_type);
- }
-
- $token_types = empty($default_type) ? [] : [explode('__', $default_type)[0]];
-
- // Add the token browser at the top.
- $form += \Drupal::service('metatag.token')->tokenBrowser($token_types);
-
- // If this is a new Metatag defaults, then list available bundles.
- if ($metatag_defaults->isNew()) {
- $options = $this->getAvailableBundles();
- $form['id'] = [
- '#type' => 'select',
- '#title' => $this->t('Type'),
- '#description' => $this->t('Select the type of default meta tags you would like to add.'),
- '#options' => $options,
- '#required' => TRUE,
- '#default_value' => $default_type,
- '#ajax' => $ajax + [
- 'trigger_as' => [
- 'name' => 'select_id_submit',
- ],
- ],
- ];
- $form['select_id_submit'] = [
- '#type' => 'submit',
- '#value' => $this->t('Submit'),
- '#name' => 'select_id_submit',
- '#ajax' => $ajax,
- '#attributes' => [
- 'class' => ['js-hide'],
- ],
- ];
- $values = [];
- }
- else {
- $values = $metatag_defaults->get('tags');
- }
-
- // Retrieve configuration settings.
- $settings = $this->config('metatag.settings');
- $entity_type_groups = $settings->get('entity_type_groups');
-
- // Find the current entity type and bundle.
- $metatag_defaults_id = $metatag_defaults->id();
- $type_parts = explode('__', $metatag_defaults_id);
- $entity_type = $type_parts[0];
- $entity_bundle = isset($type_parts[1]) ? $type_parts[1] : NULL;
-
- // See if there are requested groups for this entity type and bundle.
- $groups = !empty($entity_type_groups[$entity_type]) && !empty($entity_type_groups[$entity_type][$entity_bundle]) ? $entity_type_groups[$entity_type][$entity_bundle] : [];
- // Limit the form to requested groups, if any.
- if (!empty($groups)) {
- $form = $metatag_manager->form($values, $form, [$entity_type], $groups);
- }
- // Otherwise, display all groups.
- else {
- $form = $metatag_manager->form($values, $form);
- }
-
- return $form;
- }
-
- /**
- * Ajax form submit handler that will return the whole rebuilt form.
- *
- * @param array $form
- * An associative array containing the structure of the form.
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * The current state of the form.
- *
- * @return array
- * The form structure.
- */
- public function rebuildForm(array &$form, FormStateInterface $form_state) {
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- protected function actions(array $form, FormStateInterface $form_state) {
- $actions = parent::actions($form, $form_state);
- if (isset($actions['delete'])) {
- $actions['delete']['#access'] = $actions['delete']['#access'] && !in_array($this->entity->id(), MetatagManager::protectedDefaults());
- }
- return $actions;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- if ($form_state->getTriggeringElement()['#name'] == 'select_id_submit') {
- $form_state->set('default_type', $form_state->getValue('id'));
- $form_state->setRebuild();
- }
- else {
- parent::submitForm($form, $form_state);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $form, FormStateInterface $form_state) {
- $metatag_defaults = $this->entity;
-
- // Set the label on new defaults.
- if ($metatag_defaults->isNew()) {
- $metatag_defaults_id = $form_state->getValue('id');
-
- $type_parts = explode('__', $metatag_defaults_id);
- $entity_type = $type_parts[0];
- $entity_bundle = isset($type_parts[1]) ? $type_parts[1] : NULL;
-
- // Get the entity label.
- $entity_manager = \Drupal::service('entity_type.manager');
- $entity_info = $entity_manager->getDefinitions();
- $entity_label = (string) $entity_info[$entity_type]->get('label');
-
- if (!is_null($entity_bundle)) {
- // Get the bundle label.
- $bundle_manager = \Drupal::service('entity_type.bundle.info');
- $bundle_info = $bundle_manager->getBundleInfo($entity_type);
- if ($entity_type === 'page_variant') {
- // Check if page manager is enabled and try to load the page variant
- // so the label of the variant can be used.
- $moduleHandler = \Drupal::service('module_handler');
- if ($moduleHandler->moduleExists('metatag_page_manager')) {
- $page_variant = PageVariant::load($entity_bundle);
- $page = $page_variant->getPage();
- if ($page_variant) {
- $entity_label .= ': ' . $page->label() . ': ' . $page_variant->label();
- }
- }
- }
- else {
- $entity_label .= ': ' . $bundle_info[$entity_bundle]['label'];
- }
- }
-
- // Set the label to the config entity.
- $this->entity->set('label', $entity_label);
- }
-
- // Set tags within the Metatag entity.
- $tag_manager = \Drupal::service('plugin.manager.metatag.tag');
- $tags = $tag_manager->getDefinitions();
- $tag_values = [];
- foreach ($tags as $tag_id => $tag_definition) {
- if ($form_state->hasValue($tag_id)) {
- // Some plugins need to process form input before storing it. Hence, we
- // set it and then get it.
- $tag = $tag_manager->createInstance($tag_id);
- $tag->setValue($form_state->getValue($tag_id));
- if (!empty($tag->value())) {
- $tag_values[$tag_id] = $tag->value();
- }
- }
- }
- $metatag_defaults->set('tags', $tag_values);
- $status = $metatag_defaults->save();
-
- switch ($status) {
- case SAVED_NEW:
- drupal_set_message($this->t('Created the %label Metatag defaults.', [
- '%label' => $metatag_defaults->label(),
- ]));
- break;
-
- default:
- drupal_set_message($this->t('Saved the %label Metatag defaults.', [
- '%label' => $metatag_defaults->label(),
- ]));
- }
-
- $form_state->setRedirectUrl($metatag_defaults->toUrl('collection'));
- }
-
- /**
- * Returns an array of available bundles to override.
- *
- * @return array
- * A list of available bundles as $id => $label.
- */
- protected function getAvailableBundles() {
- $options = [];
- $entity_types = static::getSupportedEntityTypes();
- /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager */
- $entity_manager = \Drupal::service('entity_type.manager');
- /** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info */
- $bundle_info = \Drupal::service('entity_type.bundle.info');
- $metatags_defaults_manager = $entity_manager->getStorage('metatag_defaults');
- foreach ($entity_types as $entity_type => $entity_label) {
- if (empty($metatags_defaults_manager->load($entity_type))) {
- $options[$entity_label][$entity_type] = "$entity_label (Default)";
- }
-
- $bundles = $bundle_info->getBundleInfo($entity_type);
- foreach ($bundles as $bundle_id => $bundle_metadata) {
- $metatag_defaults_id = $entity_type . '__' . $bundle_id;
-
- if (empty($metatags_defaults_manager->load($metatag_defaults_id))) {
- $options[$entity_label][$metatag_defaults_id] = $bundle_metadata['label'];
- }
- }
- }
- return $options;
- }
-
- /**
- * Returns a list of supported entity types.
- *
- * @return array
- * A list of available entity types as $machine_name => $label.
- */
- public static function getSupportedEntityTypes() {
- $entity_types = [];
-
- /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_manager */
- $entity_manager = \Drupal::service('entity_type.manager');
-
- // A list of entity types that are not supported.
- $unsupported_types = [
- // Custom blocks.
- 'block_content',
- // Comments.
- 'comment',
- // Contact messages are the messages submitted on individual contact forms
- // so obviously shouldn't get meta tags.
- 'contact_message',
- // Menu items.
- 'menu_link_content',
- // Shortcut items.
- 'shortcut',
- ];
-
- // Make a list of supported content types.
- foreach ($entity_manager->getDefinitions() as $entity_name => $definition) {
- // Skip some entity types that we don't want to support.
- if (in_array($entity_name, $unsupported_types)) {
- continue;
- }
-
- // Identify supported entities.
- if ($definition instanceof ContentEntityType) {
- // Only work with entity types that have a list of links, i.e. publicly
- // viewable.
- $links = $definition->get('links');
- if (!empty($links)) {
- $entity_types[$entity_name] = static::getEntityTypeLabel($definition);
- }
- }
- }
-
- return $entity_types;
- }
-
- /**
- * Returns the text label for the entity type specified.
- *
- * @param \Drupal\Core\Entity\EntityTypeInterface $entityType
- * The entity type to process.
- *
- * @return string
- * A label.
- */
- public static function getEntityTypeLabel(EntityTypeInterface $entityType) {
- $label = $entityType->getLabel();
-
- if (is_a($label, 'Drupal\Core\StringTranslation\TranslatableMarkup')) {
- /** @var \Drupal\Core\StringTranslation\TranslatableMarkup $label */
- $label = $label->render();
- }
-
- return $label;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsRevertForm.php b/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsRevertForm.php
deleted file mode 100644
index 5d224117d..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagDefaultsRevertForm.php
+++ /dev/null
@@ -1,52 +0,0 @@
-t('Are you sure you want to revert %name to its default values?', ['%name' => $this->entity->label()]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('entity.metatag_defaults.collection');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Revert');
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->entity->revert();
-
- drupal_set_message(
- $this->t('Reverted @label defaults.',
- [
- '@label' => $this->entity->label(),
- ]
- )
- );
-
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagSettingsForm.php b/sites/all/modules/contrib/admin/metatag/src/Form/MetatagSettingsForm.php
deleted file mode 100644
index a77e24603..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Form/MetatagSettingsForm.php
+++ /dev/null
@@ -1,104 +0,0 @@
-config('metatag.settings')->get('entity_type_groups');
-
- $form['entity_type_groups'] = [
- '#type' => 'details',
- '#open' => TRUE,
- '#title' => $this->t('Entity type / Group Mapping'),
- '#description' => $this->t('Identify which metatag groups should be available on which entity type / bundle combination. Unselected groups will not appear on the configuration form for that entity type, reducing the size of the form and increasing performance. If no groups are selected for a type, all groups will appear.'),
- '#tree' => TRUE,
- ];
-
- $metatag_manager = \Drupal::service('metatag.manager');
- $bundle_manager = \Drupal::service('entity_type.bundle.info');
- $metatag_groups = $metatag_manager->sortedGroups();
- $entity_types = MetatagDefaultsForm::getSupportedEntityTypes();
- foreach ($entity_types as $entity_type => $entity_label) {
- $bundles = $bundle_manager->getBundleInfo($entity_type);
- foreach ($bundles as $bundle_id => $bundle_info) {
- // Create an option list for each bundle.
- $options = [];
- foreach ($metatag_groups as $group_name => $group_info) {
- $options[$group_name] = $group_info['label'];
- }
- // Format a collapsible fieldset for each group for easier readability.
- $form['entity_type_groups'][$entity_type][$bundle_id] = [
- '#type' => 'details',
- '#title' => $entity_label . ': ' . $bundle_info['label'],
- ];
- $form['entity_type_groups'][$entity_type][$bundle_id][] = [
- '#type' => 'checkboxes',
- '#options' => $options,
- '#default_value' => isset($settings[$entity_type]) && isset($settings[$entity_type][$bundle_id]) ? $settings[$entity_type][$bundle_id] : [],
- ];
- }
- }
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $settings = $this->config('metatag.settings');
- $value = $form_state->getValue('entity_type_groups');
- $value = static::arrayFilterRecursive($value);
- // Remove the extra layer created by collapsible fieldsets.
- foreach ($value as $entity_type => $bundle) {
- foreach ($bundle as $bundle_id => $groups) {
- $value[$entity_type][$bundle_id] = $groups[0];
- }
- }
- $settings->set('entity_type_groups', $value)->save();
- parent::submitForm($form, $form_state);
- }
-
- /**
- * Recursively filter results.
- *
- * @param array $input
- * The array to filter.
- *
- * @return array
- * The filtered array.
- */
- public static function arrayFilterRecursive(array $input) {
- foreach ($input as &$value) {
- if (is_array($value)) {
- $value = static::arrayFilterRecursive($value);
- }
- }
- return array_filter($input);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagGroupGenerator.php b/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagGroupGenerator.php
deleted file mode 100644
index 9b737e302..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagGroupGenerator.php
+++ /dev/null
@@ -1,80 +0,0 @@
-extensionManager = $extensionManager;
-
- $renderer->addSkeletonDir(__DIR__ . '/../../templates/');
- $this->setRenderer($renderer);
- }
-
- /**
- * Generator plugin.
- *
- * @param string $base_class
- * Base class.
- * @param string $module
- * Module name.
- * @param string $label
- * Group label.
- * @param string $description
- * Group description.
- * @param string $plugin_id
- * Plugin ID.
- * @param string $class_name
- * Class name.
- * @param string $weight
- * Group weight.
- */
- public function generate($base_class, $module, $label, $description, $plugin_id, $class_name, $weight) {
- $parameters = [
- 'base_class' => $base_class,
- 'module' => $module,
- 'label' => $label,
- 'description' => $description,
- 'plugin_id' => $plugin_id,
- 'class_name' => $class_name,
- 'weight' => $weight,
- 'prefix' => '<' . '?php',
- ];
-
- $this->renderFile(
- 'group.php.twig',
- $this->extensionManager->getPluginPath($module, 'metatag/Group') . '/' . $class_name . '.php',
- $parameters
- );
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagTagGenerator.php b/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagTagGenerator.php
deleted file mode 100644
index ba089b64a..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Generator/MetatagTagGenerator.php
+++ /dev/null
@@ -1,102 +0,0 @@
-extensionManager = $extensionManager;
-
- $render->addSkeletonDir(__DIR__ . '/../../templates/');
- $this->setRenderer($render);
- }
-
- /**
- * Generator plugin.
- *
- * @param string $base_class
- * Base class.
- * @param string $module
- * Module name.
- * @param string $name
- * Tag name.
- * @param string $label
- * Tag label.
- * @param string $description
- * Tag description.
- * @param string $plugin_id
- * Plugin ID.
- * @param string $class_name
- * Class name.
- * @param string $group
- * Tag group.
- * @param string $weight
- * Tag weight.
- * @param string $type
- * Tag type.
- * @param bool $secure
- * Is secure.
- * @param bool $multiple
- * Is multiple.
- */
- public function generate($base_class, $module, $name, $label, $description, $plugin_id, $class_name, $group, $weight, $type, $secure, $multiple) {
- $parameters = [
- 'base_class' => $base_class,
- 'module' => $module,
- 'name' => $name,
- 'label' => $label,
- 'description' => $description,
- 'plugin_id' => $plugin_id,
- 'class_name' => $class_name,
- 'group' => $group,
- 'weight' => $weight,
- 'type' => $type,
- 'secure' => $secure,
- 'multiple' => $multiple,
- 'prefix' => '<' . '?php',
- ];
-
- $this->renderFile(
- 'tag.php.twig',
- $this->extensionManager->getPluginPath($module, 'metatag/Tag') . '/' . $class_name . '.php',
- $parameters
- );
-
- $this->renderFile(
- 'metatag_tag.schema.yml.twig',
- $this->extensionManager->getModule($module)->getPath() . '/config/schema/' . $module . '.metatag_tag.schema.yml',
- $parameters,
- FILE_APPEND
- );
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsInterface.php b/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsInterface.php
deleted file mode 100644
index 36b2bd80d..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/MetatagDefaultsInterface.php
+++ /dev/null
@@ -1,12 +0,0 @@
-getStorage()->getQuery()
- ->condition('id', 'global', '<>');
-
- // Only add the pager if a limit is specified.
- if ($this->limit) {
- $query->pager($this->limit);
- }
-
- $entity_ids = $query->execute();
-
- // Load global entity always.
- return $entity_ids + $this->getParentIds($entity_ids);
- }
-
- /**
- * Gets the parent entity ids for the list of entities to load.
- *
- * @param array $entity_ids
- * The metatag entity ids.
- *
- * @return array
- * The list of parents to load
- */
- protected function getParentIds(array $entity_ids) {
- $parents = ['global' => 'global'];
- foreach ($entity_ids as $entity_id) {
- if (strpos($entity_id, '__') !== FALSE) {
- $entity_id_array = explode('__', $entity_id);
- $parent = reset($entity_id_array);
- $parents[$parent] = $parent;
- }
- }
- $parents_query = $this->getStorage()->getQuery()
- ->condition('id', $parents, 'IN');
- return $parents_query->execute();
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildHeader() {
- $header['label'] = $this->t('Type');
- return $header + parent::buildHeader();
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildRow(EntityInterface $entity) {
- $row['label'] = $this->getLabelAndConfig($entity);
- return $row + parent::buildRow($entity);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getOperations(EntityInterface $entity) {
- $operations = parent::getOperations($entity);
-
- // Global and entity defaults can be reverted but not deleted.
- if (in_array($entity->id(), MetatagManager::protectedDefaults())) {
- unset($operations['delete']);
- $operations['revert'] = [
- 'title' => t('Revert'),
- 'weight' => $operations['edit']['weight'] + 1,
- 'url' => $entity->toUrl('revert-form'),
- ];
- }
-
- return $operations;
- }
-
- /**
- * Renders the Metatag defaults label plus its configuration.
- *
- * @param \Drupal\Core\Entity\EntityInterface $entity
- * The Metatag defaults entity.
- *
- * @return array
- * Render array for a table cell.
- */
- public function getLabelAndConfig(EntityInterface $entity) {
- $output = '
';
-
- return [
- 'data' => [
- '#type' => 'details',
- '#prefix' => $prefix,
- '#title' => $entity->label(),
- 'config' => [
- '#markup' => $output,
- ],
- ],
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagGroupPluginManager.php b/sites/all/modules/contrib/admin/metatag/src/MetatagGroupPluginManager.php
deleted file mode 100644
index b019ca9eb..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/MetatagGroupPluginManager.php
+++ /dev/null
@@ -1,30 +0,0 @@
-alterInfo('metatag_groups');
-
- $this->setCacheBackend($cache_backend, 'metatag_groups');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagManager.php b/sites/all/modules/contrib/admin/metatag/src/MetatagManager.php
deleted file mode 100644
index 57c4ca281..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/MetatagManager.php
+++ /dev/null
@@ -1,578 +0,0 @@
-groupPluginManager = $groupPluginManager;
- $this->tagPluginManager = $tagPluginManager;
- $this->tokenService = $token;
- $this->logger = $channelFactory->get('metatag');
- $this->metatagDefaults = $entityTypeManager->getStorage('metatag_defaults');
- }
-
- /**
- * Returns the list of protected defaults.
- *
- * @return array
- * Th protected defaults.
- */
- public static function protectedDefaults() {
- return [
- 'global',
- '403',
- '404',
- 'node',
- 'front',
- 'taxonomy_term',
- 'user',
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public function tagsFromEntity(ContentEntityInterface $entity) {
- $tags = [];
-
- $fields = $this->getFields($entity);
-
- /* @var \Drupal\field\Entity\FieldConfig $field_info */
- foreach ($fields as $field_name => $field_info) {
- // Get the tags from this field.
- $tags = $this->getFieldTags($entity, $field_name);
- }
-
- return $tags;
- }
-
- /**
- * {@inheritdoc}
- */
- public function tagsFromEntityWithDefaults(ContentEntityInterface $entity) {
- return $this->tagsFromEntity($entity) + $this->defaultTagsFromEntity($entity);
- }
-
- /**
- * {@inheritdoc}
- */
- public function defaultTagsFromEntity(ContentEntityInterface $entity) {
- /** @var \Drupal\metatag\Entity\MetatagDefaults $metatags */
- $metatags = $this->metatagDefaults->load('global');
- if (!$metatags) {
- return NULL;
- }
- // Add/overwrite with tags set on the entity type.
- $entity_type_tags = $this->metatagDefaults->load($entity->getEntityTypeId());
- if (!is_null($entity_type_tags)) {
- $metatags->overwriteTags($entity_type_tags->get('tags'));
- }
- // Add/overwrite with tags set on the entity bundle.
- $bundle_metatags = $this->metatagDefaults->load($entity->getEntityTypeId() . '__' . $entity->bundle());
- if (!is_null($bundle_metatags)) {
- $metatags->overwriteTags($bundle_metatags->get('tags'));
- }
- return $metatags->get('tags');
- }
-
- /**
- * Gets the group plugin definitions.
- *
- * @return array
- * Group definitions.
- */
- protected function groupDefinitions() {
- return $this->groupPluginManager->getDefinitions();
- }
-
- /**
- * Gets the tag plugin definitions.
- *
- * @return array
- * Tag definitions
- */
- protected function tagDefinitions() {
- return $this->tagPluginManager->getDefinitions();
- }
-
- /**
- * {@inheritdoc}
- */
- public function sortedGroups() {
- $metatag_groups = $this->groupDefinitions();
-
- // Pull the data from the definitions into a new array.
- $groups = [];
- foreach ($metatag_groups as $group_name => $group_info) {
- $groups[$group_name]['id'] = $group_info['id'];
- $groups[$group_name]['label'] = $group_info['label']->render();
- $groups[$group_name]['description'] = $group_info['description'];
- $groups[$group_name]['weight'] = $group_info['weight'];
- }
-
- // Create the 'sort by' array.
- $sort_by = [];
- foreach ($groups as $group) {
- $sort_by[] = $group['weight'];
- }
-
- // Sort the groups by weight.
- array_multisort($sort_by, SORT_ASC, $groups);
-
- return $groups;
- }
-
- /**
- * {@inheritdoc}
- */
- public function sortedTags() {
- $metatag_tags = $this->tagDefinitions();
-
- // Pull the data from the definitions into a new array.
- $tags = [];
- foreach ($metatag_tags as $tag_name => $tag_info) {
- $tags[$tag_name]['id'] = $tag_info['id'];
- $tags[$tag_name]['label'] = $tag_info['label']->render();
- $tags[$tag_name]['group'] = $tag_info['group'];
- $tags[$tag_name]['weight'] = $tag_info['weight'];
- }
-
- // Create the 'sort by' array.
- $sort_by = [];
- foreach ($tags as $key => $tag) {
- $sort_by['group'][$key] = $tag['group'];
- $sort_by['weight'][$key] = $tag['weight'];
- }
-
- // Sort the tags by weight.
- array_multisort($sort_by['group'], SORT_ASC, $sort_by['weight'], SORT_ASC, $tags);
-
- return $tags;
- }
-
- /**
- * {@inheritdoc}
- */
- public function sortedGroupsWithTags() {
- $groups = $this->sortedGroups();
- $tags = $this->sortedTags();
-
- foreach ($tags as $tag_name => $tag) {
- $tag_group = $tag['group'];
-
- if (!isset($groups[$tag_group])) {
- // If the tag is claiming a group that has no matching plugin, log an
- // error and force it to the basic group.
- $this->logger->error("Undefined group '%group' on tag '%tag'", ['%group' => $tag_group, '%tag' => $tag_name]);
- $tag['group'] = 'basic';
- $tag_group = 'basic';
- }
-
- $groups[$tag_group]['tags'][$tag_name] = $tag;
- }
-
- return $groups;
- }
-
- /**
- * {@inheritdoc}
- */
- public function form(array $values, array $element, array $token_types = [], array $included_groups = NULL, array $included_tags = NULL) {
- // Add the outer fieldset.
- $element += [
- '#type' => 'details',
- ];
-
- $element += $this->tokenService->tokenBrowser($token_types);
-
- $groups_and_tags = $this->sortedGroupsWithTags();
-
- foreach ($groups_and_tags as $group_name => $group) {
- // Only act on groups that have tags and are in the list of included
- // groups (unless that list is null).
- if (isset($group['tags']) && (is_null($included_groups) || in_array($group_name, $included_groups) || in_array($group['id'], $included_groups))) {
- // Create the fieldset.
- $element[$group_name]['#type'] = 'details';
- $element[$group_name]['#title'] = $group['label'];
- $element[$group_name]['#description'] = $group['description'];
- $element[$group_name]['#open'] = FALSE;
-
- foreach ($group['tags'] as $tag_name => $tag) {
- // Only act on tags in the included tags list, unless that is null.
- if (is_null($included_tags) || in_array($tag_name, $included_tags) || in_array($tag['id'], $included_tags)) {
- // Make an instance of the tag.
- $tag = $this->tagPluginManager->createInstance($tag_name);
-
- // Set the value to the stored value, if any.
- $tag_value = isset($values[$tag_name]) ? $values[$tag_name] : NULL;
- $tag->setValue($tag_value);
-
- // Open any groups that have non-empty values.
- if (!empty($tag_value)) {
- $element[$group_name]['#open'] = TRUE;
- }
-
- // Create the bit of form for this tag.
- $element[$group_name][$tag_name] = $tag->form($element);
- }
- }
- }
- }
-
- return $element;
- }
-
- /**
- * Returns a list of the Metatag fields on an entity.
- *
- * @param \Drupal\Core\Entity\ContentEntityInterface $entity
- * The entity to examine.
- *
- * @return array
- * The fields from the entity which are Metatag fields.
- */
- protected function getFields(ContentEntityInterface $entity) {
- $field_list = [];
-
- if ($entity instanceof ContentEntityInterface) {
- // Get a list of the metatag field types.
- $field_types = $this->fieldTypes();
-
- // Get a list of the field definitions on this entity.
- $definitions = $entity->getFieldDefinitions();
-
- // Iterate through all the fields looking for ones in our list.
- foreach ($definitions as $field_name => $definition) {
- // Get the field type, ie: metatag.
- $field_type = $definition->getType();
-
- // Check the field type against our list of fields.
- if (isset($field_type) && in_array($field_type, $field_types)) {
- $field_list[$field_name] = $definition;
- }
- }
- }
-
- return $field_list;
- }
-
- /**
- * Returns a list of the meta tags with values from a field.
- *
- * @param \Drupal\Core\Entity\ContentEntityInterface $entity
- * The ContentEntityInterface object.
- * @param string $field_name
- * The name of the field to work on.
- *
- * @return array
- * Array of field tags.
- */
- protected function getFieldTags(ContentEntityInterface $entity, $field_name) {
- $tags = [];
- foreach ($entity->{$field_name} as $item) {
- // Get serialized value and break it into an array of tags with values.
- $serialized_value = $item->get('value')->getValue();
- if (!empty($serialized_value)) {
- $tags += unserialize($serialized_value);
- }
- }
-
- return $tags;
- }
-
- /**
- * Returns default meta tags for an entity.
- *
- * @param \Drupal\Core\Entity\ContentEntityInterface $entity
- * The entity to work on.
- *
- * @return array
- * The default meta tags appropriate for this entity.
- */
- public function getDefaultMetatags(ContentEntityInterface $entity = NULL) {
- // Get general global metatags.
- $metatags = $this->getGlobalMetatags();
- // If that is empty something went wrong.
- if (!$metatags) {
- return;
- }
-
- // Check if this is a special page.
- $special_metatags = $this->getSpecialMetatags();
-
- // Merge with all globals defaults.
- if ($special_metatags) {
- $metatags->set('tags', array_merge($metatags->get('tags'), $special_metatags->get('tags')));
- }
-
- // Next check if there is this page is an entity that has meta tags.
- // @todo Think about using other defaults, e.g. views. Maybe use plugins?
- else {
- if (is_null($entity)) {
- $entity = metatag_get_route_entity();
- }
-
- if (!empty($entity)) {
- // Get default meta tags for a given entity.
- $entity_defaults = $this->getEntityDefaultMetatags($entity);
- if ($entity_defaults != NULL) {
- $metatags->set('tags', array_merge($metatags->get('tags'), $entity_defaults));
- }
- }
- }
-
- return $metatags->get('tags');
- }
-
- /**
- * Returns global meta tags.
- *
- * @return array
- * The global meta tags.
- */
- public function getGlobalMetatags() {
- return $this->metatagDefaults->load('global');
- }
-
- /**
- * Returns special meta tags.
- *
- * @return array
- * The defaults for this page, if it's a special page.
- */
- public function getSpecialMetatags() {
- $metatags = NULL;
-
- if (\Drupal::service('path.matcher')->isFrontPage()) {
- $metatags = $this->metatagDefaults->load('front');
- }
- elseif (\Drupal::service('current_route_match')->getRouteName() == 'system.403') {
- $metatags = $this->metatagDefaults->load('403');
- }
- elseif (\Drupal::service('current_route_match')->getRouteName() == 'system.404') {
- $metatags = $this->metatagDefaults->load('404');
- }
-
- return $metatags;
- }
-
- /**
- * Returns default meta tags for an entity.
- *
- * @param \Drupal\Core\Entity\ContentEntityInterface $entity
- * The entity to work with.
- *
- * @return array
- * The appropriate default meta tags.
- */
- public function getEntityDefaultMetatags(ContentEntityInterface $entity) {
- $entity_metatags = $this->metatagDefaults->load($entity->getEntityTypeId());
- $metatags = [];
- if ($entity_metatags != NULL) {
- // Merge with global defaults.
- $metatags = array_merge($metatags, $entity_metatags->get('tags'));
- }
-
- // Finally, check if we should apply bundle overrides.
- $bundle_metatags = $this->metatagDefaults->load($entity->getEntityTypeId() . '__' . $entity->bundle());
- if ($bundle_metatags != NULL) {
- // Merge with existing defaults.
- $metatags = array_merge($metatags, $bundle_metatags->get('tags'));
- }
-
- return $metatags;
- }
-
- /**
- * Generate the elements that go in the hook_page_attachments attached array.
- *
- * @param array $tags
- * The array of tags as plugin_id => value.
- * @param object $entity
- * Optional entity object to use for token replacements.
- *
- * @return array
- * Render array with tag elements.
- */
- public function generateElements(array $tags, $entity = NULL) {
- $elements = [];
- $tags = $this->generateRawElements($tags, $entity);
-
- foreach ($tags as $name => $tag) {
- if (!empty($tag)) {
- $elements['#attached']['html_head'][] = [
- $tag,
- $name,
- ];
- }
- }
-
- return $elements;
- }
-
- /**
- * Generate the actual meta tag values.
- *
- * @param array $tags
- * The array of tags as plugin_id => value.
- * @param object $entity
- * Optional entity object to use for token replacements.
- *
- * @return array
- * Render array with tag elements.
- */
- public function generateRawElements(array $tags, $entity = NULL) {
- // Ignore the update.php path.
- $request = \Drupal::request();
- if ($request->getBaseUrl() == '/update.php') {
- return [];
- }
-
- $rawTags = [];
-
- $metatag_tags = $this->tagPluginManager->getDefinitions();
-
- // Order the elements by weight first, as some systems like Facebook care.
- uksort($tags, function ($tag_name_a, $tag_name_b) use ($metatag_tags) {
- $weight_a = isset($metatag_tags[$tag_name_a]['weight']) ? $metatag_tags[$tag_name_a]['weight'] : 0;
- $weight_b = isset($metatag_tags[$tag_name_b]['weight']) ? $metatag_tags[$tag_name_b]['weight'] : 0;
-
- return ($weight_a < $weight_b) ? -1 : 1;
- });
-
- // Each element of the $values array is a tag with the tag plugin name as
- // the key.
- foreach ($tags as $tag_name => $value) {
- // Check to ensure there is a matching plugin.
- if (isset($metatag_tags[$tag_name])) {
- // Get an instance of the plugin.
- $tag = $this->tagPluginManager->createInstance($tag_name);
-
- // Render any tokens in the value.
- $token_replacements = [];
- if ($entity) {
- // @todo This needs a better way of discovering the context.
- if ($entity instanceof ViewEntityInterface) {
- // Views tokens require the ViewExecutable, not the config entity.
- // @todo Can we move this into metatag_views somehow?
- $token_replacements = ['view' => $entity->getExecutable()];
- }
- elseif ($entity instanceof ContentEntityInterface) {
- $token_replacements = [$entity->getEntityTypeId() => $entity];
- }
- }
-
- // Set the value as sometimes the data needs massaging, such as when
- // field defaults are used for the Robots field, which come as an array
- // that needs to be filtered and converted to a string.
- // @see Robots::setValue()
- $tag->setValue($value);
- $langcode = \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId();
-
- $processed_value = PlainTextOutput::renderFromHtml(htmlspecialchars_decode($this->tokenService->replace($tag->value(), $token_replacements, ['langcode' => $langcode])));
-
- // Now store the value with processed tokens back into the plugin.
- $tag->setValue($processed_value);
-
- // Have the tag generate the output based on the value we gave it.
- $output = $tag->output();
-
- if (!empty($output)) {
- $output = $tag->multiple() ? $output : [$output];
-
- // Backwards compatibility for modules which don't support this logic.
- if (isset($output['#tag'])) {
- $output = [$output];
- }
-
- foreach ($output as $index => $element) {
- // Add index to tag name as suffix to avoid having same key.
- $index_tag_name = $tag->multiple() ? $tag_name . '_' . $index : $tag_name;
- $rawTags[$index_tag_name] = $element;
- }
- }
- }
- }
-
- return $rawTags;
- }
-
- /**
- * Returns a list of fields handled by Metatag.
- *
- * @return array
- * A list of supported field types.
- */
- protected function fieldTypes() {
- // @todo Either get this dynamically from field plugins or forget it and
- // just hardcode metatag where this is called.
- return ['metatag'];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagManagerInterface.php b/sites/all/modules/contrib/admin/metatag/src/MetatagManagerInterface.php
deleted file mode 100644
index 0cc060cbc..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/MetatagManagerInterface.php
+++ /dev/null
@@ -1,98 +0,0 @@
-getParameter('container.modules');
- if (isset($modules['serialization'])) {
- // Serialization module is enabled, add our metatag normalizers.
- // Priority of the metatag normalizer must be higher than other
- // general-purpose typed data and field item normalizers.
- $metatag = new Definition(MetatagNormalizer::class);
- $metatag->addTag('normalizer', ['priority' => 30]);
- $container->setDefinition('metatag.normalizer.metatag', $metatag);
-
- $metatag_hal = new Definition(MetatagHalNormalizer::class);
- $metatag_hal->addTag('normalizer', ['priority' => 31]);
- $container->setDefinition('metatag.normalizer.metatag.hal', $metatag_hal);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagTagPluginManager.php b/sites/all/modules/contrib/admin/metatag/src/MetatagTagPluginManager.php
deleted file mode 100644
index 06562fed2..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/MetatagTagPluginManager.php
+++ /dev/null
@@ -1,30 +0,0 @@
-alterInfo('metatag_tags');
-
- $this->setCacheBackend($cache_backend, 'metatag_tags');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/MetatagToken.php b/sites/all/modules/contrib/admin/metatag/src/MetatagToken.php
deleted file mode 100644
index e240fc019..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/MetatagToken.php
+++ /dev/null
@@ -1,95 +0,0 @@
-token = $token;
- }
-
- /**
- * Wrapper for the Token module's string parsing.
- *
- * @param string $string
- * The string to parse.
- * @param array $data
- * Arguments for token->replace().
- * @param array $options
- * Any additional options necessary.
- * @param \Drupal\Core\Render\BubbleableMetadata|null $bubbleable_metadata
- * (optional) An object to which static::generate() and the hooks and
- * functions that it invokes will add their required bubbleable metadata.
- *
- * @return mixed|string
- * The processed string.
- */
- public function replace($string, array $data = [], array $options = [], BubbleableMetadata $bubbleable_metadata = NULL) {
- // Set default requirements for metatag unless options specify otherwise.
- $options = $options + [
- 'clear' => TRUE,
- ];
-
- $replaced = $this->token->replace($string, $data, $options, $bubbleable_metadata);
-
- // Ensure that there are no double-slash sequences due to empty token
- // values.
- $replaced = preg_replace('/(? '
' . t('Configure the meta tags below. To view a summary of the individual meta tags and the pattern for a specific configuration, click on its name below. Use tokens to avoid redundant meta data and search engine penalization. For example, a \'keyword\' value of "example" will be shown on all content using this configuration, whereas using the [node:field_keywords] automatically inserts the "keywords" values from the current entity (node, term, etc).') . '
',
- ];
-
- // Normalize taxonomy tokens.
- if (!empty($token_types)) {
- $token_types = array_map(function ($value) {
- return stripos($value, 'taxonomy_') === 0 ? substr($value, strlen('taxonomy_')) : $value;
- }, (array) $token_types);
- }
-
- $form['tokens'] = [
- '#theme' => 'token_tree_link',
- '#token_types' => $token_types,
- '#global_types' => TRUE,
- '#show_nested' => FALSE,
- ];
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagHalNormalizer.php b/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagHalNormalizer.php
deleted file mode 100644
index 4d0aff94e..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagHalNormalizer.php
+++ /dev/null
@@ -1,27 +0,0 @@
- [$normalized],
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagNormalizer.php b/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagNormalizer.php
deleted file mode 100644
index 32837dcd6..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Normalizer/MetatagNormalizer.php
+++ /dev/null
@@ -1,53 +0,0 @@
-getEntity();
-
- $tags = metatag_get_tags_from_route($entity);
-
- $normalized['value'] = [];
- if (isset($tags['#attached']['html_head'])) {
- foreach ($tags['#attached']['html_head'] as $tag) {
- // @todo Work out a proper, long-term fix for this.
- if (isset($tag[0]['#attributes']['content'])) {
- $normalized['value'][$tag[1]] = $tag[0]['#attributes']['content'];
- }
- elseif (isset($tag[0]['#attributes']['href'])) {
- $normalized['value'][$tag[1]] = $tag[0]['#attributes']['href'];
- }
- }
- }
-
- if (isset($context['langcode'])) {
- $normalized['lang'] = $context['langcode'];
- }
-
- return $normalized;
- }
-
- /**
- * {@inheritdoc}
- */
- public function supportsDenormalization($data, $type, $format = NULL) {
- return FALSE;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/Metatag.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/Metatag.php
deleted file mode 100644
index 757179967..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/DataType/Metatag.php
+++ /dev/null
@@ -1,19 +0,0 @@
- [
- 'value' => [
- 'type' => 'text',
- 'size' => 'big',
- 'not null' => FALSE,
- ],
- ],
- ];
- }
-
- /**
- * {@inheritdoc}
- */
- public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
- $properties['value'] = DataDefinition::create('metatag')
- ->setLabel(t('Metatag'))
- ->setRequired(TRUE);
-
- return $properties;
- }
-
- /**
- * {@inheritdoc}
- */
- public function isEmpty() {
- $value = $this->get('value')->getValue();
- return $value === NULL || $value === '' || $value === serialize([]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function preSave() {
- parent::preSave();
-
- // Merge field defaults on top of global ones.
- $default_tags = metatag_get_default_tags();
-
- // Get the value about to be saved.
- $current_value = $this->value;
- // Only unserialize if still serialized string.
- if (is_string($current_value)) {
- $current_tags = unserialize($current_value);
- }
- else {
- $current_tags = $current_value;
- }
-
- // Only include values that differ from the default.
- // @todo When site defaults are added, account for those.
- $tags_to_save = [];
- foreach ($current_tags as $tag_id => $tag_value) {
- if (!isset($default_tags[$tag_id]) || ($tag_value != $default_tags[$tag_id])) {
- $tags_to_save[$tag_id] = $tag_value;
- }
- }
-
- // Update the value to only save overridden tags.
- $this->value = serialize($tags_to_save);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldWidget/MetatagFirehose.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldWidget/MetatagFirehose.php
deleted file mode 100644
index 6797f59ae..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/FieldWidget/MetatagFirehose.php
+++ /dev/null
@@ -1,129 +0,0 @@
-get('metatag.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, array $third_party_settings, MetatagManager $manager) {
- parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $third_party_settings);
- $this->metatagManager = $manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
- $item = $items[$delta];
- $default_tags = metatag_get_default_tags();
-
- // Retrieve the values for each metatag from the serialized array.
- $values = [];
- if (!empty($item->value)) {
- $values = unserialize($item->value);
- }
-
- // Populate fields which have not been overridden in the entity.
- if (!empty($default_tags)) {
- foreach ($default_tags as $tag_id => $tag_value) {
- if (!isset($values[$tag_id]) && !empty($tag_value)) {
- $values[$tag_id] = $tag_value;
- }
- }
- }
-
- // Retrieve configuration settings.
- $settings = \Drupal::config('metatag.settings');
- $entity_type_groups = $settings->get('entity_type_groups');
-
- // Find the current entity type and bundle.
- $entity_type = $item->getEntity()->getentityTypeId();
- $entity_bundle = $item->getEntity()->bundle();
-
- // See if there are requested groups for this entity type and bundle.
- $groups = !empty($entity_type_groups[$entity_type]) && !empty($entity_type_groups[$entity_type][$entity_bundle]) ? $entity_type_groups[$entity_type][$entity_bundle] : [];
- // Limit the form to requested groups, if any.
- if (!empty($groups)) {
- $element = $this->metatagManager->form($values, $element, [$entity_type], $groups);
- }
- // Otherwise, display all groups.
- else {
- $element = $this->metatagManager->form($values, $element, [$entity_type]);
- }
-
- // Put the form element into the form's "advanced" group.
- $element['#group'] = 'advanced';
-
- return $element;
- }
-
- /**
- * {@inheritdoc}
- */
- public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
- // Flatten the values array to remove the groups and then serialize all the
- // meta tags into one value for storage.
- $tag_manager = \Drupal::service('plugin.manager.metatag.tag');
- foreach ($values as &$value) {
- $flattened_value = [];
- foreach ($value as $group) {
- // Exclude the "original delta" value.
- if (is_array($group)) {
- foreach ($group as $tag_id => $tag_value) {
- $tag = $tag_manager->createInstance($tag_id);
- $tag->setValue($tag_value);
- if (!empty($tag->value())) {
- $flattened_value[$tag_id] = $tag->value();
- }
- }
- }
- }
- $value = serialize($flattened_value);
- }
-
- return $values;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php
deleted file mode 100644
index 69c11265e..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/Field/MetatagEntityFieldItemList.php
+++ /dev/null
@@ -1,11 +0,0 @@
-id = $plugin_definition['id'];
- $this->label = $plugin_definition['label'];
- $this->description = $plugin_definition['description'];
- }
-
- /**
- * Get this group's internal ID.
- *
- * @return string
- * This group's ID.
- */
- public function id() {
- return $this->id;
- }
-
- /**
- * Get this group's human-friendly name.
- *
- * @return string
- * This group's human-friendly name.
- */
- public function label() {
- return $this->label;
- }
-
- /**
- * This group object's description.
- *
- * @return string
- * This group's ID.
- */
- public function description() {
- return $this->description;
- }
-
- /**
- * Whether or not this group is being used.
- *
- * @return bool
- * Whether this group has been enabled.
- */
- public function isActive() {
- return TRUE;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/AbstractTag.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/AbstractTag.php
deleted file mode 100644
index d8786110e..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/AbstractTag.php
+++ /dev/null
@@ -1,38 +0,0 @@
-no longer supported by major search engines."),
- * name = "abstract",
- * group = "basic",
- * weight = 3,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class AbstractTag extends MetaNameBase {
-
- /**
- * Generate a form element for this meta tag.
- */
- public function form(array $element = []) {
- $form = [
- '#type' => 'textarea',
- '#title' => $this->label(),
- '#default_value' => $this->value(),
- '#row' => 2,
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#description' => $this->description(),
- '#element_validate' => [[get_class($this), 'validateTag']],
- ];
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/CanonicalUrl.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/CanonicalUrl.php
deleted file mode 100644
index 9b2f85a25..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/CanonicalUrl.php
+++ /dev/null
@@ -1,22 +0,0 @@
- 'textarea',
- '#title' => $this->label(),
- '#default_value' => $this->value(),
- '#row' => 2,
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#description' => $this->description(),
- '#element_validate' => [[get_class($this), 'validateTag']],
- ];
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Generator.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Generator.php
deleted file mode 100644
index 23f19bba4..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Generator.php
+++ /dev/null
@@ -1,22 +0,0 @@
-see Wikipedia for details."),
- * name = "geo.position",
- * group = "advanced",
- * weight = 0,
- * type = "label",
- * secure = 0,
- * multiple = FALSE
- * )
- */
-class GeoPosition extends MetaNameBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoRegion.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoRegion.php
deleted file mode 100644
index b939e462f..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/GeoRegion.php
+++ /dev/null
@@ -1,22 +0,0 @@
-meta tags that Google understands for further details."),
- * name = "google",
- * group = "advanced",
- * weight = 5,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Google extends MetaNameBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Icbm.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Icbm.php
deleted file mode 100644
index 078d2c7a9..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Icbm.php
+++ /dev/null
@@ -1,22 +0,0 @@
-see Wikipedia for details."),
- * name = "icbm",
- * group = "advanced",
- * weight = 0,
- * type = "label",
- * secure = 0,
- * multiple = FALSE
- * )
- */
-class Icbm extends MetaNameBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ImageSrc.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ImageSrc.php
deleted file mode 100644
index 6c9fe3eaa..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ImageSrc.php
+++ /dev/null
@@ -1,22 +0,0 @@
-no longer supported by most search engines."),
- * name = "keywords",
- * group = "basic",
- * weight = 4,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Keywords extends MetaNameBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/LinkRelBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/LinkRelBase.php
deleted file mode 100644
index 449ce2fb4..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/LinkRelBase.php
+++ /dev/null
@@ -1,27 +0,0 @@
- $this->name(),
- 'href' => $element['#attributes']['content'],
- ];
- unset($element['#attributes']['content']);
- }
-
- return $element;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php
deleted file mode 100644
index 607d6bf75..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaHttpEquivBase.php
+++ /dev/null
@@ -1,17 +0,0 @@
-id = $plugin_definition['id'];
- $this->name = $plugin_definition['name'];
- $this->label = $plugin_definition['label'];
- $this->description = $plugin_definition['description'];
- $this->group = $plugin_definition['group'];
- $this->weight = $plugin_definition['weight'];
- $this->type = $plugin_definition['type'];
- $this->secure = $plugin_definition['secure'];
- $this->multiple = $plugin_definition['multiple'];
- $this->absoluteUrl = !empty($plugin_definition['absolute_url']);
- $this->request = \Drupal::request();
- }
-
- /**
- * Obtain the meta tag's internal ID.
- *
- * @return string
- * This meta tag's internal ID.
- */
- public function id() {
- return $this->id;
- }
-
- /**
- * This meta tag's label.
- *
- * @return string
- * The label.
- */
- public function label() {
- return $this->label;
- }
-
- /**
- * The meta tag's description.
- *
- * @return bool
- * This meta tag's description.
- */
- public function description() {
- return $this->description;
- }
-
- /**
- * The meta tag's machine name.
- *
- * @return string
- * This meta tag's machine name.
- */
- public function name() {
- return $this->name;
- }
-
- /**
- * The meta tag group this meta tag belongs to.
- *
- * @return string
- * The meta tag's group name.
- */
- public function group() {
- return $this->group;
- }
-
- /**
- * This meta tag's form field's weight.
- *
- * @return int|float
- * The form API weight for this. May be any number supported by Form API.
- */
- public function weight() {
- return $this->weight;
- }
-
- /**
- * Obtain this meta tag's type.
- *
- * @return string
- * This meta tag's type.
- */
- public function type() {
- return $this->type;
- }
-
- /**
- * Whether or not this meta tag must output secure (HTTPS) URLs.
- *
- * @return bool
- * Whether or not this meta tag must output secure (HTTPS) URLs.
- */
- public function secure() {
- return $this->secure;
- }
-
- /**
- * Whether or not this meta tag supports multiple values.
- *
- * @return bool
- * Whether or not this meta tag supports multiple values.
- */
- public function multiple() {
- return $this->multiple;
- }
-
- /**
- * Whether or not this meta tag must output required absolute URLs.
- *
- * @return bool
- * Whether or not this meta tag must output required absolute URLs.
- */
- public function requiresAbsoluteUrl() {
- return $this->absoluteUrl;
- }
-
- /**
- * Whether or not this meta tag is active.
- *
- * @return bool
- * Whether this meta tag has been enabled.
- */
- public function isActive() {
- return TRUE;
- }
-
- /**
- * Generate a form element for this meta tag.
- *
- * @param array $element
- * The existing form element to attach to.
- *
- * @return array
- * The completed form element.
- */
- public function form(array $element = []) {
- $form = [
- '#type' => 'textfield',
- '#title' => $this->label(),
- '#default_value' => $this->value(),
- '#maxlength' => 255,
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#description' => $this->description(),
- '#element_validate' => [[get_class($this), 'validateTag']],
- ];
-
- // Optional handling for items that allow multiple values.
- if (!empty($this->multiple)) {
- $form['#description'] .= ' ' . $this->t('Multiple values may be used, separated by a comma. Note: Tokens that return multiple values will be handled automatically.');
- }
-
- // Optional handling for images.
- if ((!empty($this->type())) && ($this->type() === 'image')) {
- $form['#description'] .= ' ' . $this->t('This will be able to extract the URL from an image field.');
- }
-
- if (!empty($this->absolute_url)) {
- $form['#description'] .= ' ' . $this->t('Any relative or protocol-relative URLs will be converted to absolute URLs.');
- }
-
- // Optional handling for secure paths.
- if (!empty($this->secure)) {
- $form['#description'] .= ' ' . $this->t('Any links containing http:// will be converted to https://');
- }
-
- return $form;
- }
-
- /**
- * Obtain the current meta tag's raw value.
- *
- * @return string
- * The current raw meta tag value.
- */
- public function value() {
- return $this->value;
- }
-
- /**
- * Assign the current meta tag a value.
- *
- * @param string $value
- * The value to assign this meta tag.
- */
- public function setValue($value) {
- $this->value = $value;
- }
-
- /**
- * Make the string presentable.
- *
- * @param string $value
- * The raw string to process.
- *
- * @return string
- * The meta tag value after processing.
- */
- private function tidy($value) {
- return trim($value);
- }
-
- /**
- * Generate the HTML tag output for a meta tag.
- *
- * @return array|string
- * A render array or an empty string.
- */
- public function output() {
- if (empty($this->value)) {
- // If there is no value, we don't want a tag output.
- return $this->multiple() ? [] : '';
- }
-
- // Parse out the image URL, if needed.
- $value = $this->parseImageUrl();
- $values = $this->multiple() ? explode(',', $value) : [$value];
- $elements = [];
- foreach ($values as $value) {
- $value = $this->tidy($value);
- if ($this->requiresAbsoluteUrl()) {
- // Relative URL.
- if (parse_url($value, PHP_URL_HOST) == NULL) {
- $value = $this->request->getSchemeAndHttpHost() . $value;
- }
- // Protocol-relative URL.
- elseif (substr($value, 0, 2) === '//') {
- $value = $this->request->getScheme() . ':' . $value;
- }
- }
-
- // If tag must be secure, convert all http:// to https://.
- if ($this->secure() && strpos($value, 'http://') !== FALSE) {
- $value = str_replace('http://', 'https://', $value);
- }
-
- $elements[] = [
- '#tag' => 'meta',
- '#attributes' => [
- $this->nameAttribute => $this->name,
- 'content' => $value,
- ],
- ];
- }
-
- return $this->multiple() ? $elements : reset($elements);
- }
-
- /**
- * Validates the metatag data.
- *
- * @param array $element
- * The form element to process.
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * The form state.
- */
- public static function validateTag(array &$element, FormStateInterface $form_state) {
- // @todo If there is some common validation, put it here. Otherwise, make
- // it abstract?
- }
-
- /**
- * Extract any image URLs that might be found in a meta tag.
- *
- * @return string
- * A comma separated list of any image URLs found in the meta tag's value,
- * or the original string if no images were identified.
- */
- protected function parseImageUrl() {
- $value = $this->value();
-
- // If this contains embedded image tags, extract the image URLs.
- if ($this->type() === 'image') {
- // If image tag src is relative (starts with /), convert to an absolute
- // link; ignore protocol-relative URLs.
- global $base_root;
- if (strpos($value, 'multiple()) {
- // Split the string into an array, remove empty items.
- $values = array_filter(explode(',', $value));
- }
- else {
- $values = [$value];
- }
-
- // Check through the value(s) to see if there are any image tags.
- foreach ($values as $key => $val) {
- $matches = [];
- preg_match('/src="([^"]*)"/', $val, $matches);
- if (!empty($matches[1])) {
- $values[$key] = $matches[1];
- }
- }
- $value = implode(',', $values);
-
- // Remove any HTML tags that might remain.
- $value = strip_tags($value);
- }
-
- return $value;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaPropertyBase.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaPropertyBase.php
deleted file mode 100644
index c242d23cf..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/MetaPropertyBase.php
+++ /dev/null
@@ -1,17 +0,0 @@
-Google News.", arguments = { ":google_news" = "https://support.google.com/news/publisher/bin/answer.py?hl=en&answer=68297" }),
- * name = "news_keywords",
- * group = "advanced",
- * weight = 2,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class NewsKeywords extends MetaNameBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/OriginalSource.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/OriginalSource.php
deleted file mode 100644
index aa3cd820f..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/OriginalSource.php
+++ /dev/null
@@ -1,22 +0,0 @@
-the W3C specifications for further details."),
- * name = "referrer",
- * group = "advanced",
- * weight = 5,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Referrer extends MetaNameBase {
-
- /**
- * {@inheritdoc}
- */
- public function form(array $element = []) {
- $form = [
- '#type' => 'select',
- '#title' => $this->label(),
- '#description' => $this->description(),
- '#options' => [
- 'no-referrer' => t('No Referrer'),
- 'origin' => t('Origin'),
- 'no-referrer-when-downgrade' => t('No Referrer When Downgrade'),
- 'origin-when-cross-origin' => t('Origin When Cross-Origin'),
- 'unsafe-url' => t('Unsafe URL'),
- ],
- '#empty_option' => t('- None -'),
- '#empty_value' => '',
- '#default_value' => $this->value(),
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#element_validate' => [[get_class($this), 'validateTag']],
- ];
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Rights.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Rights.php
deleted file mode 100644
index df692eed3..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Rights.php
+++ /dev/null
@@ -1,22 +0,0 @@
-value = $value;
- }
-
- /**
- * {@inheritdoc}
- */
- public function form(array $element = []) {
- // Prepare the default value as it is stored as a string.
- $default_value = [];
- if (!empty($this->value)) {
- $default_value = explode(', ', $this->value);
- }
-
- $form = [
- '#type' => 'checkboxes',
- '#title' => $this->label(),
- '#description' => $this->description(),
- '#options' => [
- 'index' => t('Allow search engines to index this page (assumed).'),
- 'follow' => t('Allow search engines to follow links on this page (assumed).'),
- 'noindex' => t('Prevents search engines from indexing this page.'),
- 'nofollow' => t('Prevents search engines from following links on this page.'),
- 'noarchive' => t('Prevents cached copies of this page from appearing in search results.'),
- 'nosnippet' => t('Prevents descriptions from appearing in search results, and prevents page caching.'),
- 'noodp' => t('Blocks the Open Directory Project description from appearing in search results.', [':opendirectory' => 'http://www.dmoz.org/']),
- 'noydir' => t('Prevents Yahoo! from listing this page in the Yahoo! Directory.', [':ydir' => 'http://dir.yahoo.com/']),
- 'noimageindex' => t('Prevent search engines from indexing images on this page.'),
- 'notranslate' => t('Prevent search engines from offering to translate this page in search results.'),
- ],
- '#default_value' => $default_value,
- '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
- '#element_validate' => [[get_class($this), 'validateTag']],
- ];
-
- return $form;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/SetCookie.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/SetCookie.php
deleted file mode 100644
index f72c76318..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/SetCookie.php
+++ /dev/null
@@ -1,22 +0,0 @@
-Sets a cookie on the visitor's browser. Can be in either NAME=VALUE format, or a more verbose format including the path and expiration date; see the link for full details on the syntax."),
- * name = "set-cookie",
- * group = "advanced",
- * weight = 5,
- * type = "string",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class SetCookie extends MetaHttpEquivBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ShortLink.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ShortLink.php
deleted file mode 100644
index 9df80e5b9..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/ShortLink.php
+++ /dev/null
@@ -1,22 +0,0 @@
-Google News. Warning: Don't abuse it, to be used a maximum of 7 times per calendar week!", arguments = { ":google_news" = "https://support.google.com/news/publisher/bin/answer.py?hl=en&answer=68297" }),
- * name = "standout",
- * group = "advanced",
- * weight = 3,
- * type = "label",
- * secure = FALSE,
- * multiple = FALSE
- * )
- */
-class Standout extends MetaNameBase {
- // Nothing here yet. Just a placeholder class for a plugin.
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Title.php b/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Title.php
deleted file mode 100644
index 4cdbe54b6..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Plugin/metatag/Tag/Title.php
+++ /dev/null
@@ -1,43 +0,0 @@
-value)) {
- // // If there is no value, we don't want a tag output.
- // $element = '';
- // }
- // else {
- // $element = [
- // '#theme' => 'hidden',
- // // '#tag' => 'title',
- // '#value' => $this->value(),
- // ];
- // }
- //
- // return $element;
- // }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagAdminTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagAdminTest.php
deleted file mode 100644
index 3072b62e0..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagAdminTest.php
+++ /dev/null
@@ -1,497 +0,0 @@
-config('system.site')->set('page.front', '/test-page')->save();
-
- // Create Basic page and Article node types.
- if ($this->profile != 'standard') {
- $this->drupalCreateContentType([
- 'type' => 'page',
- 'name' => 'Basic page',
- 'display_submitted' => FALSE,
- ]);
- $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
- }
- }
-
- /**
- * Tests the interface to manage metatag defaults.
- */
- public function testDefaults() {
- // Save the default title to test the Revert operation at the end.
- $metatag_defaults = \Drupal::config('metatag.metatag_defaults.global');
- $default_title = $metatag_defaults->get('tags')['title'];
-
- // Initiate session with a user who can manage metatags.
- $permissions = ['administer site configuration', 'administer meta tags'];
- $account = $this->drupalCreateUser($permissions);
- $this->drupalLogin($account);
-
- // Check that the user can see the list of metatag defaults.
- $this->drupalGet('admin/config/search/metatag');
- $this->assertResponse(200);
-
- // Check that the Global defaults were created.
- $this->assertLinkByHref('admin/config/search/metatag/global', 0, t('Global defaults were created on installation.'));
-
- // Check that Global and entity defaults can't be deleted.
- $this->assertNoLinkByHref('admin/config/search/metatag/global/delete', 0, t("Global defaults can't be deleted"));
- $this->assertNoLinkByHref('admin/config/search/metatag/node/delete', 0, t("Entity defaults can't be deleted"));
-
- // Check that the module defaults were injected into the Global config
- // entity.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $this->assertFieldById('edit-title', $metatag_defaults->get('title'), t('Metatag defaults were injected into the Global configuration entity.'));
-
- // Update the Global defaults and test them.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $values = [
- 'title' => 'Test title',
- 'description' => 'Test description',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
- $this->drupalGet('hit-a-404');
- $this->assertResponse(404);
- foreach ($values as $metatag => $value) {
- $this->assertRaw($value, t('Updated metatag @tag was found in the HEAD section of the page.', ['@tag' => $metatag]));
- }
-
- // Check that tokens are processed.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $values = [
- 'title' => '[site:name] | Test title',
- 'description' => '[site:name] | Test description',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
- drupal_flush_all_caches();
- $this->drupalGet('hit-a-404');
- $this->assertResponse(404);
- foreach ($values as $metatag => $value) {
- $processed_value = \Drupal::token()->replace($value);
- $this->assertRaw($processed_value, t('Processed token for metatag @tag was found in the HEAD section of the page.', ['@tag' => $metatag]));
- }
-
- // Test the Robots plugin.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $robots_values = ['index', 'follow', 'noydir'];
- $values = [];
- foreach ($robots_values as $value) {
- $values['robots[' . $value . ']'] = TRUE;
- }
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
- drupal_flush_all_caches();
-
- // Trigger a 404 request.
- $this->drupalGet('hit-a-404');
- $this->assertResponse(404);
- $robots_value = implode(', ', $robots_values);
- $this->assertRaw($robots_value, t('Robots metatag has the expected values.'));
-
- // Test reverting global configuration to its defaults.
- $this->drupalGet('admin/config/search/metatag/global/revert');
- $this->assertResponse(200);
- $this->drupalPostForm(NULL, [], 'Revert');
- $this->assertText('Reverted Global defaults.');
- $this->assertText($default_title, 'Global title was reverted to its default value.');
-
- $this->drupalLogout();
- }
-
- /**
- * Confirm the available entity types show on the add-default page.
- */
- public function testAvailableConfigEntities() {
- // Initiate session with a user who can manage metatags.
- $permissions = [
- 'administer site configuration',
- 'administer meta tags',
- ];
- $account = $this->drupalCreateUser($permissions);
- $this->drupalLogin($account);
-
- // Load the default-add page.
- $this->drupalGet('admin/config/search/metatag/add');
- $this->assertResponse(200);
-
- // Confirm the 'type' field exists.
- $this->assertFieldByName('id');
-
- // Compile a list of entities from the list.
- $xpath = $this->xpath("//select[@name='id']");
- $this->verbose('
');
-
- // Check through the values that are in the 'select' list, make sure that
- // unwanted items are not present.
- $this->assertFalse(isset($types['block_content']), 'Custom block entities are not supported.');
- $this->assertFalse(isset($types['comment']), 'Comment entities are not supported.');
- $this->assertFalse(isset($types['menu_link_content']), 'Menu link entities are not supported.');
- $this->assertFalse(isset($types['shortcut']), 'Shortcut entities are not supported.');
- $this->assertTrue(isset($types['node__page']), 'Nodes are supported.');
- $this->assertTrue(isset($types['user__user']), 'Users are supported.');
- $this->assertTrue(isset($types['entity_test']), 'Test entities are supported.');
- }
-
- /**
- * Tests special pages.
- */
- public function testSpecialPages() {
- // Initiate session with a user who can manage metatags.
- $permissions = ['administer site configuration', 'administer meta tags'];
- $account = $this->drupalCreateUser($permissions);
- $this->drupalLogin($account);
-
- // Adjust the front page and test it.
- $this->drupalGet('admin/config/search/metatag/front');
- $this->assertResponse(200);
- $values = [
- 'description' => 'Front page description',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Front page Metatag defaults.');
- $this->drupalGet('');
- $this->assertResponse(200);
- $this->assertRaw($values['description'], t('Front page defaults are used at the front page.'));
-
- // Adjust the 403 page and test it.
- $this->drupalGet('admin/config/search/metatag/403');
- $this->assertResponse(200);
- $values = [
- 'description' => '403 page description.',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the 403 access denied Metatag defaults.');
- $this->drupalLogout();
- $this->drupalGet('admin/config/search/metatag');
- $this->assertResponse(403);
- $this->assertRaw($values['description'], t('403 page defaults are used at 403 pages.'));
-
- // Adjust the 404 page and test it.
- $this->drupalLogin($account);
- $this->drupalGet('admin/config/search/metatag/404');
- $this->assertResponse(200);
- $values = [
- 'description' => '404 page description.',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the 404 page not found Metatag defaults.');
- $this->drupalGet('foo');
- $this->assertResponse(404);
- $this->assertRaw($values['description'], t('404 page defaults are used at 404 pages.'));
- $this->drupalLogout();
- }
-
- /**
- * Tests entity and bundle overrides.
- */
- public function testOverrides() {
- // Initiate session with a user who can manage metatags.
- $permissions = [
- 'administer site configuration',
- 'administer meta tags',
- 'access content',
- 'create article content',
- 'administer nodes',
- 'create article content',
- 'create page content',
- ];
- $account = $this->drupalCreateUser($permissions);
- $this->drupalLogin($account);
-
- // Update the Metatag Node defaults.
- $this->drupalGet('admin/config/search/metatag/node');
- $this->assertResponse(200);
- $values = [
- 'title' => 'Test title for a node.',
- 'description' => 'Test description for a node.',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Content Metatag defaults.');
-
- // Create a test node.
- $node = $this->drupalCreateNode([
- 'title' => t('Hello, world!'),
- 'type' => 'article',
- ]);
-
- // Check that the new values are found in the response.
- $this->drupalGet('node/' . $node->id());
- $this->assertResponse(200);
- foreach ($values as $metatag => $value) {
- $this->assertRaw($value, t('Node metatag @tag overrides Global defaults.', ['@tag' => $metatag]));
- }
-
- // Check that when the node defaults don't define a metatag, the Global one
- // is used.
- // First unset node defaults.
- $this->drupalGet('admin/config/search/metatag/node');
- $this->assertResponse(200);
- $values = [
- 'title' => '',
- 'description' => '',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Content Metatag defaults.');
-
- // Then, set global ones.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $values = [
- 'title' => 'Global title',
- 'description' => 'Global description',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
-
- // Next, test that global defaults are rendered since node ones are empty.
- // We are creating a new node as doing a get on the previous one would
- // return cached results.
- // @todo BookTest.php resets the cache of a single node, which is way more
- // performant than creating a node for every set of assertions.
- // @see BookTest::testDelete()
- $node = $this->drupalCreateNode([
- 'title' => t('Hello, world!'),
- 'type' => 'article',
- ]);
- $this->drupalGet('node/' . $node->id());
- $this->assertResponse(200);
- foreach ($values as $metatag => $value) {
- $this->assertRaw($value, t('Found global @tag tag as Node does not set it.', ['@tag' => $metatag]));
- }
-
- // Now create article overrides and then test them.
- $this->drupalGet('admin/config/search/metatag/add');
- $this->assertResponse(200);
- $values = [
- 'id' => 'node__article',
- 'title' => 'Article title override',
- 'description' => 'Article description override',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText(strip_tags(t('Created the %label Metatag defaults.', ['%label' => 'Content: Article'])));
-
- // Confirm the fields load properly on the node/add/article page.
- $node = $this->drupalCreateNode([
- 'title' => t('Hello, world!'),
- 'type' => 'article',
- ]);
- $this->drupalGet('node/' . $node->id());
- $this->assertResponse(200);
- unset($values['id']);
- foreach ($values as $metatag => $value) {
- $this->assertRaw($value, t('Found bundle override for tag @tag.', ['@tag' => $metatag]));
- }
-
- // Test deleting the article defaults.
- $this->drupalGet('admin/config/search/metatag/node__article/delete');
- $this->assertResponse(200);
- $this->drupalPostForm(NULL, [], 'Delete');
- $this->assertText(t('Deleted @label defaults.', ['@label' => 'Content: Article']));
- }
-
- /**
- * Test that the entity default values load on the entity form.
- *
- * And that they can then be overridden correctly.
- */
- public function testEntityDefaultInheritence() {
- // Initiate session with a user who can manage meta tags and content type
- // fields.
- $permissions = [
- 'administer site configuration',
- 'administer meta tags',
- 'access content',
- 'administer node fields',
- 'create article content',
- 'administer nodes',
- 'create article content',
- 'create page content',
- ];
- $account = $this->drupalCreateUser($permissions);
- $this->drupalLogin($account);
-
- // Add a Metatag field to the Article content type.
- $this->drupalGet('admin/structure/types/manage/article/fields/add-field');
- $this->assertResponse(200);
- $edit = [
- 'new_storage_type' => 'metatag',
- 'label' => 'Meta tags',
- 'field_name' => 'meta_tags',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save and continue'));
- $this->drupalPostForm(NULL, [], t('Save field settings'));
- $this->assertText(strip_tags(t('Updated field %label field settings.', ['%label' => 'Meta tags'])));
- $this->drupalPostForm(NULL, [], t('Save settings'));
- $this->assertText(strip_tags(t('Saved %label configuration.', ['%label' => 'Meta tags'])));
-
- // Try creating an article, confirm the fields are present. This should be
- // the node default values that are shown.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200);
- $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]');
- $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]');
-
- // Customize the Article content type defaults.
- $this->drupalGet('admin/config/search/metatag/add');
- $this->assertResponse(200);
- $values = [
- 'id' => 'node__article',
- 'title' => 'Article title override',
- 'description' => 'Article description override',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText(strip_tags(t('Created the %label Metatag defaults.', ['%label' => 'Content: Article'])));
-
- // Try creating an article, this time with the overridden defaults.
- $this->drupalGet('node/add/article');
- $this->assertResponse(200);
- $this->assertFieldByName('field_meta_tags[0][basic][title]', 'Article title override');
- $this->assertFieldByName('field_meta_tags[0][basic][description]', 'Article description override');
- }
-
- /**
- * Test that protected Metatag defaults cannot be deleted.
- */
- public function testDefaultProtected() {
- // Initiate session with a user who can manage metatags.
- $permissions = ['administer site configuration', 'administer meta tags'];
- $account = $this->drupalCreateUser($permissions);
- $this->drupalLogin($account);
-
- // Add default metatag for Articles.
- $edit = [
- 'id' => 'node__article',
- ];
- $this->drupalPostForm('/admin/config/search/metatag/add', $edit, 'Save');
-
- // Check that protected defaults contains "Revert" link instead of "Delete".
- foreach (MetatagManager::protectedDefaults() as $protected) {
- $this->assertLinkByHref('/admin/config/search/metatag/' . $protected);
- $this->assertLinkByHref('/admin/config/search/metatag/' . $protected . '/revert');
- $this->assertNoLinkByHref('/admin/config/search/metatag/' . $protected . '/delete');
- }
-
- // Confirm that non protected defaults can be deleted.
- $this->assertLinkByHref('/admin/config/search/metatag/node__article');
- $this->assertNoLinkByHref('/admin/config/search/metatag/node__article/revert');
- $this->assertLinkByHref('/admin/config/search/metatag/node__article/delete');
-
- // Visit each protected default page to confirm "Delete" button is hidden.
- foreach (MetatagManager::protectedDefaults() as $protected) {
- $this->drupalGet('/admin/config/search/metatag/' . $protected);
- $this->assertNoLink('Delete');
- }
-
- // Confirm that non protected defaults can be deleted.
- $this->drupalGet('/admin/config/search/metatag/node__article');
- $this->assertLink('Delete');
- }
-
- /**
- * Test that metatag list page pager works as expected.
- */
- public function testListPager() {
- $this->loginUser1();
-
- $this->drupalGet('admin/config/search/metatag');
- $this->assertLinkByHref('/admin/config/search/metatag/global');
- $this->assertLinkByHref('/admin/config/search/metatag/front');
- $this->assertLinkByHref('/admin/config/search/metatag/403');
- $this->assertLinkByHref('/admin/config/search/metatag/404');
- $this->assertLinkByHref('/admin/config/search/metatag/node');
- $this->assertLinkByHref('/admin/config/search/metatag/taxonomy_term');
- $this->assertLinkByHref('/admin/config/search/metatag/user');
-
- // Create 50 vocabularies and generate metatag defaults for all of them.
- for ($i = 0; $i < 50; $i++) {
- $vocabulary = $this->createVocabulary();
- MetatagDefaults::create([
- 'id' => 'taxonomy_term__' . $vocabulary->id(),
- 'label' => 'Taxonomy term: ' . $vocabulary->label(),
- ])->save();
- }
-
- // Reload the page.
- $this->drupalGet('admin/config/search/metatag');
- $this->assertLinkByHref('/admin/config/search/metatag/global');
- $this->assertLinkByHref('/admin/config/search/metatag/front');
- $this->assertLinkByHref('/admin/config/search/metatag/403');
- $this->assertLinkByHref('/admin/config/search/metatag/404');
- $this->assertLinkByHref('/admin/config/search/metatag/node');
- $this->assertLinkByHref('/admin/config/search/metatag/taxonomy_term');
- // User entity not visible because it has been pushed to the next page.
- $this->assertNoLinkByHref('/admin/config/search/metatag/user');
- $this->clickLinkPartialName('Next');
-
- // Go to next page and confirm that parents are loaded and user us present.
- $this->assertLinkByHref('/admin/config/search/metatag/global');
- $this->assertLinkByHref('/admin/config/search/metatag/taxonomy_term');
- // Main links not visible in the 2nd page.
- $this->assertNoLinkByHref('/admin/config/search/metatag/front');
- $this->assertNoLinkByHref('/admin/config/search/metatag/403');
- $this->assertNoLinkByHref('/admin/config/search/metatag/404');
- $this->assertNoLinkByHref('/admin/config/search/metatag/node');
- // User is present because was pushed to page 2.
- $this->assertLinkByHref('/admin/config/search/metatag/user');
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagConfigTranslationTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagConfigTranslationTest.php
deleted file mode 100644
index f5c45180b..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagConfigTranslationTest.php
+++ /dev/null
@@ -1,160 +0,0 @@
-adminUser = $this->drupalCreateUser($this->permissions);
- $this->drupalLogin($this->adminUser);
-
- // Enable the French language.
- $this->drupalGet('admin/config/regional/language/add');
- $this->assertResponse(200);
- $edit = [
- 'predefined_langcode' => 'fr',
- ];
- $this->drupalPostForm(NULL, $edit, t('Add language'));
- $this->assertRaw(t(
- 'The language %language has been created and can now be used.',
- ['%language' => t('French')]
- ));
- }
-
- /**
- * Confirm the config defaults show on the translations page.
- */
- public function testConfigTranslationsExist() {
- // Ensure the config shows on the admin form.
- $this->drupalGet('admin/config/regional/config-translation');
- $this->assertResponse(200);
- $this->assertText(t('Metatag defaults'));
-
- // Load the main metatag_defaults config translation page.
- $this->drupalGet('admin/config/regional/config-translation/metatag_defaults');
- $this->assertResponse(200);
- // @todo Update this to confirm the H1 is loaded.
- $this->assertRaw(t('Metatag defaults'));
-
- // Load all of the Metatag defaults.
- $defaults = \Drupal::configFactory()->listAll('metatag.metatag_defaults');
-
- /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
- $config_manager = \Drupal::service('config.manager');
-
- // Confirm each of the configs is available on the translation form.
- foreach ($defaults as $config_name) {
- if ($config_entity = $config_manager->loadConfigEntityByName($config_name)) {
- $this->assertText($config_entity->label());
- }
- }
-
- // Confirm that each config translation page can be loaded.
- foreach ($defaults as $config_name) {
- if ($config_entity = $config_manager->loadConfigEntityByName($config_name)) {
- $this->drupalGet('admin/config/search/metatag/' . $config_entity->id() . '/translate');
- $this->assertResponse(200);
- }
- else {
- $this->error('Unable to load a Metatag default config: ' . $config_name);
- }
- }
- }
-
- /**
- * Confirm the global configs are translatable page.
- */
- public function testConfigTranslations() {
- // Add something to the Global config.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $edit = [
- 'title' => 'Test title',
- 'description' => 'Test description',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertResponse(200);
- $this->assertText(t('Saved the Global Metatag defaults.'));
-
- // Confirm the config has languages available to translate into.
- $this->drupalGet('admin/config/search/metatag/global/translate');
- $this->assertResponse(200);
-
- // Load the translation form.
- $this->drupalGet('admin/config/search/metatag/global/translate/fr/add');
- $this->assertResponse(200);
-
- // Confirm the meta tag fields are shown on the form. Confirm the fields and
- // values separately to make it easier to pinpoint where the problem is if
- // one should fail.
- $this->assertFieldByName('translation[config_names][metatag.metatag_defaults.global][tags][title]');
- $this->assertFieldByName('translation[config_names][metatag.metatag_defaults.global][tags][title]', $edit['title']);
- $this->assertFieldByName('translation[config_names][metatag.metatag_defaults.global][tags][description]');
- $this->assertFieldByName('translation[config_names][metatag.metatag_defaults.global][tags][description]', $edit['description']);
-
- // Confirm the form can be saved correctly.
- $edit = [
- 'translation[config_names][metatag.metatag_defaults.global][tags][title]' => 'Le title',
- 'translation[config_names][metatag.metatag_defaults.global][tags][description]' => 'Le description',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save translation'));
- $this->assertResponse(200);
- $this->assertText(t('Successfully saved French translation'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagCustomRouteTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagCustomRouteTest.php
deleted file mode 100644
index b22350c8e..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagCustomRouteTest.php
+++ /dev/null
@@ -1,57 +0,0 @@
- 'test name',
- 'type' => 'entity_test',
- ]);
- $entity_test->save();
-
- MetatagDefaults::create([
- 'id' => 'entity_test__entity_test',
- 'tags' => [
- 'keywords' => 'test',
- ],
- ])->save();
-
- $this->drupalGet('metatag_test_custom_route/' . $entity_test->id());
- $this->assertResponse(200);
- $xpath = $this->xpath("//meta[@name='keywords']");
- $this->assertEqual(count($xpath), 1);
- $this->assertEqual((string) $xpath[0]->attributes()['content'], 'test');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldNodeTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldNodeTest.php
deleted file mode 100644
index e56c7f0bb..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldNodeTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-createContentType(['type' => 'page']);
-
- // 8.3 has the label 'Save and publish'.
- if ((floatval(\Drupal::VERSION) <= 8.3)) {
- $this->entitySaveButtonLabel = 'Save and publish';
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTermTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTermTest.php
deleted file mode 100644
index 36bcbde64..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTermTest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-basePerms, $new_perms);
- $this->adminUser = $this->drupalCreateUser($all_perms);
- $this->drupalLogin($this->adminUser);
- $this->drupalGet('admin/structure/taxonomy/add');
- $this->assertResponse(200);
- $edit = [
- 'name' => 'Tags',
- 'vid' => 'tags',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->drupalLogout();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestBase.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestBase.php
deleted file mode 100644
index 47d1de01d..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestBase.php
+++ /dev/null
@@ -1,503 +0,0 @@
-setUpEntityType();
-
- // Merge the base permissions with the custom ones for the entity type and
- // create a user with these permissions.
- $all_perms = array_merge($this->basePerms, $this->entityPerms);
- $this->adminUser = $this->drupalCreateUser($all_perms);
- $this->drupalGet('/user/login');
- $this->assertResponse(200);
- $this->drupalLogin($this->adminUser);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function verbose($message, $title = NULL) {
- // Handle arrays, objects, etc.
- if (!is_string($message)) {
- $message = "
\n" . print_r($message, TRUE) . "\n
\n";
- }
-
- // Optional title to go before the output.
- if (!empty($title)) {
- $title = '
' . Html::escape($title) . "
\n";
- }
-
- parent::verbose($title . $message);
- }
-
- /**
- * Any additional configuration that's needed for this entity type.
- */
- protected function setUpEntityType() {}
-
- /**
- * A list of default values to add to the entity being created.
- *
- * Defaults to "{$entityTitleField}[0][value]" => $title.
- *
- * @return array
- * Default values.
- */
- protected function entityDefaultValues() {
- return [];
- }
-
- /**
- * Add a Metatag field to this entity type.
- */
- protected function addField() {
- // Add a metatag field to the entity type test_entity.
- $this->drupalGet($this->entityFieldAdminPath . '/add-field');
- $this->assertResponse(200);
- $edit = [
- 'label' => 'Metatag',
- 'field_name' => 'metatag',
- 'new_storage_type' => 'metatag',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save and continue'));
- $this->drupalPostForm(NULL, [], t('Save field settings'));
-
- // Clear all settings.
- $this->container->get('entity.manager')->clearCachedFieldDefinitions();
- }
-
- /**
- * Confirm that the global default values work correctly.
- *
- * Specifically when there are no entity or bundle defaults available.
- */
- public function testGlobalDefaultsInheritance() {
- // First we set global defaults.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $global_values = [
- 'metatag_test_tag' => 'Global description',
- ];
- $this->drupalPostForm(NULL, $global_values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
-
- // Add the field to this entity type.
- $this->addField();
-
- // Now when we create an entity, global defaults are used to fill the form
- // fields.
- $this->drupalGet($this->entityAddPath);
- $this->assertResponse(200);
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag'], t('The metatag_test_tag field has the global default as the field default does not define it.'));
- }
-
- /**
- * Confirm that the entity default values work correctly.
- */
- public function testEntityDefaultsInheritance() {
- // This test doesn't make sense if the entity doesn't support defaults.
- if (!$this->entitySupportsDefaults) {
- return;
- }
-
- // Set a global default.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $global_values = [
- 'metatag_test_tag' => 'Global description',
- ];
- $this->drupalPostForm(NULL, $global_values, 'Save');
- $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t('Global')])));
-
- // Set an entity default.
- $this->drupalGet('admin/config/search/metatag/' . $this->entityType);
- $this->assertResponse(200);
- $entity_values = [
- 'metatag_test_tag' => 'Entity description',
- ];
- $this->drupalPostForm(NULL, $entity_values, 'Save');
- $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t($this->entityLabel)])));
-
- // Add the field to this entity type.
- $this->addField();
-
- // Load the entity form for this entity type.
- $this->drupalGet($this->entityAddPath);
- $this->assertResponse(200);
- $this->assertNoText('Fatal error');
-
- // Allow the fields to be customized if needed.
- $title = 'Barfoo';
- $edit = $this->entityDefaultValues();
- if (empty($edit)) {
- $edit = [
- $this->entityTitleField . '[0][value]' => $title,
- ];
- }
-
- // If this entity type supports defaults then verify the global default is
- // not present but that the entity default *is* present.
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $entity_values['metatag_test_tag']);
- $this->assertNoFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']);
- }
-
- /**
- * Confirm that the default values for an entity bundle work.
- *
- * When there is no field for overriding the defaults.
- *
- * @todo
- */
- public function testBundleDefaultsInheritance() {
- }
-
- /**
- * Confirm a field can be added to the entity bundle.
- */
- public function testFieldCanBeAdded() {
- $this->drupalGet($this->entityFieldAdminPath . '/add-field');
- $this->assertResponse(200);
- $this->assertRaw('');
- }
-
- /**
- * Confirm a field can be added to the entity bundle.
- */
- public function testEntityFieldsAvailable() {
- // Add a field to the entity type.
- $this->addField();
-
- // Load the entity's form.
- $this->drupalGet($this->entityAddPath);
- $this->assertResponse(200);
- $this->assertNoText('Fatal error');
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]');
- }
-
- /**
- * Confirm that the default values load correctly for an entity created.
- *
- * Before the custom field is added.
- */
- public function testEntityFieldValuesOldEntity() {
- // Set a global default.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $global_values = [
- 'metatag_test_tag' => 'Global description',
- ];
- $this->drupalPostForm(NULL, $global_values, 'Save');
- $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t('Global')])));
-
- // Set an entity default if it's supported by the entity type.
- if ($this->entitySupportsDefaults) {
- $this->drupalGet('admin/config/search/metatag/' . $this->entityType);
- $this->assertResponse(200);
- $entity_values = [
- 'metatag_test_tag' => 'Entity description',
- ];
- $this->drupalPostForm(NULL, $entity_values, 'Save');
- $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t($this->entityLabel)])));
- }
-
- // Load the entity form for this entity type.
- $title = 'Barfoo';
- $this->drupalGet($this->entityAddPath);
- $this->assertResponse(200);
- $this->assertNoText('Fatal error');
-
- // Allow the fields to be customized if needed.
- $edit = $this->entityDefaultValues();
- if (empty($edit)) {
- $edit = [
- $this->entityTitleField . '[0][value]' => $title,
- ];
- }
-
- // Create a new entity object.
- $this->drupalPostForm(NULL, $edit, t($this->entitySaveButtonLabel));
- $entities = \Drupal::entityTypeManager()
- ->getStorage($this->entityType)
- ->loadByProperties([$this->entityTitleField => $title]);
- $this->assertEqual(1, count($entities), 'Entity was saved');
- $entity = reset($entities);
-
- // @todo Confirm the values output correctly.
- // Add a field to the entity type.
- $this->addField();
-
- // Open the 'edit' form for the entity.
- $this->drupalGet($entity->toUrl('edit-form'));
- $this->assertResponse(200);
-
- // If this entity type supports defaults then verify the global default is
- // not present but that the entity default *is* present.
- if ($this->entitySupportsDefaults) {
- $this->assertNoFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']);
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $entity_values['metatag_test_tag']);
- }
- else {
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']);
- }
-
- // @todo Confirm the values output correctly.
- }
-
- /**
- * Confirm that the default values load correctly.
- *
- * For an entity created after the custom field is added.
- */
- public function testEntityFieldValuesNewEntity() {
- // Set a global default.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $global_values = [
- 'metatag_test_tag' => 'Global description',
- ];
- $this->drupalPostForm(NULL, $global_values, 'Save');
- $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t('Global')])));
-
- // Set an entity default if it's supported by the entity type.
- if ($this->entitySupportsDefaults) {
- $this->drupalGet('admin/config/search/metatag/' . $this->entityType);
- $this->assertResponse(200);
- $entity_values = [
- 'metatag_test_tag' => 'Entity description',
- ];
- $this->drupalPostForm(NULL, $entity_values, 'Save');
- $this->assertText(strip_tags(t('Saved the %label Metatag defaults.', ['%label' => t($this->entityLabel)])));
- }
-
- // Add a field to the entity type.
- $this->addField();
-
- // Load the entity form for this entity type.
- $title = 'Barfoo';
- $this->drupalGet($this->entityAddPath);
- $this->assertResponse(200);
- $this->assertNoText('Fatal error');
-
- // If this entity type supports defaults then verify the global default is
- // not present but that the entity default *is* present.
- if ($this->entitySupportsDefaults) {
- $this->assertNoFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']);
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $entity_values['metatag_test_tag']);
- }
- else {
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']);
- }
-
- // Allow the fields to be customized if needed.
- $edit = $this->entityDefaultValues();
- if (empty($edit)) {
- $edit = [
- $this->entityTitleField . '[0][value]' => $title,
- ];
- }
-
- // Create a new entity object.
- $this->drupalPostForm(NULL, $edit, t($this->entitySaveButtonLabel));
- $entities = \Drupal::entityTypeManager()
- ->getStorage($this->entityType)
- ->loadByProperties([$this->entityTitleField => $title]);
- $this->assertEqual(1, count($entities), 'Entity was saved');
- $entity = reset($entities);
-
- // @todo Confirm the values output correctly.
- // Open the 'edit' form for the entity.
- $this->drupalGet($entity->toUrl('edit-form'));
- $this->assertResponse(200);
-
- // If this entity type supports defaults then verify the global default is
- // not present but that the entity default *is* present.
- if ($this->entitySupportsDefaults) {
- $this->assertNoFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']);
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $entity_values['metatag_test_tag']);
- }
- else {
- $this->assertFieldByName('field_metatag[0][basic][metatag_test_tag]', $global_values['metatag_test_tag']);
- }
-
- // @todo Confirm the values output correctly.
- }
-
- /**
- * Tests adding and editing values on a given entity type.
- *
- * @todo Finish this.
- */
- public function tofixTestEntityField() {
- // Add a field to the entity type.
- $this->addField();
-
- // Create a test entity.
- $this->drupalGet($this->entityAddPath);
- $this->assertResponse(200);
- $this->assertNoText('Fatal error');
- $edit = $this->entityDefaultValues($title) + [
- 'field_metatag[0][basic][metatag_test_tag]' => 'Kilimanjaro',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $entities = \Drupal::entityTypeManager()
- ->getStorage('entity_test')
- ->loadByProperties([$this->entityTitleField => 'Barfoo']);
- $this->assertEqual(1, count($entities), 'Entity was saved');
- $entity = reset($entities);
-
- // Make sure tags that have a field value but no default value still show
- // up.
- $this->drupalGet($entity->toUrl());
- $this->assertResponse(200);
- $elements = $this->cssSelect('meta[name=metatag_test_tag]');
- $this->assertTrue(count($elements) === 1, 'Found keywords metatag_test_tag from defaults');
- $this->assertEqual((string) $elements[0]['content'], 'Kilimanjaro', 'Field value for metatag_test_tag found when no default set.');
-
- // @todo This should not be required, but meta tags does not invalidate
- // cache upon setting globals.
- Cache::invalidateTags(['entity_test:' . $entity->id()]);
-
- // Update the Global defaults and test them.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $values = [
- 'metatag_test_tag' => 'Purple monkey dishwasher',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
- $this->drupalGet($entity->toUrl());
- $this->assertResponse(200);
- $elements = $this->cssSelect('meta[name=metatag_test_tag]');
- $this->assertTrue(count($elements) === 1, 'Found test metatag from defaults');
- $this->verbose('
' . print_r($elements, TRUE) . '
');
- $this->assertEqual((string) $elements[0]['content'], $values['metatag_test_tag']);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestTest.php
deleted file mode 100644
index 95f7da176..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFieldTestTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
-randomString(16);
- return [
- 'mail' => 'test' . $this->adminUser->getEmail(),
- 'name' => $title,
- 'pass[pass1]' => $password,
- 'pass[pass2]' => $password,
- ];
- }
-
- /**
- * Confirm the metatag field can be shown on a user registration page.
- *
- * @todo
- */
- public function testFieldsOnUserRegistrationForm() {}
-
- /**
- * Confirm the metatag field can be shown on a normal user's own edit form.
- *
- * @todo
- */
- public function testFieldsOnUserEditForm() {}
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagForumTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagForumTest.php
deleted file mode 100644
index 662cfc942..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagForumTest.php
+++ /dev/null
@@ -1,78 +0,0 @@
-adminUser = $this->drupalCreateUser($admin_permissions);
- $this->drupalLogin($this->adminUser);
-
- // Create content type.
- $this->drupalCreateContentType(['type' => 'page', 'display_submitted' => FALSE]);
- $this->nodeId = $this->drupalCreateNode(
- [
- 'title' => $this->randomMachineName(8),
- 'promote' => 1,
- ])->id();
-
- $this->config('system.site')->set('page.front', '/node/' . $this->nodeId)->save();
- }
-
- /**
- * Verify that a forum post can be loaded when Metatag is enabled.
- */
- public function testForumPost() {
- $this->drupalGet('node/add/forum');
- $this->assertResponse(200);
- $edit = [
- 'title[0][value]' => 'Testing forums',
- 'taxonomy_forums' => 1,
- 'body[0][value]' => 'Just testing.',
- ];
- $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save');
- $this->drupalPostForm(NULL, $edit, $save_label);
- $this->assertResponse(200);
- $this->assertText(t('@type @title has been created.', ['@type' => t('Forum topic'), '@title' => 'Testing forums']));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFrontpageTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFrontpageTest.php
deleted file mode 100644
index a360432c9..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagFrontpageTest.php
+++ /dev/null
@@ -1,172 +0,0 @@
-loginUser1();
-
- // Create content type.
- $this->drupalCreateContentType(['type' => 'page', 'display_submitted' => FALSE]);
- $this->nodeId = $this->drupalCreateNode(
- [
- 'title' => $this->randomMachineName(8),
- 'promote' => 1,
- ])->id();
-
- $this->config('system.site')->set('page.front', '/node/' . $this->nodeId)->save();
- }
-
- /**
- * The front page config is enabled, its meta tags should be used.
- */
- public function testFrontPageMetatagsEnabledConfig() {
- // Add something to the front page config.
- $this->drupalGet('admin/config/search/metatag/front');
- $this->assertResponse(200);
- $edit = [
- 'title' => 'Test title',
- 'description' => 'Test description',
- 'keywords' => 'testing,keywords',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertResponse(200);
- $this->assertText(t('Saved the Front page Metatag defaults.'));
-
- // Testing front page metatags.
- $this->drupalGet('');
- foreach ($edit as $metatag => $metatag_value) {
- $xpath = $this->xpath("//meta[@name='" . $metatag . "']");
- $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, $metatag_value);
- }
-
- $node_path = '/node/' . $this->nodeId;
- // Testing front page metatags.
- $this->drupalGet($node_path);
- foreach ($edit as $metatag => $metatag_value) {
- $xpath = $this->xpath("//meta[@name='" . $metatag . "']");
- $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, $metatag_value);
- }
-
- // Change the front page to a valid custom route.
- $site_edit = [
- 'site_frontpage' => '/test-page',
- ];
- $this->drupalGet('admin/config/system/site-information');
- $this->assertResponse(200);
- $this->drupalPostForm(NULL, $site_edit, t('Save configuration'));
- $this->assertText(t('The configuration options have been saved.'), 'The front page path has been saved.');
- return;
-
- // @todo Finish this?
- $this->drupalGet('test-page');
- $this->assertResponse(200);
- foreach ($edit as $metatag => $metatag_value) {
- $xpath = $this->xpath("//meta[@name='" . $metatag . "']");
- $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, $metatag_value);
- }
- }
-
- /**
- * Test front page meta tags when front page config is disabled.
- */
- public function testFrontPageMetatagDisabledConfig() {
- // Disable front page metatag, enable node metatag & check.
- $this->drupalGet('admin/config/search/metatag/front/delete');
- $this->assertResponse(200);
- $this->drupalPostForm(NULL, [], t('Delete'));
- $this->assertResponse(200);
- $this->assertText(t('Deleted Front page defaults.'));
-
- // Update the Metatag Node defaults.
- $this->drupalGet('admin/config/search/metatag/node');
- $this->assertResponse(200);
- $edit = [
- 'title' => 'Test title for a node.',
- 'description' => 'Test description for a node.',
- ];
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Saved the Content Metatag defaults.');
- $this->drupalGet('');
- foreach ($edit as $metatag => $metatag_value) {
- $xpath = $this->xpath("//meta[@name='" . $metatag . "']");
- $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, $metatag_value);
- }
-
- // Change the front page to a valid path.
- $this->drupalGet('admin/config/system/site-information');
- $this->assertResponse(200);
- $edit = [
- 'site_frontpage' => '/test-page',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
- $this->assertText(t('The configuration options have been saved.'), 'The front page path has been saved.');
-
- // Front page is custom route.
- // Update the Metatag Node global.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $edit = [
- 'title' => 'Test title.',
- 'description' => 'Test description.',
- ];
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
-
- // Test Metatags.
- $this->drupalGet('test-page');
- $this->assertResponse(200);
- foreach ($edit as $metatag => $metatag_value) {
- $xpath = $this->xpath("//meta[@name='" . $metatag . "']");
- $this->assertEqual(count($xpath), 1, 'Exactly one ' . $metatag . ' meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, $metatag_value);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagHelperTrait.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagHelperTrait.php
deleted file mode 100644
index fc9538abf..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagHelperTrait.php
+++ /dev/null
@@ -1,159 +0,0 @@
-setPassword($password)->save();
-
- // Support old and new tests.
- $account->passRaw = $password;
- $account->pass_raw = $password;
-
- // Login.
- $this->drupalLogin($account);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function verbose($message, $title = NULL) {
- // Handle arrays, objects, etc.
- if (!is_string($message)) {
- $message = "
\n" . print_r($message, TRUE) . "\n
\n";
- }
-
- // Optional title to go before the output.
- if (!empty($title)) {
- $title = '
' . Html::escape($title) . "
\n";
- }
-
- parent::verbose($title . $message);
- }
-
- /**
- * Create a content type and a node.
- *
- * @param string $title
- * A title for the node that will be returned.
- * @param string $body
- * The text to use as the body.
- *
- * @return \Drupal\node\NodeInterface
- * A fully formatted node object.
- */
- private function createContentTypeNode($title = 'Title test', $body = 'Body test') {
- $content_type = 'metatag_test';
- $args = [
- 'type' => $content_type,
- 'label' => 'Test content type',
- ];
- $this->createContentType($args);
-
- $args = [
- 'body' => [
- [
- 'value' => $body,
- 'format' => filter_default_format(),
- ],
- ],
- 'title' => $title,
- 'type' => $content_type,
- ];
-
- return $this->createNode($args);
- }
-
- /**
- * Create a vocabulary.
- *
- * @param array $values
- * Items passed to the vocabulary. If the 'vid' item is not present it will
- * be automatically generated. If the 'name' item is not present the 'vid'
- * will be used.
- *
- * @return \Drupal\taxonomy\Entity\Vocabulary
- * A fully formatted vocabulary object.
- */
- private function createVocabulary(array $values = []) {
- // Find a non-existent random type name.
- if (!isset($values['vid'])) {
- do {
- $id = strtolower($this->randomMachineName(8));
- } while (Vocabulary::load($id));
- }
- else {
- $id = $values['vid'];
- }
- $values += [
- 'vid' => $id,
- 'name' => $id,
- ];
- $vocab = Vocabulary::create($values);
- $status = $vocab->save();
-
- if ($this instanceof \PHPUnit_Framework_TestCase) {
- $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created vocabulary %type.', ['%type' => $vocab->id()]))->__toString());
- }
- else {
- $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created vocabulary %type.', ['%type' => $vocab->id()]))->__toString());
- }
-
- return $vocab;
- }
-
- /**
- * Create a taxonomy term.
- *
- * @param array $values
- * Items passed to the term. Requires the 'vid' element.
- *
- * @return Drupal\taxonomy\Entity\Term
- * A fully formatted term object.
- */
- private function createTerm(array $values = []) {
- // Populate defaults array.
- $values += [
- 'description' => [
- [
- 'value' => $this->randomMachineName(32),
- 'format' => filter_default_format(),
- ],
- ],
- 'name' => $this->randomMachineName(8),
- ];
- $term = Term::create($values);
- $status = $term->save();
-
- if ($this instanceof \PHPUnit_Framework_TestCase) {
- $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created term %name.', ['%name' => $term->label()]))->__toString());
- }
- else {
- $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created term %name.', ['%name' => $term->label()]))->__toString());
- }
-
- return $term;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagNodeTranslationTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagNodeTranslationTest.php
deleted file mode 100644
index 669726a34..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagNodeTranslationTest.php
+++ /dev/null
@@ -1,210 +0,0 @@
-adminUser = $this->drupalCreateUser($admin_permissions);
-
- // Add languages.
- foreach ($this->additionalLangcodes as $langcode) {
- ConfigurableLanguage::createFromLangcode($langcode)->save();
- }
- }
-
- /**
- * Tests the metatag value translations.
- */
- public function testMetatagValueTranslation() {
- if (floatval(\Drupal::VERSION) <= 8.3) {
- $save_label = t('Save and publish');
- $save_label_i18n = t('Save and keep published (this translation)');
- }
- else {
- $save_label = t('Save');
- $save_label_i18n = t('Save (this translation)');
- }
-
- // Set up a content type.
- $name = $this->randomMachineName() . ' ' . $this->randomMachineName();
- $this->drupalLogin($this->adminUser);
- $this->drupalCreateContentType(['type' => 'metatag_node', 'name' => $name]);
-
- // Add a metatag field to the content type.
- $this->drupalGet('admin/structure/types');
- $this->assertResponse(200);
- $this->drupalGet('admin/structure/types/manage/metatag_node');
- $this->assertResponse(200);
- $edit = [
- 'language_configuration[language_alterable]' => TRUE,
- 'language_configuration[content_translation]' => TRUE,
- ];
- $this->drupalPostForm(NULL, $edit, t('Save content type'));
- $this->assertResponse(200);
-
- $this->drupalGet('admin/structure/types/manage/metatag_node/fields/add-field');
- $this->assertResponse(200);
- $edit = [
- 'label' => 'Meta tags',
- 'field_name' => 'meta_tags',
- 'new_storage_type' => 'metatag',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save and continue'));
- $this->assertResponse(200);
- $this->drupalPostForm(NULL, [], t('Save field settings'));
- $this->assertResponse(200);
- $edit = [
- 'translatable' => TRUE,
- ];
- $this->drupalPostForm(NULL, $edit, t('Save settings'));
- $this->assertResponse(200);
- $this->drupalGet('admin/structure/types/manage/metatag_node/fields/node.metatag_node.field_meta_tags');
- $this->assertResponse(200);
-
- // Set up a node without explicit metatag description. This causes the
- // global default to be used, which contains a token (node:summary). The
- // token value should be correctly translated.
-
- // Load the node form.
- $this->drupalGet('node/add/metatag_node');
- $this->assertResponse(200);
-
- // Check the default values are correct.
- $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.');
- $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]', 'Default description token is present.');
-
- // Create a node.
- $edit = [
- 'title[0][value]' => 'Node Français',
- 'body[0][value]' => 'French summary.',
- ];
- $this->drupalPostForm(NULL, $edit, $save_label);
- $this->assertResponse(200);
-
- $xpath = $this->xpath("//meta[@name='description']");
- $this->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, 'French summary.');
-
- $this->drupalGet('node/1/translations/add/en/es');
- $this->assertResponse(200);
- // Check the default values are there.
- $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.');
- $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]', 'Default description token is present.');
-
- $edit = [
- 'title[0][value]' => 'Node Español',
- 'body[0][value]' => 'Spanish summary.',
- ];
- $this->drupalPostForm(NULL, $edit, $save_label_i18n);
- $this->assertResponse(200);
-
- $this->drupalGet('es/node/1');
- $this->assertResponse(200);
- $xpath = $this->xpath("//meta[@name='description']");
- $this->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, 'Spanish summary.');
- $this->assertNotEqual($value, 'French summary.');
-
- $this->drupalGet('node/1/edit');
- $this->assertResponse(200);
- // Check the default values are there.
- $this->assertFieldByName('field_meta_tags[0][basic][title]', '[node:title] | [site:name]', 'Default title token is present.');
- $this->assertFieldByName('field_meta_tags[0][basic][description]', '[node:summary]', 'Default description token is present.');
-
- // Set explicit values on the description metatag instead using the
- // defaults.
- $this->drupalGet('node/1/edit');
- $this->assertResponse(200);
- $edit = [
- 'field_meta_tags[0][basic][description]' => 'Overridden French description.',
- ];
- $this->drupalPostForm(NULL, $edit, $save_label_i18n);
- $this->assertResponse(200);
-
- $xpath = $this->xpath("//meta[@name='description']");
- $this->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, 'Overridden French description.');
- $this->assertNotEqual($value, 'Spanish summary.');
- $this->assertNotEqual($value, 'French summary.');
-
- $this->drupalGet('es/node/1/edit');
- $this->assertResponse(200);
- $edit = [
- 'field_meta_tags[0][basic][description]' => 'Overridden Spanish description.',
- ];
- $this->drupalPostForm(NULL, $edit, $save_label_i18n);
- $this->assertResponse(200);
-
- $xpath = $this->xpath("//meta[@name='description']");
- $this->assertEqual(count($xpath), 1, 'Exactly one description meta tag found.');
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, 'Overridden Spanish description.');
- $this->assertNotEqual($value, 'Spanish summary.');
- $this->assertNotEqual($value, 'French summary.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagStringTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagStringTest.php
deleted file mode 100644
index ac5c7d578..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagStringTest.php
+++ /dev/null
@@ -1,319 +0,0 @@
-adminUser = $this->drupalCreateUser($this->permissions);
- $this->drupalLogin($this->adminUser);
-
- $this->drupalCreateContentType(['type' => 'page', 'display_submitted' => FALSE]);
-
- // Add a Metatag field to the content type.
- $this->drupalGet('admin/structure/types');
- $this->assertResponse(200);
- $this->drupalGet('admin/structure/types/manage/page/fields/add-field');
- $this->assertResponse(200);
- $edit = [
- 'label' => 'Metatag',
- 'field_name' => 'metatag_field',
- 'new_storage_type' => 'metatag',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save and continue'));
- $this->drupalPostForm(NULL, [], t('Save field settings'));
- $this->container->get('entity.manager')->clearCachedFieldDefinitions();
- }
-
- /**
- * Tests that a meta tag with single quote is not double escaped.
- */
- public function testSingleQuote() {
- $this->checkString("bla'bleblu");
- }
-
- /**
- * Tests that a meta tag with a double quote is not double escaped.
- */
- public function testDoubleQuote() {
- $this->checkString('bla"bleblu');
- }
-
- /**
- * Tests that a meta tag with an ampersand is not double escaped.
- */
- public function testAmpersand() {
- $this->checkString("blable&blu");
- }
-
- /**
- * Tests that specific strings are not double escaped.
- */
- public function checkString($string) {
- $this->checkConfig($string);
- $this->checkNode($string);
- $this->checkEncodedField($string);
- }
-
- /**
- * Tests that a specific config string is not double encoded.
- */
- public function checkConfig($string) {
- // The original strings.
- $title_original = 'Title: ' . $string;
- $desc_original = 'Description: ' . $string;
-
- // The strings after they're encoded, but quotes will not be encoded.
- $title_encoded = htmlentities($title_original, ENT_QUOTES);
- $desc_encoded = htmlentities($desc_original, ENT_QUOTES);
-
- // The strings double-encoded, to make sure the tags aren't broken.
- $title_encodeded = htmlentities($title_encoded, ENT_QUOTES);
- $desc_encodeded = htmlentities($desc_encoded, ENT_QUOTES);
-
- // Update the Global defaults and test them.
- $this->drupalGet('admin/config/search/metatag/front');
- $this->assertResponse(200);
- $edit = [
- 'title' => $title_original,
- 'description' => $desc_original,
- ];
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertResponse(200);
-
- $metatag_defaults = \Drupal::config('metatag.metatag_defaults.front');
- $default_title = $metatag_defaults->get('tags')['title'];
- $default_description = $metatag_defaults->get('tags')['description'];
-
- // Make sure the title tag is stored correctly.
- $this->assertEqual($title_original, $default_title, 'The title tag was stored in its original format.');
- $this->assertNotEqual($title_encoded, $default_title, 'The title tag was not stored in an encoded format.');
- $this->assertNotEqual($title_encodeded, $default_title, 'The title tag was not stored in a double-encoded format.');
-
- // Make sure the description tag is stored correctly.
- $this->assertEqual($desc_original, $default_description, 'The description tag was stored in its original format.');
- $this->assertNotEqual($desc_encoded, $default_description, 'The description tag was not stored in an encoded format.');
- $this->assertNotEqual($desc_encodeded, $default_description, 'The description tag was not stored in a double-encoded format.');
-
- // Set up a node without explicit metatag description. This causes the
- // global default to be used, which contains a token (node:summary). The
- // token value should be correctly translated.
-
- // Create a node.
- $this->drupalGet('node/add/page');
- $this->assertResponse(200);
- $edit = [
- 'title[0][value]' => $title_original,
- 'body[0][value]' => $desc_original,
- ];
- $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save');
- $this->drupalPostForm(NULL, $edit, $save_label);
-
- $this->config('system.site')->set('page.front', '/node/1')->save();
-
- // Load the front page.
- $this->drupalGet('');
- $this->assertResponse(200);
-
- // Again, with xpath the HTML entities will be parsed automagically.
- $xpath_title = (string) current($this->xpath("//title"));
- $this->assertEqual($xpath_title, $title_original);
- $this->assertNotEqual($xpath_title, $title_encoded);
- $this->assertNotEqual($xpath_title, $title_encodeded);
-
- // The page title should be HTML encoded; have to do this check manually
- // because assertRaw() checks the raw HTML, not the parsed strings like
- // xpath does.
- $this->assertRaw('' . $title_encoded . '', 'Confirmed the node title tag is available in its encoded format.');
- $this->assertNoRaw('' . $title_original . '', 'Confirmed the node title tag is not available in its original format.');
- $this->assertNoRaw('' . $title_encodeded . '', 'Confirmed the node title tag is not double-double-encoded?');
-
- // Again, with xpath the HTML entities will be parsed automagically.
- $xpath = $this->xpath("//meta[@name='description']");
- $this->assertEqual($xpath[0]['content'], $desc_original);
- $this->assertNotEqual($xpath[0]['content'], $desc_encoded);
- $this->assertNotEqual($xpath[0]['content'], $desc_encodeded);
- }
-
- /**
- * Tests that a specific node string is not double escaped.
- */
- public function checkNode($string) {
- $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save');
-
- // The original strings.
- $title_original = 'Title: ' . $string;
- $desc_original = 'Description: ' . $string;
-
- // The strings after they're encoded, but quotes will not be encoded.
- $title_encoded = htmlentities($title_original, ENT_QUOTES);
- $desc_encoded = htmlentities($desc_original, ENT_QUOTES);
-
- // The strings double-encoded, to make sure the tags aren't broken.
- $title_encodeded = htmlentities($title_encoded, ENT_QUOTES);
- $desc_encodeded = htmlentities($desc_encoded, ENT_QUOTES);
-
- // Update the Global defaults and test them.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $edit = [
- 'title' => $title_original,
- 'description' => $desc_original,
- ];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertResponse(200);
-
- // Set up a node without explicit metatag description. This causes the
- // global default to be used, which contains a token (node:summary). The
- // token value should be correctly translated.
-
- // Create a node.
- $this->drupalGet('node/add/page');
- $this->assertResponse(200);
- $edit = [
- 'title[0][value]' => $title_original,
- 'body[0][value]' => $desc_original,
- ];
- $this->drupalPostForm(NULL, $edit, $save_label);
- $this->assertResponse(200);
-
- // Load the node page.
- $this->drupalGet('node/1');
- $this->assertResponse(200);
-
- // Again, with xpath the HTML entities will be parsed automagically.
- $xpath_title = (string) current($this->xpath("//title"));
- $this->assertEqual($xpath_title, $title_original);
- $this->assertNotEqual($xpath_title, $title_encoded);
- $this->assertNotEqual($xpath_title, $title_encodeded);
-
- // The page title should be HTML encoded; have to do this check manually
- // because assertRaw() checks the raw HTML, not the parsed strings like
- // xpath does.
- $this->assertRaw('' . $title_encoded . '', 'Confirmed the node title tag is encoded.');
- // Again, with xpath the HTML entities will be parsed automagically.
- $xpath = $this->xpath("//meta[@name='description']");
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, $desc_original);
- $this->assertNotEqual($value, $desc_encoded);
- $this->assertNotEqual($value, $desc_encodeded);
-
- // Normal meta tags should be encoded properly.
- $this->assertRaw('"' . $desc_encoded . '"', 'Confirmed the node "description" meta tag string was encoded properly.');
- // Normal meta tags with HTML entities should be displayed in their original
- // format.
- $this->assertNoRaw('"' . $desc_original . '"', 'Confirmed the node "description" meta tag string does not show in its original form.');
- // Normal meta tags should not be double-encoded.
- $this->assertNoRaw('"' . $desc_encodeded . '"', 'Confirmed the node "description" meta tag string was not double-encoded.');
- }
-
- /**
- * Tests that fields with encoded HTML entities will not be double-encoded.
- */
- public function checkEncodedField($string) {
- $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save');
-
- // The original strings.
- $title_original = 'Title: ' . $string;
- $desc_original = 'Description: ' . $string;
-
- // The strings after they're encoded, but quotes will not be encoded.
- $desc_encoded = htmlentities($desc_original, ENT_QUOTES);
-
- // The strings double-encoded, to make sure the tags aren't broken.
- $desc_encodeded = htmlentities($desc_encoded, ENT_QUOTES);
-
- // Update the Global defaults and test them.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $edit = [
- 'title' => $title_original,
- 'description' => $desc_original,
- ];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertResponse(200);
-
- // Set up a node without explicit metatag description. This causes the
- // global default to be used, which contains a token (node:summary). The
- // token value should be correctly translated.
-
- // Create a node.
- $this->drupalGet('node/add/page');
- $this->assertResponse(200);
- $edit = [
- 'title[0][value]' => $title_original,
- 'body[0][value]' => $desc_original,
- ];
- $this->drupalPostForm(NULL, $edit, $save_label);
- $this->assertResponse(200);
-
- // Load the node page.
- $this->drupalGet('node/1');
- $this->assertResponse(200);
-
- // With xpath the HTML entities will be parsed automagically.
- $xpath = $this->xpath("//meta[@name='description']");
- $value = (string) $xpath[0]['content'];
- $this->assertEqual($value, $desc_original);
- $this->assertNotEqual($value, $desc_encoded);
- $this->assertNotEqual($value, $desc_encodeded);
-
- // Normal meta tags should be encoded properly.
- $this->assertRaw('"' . $desc_encoded . '"', 'Confirmed the node "description" meta tag string was encoded properly.');
-
- // Normal meta tags with HTML entities should be displayed in their original
- // format.
- $this->assertNoRaw('"' . $desc_original . '"', 'Confirmed the node "description" meta tag string does not show in its original form.');
-
- // Normal meta tags should not be double-encoded.
- $this->assertNoRaw('"' . $desc_encodeded . '"', 'Confirmed the node "description" meta tag string was not double-encoded.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagTypesTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagTypesTest.php
deleted file mode 100644
index c1404835b..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagTypesTest.php
+++ /dev/null
@@ -1,188 +0,0 @@
-adminUser = $this->drupalCreateUser($this->permissions);
- $this->drupalLogin($this->adminUser);
-
- // Add a metatag field to the entity type test_entity.
- $this->drupalGet('entity_test/structure/entity_test/fields/add-field');
- $this->assertResponse(200);
- $edit = [
- 'label' => 'Metatag',
- 'field_name' => 'metatag',
- 'new_storage_type' => 'metatag',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save and continue'));
- $this->drupalPostForm(NULL, [], t('Save field settings'));
- $this->container->get('entity.manager')->clearCachedFieldDefinitions();
- }
-
- /**
- * Tests whether HTML is correctly removed from metatags.
- *
- * Tests three values in meta tags -- one without any HTML; one with raw html;
- * and one with escaped HTML. To pass all HTML including escaped should be
- * removed.
- */
- public function testHtmlIsRemoved() {
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $values = [
- 'abstract' => 'No HTML here',
- 'description' => '
Surrounded by raw HTML
',
- 'keywords' => '<html><body><p class="test">Surrounded by escaped HTML</p></body></html>',
- ];
-
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
- drupal_flush_all_caches();
- $this->drupalGet('hit-a-404');
- $this->assertResponse(404);
-
- $this->assertRaw('', t('Test with no HTML content'));
- $this->assertRaw('', t('Test with raw HTML content'));
- $this->assertRaw('', t('Test with escaped HTML content'));
- }
-
- /**
- * Tests the 'secure' meta tag attribute.
- *
- * Tests insecure values in og:image:secure_url (a tag with secure attribute
- * set to TRUE) and in og:image (a tag with secure attribute set to FALSE). To
- * To pass og:image_secure should be changed to https:// and og:image
- * unchanged.
- */
- public function testSecureTagOption() {
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $values = [
- 'og_image' => 'http://blahblahblah.com/insecure.jpg',
- 'og_image_secure_url' => 'http://blahblahblah.com/secure.jpg',
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
- drupal_flush_all_caches();
- $this->drupalGet('');
- $this->assertResponse(200);
-
- $this->assertRaw('', t('Test og:image with regular http:// link'));
- $this->assertRaw('', t('Test og:image:secure_url updated regular http:// link to https://'));
- }
-
- /**
- * Check the contact form.
- *
- * @todo Move this somewhere else.
- */
- public function testContactForm() {
- // Test a route where the entity for that route does not implement
- // ContentEntityInterface.
- $controller = \Drupal::entityTypeManager()->getStorage('contact_form');
- $controller->create([
- 'id' => 'test_contact_form',
- ])->save();
- $account = $this->drupalCreateUser(['access site-wide contact form']);
- $this->drupalLogin($account);
- $this->drupalGet('contact/test_contact_form');
- $this->assertResponse(200);
- }
-
- /**
- * Check URL handling.
- *
- * @todo Finish.
- */
- public function todoTestUrl() {
- // $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save');
- // // Tests meta tags with URLs work.
- // $this->drupalGet($this->entity_add_path);
- // $this->assertResponse(200);
- // $edit = [
- // 'name[0][value]' => 'UrlTags',
- // 'user_id[0][target_id]' => 'foo (' . $this->adminUser->id() . ')',
- // 'field_metatag[0][advanced][original_source]' => 'http://example.com/foo.html',
- // ];
- // $this->drupalPostForm(NULL, $edit, $save_label);
- // $entities = entity_load_multiple_by_properties('entity_test', [
- // 'name' => 'UrlTags',
- // ]);
- // $this->assertEqual(1, count($entities), 'Entity was saved');
- // $entity = reset($entities);
- // $this->drupalGet($this->entity_base_path . '/' . $entity->id());
- // $this->assertResponse(200);
- // $elements = $this->cssSelect("meta[name='original-source']");
- // $this->assertTrue(count($elements) === 1, 'Found original source metatag from defaults');
- // $this->assertEqual((string) $elements[0]['content'], $edit['field_metatag[0][advanced][original_source]']);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagsTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagsTest.php
deleted file mode 100644
index 5cdb3a501..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagTagsTest.php
+++ /dev/null
@@ -1,184 +0,0 @@
-config('system.site')->set('page.front', '/test-page')->save();
-
- // Initiate session with a user who can manage meta tags and access content.
- $permissions = [
- 'administer site configuration',
- 'administer meta tags',
- 'access content',
- ];
- $account = $this->drupalCreateUser($permissions);
- $this->drupalLogin($account);
- }
-
- /**
- * Tests that this module's tags are available.
- */
- public function testTagsArePresent() {
- // Load the global config.
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
-
- // Confirm the various meta tags are available.
- foreach ($this->tags as $tag) {
- // Look for a custom method named "{$tagname}TestFieldXpath", if found
- // use that method to get the xpath definition for this meta tag,
- // otherwise it defaults to just looking for a text input field.
- $method = $this->getMethodFromTagCallback($tag, 'test_field_xpath');
- if (method_exists($this, $method)) {
- $xpath = $this->$method();
- }
- else {
- $xpath = "//input[@name='{$tag}' and @type='text']";
- }
-
- $this->assertFieldByXPath($xpath, NULL, new FormattableMarkup('Found the @tag meta tag field.', ['@tag' => $tag]));
- }
-
- $this->drupalLogout();
- }
-
- /**
- * Confirm that each tag can be saved and that the output is correct.
- */
- public function testTagsInputOutput() {
- // Create a content type to test with.
- $this->createContentType(['type' => 'page']);
- $this->drupalCreateNode([
- 'title' => t('Hello, world!'),
- 'type' => 'page',
- ]);
-
- // Test a non-entity path and an entity path. The non-entity path inherits
- // the global meta tags, the entity path inherits from its entity config.
- $paths = [
- [
- 'admin/config/search/metatag/global',
- 'metatag_test_custom_route',
- 'Saved the Global Metatag defaults.',
- ],
- [
- 'admin/config/search/metatag/node',
- 'node/1',
- 'Saved the Content Metatag defaults',
- ],
- ];
-
- foreach ($paths as $item) {
- list($path1, $path2, $save_message) = $item;
-
- // Load the global config.
- $this->drupalGet($path1);
- $this->assertResponse(200);
-
- // Update the Global defaults and test them.
- $all_values = $values = [];
- foreach ($this->tags as $tag_name) {
- // Look for a custom method named "{$tagname}TestKey", if found use
- // that method to get the test string for this meta tag, otherwise it
- // defaults to the meta tag's name.
- $method = $this->getMethodFromTagCallback($tag_name, 'TestKey');
- if (method_exists($this, $method)) {
- $test_key = $this->$method();
- }
- else {
- $test_key = $tag_name;
- }
-
- // Look for a custom method named "{$tagname}TestValue", if found use
- // that method to get the test string for this meta tag, otherwise it
- // defaults to just generating a random string.
- $method = $this->getMethodFromTagCallback($tag_name, 'TestValue');
- if (method_exists($this, $method)) {
- $test_value = $this->$method();
- }
- else {
- // Generate a random string. Generating two words of 8 characters each
- // with simple machine name -style strings.
- $test_value = $this->randomMachineName() . ' ' . $this->randomMachineName();
- }
-
- $values[$test_key] = $test_value;
- $all_values[$tag_name] = $test_value;
- }
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText($save_message);
-
- // Load the test page.
- $this->drupalGet($path2);
- $this->assertResponse(200);
-
- // Look for the values.
- foreach ($this->tags as $tag_name) {
- // Look for a custom method named "{$tag_name}TestOutputXpath", if
- // found use that method to get the xpath definition for this meta tag,
- // otherwise it defaults to just looking for a meta tag matching:
- // <$testTag $testNameAttribute=$tag_name $testValueAttribute=$value />
- $method = $this->getMethodFromTagCallback($tag_name, 'TestOutputXpath');
- if (method_exists($this, $method)) {
- $xpath_string = $this->$method();
- }
- else {
- // Look for a custom method named "{$tag_name}TestTag", if
- // found use that method to get the xpath definition for this meta
- // tag, otherwise it defaults to $this->testTag.
- $method = $this->getMethodFromTagCallback($tag_name, 'TestTag');
- if (method_exists($this, $method)) {
- $xpath_tag = $this->$method();
- }
- else {
- $xpath_tag = $this->testTag;
- }
-
- // Look for a custom method named "{$tag_name}TestNameAttribute",
- // if found use that method to get the xpath definition for this meta
- // tag, otherwise it defaults to $this->testNameAttribute.
- $method = $this->getMethodFromTagCallback($tag_name, 'TestNameAttribute');
- if (method_exists($this, $method)) {
- $xpath_name_attribute = $this->$method();
- }
- else {
- $xpath_name_attribute = $this->testNameAttribute;
- }
-
- // Look for a custom method named "{$tag_name}TestTagName", if
- // found use that method to get the xpath definition for this meta
- // tag, otherwise it defaults to $tag_name.
- $method = $this->getMethodFromTagCallback($tag_name, 'TestTagName');
- if (method_exists($this, $method)) {
- $xpath_name_tag = $this->$method();
- }
- else {
- $xpath_name_tag = $this->getTestTagName($tag_name);
- }
-
- // Compile the xpath.
- $xpath_string = "//{$xpath_tag}[@{$xpath_name_attribute}='{$xpath_name_tag}']";
- }
-
- // Look for a custom method named "{$tag_name}TestValueAttribute", if
- // found use that method to get the xpath definition for this meta tag,
- // otherwise it defaults to $this->testValueAttribute.
- $method = $this->getMethodFromTagCallback($tag_name, 'TestValueAttribute');
- if (method_exists($this, $method)) {
- $xpath_value_attribute = $this->$method();
- }
- else {
- $xpath_value_attribute = $this->testValueAttribute;
- }
-
- // Extract the meta tag from the HTML.
- $xpath = $this->xpath($xpath_string);
- $this->assertEqual(count($xpath), 1, new FormattableMarkup('One @name tag found.', ['@name' => $tag_name]));
- if (count($xpath) !== 1) {
- $this->verbose($xpath, $tag_name . ': ' . $xpath_string);
- }
-
- // Run various tests on the output variables.
- // Most meta tags have an attribute, but some don't.
- if (!empty($xpath_value_attribute)) {
- $this->assertTrue($xpath_value_attribute);
- $this->assertTrue(isset($xpath[0][$xpath_value_attribute]));
- // Help with debugging.
- if (!isset($xpath[0][$xpath_value_attribute])) {
- $this->verbose($xpath, $tag_name . ': ' . $xpath_string);
- }
- else {
- if ((string) $xpath[0][$xpath_value_attribute] != $all_values[$tag_name]) {
- $this->verbose($xpath, $tag_name . ': ' . $xpath_string);
- }
- $this->assertTrue($xpath[0][$xpath_value_attribute]);
- $this->assertEqual($xpath[0][$xpath_value_attribute], $all_values[$tag_name], "The meta tag was found with the expected value.");
- }
- }
- else {
- $this->verbose($xpath, $tag_name . ': ' . $xpath_string);
- $this->assertTrue((string) $xpath[0]);
- $this->assertEqual((string) $xpath[0], $all_values[$tag_name], "The meta tag was found with the expected value.");
- }
- }
- }
-
- $this->drupalLogout();
- }
-
- /**
- * Convert a tag's internal name to the string which is actually used in HTML.
- *
- * The meta tag internal name will be machine names, i.e. only contain a-z,
- * A-Z, 0-9 and the underline character. Meta tag names will actually contain
- * any possible character.
- *
- * @param string $tag_name
- * The tag name to be converted.
- *
- * @return string
- * The converted tag name.
- */
- private function getTestTagName($tag_name) {
- return $tag_name;
- }
-
- /**
- * Generate a random value for testing meta tag fields.
- *
- * As a reasonable default, this will generating two words of 8 characters
- * each with simple machine name -style strings.
- *
- * @return string
- * A normal string.
- */
- private function getTestTagValue() {
- return $this->randomMachineName() . ' ' . $this->randomMachineName();
- }
-
- /**
- * Generate a URL for an image.
- *
- * @return string
- * An absolute URL to a non-existent image.
- */
- private function randomImageUrl() {
- return 'http://www.example.com/images/' . $this->randomMachineName() . '.png';
- }
-
- /**
- * Convert a tag name with a callback to a lowerCamelCase method name.
- *
- * @param string $tag_name
- * The meta tag name.
- * @param string $callback
- * The callback that is to be used.
- *
- * @return string
- * The tag name and callback concatenated together and converted to
- * lowerCamelCase.
- */
- private function getMethodFromTagCallback($tag_name, $callback) {
- return lcfirst(Container::camelize($tag_name . '_' . $callback));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagXssTest.php b/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagXssTest.php
deleted file mode 100644
index da5a3e6d8..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/MetatagXssTest.php
+++ /dev/null
@@ -1,213 +0,0 @@
-alert("xss");';
-
- /**
- * String that causes an alert when meta tags aren't filtered for xss.
- *
- * @var string
- */
- private $xssString = '">';
-
- /**
- * String that causes an alert when meta tags aren't filtered for xss.
- *
- * "Image" meta tags are processed differently to others, so this checks for a
- * different string.
- *
- * @var string
- */
- private $xssImageString = '">';
-
- /**
- * Administrator user for tests.
- *
- * @var \Drupal\user\UserInterface
- */
- protected $adminUser;
-
- /**
- * {@inheritdoc}
- */
- public static $modules = [
- 'node',
- 'views',
- 'system',
- 'field',
- 'field_ui',
- 'token',
- 'metatag',
- ];
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- parent::setUp();
-
- // Create a user that can manage content types and create content.
- $admin_permissions = [
- 'administer content types',
- 'administer nodes',
- 'bypass node access',
- 'administer meta tags',
- 'administer site configuration',
- 'access content',
- 'administer content types',
- 'administer nodes',
- 'administer node fields',
- ];
-
- // Create and login a with the admin-ish permissions user.
- $this->adminUser = $this->drupalCreateUser($admin_permissions);
- $this->drupalLogin($this->adminUser);
-
- // Set up a content type.
- $this->drupalCreateContentType(['type' => 'metatag_node', 'name' => 'Test Content Type']);
-
- // Add a metatag field to the content type.
- $this->drupalGet('admin/structure/types/manage/metatag_node/fields/add-field');
- $this->assertResponse(200);
- $edit = [
- 'label' => 'Metatag',
- 'field_name' => 'metatag_field',
- 'new_storage_type' => 'metatag',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save and continue'));
- $this->drupalPostForm(NULL, [], t('Save field settings'));
- }
-
- /**
- * Verify XSS injected in global config is not rendered.
- */
- public function testXssMetatagConfig() {
- $this->drupalGet('admin/config/search/metatag/global');
- $this->assertResponse(200);
- $values = [
- 'title' => $this->xssTitleString,
- 'abstract' => $this->xssString,
- 'image_src' => $this->xssImageString,
- ];
- $this->drupalPostForm(NULL, $values, 'Save');
- $this->assertText('Saved the Global Metatag defaults.');
- $this->rebuildAll();
-
- // Load the Views-based front page.
- $this->drupalGet('node');
- $this->assertResponse(200);
- $this->assertText(t('No front page content has been created yet.'));
-
- // Check for the title tag, which will have the HTML tags removed and then
- // be lightly HTML encoded.
- $this->assertEscaped(strip_tags($this->xssTitleString));
- $this->assertNoRaw($this->xssTitleString);
-
- // Check for the basic meta tag.
- $this->assertRaw($this->escapedXssTag);
- $this->assertNoRaw($this->xssString);
-
- // Check for the image meta tag.
- $this->assertRaw($this->escapedXssImageTag);
- $this->assertNoRaw($this->xssImageString);
- }
-
- /**
- * Verify XSS injected in the entity metatag override field is not rendered.
- */
- public function testXssEntityOverride() {
- $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save');
-
- $this->drupalGet('node/add/metatag_node');
- $this->assertResponse(200);
- $edit = [
- 'title[0][value]' => $this->randomString(32),
- 'field_metatag_field[0][basic][title]' => $this->xssTitleString,
- 'field_metatag_field[0][basic][abstract]' => $this->xssString,
- 'field_metatag_field[0][advanced][image_src]' => $this->xssImageString,
- ];
- $this->drupalPostForm(NULL, $edit, $save_label);
-
- // Check for the title tag, which will have the HTML tags removed and then
- // be lightly HTML encoded.
- $this->assertEscaped(strip_tags($this->xssTitleString));
- $this->assertNoRaw($this->xssTitleString);
-
- // Check for the basic meta tag.
- $this->assertRaw($this->escapedXssTag);
- $this->assertNoRaw($this->xssString);
-
- // Check for the image meta tag.
- $this->assertRaw($this->escapedXssImageTag);
- $this->assertNoRaw($this->xssImageString);
- }
-
- /**
- * Verify XSS injected in the entity titles are not rendered.
- */
- public function testXssEntityTitle() {
- $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save');
-
- $this->drupalGet('node/add/metatag_node');
- $this->assertResponse(200);
- $edit = [
- 'title[0][value]' => $this->xssTitleString,
- 'body[0][value]' => $this->randomString() . ' ' . $this->randomString(),
- ];
- $this->drupalPostForm(NULL, $edit, $save_label);
-
- // Check for the title tag, which will have the HTML tags removed and then
- // be lightly HTML encoded.
- $this->assertEscaped(strip_tags($this->xssTitleString));
- $this->assertNoRaw($this->xssTitleString);
- }
-
- /**
- * Verify XSS injected in the entity fields are not rendered.
- */
- public function testXssEntityBody() {
- $save_label = (floatval(\Drupal::VERSION) <= 8.3) ? t('Save and publish') : t('Save');
-
- $this->drupalGet('node/add/metatag_node');
- $this->assertResponse(200);
- $edit = [
- 'title[0][value]' => $this->randomString(),
- 'body[0][value]' => $this->xssTitleString,
- ];
- $this->drupalPostForm(NULL, $edit, $save_label);
-
- // Check the body text.
- // $this->assertNoTitle($this->xssTitleString);
- $this->assertNoRaw($this->xssTitleString);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/src/Tests/WithRedirect.php b/sites/all/modules/contrib/admin/metatag/src/Tests/WithRedirect.php
deleted file mode 100644
index 72c0833c6..000000000
--- a/sites/all/modules/contrib/admin/metatag/src/Tests/WithRedirect.php
+++ /dev/null
@@ -1,37 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('Support module for testing handling of a custom route.') . '
'),
- ];
-
- return $render;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/config/schema/metatag_test_tag.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/config/schema/metatag_test_tag.metatag_tag.schema.yml
deleted file mode 100644
index f401affa9..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/config/schema/metatag_test_tag.metatag_tag.schema.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-metatag.metatag_tag.metatag_test_tag:
- type: label
- label: 'Metatag Test'
diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml
deleted file mode 100644
index ab69327c1..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: 'Metatag Tests: Tag'
-type: module
-description: 'Support module for testing handling of a custom meta tag.'
-# core: 8.x
-package: Testing
-dependencies:
- - metatag:metatag
-
-# Information added by Drupal.org packaging script on 2019-02-20
-version: '8.x-1.8'
-core: '8.x'
-project: 'metatag'
-datestamp: 1550683387
diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.metatag_tag.schema.yml b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.metatag_tag.schema.yml
deleted file mode 100644
index 405573206..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.metatag_tag.schema.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-metatag.metatag_tag.metatag_test_tag:
- type: label
- label: 'Metatag test'
diff --git a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.module b/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.module
deleted file mode 100644
index 65808d44f..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/modules/metatag_test_tag/metatag_test_tag.module
+++ /dev/null
@@ -1,6 +0,0 @@
-getEditable('system.site')
- ->set('page.front', '/node')
- ->save(TRUE);
- }
-
- /**
- * Test the default values for the front page.
- */
- public function testFrontpage() {
- $this->drupalGet('');
- $this->assertResponse(200);
- $xpath = $this->xpath("//link[@rel='canonical']");
- $this_page_url = $this->buildUrl('');
- $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url);
- }
-
- /**
- * Test the default values for a custom route.
- */
- public function testCustomRoute() {
- $this->drupalGet('metatag_test_custom_route');
- $this->assertResponse(200);
- $this->assertText('Hello world!');
-
- // Check the meta tags.
- $xpath = $this->xpath("//link[@rel='canonical']");
- $this_page_url = $this->buildUrl('/metatag_test_custom_route');
- $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url);
- }
-
- /**
- * Test the default values for a Node entity.
- */
- public function testNode() {
- $node = $this->createContentTypeNode();
- $this_page_url = $node->toUrl('canonical', ['absolute' => TRUE])->toString();
-
- // Load the node's entity page.
- $this->drupalGet($this_page_url);
- $this->assertResponse(200);
-
- // Check the meta tags.
- $xpath = $this->xpath("//link[@rel='canonical']");
- $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url);
- }
-
- /**
- * Test the default values for a Term entity.
- */
- public function testTerm() {
- $vocab = $this->createVocabulary();
- $term = $this->createTerm(['vid' => $vocab->id()]);
- $this_page_url = $term->toUrl('canonical', ['absolute' => TRUE])->toString();
- $this->drupalGet($this_page_url);
- $this->assertResponse(200);
-
- // Check the meta tags.
- $xpath = $this->xpath("//link[@rel='canonical']");
- $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url);
- }
-
- /**
- * Test the default values for a User entity.
- */
- public function testUser() {
- $this->loginUser1();
- $account = \Drupal::currentUser()->getAccount();
- $this_page_url = $account->toUrl('canonical', ['absolute' => TRUE])->toString();
-
- // Load the user's entity page.
- $this->drupalGet($this_page_url);
- $this->assertResponse(200);
-
- // Check the meta tags.
- $xpath = $this->xpath("//link[@rel='canonical']");
- $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url);
- $this->drupalLogout();
- }
-
- /**
- * Test the default values for the user login page, etc.
- */
- public function testUserLoginPages() {
- $front_url = $this->buildUrl('', ['absolute' => TRUE]);;
-
- // A list of paths to examine.
- $routes = [
- '/user/login',
- '/user/register',
- '/user/password',
- ];
-
- foreach ($routes as $route) {
- // Identify the path to load.
- $this_page_url = $this->buildUrl($route, ['absolute' => TRUE]);
- $this->assertTrue(!empty($this_page_url));
-
- // Load the path.
- $this->drupalGet($this_page_url);
- $this->assertResponse(200);
-
- // Check the meta tags.
- $xpath = $this->xpath("//link[@rel='canonical']");
- $this->assertNotEqual((string) $xpath[0]->getAttribute('href'), $front_url);
- $this->assertEqual((string) $xpath[0]->getAttribute('href'), $this_page_url);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/EnsureDevelWebProfilerWorks.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/EnsureDevelWebProfilerWorks.php
deleted file mode 100644
index 654f1bff7..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/EnsureDevelWebProfilerWorks.php
+++ /dev/null
@@ -1,36 +0,0 @@
-drupalGet('metatag_test_custom_route');
- $this->assertResponse(200);
- $this->assertText('Hello world!');
- }
-
- /**
- * Make sure that the system still works when some example content exists.
- */
- public function testNode() {
- $node = $this->createContentTypeNode();
- $this->drupalGet($node->toUrl());
- $this->assertResponse(200);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/MetatagHelperTrait.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/MetatagHelperTrait.php
deleted file mode 100644
index 659b5ef63..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/MetatagHelperTrait.php
+++ /dev/null
@@ -1,157 +0,0 @@
-setPassword($password)->save();
-
- // Support old and new tests.
- $account->passRaw = $password;
- $account->pass_raw = $password;
-
- // Login.
- $this->drupalLogin($account);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function verbose($message, $title = NULL) {
- // Handle arrays, objects, etc.
- if (!is_string($message)) {
- $message = "
\n" . print_r($message, TRUE) . "\n
\n";
- }
-
- // Optional title to go before the output.
- if (!empty($title)) {
- $title = '
' . Html::escape($title) . "
\n";
- }
-
- parent::verbose($title . $message);
- }
-
- /**
- * Create a content type and a node.
- *
- * @param string $title
- * A title for the node that will be returned.
- * @param string $body
- * The text to use as the body.
- *
- * @return \Drupal\node\NodeInterface
- * A fully formatted node object.
- */
- private function createContentTypeNode($title = 'Title test', $body = 'Body test') {
- $content_type = 'metatag_test';
- $args = [
- 'type' => $content_type,
- 'label' => 'Test content type',
- ];
- $this->createContentType($args);
-
- $args = [
- 'body' => [
- [
- 'value' => $body,
- 'format' => filter_default_format(),
- ],
- ],
- 'title' => $title,
- 'type' => $content_type,
- ];
-
- return $this->createNode($args);
- }
-
- /**
- * Create a vocabulary.
- *
- * @param array $values
- * Items passed to the vocabulary. If the 'vid' item is not present it will
- * be automatically generated. If the 'name' item is not present the 'vid'
- * will be used.
- *
- * @return \Drupal\taxonomy\Entity\Vocabulary
- * A fully formatted vocabulary object.
- */
- private function createVocabulary(array $values = []) {
- // Find a non-existent random type name.
- if (!isset($values['vid'])) {
- do {
- $id = strtolower($this->randomMachineName(8));
- } while (Vocabulary::load($id));
- }
- else {
- $id = $values['vid'];
- }
- $values += [
- 'vid' => $id,
- 'name' => $id,
- ];
- $vocab = Vocabulary::create($values);
- $status = $vocab->save();
-
- if ($this instanceof \PHPUnit_Framework_TestCase) {
- $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created vocabulary %type.', ['%type' => $vocab->id()]))->__toString());
- }
- else {
- $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created vocabulary %type.', ['%type' => $vocab->id()]))->__toString());
- }
-
- return $vocab;
- }
-
- /**
- * Create a taxonomy term.
- *
- * @param array $values
- * Items passed to the term. Requires the 'vid' element.
- *
- * @return Drupal\taxonomy\Entity\Term
- * A fully formatted term object.
- */
- private function createTerm(array $values = []) {
- // Populate defaults array.
- $values += [
- 'description' => [
- [
- 'value' => $this->randomMachineName(32),
- 'format' => filter_default_format(),
- ],
- ],
- 'name' => $this->randomMachineName(8),
- ];
- $term = Term::create($values);
- $status = $term->save();
-
- if ($this instanceof \PHPUnit_Framework_TestCase) {
- $this->assertSame($status, SAVED_NEW, (new FormattableMarkup('Created term %name.', ['%name' => $term->label()]))->__toString());
- }
- else {
- $this->assertEqual($status, SAVED_NEW, (new FormattableMarkup('Created term %name.', ['%name' => $term->label()]))->__toString());
- }
-
- return $term;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeJsonOutput.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeJsonOutput.php
deleted file mode 100644
index 44681192f..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeJsonOutput.php
+++ /dev/null
@@ -1,135 +0,0 @@
-provisionResource();
-
- /* @var\Drupal\node\NodeInterface $node */
- $node = $this->createContentTypeNode('Test JSON output', 'Testing JSON output for a content type');
- $url = $node->toUrl();
-
- // Load the node's page.
- $this->drupalGet($url);
- $this->assertResponse(200);
-
- // Load the JSON output.
- $url->setOption('query', ['_format' => 'json']);
- $response = $this->drupalGet($url);
- $this->assertResponse(200);
-
- // Decode the JSON output.
- $response = $this->getRawContent();
- $this->assertTrue(!empty($response));
- $json = json_decode($response);
- $this->verbose($json, 'JSON output');
- $this->assertTrue(!empty($json));
-
- // Confirm the JSON object's values.
- $this->assertTrue(isset($json->nid));
- if (isset($json->nid)) {
- $this->assertTrue($json->nid[0]->value == $node->id());
- }
- $this->assertTrue(isset($json->metatag));
- if (isset($json->metatag)) {
- $this->assertTrue($json->metatag->value->title == $node->label() . ' | Drupal');
- // @todo Test other meta tags.
- }
- }
-
- /**
- * Provisions the REST resource under test.
- *
- * @param string $entity_type
- * The entity type to be enabled; defaults to 'node'.
- * @param array $formats
- * The allowed formats for this resource; defaults to ['json'].
- * @param array $authentication
- * The allowed authentication providers for this resource; defaults to
- * ['basic_auth'].
- */
- protected function provisionResource($entity_type = 'node', array $formats = [], array $authentication = []) {
- $this->resourceConfigStorage = $this->container
- ->get('entity_type.manager')
- ->getStorage('rest_resource_config');
-
- // Defaults.
- if (empty($formats)) {
- $formats[] = 'json';
- }
- if (empty($authentication)) {
- $authentication[] = 'basic_auth';
- }
-
- $this->resourceConfigStorage->create([
- 'id' => 'entity.' . $entity_type,
- 'granularity' => RestResourceConfigInterface::RESOURCE_GRANULARITY,
- 'configuration' => [
- 'methods' => ['GET', 'POST', 'PATCH', 'DELETE'],
- 'formats' => $formats,
- 'authentication' => $authentication,
- ],
- 'status' => TRUE,
- ])->save();
-
- // Ensure that the cache tags invalidator has its internal values reset.
- // Otherwise the http_response cache tag invalidation won't work.
- // Clear the tag cache.
- \Drupal::service('cache_tags.invalidator')->resetChecksums();
- foreach (Cache::getBins() as $backend) {
- if (is_callable([$backend, 'reset'])) {
- $backend->reset();
- }
- }
- $this->container->get('config.factory')->reset();
- $this->container->get('state')->resetCache();
-
- // Tests using this base class may trigger route rebuilds due to changes to
- // RestResourceConfig entities or 'rest.settings'. Ensure the test generates
- // routes using an up-to-date router.
- \Drupal::service('router.builder')->rebuildIfNeeded();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeTranslation.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeTranslation.php
deleted file mode 100644
index 91b444379..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/NodeTranslation.php
+++ /dev/null
@@ -1,76 +0,0 @@
-loginUser1();
-
- // Add language.
- $this->drupalGet('/admin/config/regional/language/add');
- $this->assertResponse(200);
- $edit = [
- 'predefined_langcode' => 'hu',
- ];
- $this->drupalPostForm(NULL, $edit, 'Add language');
-
- // Set up a content type.
- $this->drupalCreateContentType(['type' => 'article']);
- $this->drupalGet('/admin/structure/types/manage/article');
- $this->assertResponse(200);
- $edit = [
- 'language_configuration[content_translation]' => TRUE,
- ];
- $this->drupalPostForm(NULL, $edit, 'Save content type');
- }
-
- /**
- * Load the custom route, make sure something is output.
- */
- public function testContentTranslationForm() {
- $this->drupalGet('/admin/config/regional/content-language');
- $this->assertResponse(200);
- $this->assertText('Content language');
- $this->drupalPostForm(NULL, [], 'Save configuration');
- $this->assertResponse(200);
- $this->assertText('Settings successfully updated.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/RemoveCoreMetaTags.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/RemoveCoreMetaTags.php
deleted file mode 100644
index 489b007ba..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/RemoveCoreMetaTags.php
+++ /dev/null
@@ -1,60 +0,0 @@
-loginUser1();
-
- // Set up a vocabulary.
- $vocabulary = Vocabulary::create([
- 'vid' => 'metatag_vocab',
- 'name' => $this->randomString(),
- ]);
- $vocabulary->save();
- $term = Term::create([
- 'vid' => $vocabulary->id(),
- 'name' => $this->randomString(),
- ]);
- $term->save();
-
- // Set up meta tags for taxonomy.
- $edit = [
- 'canonical_url' => '[current-page:url:unaliased]',
- ];
- $this->drupalPostForm('admin/config/search/metatag/taxonomy_term', $edit, 'Save');
-
- // Ensure there is only 1 canonical metatag.
- $this->drupalGet('taxonomy/term/' . $term->id());
- $xpath = $this->xpath("//link[@rel='canonical']");
- $this->assertEquals(1, count($xpath), 'Exactly one canonical rel meta tag found.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/SchemaMetatagTest.php b/sites/all/modules/contrib/admin/metatag/tests/src/Functional/SchemaMetatagTest.php
deleted file mode 100644
index bc4330c6d..000000000
--- a/sites/all/modules/contrib/admin/metatag/tests/src/Functional/SchemaMetatagTest.php
+++ /dev/null
@@ -1,19 +0,0 @@
-generateElements([
- 'og_image_width' => 100,
- 'og_image_height' => 100,
- 'og_image_url' => 'http://www.example.com/example/foo.png',
- ]);
-
- $expected = [
- '#attached' => [
- 'html_head' => [
- [
- [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:image:url',
- 'content' => 'http://www.example.com/example/foo.png',
- ],
- ],
- 'og_image_url_0',
- ],
- [
- [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:image:width',
- 'content' => 100,
- ],
- ],
- 'og_image_width',
- ],
- [
- [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:image:height',
- 'content' => 100,
- ],
- ],
- 'og_image_height',
- ],
- ],
- ],
- ];
- $this->assertEquals($expected, $tags);
- }
-
- /**
- * Tests metatags with multiple values return multiple metatags.
- */
- public function testMetatagMultiple() {
- /** @var \Drupal\metatag\MetatagManager $metatag_manager */
- $metatag_manager = \Drupal::service('metatag.manager');
-
- $tags = $metatag_manager->generateElements([
- 'og_image_width' => 100,
- 'og_image_height' => 100,
- 'og_image_url' => 'http://www.example.com/example/foo.png, http://www.example.com/example/foo2.png',
- ]);
-
- $expected = [
- '#attached' => [
- 'html_head' => [
- [
- [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:image:url',
- 'content' => 'http://www.example.com/example/foo.png',
- ],
- ],
- 'og_image_url_0',
- ],
- [
- [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:image:url',
- 'content' => 'http://www.example.com/example/foo2.png',
- ],
- ],
- 'og_image_url_1',
- ],
- [
- [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:image:width',
- 'content' => 100,
- ],
- ],
- 'og_image_width',
- ],
- [
- [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:image:height',
- 'content' => 100,
- ],
- ],
- 'og_image_height',
- ],
- ],
- ],
- ];
- $this->assertEquals($expected, $tags);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/LICENSE.txt b/sites/all/modules/contrib/admin/path_alias_xt/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/config/install/path_alias_xt.settings.yml b/sites/all/modules/contrib/admin/path_alias_xt/config/install/path_alias_xt.settings.yml
deleted file mode 100644
index b64509822..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/config/install/path_alias_xt.settings.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-user_special: true
-regex_pattern: '{(^node|^user|^taxonomy/term)/([0-9]+)/(.+)}'
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/config/schema/path_alias_xt.schema.yml b/sites/all/modules/contrib/admin/path_alias_xt/config/schema/path_alias_xt.schema.yml
deleted file mode 100644
index 84ba2300d..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/config/schema/path_alias_xt.schema.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-path_alias_xt.settings:
- type: config_object
- mapping:
- user_special:
- type: boolean
- label: 'User special'
- regex_pattern:
- type: string
- label: 'RegEx pattern'
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.info.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.info.yml
deleted file mode 100644
index 51fca7b7e..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.info.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-name: Extended Path Aliases
-description: 'Automatically extend path aliases to include tabs, like about-us/edit for node/123/edit. Allow these aliases to be entered in page specification wild-cards, about-us*, e.g for block visibility.'
-
-type: module
-# core: 8.x
-
-dependencies:
- - drupal:path
-
-configure: path_alias_xt.settings_form
-
-# Information added by Drupal.org packaging script on 2019-01-30
-version: '8.x-1.x-dev'
-core: '8.x'
-project: 'path_alias_xt'
-datestamp: 1548876484
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.links.menu.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.links.menu.yml
deleted file mode 100644
index ef411e3e0..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.links.menu.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-path_alias_xt.settings_form:
- title: 'Extended path aliases'
- route_name: path_alias_xt.settings_form
- description: 'Advanced settings.'
- parent: system.admin_config_system
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.module b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.module
deleted file mode 100644
index 725ef7392..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.module
+++ /dev/null
@@ -1,24 +0,0 @@
-';
- $output .= t('Installation instructions are in the README.txt file. Further documentation is on the Extended Path Aliases project page.',
- ['@path_alias_xt' => Url::fromUri('http://drupal.org/project/path_alias_xt')->toString()]);
- $output .= '';
-
- return ['#markup' => $output];
- }
-}
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.permissions.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.permissions.yml
deleted file mode 100644
index 6ef8ecb0e..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.permissions.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-administer extended path aliases:
- title: 'Administer Extended Path Aliases'
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.routing.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.routing.yml
deleted file mode 100644
index a9629810e..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.routing.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-path_alias_xt.settings_form:
- path: '/admin/config/system/path_alias_xt'
- defaults:
- _form: '\Drupal\path_alias_xt\Form\PathAliasXtSettingsForm'
- _title: 'Extended path aliases'
- requirements:
- _permission: 'administer extended path aliases'
- options:
- _admin_route: TRUE
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.services.yml b/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.services.yml
deleted file mode 100644
index cb85ebec6..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/path_alias_xt.services.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-services:
- path_alias_xt.path_processor_alias:
- class: Drupal\path_alias_xt\PathAliasXtProcessorAlias
- tags:
- - { name: path_processor_inbound, priority: 100 }
- - { name: path_processor_outbound, priority: 100 }
- arguments: ['@path.alias_manager', '@config.factory']
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/src/Form/PathAliasXtSettingsForm.php b/sites/all/modules/contrib/admin/path_alias_xt/src/Form/PathAliasXtSettingsForm.php
deleted file mode 100644
index f9482a2e2..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/src/Form/PathAliasXtSettingsForm.php
+++ /dev/null
@@ -1,69 +0,0 @@
-config('path_alias_xt.settings');
-
- $form['user_special'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('For the current user: instead of /user/uid or its alias, apply the alias for /user.'),
- '#default_value' => $config->get('user_special'),
- '#description' => $this->t('If ticked and the system path /user has an alias, such as /MyAccount, then /MyAccount will also be applied when a user visits their /user/uid/... pages. For this feature to work you must complete the full installation procedure outlined in the README.', [
- '@alias' => Url::fromRoute('path.admin_overview')->toString(),
- '@README' => Url::fromUserInput('/' . drupal_get_path('module', 'path_alias_xt') . '/README.txt')->toString(),
- ]),
- ];
-
- $form['regex_pattern'] = [
- '#type' => 'textfield',
- '#size' => 100,
- '#title' => $this->t('Regular expression to match system paths for nodes, users and taxonomy terms'),
- '#default_value' => $config->get('regex_pattern'),
- '#description' => $this->t("While you can always reset this configuration and recover without permanent damage to your site, a change to this expression may temporarily break all extended aliases. Change only when you know what you're doing."),
- ];
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $config = $this->config('path_alias_xt.settings');
-
- foreach ($form_state->getValues() as $key => $value) {
- $config->set($key, $value);
- }
- $config->save();
-
- parent::submitForm($form, $form_state);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/path_alias_xt/src/PathAliasXtProcessorAlias.php b/sites/all/modules/contrib/admin/path_alias_xt/src/PathAliasXtProcessorAlias.php
deleted file mode 100644
index 2d263a65f..000000000
--- a/sites/all/modules/contrib/admin/path_alias_xt/src/PathAliasXtProcessorAlias.php
+++ /dev/null
@@ -1,89 +0,0 @@
-configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public function processInbound($path, Request $request) {
- $path_to_process = ltrim($path, '/');
-
- $removed_elements = [];
- $path_elements = explode('/', $path_to_process);
-
- foreach ($path_elements as $element) {
- $candidate_alias = '/' . implode('/', $path_elements);
- $source = $this->aliasManager->getPathByAlias($candidate_alias);
-
- if ($source != $candidate_alias) {
- // Change the order of the elements.
- krsort($removed_elements);
- $return_path = $source;
- if (!empty($removed_elements)) {
- $return_path .= '/' . implode('/', $removed_elements);
- }
-
- // Validate the path.
- // Injecting the service threw ServiceCircularReferenceException.
- if (\Drupal::service('path.validator')->getUrlIfValidWithoutAccessCheck($return_path)) {
- return $return_path;
- }
- }
- // Remove the last element from the elements array to be able to add it
- // to the end of the found path.
- $removed_elements[] = array_pop($path_elements);
- }
-
- return $path;
- }
-
- /**
- * {@inheritdoc}
- */
- public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
- $path = parent::processOutbound($path, $options, $request, $bubbleable_metadata);
-
- $config = $this->configFactory->get('path_alias_xt.settings');
- if (preg_match($config->get('regex_pattern'), Unicode::substr($path, 1), $matches)) {
- $langcode = isset($options['language']) ? $options['language']->getId() : NULL;
- if ($alias = $this->aliasManager->getAliasByPath("/$matches[1]/$matches[2]", $langcode)) {
- $path = "$alias/$matches[3]";
- }
- }
-
- return $path;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/LICENSE.txt b/sites/all/modules/contrib/admin/pathauto/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/pathauto/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/pathauto/README.md b/sites/all/modules/contrib/admin/pathauto/README.md
deleted file mode 100644
index d21f1356a..000000000
--- a/sites/all/modules/contrib/admin/pathauto/README.md
+++ /dev/null
@@ -1,83 +0,0 @@
-#Pathauto
-
-If you are developing for this module, have a look at pathauto.api.php.
-
-##Description
-
-The Pathauto module provides support functions for other modules to
-automatically generate aliases based on appropriate criteria, with a
-central settings path for site administrators.
-
-Implementations are provided for core entity types: content, taxonomy terms,
-and users (including blogs and forum pages).
-
-Pathauto also provides a way to delete large numbers of aliases. This feature
-is available at Administer > Configuration > Search and metadata > URL aliases >
-Delete aliases.
-
-##Benefits
-
-Besides making the page address more reflective of its content than
-"node/138", it's important to know that modern search engines give
-heavy weight to search terms which appear in a page's URL. By
-automatically using keywords based directly on the page content in the URL,
-relevant search engine hits for your page can be significantly
-enhanced.
-
-##Notices
-
-Pathauto just adds URL aliases to content, users, and taxonomy terms.
-Because it's an alias, the standard Drupal URL (for example node/123 or
-taxonomy/term/1) will still function as normal. If you have external links
-to your site pointing to standard Drupal URLs, or hardcoded links in a module,
-template, content or menu which point to standard Drupal URLs it will bypass
-the alias set by Pathauto.
-
-There are reasons you might not want two URLs for the same content on your
-site. If this applies to you, please note that you will need to update any
-hard coded links in your content or blocks.
-
-If you use the "system path" (i.e. node/10) for menu items and settings like
-that, Drupal will replace it with the url_alias.
-
-For external links, you might want to consider the Path Redirect or
-Global Redirect modules, which allow you to set forwarding either per item or
-across the site to your aliased URLs.
-
-###URLs (not) Getting Replaced With Aliases:
-Please bear in mind that only URLs passed through Drupal's Drupal's URL and
-Link APIs will be replaced with their aliases during page output. If
-a module or your template contains hardcoded links, such as
-'href="node/$node->nid"', those won't get replaced with their corresponding
-aliases.
-
-## Disabling Pathauto for a specific content type (or taxonomy)
-
-When the pattern for a content type is left blank, the default pattern will be
-used. But if the default pattern is also blank, Pathauto will be disabled
-for that content type.
-
-## Installing Pathauto
-1. Install the module as normal, note that there are two dependencies.
-2. Configure the module at admin/config/search/path/patterns - add a new pattern by creating by clicking "Add Pathauto pattern".
-3. Fill out "Path pattern" with fx [node:title], choose which content types this applies to, give it a label (the name) and save it.
-4. When you save new content from now on, it should automatically be assigned an alternative URL
-
-##Credits:
-
-The original module combined the functionality of Mike Ryan's autopath with
-Tommy Sundstrom's path_automatic.
-
-Significant enhancements were contributed by jdmquin @ www.bcdems.net.
-
-Matt England added the tracker support (tracker support has been removed in
-recent changes).
-
-Other suggestions and patches contributed by the Drupal community.
-
-Current maintainers:
-
-- Dave Reid - http://www.davereid.net
-- Greg Knaddison - http://www.knaddison.com
-- Mike Ryan - http://mikeryan.name
-- Frederik 'Freso' S. Olesen - http://freso.dk
diff --git a/sites/all/modules/contrib/admin/pathauto/config/install/pathauto.settings.yml b/sites/all/modules/contrib/admin/pathauto/config/install/pathauto.settings.yml
deleted file mode 100644
index 03004aa1d..000000000
--- a/sites/all/modules/contrib/admin/pathauto/config/install/pathauto.settings.yml
+++ /dev/null
@@ -1,20 +0,0 @@
-enabled_entity_types:
- - user
-punctuation:
- hyphen: 1
-verbose : FALSE
-separator : '-'
-max_length : 100
-max_component_length: 100
-transliterate : TRUE
-reduce_ascii : FALSE
-case : TRUE
-ignore_words : 'a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with'
-update_action : 2
-safe_tokens:
- - alias
- - path
- - join-path
- - login-url
- - url
- - url-brief
diff --git a/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_node.yml b/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_node.yml
deleted file mode 100644
index 07709b7c0..000000000
--- a/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_node.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-id: pathauto_update_alias_node
-label: 'Update URL alias'
-status: true
-langcode: en
-type: node
-plugin: pathauto_update_alias
-dependencies:
- module:
- - node
diff --git a/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_user.yml b/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_user.yml
deleted file mode 100644
index 891cbf220..000000000
--- a/sites/all/modules/contrib/admin/pathauto/config/optional/system.action.pathauto_update_alias_user.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-id: pathauto_update_alias_user
-label: 'Update URL alias'
-status: true
-langcode: en
-type: user
-plugin: pathauto_update_alias
-dependencies:
- module:
- - user
diff --git a/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto.schema.yml b/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto.schema.yml
deleted file mode 100644
index 1da59f187..000000000
--- a/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto.schema.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-pathauto.settings:
- type: config_object
- mapping:
- enabled_entity_types:
- label: Enabled entity types
- type: sequence
- sequence:
- type: string
- punctuation:
- type: sequence
- sequence:
- type: integer
- verbose:
- type: boolean
- separator:
- type: string
- max_length:
- type: integer
- max_component_length:
- type: integer
- transliterate:
- type: boolean
- reduce_ascii:
- type: boolean
- case:
- type: boolean
- ignore_words:
- type: string
- update_action:
- type: integer
- safe_tokens:
- label: Tokens that are safe to use and do not need to be cleaned.
- type: sequence
- sequence:
- type: string
-
-action.configuration.pathauto_update_alias:
- type: action_configuration_default
- label: 'Update URL alias'
diff --git a/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto_pattern.schema.yml b/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto_pattern.schema.yml
deleted file mode 100644
index 14a1ae7b6..000000000
--- a/sites/all/modules/contrib/admin/pathauto/config/schema/pathauto_pattern.schema.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-pathauto.pattern.*:
- type: config_entity
- label: 'Pathauto pattern config'
- mapping:
- id:
- type: string
- label: 'ID'
- label:
- type: label
- label: 'Label'
- uuid:
- type: string
- type:
- type: string
- label: 'Pattern type'
- pattern:
- type: string
- label: 'Pattern'
- selection_criteria:
- type: sequence
- label: 'Selection criteria'
- sequence:
- type: condition.plugin.[id]
- label: 'Selection condition'
- selection_logic:
- type: string
- label: 'Selection logic'
- weight:
- type: integer
- label: 'Weight'
- relationships:
- type: sequence
- label: 'Context definitions'
- sequence:
- - type: mapping
- label: 'Relationship'
- mapping:
- label:
- type: label
- label: 'Label'
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.api.php b/sites/all/modules/contrib/admin/pathauto/pathauto.api.php
deleted file mode 100644
index 6595116fd..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.api.php
+++ /dev/null
@@ -1,159 +0,0 @@
-query("SELECT 1 FROM {mytable} WHERE path = :path", [':path' => $alias])->fetchField();
-}
-
-/**
- * Alter the pattern to be used before an alias is generated by Pathauto.
- *
- * This hook will only be called if a default pattern is configured (on
- * admin/config/search/path/patterns).
- *
- * @param \Drupal\pathauto\PathautoPatternInterface $pattern
- * The Pathauto pattern to be used.
- * @param array $context
- * An associative array of additional options, with the following elements:
- * - 'module': The module or entity type being aliased.
- * - 'op': A string with the operation being performed on the object being
- * aliased. Can be either 'insert', 'update', 'return', or 'bulkupdate'.
- * - 'source': A string of the source path for the alias (e.g. 'node/1').
- * - 'data': An array of keyed objects to pass to token_replace().
- * - 'bundle': The sub-type or bundle of the object being aliased.
- * - 'language': A string of the language code for the alias (e.g. 'en').
- * This can be altered by reference.
- */
-function hook_pathauto_pattern_alter(\Drupal\pathauto\PathautoPatternInterface $pattern, array $context) {
- // Switch out any [node:created:*] tokens with [node:updated:*] on update.
- if ($context['module'] == 'node' && ($context['op'] == 'update')) {
- $pattern->setPattern(preg_replace('/\[node:created(\:[^]]*)?\]/', '[node:updated$1]', $pattern->getPattern()));
- }
-}
-
-/**
- * Alter Pathauto-generated aliases before saving.
- *
- * @param string $alias
- * The automatic alias after token replacement and strings cleaned.
- * @param array $context
- * An associative array of additional options, with the following elements:
- * - 'module': The module or entity type being aliased.
- * - 'op': A string with the operation being performed on the object being
- * aliased. Can be either 'insert', 'update', 'return', or 'bulkupdate'.
- * - 'source': A string of the source path for the alias (e.g. 'node/1').
- * This can be altered by reference.
- * - 'data': An array of keyed objects to pass to token_replace().
- * - 'type': The sub-type or bundle of the object being aliased.
- * - 'language': A string of the language code for the alias (e.g. 'en').
- * This can be altered by reference.
- * - 'pattern': A string of the pattern used for aliasing the object.
- */
-function hook_pathauto_alias_alter(&$alias, array &$context) {
- // Add a suffix so that all aliases get saved as 'content/my-title.html'.
- $alias .= '.html';
-
- // Force all aliases to be saved as language neutral.
- $context['language'] = Language::LANGCODE_NOT_SPECIFIED;
-}
-
-/**
- * Alter the list of punctuation characters for Pathauto control.
- *
- * @param array $punctuation
- * An array of punctuation to be controlled by Pathauto during replacement
- * keyed by punctuation name. Each punctuation record should be an array
- * with the following key/value pairs:
- * - value: The raw value of the punctuation mark.
- * - name: The human-readable name of the punctuation mark. This must be
- * translated using t() already.
- */
-function hook_pathauto_punctuation_chars_alter(array &$punctuation) {
- // Add the trademark symbol.
- $punctuation['trademark'] = array('value' => '™', 'name' => t('Trademark symbol'));
-
- // Remove the dollar sign.
- unset($punctuation['dollar']);
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.info.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.info.yml
deleted file mode 100644
index c661dae56..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.info.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name : 'Pathauto'
-description : 'Provides a mechanism for modules to automatically generate aliases for the content they manage.'
-# core: 8.x
-type: module
-
-dependencies:
-- ctools:ctools
-- drupal:path
-- drupal:system (>=8.5)
-- token:token
-
-configure: entity.pathauto_pattern.collection
-
-recommends:
-- redirect:redirect
-
-# Information added by Drupal.org packaging script on 2018-09-08
-version: '8.x-1.3'
-core: '8.x'
-project: 'pathauto'
-datestamp: 1536407890
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.install b/sites/all/modules/contrib/admin/pathauto/pathauto.install
deleted file mode 100644
index 4b160ba10..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.install
+++ /dev/null
@@ -1,320 +0,0 @@
-schema();
- if (!$database_schema->tableExists($alias_storage::TABLE)) {
- $schema_definition = $alias_storage->schemaDefinition();
- $database_schema->createTable($alias_storage::TABLE, $schema_definition);
- }
- }
-}
-
-/**
- * Updates pathauto widgets to use the path widget ID.
- */
-function pathauto_update_8001() {
-
- // Replace values in the 'entity.definitions.installed' keyvalue collection.
- $collection = \Drupal::service('keyvalue')->get('entity.definitions.installed');
- foreach ($collection->getAll() as $key => $definitions) {
- if (!is_array($definitions) || empty($definitions['path'])) {
- continue;
- }
-
- // Retrieve and change path base field definition.
- $path_definition = $definitions['path'];
- if (($options = $path_definition->getDisplayOptions('form')) && $options['type'] = 'pathauto') {
- $options['type'] = 'path';
- $path_definition->setDisplayOptions('form', $options);
- // Save the new value.
- $collection->set($key, $definitions);
- }
-
- }
-
- foreach (EntityFormDisplay::loadMultiple() as $form_display) {
- if ($component = $form_display->getComponent('path')) {
- if (isset($component['type']) && $component['type'] == 'pathauto') {
- $component['type'] = 'path';
- $form_display->setComponent('path', $component);
- $form_display->save();
- }
- }
- }
-}
-
-/**
- * Converts patterns from configuration objects to configuration entities.
- */
-function pathauto_update_8100() {
- \Drupal::service('module_installer')->install(['ctools']);
-
- $messages = array();
- /** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_bundle_info */
- $entity_bundle_info = \Drupal::service('entity_type.bundle.info');
- $entity_type_manager = \Drupal::entityTypeManager();
- $language_manager = \Drupal::languageManager();
- $entity_type_manager->clearCachedDefinitions();
- \Drupal::service('plugin.manager.alias_type')->clearCachedDefinitions();
- $entity_types = $entity_type_manager->getDefinitions();
-
- // 1. Load all patterns.
- $config = \Drupal::configFactory()->getEditable('pathauto.pattern');
- $patterns = $config->get('patterns');
-
- // 2. Create a configuration entity per pattern.
- foreach ($patterns as $entity_type => $entity_patterns) {
- if (!array_key_exists($entity_type, $entity_types)) {
- // We found an unknown entity type. Report it.
- $messages[] = t('Entity of type @type was not processed. It defines the following patterns: @patterns', array(
- '@type' => $entity_type,
- '@patterns' => print_r($entity_patterns, TRUE),
- ));
- continue;
- }
- $entity_label = $entity_types[$entity_type]->getLabel();
-
- if (!empty($entity_patterns['default'])) {
- // This is a pattern for an entity type, such as "node".
- $pattern = PathautoPattern::create([
- 'id' => $entity_type,
- 'label' => $entity_label,
- 'type' => 'canonical_entities:' . $entity_type,
- 'pattern' => $entity_patterns['default'],
- 'weight' => 0,
- ]);
- $pattern->save();
- }
-
- // Loop over bundles and create patterns if they have a value.
- // Bundle keys may have a language suffix for language-dependant patterns.
- if (isset($entity_patterns['bundles'])) {
- $bundle_info = $entity_bundle_info->getBundleInfo($entity_type);
- foreach ($entity_patterns['bundles'] as $bundle => $bundle_patterns) {
- if (empty($bundle_patterns['default'])) {
- // This bundle does not define a pattern. Move on to the next one.
- continue;
- }
-
- if (isset($bundle_info[$bundle])) {
- // This is a pattern for a bundle, such as "node_article".
- $pattern = PathautoPattern::create([
- 'id' => $entity_type . '_' . $bundle,
- 'label' => $entity_label . ' ' . $bundle_info[$bundle]['label'],
- 'type' => 'canonical_entities:' . $entity_type,
- 'pattern' => $bundle_patterns['default'],
- 'weight' => -5,
- ]);
-
- // Add the bundle condition.
- $pattern->addSelectionCondition([
- 'id' => 'entity_bundle:' . $entity_type,
- 'bundles' => array($bundle => $bundle),
- 'negate' => FALSE,
- 'context_mapping' => [ $entity_type => $entity_type ],
- ]);
-
- $pattern->save();
- }
- else {
- // This is either a language dependent pattern such as "article_es" or
- // an unknown bundle or langcode. Let's figure it out.
- $matches = NULL;
- $langcode = NULL;
- $extracted_bundle = NULL;
- $language = NULL;
- preg_match('/^(.*)_([a-z-]*)$/', $bundle, $matches);
- if (count($matches) == 3) {
- list(, $extracted_bundle, $langcode) = $matches;
- $language = $language_manager->getLanguage($langcode);
- }
- // Validate bundle, langcode and language.
- if (!isset($bundle_info[$extracted_bundle]) || ($langcode == NULL) || ($language == NULL)) {
- $messages[] = t('Unrecognized entity bundle @entity:@bundle was not processed. It defines the following patterns: @patterns', array(
- '@entity' => $entity_type,
- '@bundle' => $bundle,
- '@patterns' => print_r($entity_patterns, TRUE),
- ));
- continue;
- }
-
- // This is a pattern for a bundle and a language, such as
- // "node_article_es".
- $pattern = PathautoPattern::create([
- 'id' => $entity_type . '_' . $extracted_bundle . '_' . str_replace('-', '_', $langcode),
- 'label' => $entity_label . ' ' . $bundle_info[$extracted_bundle]['label'] . ' ' . $language->getName(),
- 'type' => 'canonical_entities:' . $entity_type,
- 'pattern' => $bundle_patterns['default'],
- 'weight' => -10,
- ]);
-
- // Add the bundle condition.
- $pattern->addSelectionCondition([
- 'id' => 'entity_bundle:' . $entity_type,
- 'bundles' => array($extracted_bundle => $extracted_bundle),
- 'negate' => FALSE,
- 'context_mapping' => [ $entity_type => $entity_type ],
- ]);
-
- // Add the language condition.
- $language_mapping = $entity_type . ':' . $entity_type_manager->getDefinition($entity_type)->getKey('langcode') . ':language';
- $pattern->addSelectionCondition([
- 'id' => 'language',
- 'langcodes' => [ $langcode => $langcode ],
- 'negate' => FALSE,
- 'context_mapping' => [
- 'language' => $language_mapping,
- ]
- ]);
-
- // Add the context relationship for this language.
- $pattern->addRelationship($language_mapping, 'Language');
-
- $pattern->save();
- }
- }
- }
- }
-
- // 3. Delete the old configuration object that stores patterns.
- $config->delete();
-
- // 4. Print out messages.
- if (!empty($messages)) {
- return implode('', $messages);
- }
-}
-
-/**
- * Update relationship storage.
- */
-function pathauto_update_8101() {
- foreach (\Drupal::configFactory()->listAll('pathauto.pattern.') as $pattern_config_name) {
- $pattern_config = \Drupal::configFactory()->getEditable($pattern_config_name);
-
- $relationships = [];
- foreach ((array) $pattern_config->get('context_definitions') as $context_definition) {
- $relationships[$context_definition['id']] = ['label' => $context_definition['label']];
- }
-
- $pattern_config->clear('context_definitions');
- $pattern_config->set('relationships', $relationships);
- $pattern_config->save();
- }
-}
-
-/**
- * Update node type conditions from entity_bundle to node_type.
- */
-function pathauto_update_8102() {
- // Load all pattern configuration entities.
- foreach (\Drupal::configFactory()->listAll('pathauto.pattern.') as $pattern_config_name) {
- $pattern_config = \Drupal::configFactory()->getEditable($pattern_config_name);
-
- // Loop patterns and swap the entity_bundle:node plugin by the node_type
- // plugin.
- if ($pattern_config->get('type') == 'canonical_entities:node') {
- $selection_criteria = $pattern_config->get('selection_criteria');
- foreach ($selection_criteria as $uuid => $condition) {
- if ($condition['id'] == 'entity_bundle:node') {
- $selection_criteria[$uuid]['id'] = 'node_type';
- $pattern_config->set('selection_criteria', $selection_criteria);
- $pattern_config->save();
- break;
- }
- }
- }
- }
-}
-
-/**
- * Fix invalid default value for ignore_words.
- */
-function pathauto_update_8103() {
- $config_factory = \Drupal::configFactory();
- $config = $config_factory->getEditable('pathauto.settings');
- $ignore_words = $config->get('ignore_words');
- if ($ignore_words === ', in, is,that, the , this, with, ') {
- $config->set('ignore_words', 'a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with')->save(TRUE);
- }
-}
-
-/**
- * Resave patterns so that lookup keys are updated.
- */
-function pathauto_update_8104() {
- \Drupal::entityTypeManager()->clearCachedDefinitions();
- // Load all pattern configuration entities and save them, so that the new
- // status lookup keys are saved.
- foreach (\Drupal::configFactory()->listAll('pathauto.pattern.') as $pattern_config_name) {
- $pattern_config = \Drupal::configFactory()->getEditable($pattern_config_name);
- $pattern_config->save();
- }
-}
-
-/**
- * Ensure the url_alias table exists.
- */
-function pathauto_update_8105() {
- _pathauto_ensure_url_alias_table_exists();
-}
-
-/**
- * Update default configuration for enabled entity types.
- */
-function pathauto_update_8106() {
- $config_factory = \Drupal::configFactory();
- $config = $config_factory->getEditable('pathauto.settings');
- $config->set('enabled_entity_types', ['user']);
- $config->save();
-}
-
-/**
- * Initialize the new safe tokens setting.
- */
-function pathauto_update_8107() {
-
- $safe_tokens = [
- 'alias',
- 'alias',
- 'path',
- 'join-path',
- 'login-url',
- 'url',
- 'url-brief',
- ];
-
- \Drupal::configFactory()->getEditable('pathauto.settings')
- ->set('safe_tokens', $safe_tokens)
- ->save();
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.js b/sites/all/modules/contrib/admin/pathauto/pathauto.js
deleted file mode 100644
index 3bdc3d561..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.js
+++ /dev/null
@@ -1,21 +0,0 @@
-(function ($) {
- 'use strict';
- Drupal.behaviors.pathFieldsetSummaries = {
- attach: function (context) {
- $(context).find('.path-form').drupalSetSummary(function (context) {
- var path = $('.js-form-item-path-0-alias input', context).val();
- var automatic = $('.js-form-item-path-0-pathauto input', context).prop('checked');
-
- if (automatic) {
- return Drupal.t('Automatic alias');
- }
- else if (path) {
- return Drupal.t('Alias: @alias', {'@alias': path});
- }
- else {
- return Drupal.t('No alias');
- }
- });
- }
- };
-})(jQuery);
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.libraries.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.libraries.yml
deleted file mode 100644
index ae978aa42..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.libraries.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-widget:
- version: 1.0
- js:
- pathauto.js: {}
- dependencies:
- - core/jquery
- - core/drupal
- - core/drupalSettings
- - core/drupal.form
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.links.action.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.links.action.yml
deleted file mode 100644
index 0afa384db..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-entity.pathauto_pattern.add_form:
- route_name: 'entity.pathauto_pattern.add_form'
- title: 'Add Pathauto pattern'
- appears_on:
- - entity.pathauto_pattern.collection
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.links.task.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.links.task.yml
deleted file mode 100644
index d6fa0bca5..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.links.task.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-pathauto.patterns.form:
- route_name: entity.pathauto_pattern.collection
- base_route: path.admin_overview
- title: 'Patterns'
- weight: 10
-
-pathauto.settings.form:
- route_name: pathauto.settings.form
- base_route: path.admin_overview
- title: 'Settings'
- weight: 20
-
-pathauto.bulk.update.form:
- route_name: pathauto.bulk.update.form
- base_route: path.admin_overview
- title: 'Bulk generate'
- weight: 30
-
-pathauto.admin.delete:
- route_name: pathauto.admin.delete
- base_route: path.admin_overview
- title: 'Delete aliases'
- weight: 40
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.module b/sites/all/modules/contrib/admin/pathauto/pathauto.module
deleted file mode 100644
index ac7d9b0c0..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.module
+++ /dev/null
@@ -1,179 +0,0 @@
- 'pathauto'));
-}
-
-/**
- * Implements hook_help().
- */
-function pathauto_help($route_name, RouteMatchInterface $route_match) {
- switch ($route_name) {
- case 'help.page.pathauto':
- $output = '
' . t('About') . '
';
- $output .= '
' . t('The Pathauto module provides a mechanism to automate the creation of path aliases. This makes URLs more readable and helps search engines index content more effectively. For more information, see the online documentation for Pathauto.', [':online' => 'https://www.drupal.org/documentation/modules/pathauto']) . '
';
- $output .= '
';
- $output .= '
' . t('Uses') . '
';
- $output .= '
' . t('Pathauto is accessed from the tabs it adds to the list of URL aliases.', [':aliases' => Url::fromRoute('path.admin_overview')->toString()]) . '
';
- $output .= '
' . t('Creating Pathauto Patterns') . '
';
- $output .= '
' . t('The "Patterns" page is used to configure automatic path aliasing. New patterns are created here using the Add Pathauto pattern button which presents a form to simplify pattern creation thru the use of available tokens. The patterns page provides a list of all patterns on the site and allows you to edit and reorder them. An alias is generated for the first pattern that applies.', [':pathauto_pattern' => Url::fromRoute('entity.pathauto_pattern.collection')->toString(), ':add_form' => Url::fromRoute('entity.pathauto_pattern.add_form')->toString()]) . '
';
- $output .= '
' . t('Pathauto Settings') . '
';
- $output .= '
' . t('The "Settings" page is used to customize global Pathauto settings for automated pattern creation.', [':settings' => Url::fromRoute('pathauto.settings.form')->toString()]) . '
';
- $output .= '
' . t('The maximum alias length and maximum component length values default to 100 and have a limit of @max from Pathauto. You should enter a value that is the length of the "alias" column of the url_alias database table minus the length of any strings that might get added to the end of the URL. The recommended and default value is 100.', array('@max' => \Drupal::service('pathauto.alias_storage_helper')->getAliasSchemaMaxlength())) . '
';
- $output .= '
' . t('Bulk Generation') . '
';
- $output .= '
' . t('The "Bulk Generate" page allows you to create URL aliases for items that currently have no aliases. This is typically used when installing Pathauto on a site that has existing un-aliased content that needs to be aliased in bulk.', [':pathauto_bulk' => Url::fromRoute('pathauto.bulk.update.form')->toString()]) . '
';
- $output .= '
' . t('Delete Aliases') . '
';
- $output .= '
' . t('The "Delete Aliases" page allows you to remove URL aliases from items that have previously been assigned aliases using pathauto.', [':pathauto_delete' => Url::fromRoute('pathauto.admin.delete')->toString()]) . '
' . t('You need to select a pattern type, then a pattern and filter, and a label. Additional types can be enabled on the Settings page.', [':settings' => Url::fromRoute('pathauto.settings.form')->toString()]) . '
' . t('Bulk generation can be used to generate URL aliases for items that currently have no aliases. This is typically used when installing Pathauto on a site that has existing un-aliased content that needs to be aliased in bulk.') . ' ';
- $output .= t('It can also be used to regenerate URL aliases for items that have an old alias and for which the Pathauto pattern has been changed.') . '
';
- $output .= '
' . t('Note that this will only affect items which are configured to have their URL alias automatically set. Items whose URL alias is manually set are not affected.') . '
';
- return $output;
- }
-}
-
-/**
- * Implements hook_entity_insert().
- */
-function pathauto_entity_insert(EntityInterface $entity) {
- \Drupal::service('pathauto.generator')->updateEntityAlias($entity, 'insert');
-}
-
-/**
- * Implements hook_entity_update().
- */
-function pathauto_entity_update(EntityInterface $entity) {
- \Drupal::service('pathauto.generator')->updateEntityAlias($entity, 'update');
-}
-
-/**
- * Implements hook_entity_delete().
- */
-function pathauto_entity_delete(EntityInterface $entity) {
- if ($entity->hasLinkTemplate('canonical') && $entity instanceof ContentEntityInterface && $entity->hasField('path')) {
- \Drupal::service('pathauto.alias_storage_helper')->deleteEntityPathAll($entity);
- $entity->get('path')->first()->get('pathauto')->purge();
- }
-}
-
-/**
- * Implements hook_field_info_alter().
- */
-function pathauto_field_info_alter(&$info) {
- $info['path']['class'] = PathautoItem::class;
- $info['path']['list_class'] = PathautoFieldItemList::class;
-}
-
-/**
- * Implements hook_field_widget_info_alter().
- */
-function pathauto_field_widget_info_alter(&$widgets) {
- $widgets['path']['class'] = 'Drupal\pathauto\PathautoWidget';
-}
-
-/**
- * Implements hook_entity_base_field_info().
- */
-function pathauto_entity_base_field_info(EntityTypeInterface $entity_type) {
- $config = \Drupal::config('pathauto.settings');
- // Verify that the configuration data isn't null (as is the case before the
- // module's initialization, in tests), so that in_array() won't fail.
- if ($enabled_entity_types = $config->get('enabled_entity_types')) {
- if (in_array($entity_type->id(), $enabled_entity_types)) {
- $fields['path'] = BaseFieldDefinition::create('path')
- ->setCustomStorage(TRUE)
- ->setLabel(t('URL alias'))
- ->setTranslatable(TRUE)
- ->setComputed(TRUE)
- ->setDisplayOptions('form', array(
- 'type' => 'path',
- 'weight' => 30,
- ))
- ->setDisplayConfigurable('form', TRUE);
-
- return $fields;
- }
- }
-}
-
-/**
- * Validate the pattern field, to ensure it doesn't contain any characters that
- * are invalid in URLs.
- */
-function pathauto_pattern_validate($element, FormStateInterface $form_state) {
-
- if (isset($element['#value'])) {
- $title = empty($element['#title']) ? $element['#parents'][0] : $element['#title'];
- $invalid_characters = ['#', '?', '&'];
- $invalid_characters_used = [];
-
- foreach ($invalid_characters as $invalid_character) {
- if (strpos($element['#value'], $invalid_character) !== FALSE) {
- $invalid_characters_used[] = $invalid_character;
- }
- }
-
- if (!empty($invalid_characters_used)) {
- $form_state->setError($element, t('The %element-title is using the following invalid characters: @invalid-characters.', array('%element-title' => $title, '@invalid-characters' => implode(', ', $invalid_characters_used))));
- }
-
- if (preg_match('/(\s$)+/', $element['#value'])) {
- $form_state->setError($element, t('The %element-title doesn\'t allow the patterns ending with whitespace.', array('%element-title' => $title)));
- }
- }
-
- return $element;
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.permissions.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.permissions.yml
deleted file mode 100644
index ede9f288c..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.permissions.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-administer pathauto:
- title: 'Administer pathauto'
- description: 'Allows a user to configure patterns for automated aliases and bulk delete URL-aliases.'
-notify of path changes:
- title: 'Notify of Path Changes'
- description: 'Determines whether or not users are notified.'
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.routing.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.routing.yml
deleted file mode 100644
index e55063c5b..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.routing.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-entity.pathauto_pattern.collection:
- path: '/admin/config/search/path/patterns'
- defaults:
- _entity_list: 'pathauto_pattern'
- _title: 'Patterns'
- requirements:
- _permission: 'administer pathauto'
-
-entity.pathauto_pattern.add_form:
- path: '/admin/config/search/path/patterns/add'
- defaults:
- _entity_form: 'pathauto_pattern.default'
- _title: 'Add Pathauto pattern'
- tempstore_id: 'pathauto.pattern'
- requirements:
- _permission: 'administer pathauto'
-
-pathauto.settings.form:
- path: '/admin/config/search/path/settings'
- defaults:
- _form: '\Drupal\pathauto\Form\PathautoSettingsForm'
- _title: 'Settings'
- requirements:
- _permission: 'administer pathauto'
-
-entity.pathauto_pattern.enable:
- path: '/admin/config/search/path/patterns/{pathauto_pattern}/enable'
- defaults:
- _entity_form: 'pathauto_pattern.enable'
- requirements:
- _entity_access: 'pathauto_pattern.update'
-
-entity.pathauto_pattern.disable:
- path: '/admin/config/search/path/patterns/{pathauto_pattern}/disable'
- defaults:
- _entity_form: 'pathauto_pattern.disable'
- requirements:
- _entity_access: 'pathauto_pattern.update'
-
-pathauto.bulk.update.form:
- path: '/admin/config/search/path/update_bulk'
- defaults:
- _form: '\Drupal\pathauto\Form\PathautoBulkUpdateForm'
- _title: 'Bulk generate'
- requirements:
- _permission: 'administer url aliases'
-
-pathauto.admin.delete:
- path: '/admin/config/search/path/delete_bulk'
- defaults:
- _form: '\Drupal\pathauto\Form\PathautoAdminDelete'
- _title: 'Delete aliases'
- requirements:
- _permission: 'administer url aliases'
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.services.yml b/sites/all/modules/contrib/admin/pathauto/pathauto.services.yml
deleted file mode 100644
index 8848f7f33..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.services.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-services:
- pathauto.generator:
- class: Drupal\pathauto\PathautoGenerator
- arguments: ['@config.factory', '@module_handler', '@token', '@pathauto.alias_cleaner', '@pathauto.alias_storage_helper', '@pathauto.alias_uniquifier', '@pathauto.verbose_messenger', '@string_translation', '@token.entity_mapper', '@entity_type.manager']
- pathauto.alias_cleaner:
- class: Drupal\pathauto\AliasCleaner
- arguments: ['@config.factory', '@pathauto.alias_storage_helper', '@language_manager', '@cache.discovery', '@transliteration', '@module_handler']
- pathauto.alias_storage_helper:
- class: Drupal\pathauto\AliasStorageHelper
- arguments: ['@config.factory', '@path.alias_storage', '@database','@pathauto.verbose_messenger', '@string_translation']
- tags:
- - { name: backend_overridable }
- pathauto.alias_uniquifier:
- class: Drupal\pathauto\AliasUniquifier
- arguments: ['@config.factory', '@pathauto.alias_storage_helper','@module_handler', '@router.route_provider', '@path.alias_manager']
- pathauto.verbose_messenger:
- class: Drupal\pathauto\VerboseMessenger
- arguments: ['@config.factory', '@current_user', '@messenger']
- plugin.manager.alias_type:
- class: Drupal\pathauto\AliasTypeManager
- parent: default_plugin_manager
- pathauto.settings_cache_tag:
- class: Drupal\pathauto\EventSubscriber\PathautoSettingsCacheTag
- arguments: ['@entity_field.manager', '@plugin.manager.alias_type']
- tags:
- - { name: event_subscriber }
diff --git a/sites/all/modules/contrib/admin/pathauto/pathauto.tokens.inc b/sites/all/modules/contrib/admin/pathauto/pathauto.tokens.inc
deleted file mode 100644
index 626ff09c5..000000000
--- a/sites/all/modules/contrib/admin/pathauto/pathauto.tokens.inc
+++ /dev/null
@@ -1,49 +0,0 @@
- t('Joined path'),
- 'description' => t('The array values each cleaned by Pathauto and then joined with the slash into a string that resembles an URL.'),
- );
-
- return $info;
-}
-
-/**
- * Implements hook_tokens().
- */
-function pathauto_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
- $replacements = array();
-
- if ($type == 'array' && !empty($data['array'])) {
- $array = $data['array'];
-
- foreach ($tokens as $name => $original) {
- switch ($name) {
- case 'join-path':
- $values = array();
- foreach (token_element_children($array) as $key) {
- $value = is_array($array[$key]) ? render($array[$key]) : (string) $array[$key];
- $value = \Drupal::service('pathauto.alias_cleaner')->cleanString($value, $options);
- $values[] = $value;
- }
- $replacements[$original] = implode('/', $values);
- break;
- }
- }
- }
-
- return $replacements;
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasCleaner.php b/sites/all/modules/contrib/admin/pathauto/src/AliasCleaner.php
deleted file mode 100644
index cb8b6d125..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/AliasCleaner.php
+++ /dev/null
@@ -1,353 +0,0 @@
-configFactory = $config_factory;
- $this->aliasStorageHelper = $alias_storage_helper;
- $this->languageManager = $language_manager;
- $this->cacheBackend = $cache_backend;
- $this->transliteration = $transliteration;
- $this->moduleHandler = $module_handler;
- }
-
- /**
- * {@inheritdoc}
- */
- public function cleanAlias($alias) {
- $config = $this->configFactory->get('pathauto.settings');
- $alias_max_length = min($config->get('max_length'), $this->aliasStorageHelper->getAliasSchemaMaxLength());
-
- $output = $alias;
-
- // Trim duplicate, leading, and trailing separators. Do this before cleaning
- // backslashes since a pattern like "[token1]/[token2]-[token3]/[token4]"
- // could end up like "value1/-/value2" and if backslashes were cleaned first
- // this would result in a duplicate backslash.
- $output = $this->getCleanSeparators($output);
-
- // Trim duplicate, leading, and trailing backslashes.
- $output = $this->getCleanSeparators($output, '/');
-
- // Shorten to a logical place based on word boundaries.
- $output = Unicode::truncate($output, $alias_max_length, TRUE);
-
- return $output;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCleanSeparators($string, $separator = NULL) {
- $config = $this->configFactory->get('pathauto.settings');
-
- if (!isset($separator)) {
- $separator = $config->get('separator');
- }
-
- $output = $string;
-
- if (strlen($separator)) {
- // Trim any leading or trailing separators.
- $output = trim($output, $separator);
-
- // Escape the separator for use in regular expressions.
- $seppattern = preg_quote($separator, '/');
-
- // Replace multiple separators with a single one.
- $output = preg_replace("/$seppattern+/", $separator, $output);
-
- // Replace trailing separators around slashes.
- if ($separator !== '/') {
- $output = preg_replace("/\/+$seppattern\/+|$seppattern\/+|\/+$seppattern/", "/", $output);
- }
- else {
- // If the separator is a slash, we need to re-add the leading slash
- // dropped by the trim function.
- $output = '/' . $output;
- }
- }
-
- return $output;
- }
-
- /**
- * {@inheritdoc}
- */
- public function cleanString($string, array $options = array()) {
- if (empty($this->cleanStringCache)) {
- // Generate and cache variables used in this method.
- $config = $this->configFactory->get('pathauto.settings');
- $this->cleanStringCache = array(
- 'separator' => $config->get('separator'),
- 'strings' => array(),
- 'transliterate' => $config->get('transliterate'),
- 'punctuation' => array(),
- 'reduce_ascii' => (bool) $config->get('reduce_ascii'),
- 'ignore_words_regex' => FALSE,
- 'lowercase' => (bool) $config->get('case'),
- 'maxlength' => min($config->get('max_component_length'), $this->aliasStorageHelper->getAliasSchemaMaxLength()),
- );
-
- // Generate and cache the punctuation replacements for strtr().
- $punctuation = $this->getPunctuationCharacters();
- foreach ($punctuation as $name => $details) {
- $action = $config->get('punctuation.' . $name);
- switch ($action) {
- case PathautoGeneratorInterface::PUNCTUATION_REMOVE:
- $this->cleanStringCache['punctuation'][$details['value']] = '';
- break;
-
- case PathautoGeneratorInterface::PUNCTUATION_REPLACE:
- $this->cleanStringCache['punctuation'][$details['value']] = $this->cleanStringCache['separator'];
- break;
-
- case PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING:
- // Literally do nothing.
- break;
- }
- }
-
- // Generate and cache the ignored words regular expression.
- $ignore_words = $config->get('ignore_words');
- $ignore_words_regex = preg_replace(array('/^[,\s]+|[,\s]+$/', '/[,\s]+/'), array('', '\b|\b'), $ignore_words);
- if ($ignore_words_regex) {
- $this->cleanStringCache['ignore_words_regex'] = '\b' . $ignore_words_regex . '\b';
- if (function_exists('mb_eregi_replace')) {
- mb_regex_encoding('UTF-8');
- $this->cleanStringCache['ignore_words_callback'] = 'mb_eregi_replace';
- }
- else {
- $this->cleanStringCache['ignore_words_callback'] = 'preg_replace';
- $this->cleanStringCache['ignore_words_regex'] = '/' . $this->cleanStringCache['ignore_words_regex'] . '/i';
- }
- }
- }
-
- // Empty strings do not need any processing.
- if ($string === '' || $string === NULL) {
- return '';
- }
-
- $langcode = NULL;
- if (!empty($options['language'])) {
- $langcode = $options['language']->getId();
- }
- elseif (!empty($options['langcode'])) {
- $langcode = $options['langcode'];
- }
-
- // Check if the string has already been processed, and if so return the
- // cached result.
- if (isset($this->cleanStringCache['strings'][$langcode][(string) $string])) {
- return $this->cleanStringCache['strings'][$langcode][(string) $string];
- }
-
- // Remove all HTML tags from the string.
- $output = Html::decodeEntities($string);
- $output = PlainTextOutput::renderFromHtml($output);
-
- // Optionally transliterate.
- if ($this->cleanStringCache['transliterate']) {
- // If the reduce strings to letters and numbers is enabled, don't bother
- // replacing unknown characters with a question mark. Use an empty string
- // instead.
- $output = $this->transliteration->transliterate($output, $langcode, $this->cleanStringCache['reduce_ascii'] ? '' : '?');
- }
-
- // Replace or drop punctuation based on user settings.
- $output = strtr($output, $this->cleanStringCache['punctuation']);
-
- // Reduce strings to letters and numbers.
- if ($this->cleanStringCache['reduce_ascii']) {
- $output = preg_replace('/[^a-zA-Z0-9\/]+/', $this->cleanStringCache['separator'], $output);
- }
-
- // Get rid of words that are on the ignore list.
- if ($this->cleanStringCache['ignore_words_regex']) {
- $words_removed = $this->cleanStringCache['ignore_words_callback']($this->cleanStringCache['ignore_words_regex'], '', $output);
- if (mb_strlen(trim($words_removed)) > 0) {
- $output = $words_removed;
- }
- }
-
- // Always replace whitespace with the separator.
- $output = preg_replace('/\s+/', $this->cleanStringCache['separator'], $output);
-
- // Trim duplicates and remove trailing and leading separators.
- $output = $this->getCleanSeparators($this->getCleanSeparators($output, $this->cleanStringCache['separator']));
-
- // Optionally convert to lower case.
- if ($this->cleanStringCache['lowercase']) {
- $output = mb_strtolower($output);
- }
-
- // Shorten to a logical place based on word boundaries.
- $output = Unicode::truncate($output, $this->cleanStringCache['maxlength'], TRUE);
-
- // Cache this result in the static array.
- $this->cleanStringCache['strings'][$langcode][(string) $string] = $output;
-
- return $output;
- }
-
-
- /**
- * {@inheritdoc}
- */
- public function getPunctuationCharacters() {
- if (empty($this->punctuationCharacters)) {
- $langcode = $this->languageManager->getCurrentLanguage()->getId();
-
- $cid = 'pathauto:punctuation:' . $langcode;
- if ($cache = $this->cacheBackend->get($cid)) {
- $this->punctuationCharacters = $cache->data;
- }
- else {
- $punctuation = array();
- $punctuation['double_quotes'] = array('value' => '"', 'name' => t('Double quotation marks'));
- $punctuation['quotes'] = array('value' => '\'', 'name' => t("Single quotation marks (apostrophe)"));
- $punctuation['backtick'] = array('value' => '`', 'name' => t('Back tick'));
- $punctuation['comma'] = array('value' => ',', 'name' => t('Comma'));
- $punctuation['period'] = array('value' => '.', 'name' => t('Period'));
- $punctuation['hyphen'] = array('value' => '-', 'name' => t('Hyphen'));
- $punctuation['underscore'] = array('value' => '_', 'name' => t('Underscore'));
- $punctuation['colon'] = array('value' => ':', 'name' => t('Colon'));
- $punctuation['semicolon'] = array('value' => ';', 'name' => t('Semicolon'));
- $punctuation['pipe'] = array('value' => '|', 'name' => t('Vertical bar (pipe)'));
- $punctuation['left_curly'] = array('value' => '{', 'name' => t('Left curly bracket'));
- $punctuation['left_square'] = array('value' => '[', 'name' => t('Left square bracket'));
- $punctuation['right_curly'] = array('value' => '}', 'name' => t('Right curly bracket'));
- $punctuation['right_square'] = array('value' => ']', 'name' => t('Right square bracket'));
- $punctuation['plus'] = array('value' => '+', 'name' => t('Plus sign'));
- $punctuation['equal'] = array('value' => '=', 'name' => t('Equal sign'));
- $punctuation['asterisk'] = array('value' => '*', 'name' => t('Asterisk'));
- $punctuation['ampersand'] = array('value' => '&', 'name' => t('Ampersand'));
- $punctuation['percent'] = array('value' => '%', 'name' => t('Percent sign'));
- $punctuation['caret'] = array('value' => '^', 'name' => t('Caret'));
- $punctuation['dollar'] = array('value' => '$', 'name' => t('Dollar sign'));
- $punctuation['hash'] = array('value' => '#', 'name' => t('Number sign (pound sign, hash)'));
- $punctuation['at'] = array('value' => '@', 'name' => t('At sign'));
- $punctuation['exclamation'] = array('value' => '!', 'name' => t('Exclamation mark'));
- $punctuation['tilde'] = array('value' => '~', 'name' => t('Tilde'));
- $punctuation['left_parenthesis'] = array('value' => '(', 'name' => t('Left parenthesis'));
- $punctuation['right_parenthesis'] = array('value' => ')', 'name' => t('Right parenthesis'));
- $punctuation['question_mark'] = array('value' => '?', 'name' => t('Question mark'));
- $punctuation['less_than'] = array('value' => '<', 'name' => t('Less-than sign'));
- $punctuation['greater_than'] = array('value' => '>', 'name' => t('Greater-than sign'));
- $punctuation['slash'] = array('value' => '/', 'name' => t('Slash'));
- $punctuation['back_slash'] = array('value' => '\\', 'name' => t('Backslash'));
-
- // Allow modules to alter the punctuation list and cache the result.
- $this->moduleHandler->alter('pathauto_punctuation_chars', $punctuation);
- $this->cacheBackend->set($cid, $punctuation);
- $this->punctuationCharacters = $punctuation;
- }
- }
-
- return $this->punctuationCharacters;
- }
-
- /**
- * {@inheritdoc}
- */
- public function cleanTokenValues(&$replacements, $data = array(), $options = array()) {
- foreach ($replacements as $token => $value) {
- // Only clean non-path tokens.
- $config = $this->configFactory->get('pathauto.settings');
- $safe_tokens = implode('|', (array) $config->get('safe_tokens'));
- if (!preg_match('/:(' . $safe_tokens . ')(:|\]$)/', $token)) {
- $replacements[$token] = $this->cleanString($value, $options);
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function resetCaches() {
- $this->cleanStringCache = array();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasCleanerInterface.php b/sites/all/modules/contrib/admin/pathauto/src/AliasCleanerInterface.php
deleted file mode 100644
index 95d2920f7..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/AliasCleanerInterface.php
+++ /dev/null
@@ -1,103 +0,0 @@
-configFactory = $config_factory;
- $this->aliasStorage = $alias_storage;
- $this->database = $database;
- $this->messenger = $messenger;
- $this->stringTranslation = $string_translation;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAliasSchemaMaxLength() {
- return $this->aliasSchemaMaxLength;
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $path, $existing_alias = NULL, $op = NULL) {
- $config = $this->configFactory->get('pathauto.settings');
-
- // Alert users if they are trying to create an alias that is the same as the
- // internal path.
- if ($path['source'] == $path['alias']) {
- $this->messenger->addMessage($this->t('Ignoring alias %alias because it is the same as the internal path.', array('%alias' => $path['alias'])));
- return NULL;
- }
-
- // Skip replacing the current alias with an identical alias.
- if (empty($existing_alias) || $existing_alias['alias'] != $path['alias']) {
- $path += array(
- 'pathauto' => TRUE,
- 'original' => $existing_alias,
- 'pid' => NULL,
- );
-
- // If there is already an alias, respect some update actions.
- if (!empty($existing_alias)) {
- switch ($config->get('update_action')) {
- case PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW:
- // Do not create the alias.
- return NULL;
-
- case PathautoGeneratorInterface::UPDATE_ACTION_LEAVE:
- // Create a new alias instead of overwriting the existing by leaving
- // $path['pid'] empty.
- break;
-
- case PathautoGeneratorInterface::UPDATE_ACTION_DELETE:
- // The delete actions should overwrite the existing alias.
- $path['pid'] = $existing_alias['pid'];
- break;
- }
- }
-
- // Save the path array.
- $this->aliasStorage->save($path['source'], $path['alias'], $path['language'], $path['pid']);
-
- if (!empty($existing_alias['pid'])) {
- $this->messenger->addMessage($this->t(
- 'Created new alias %alias for %source, replacing %old_alias.',
- array(
- '%alias' => $path['alias'],
- '%source' => $path['source'],
- '%old_alias' => $existing_alias['alias'],
- )
- )
- );
- }
- else {
- $this->messenger->addMessage($this->t('Created new alias %alias for %source.', array(
- '%alias' => $path['alias'],
- '%source' => $path['source'],
- )));
- }
-
- return $path;
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadBySource($source, $language = LanguageInterface::LANGCODE_NOT_SPECIFIED) {
- $alias = $this->aliasStorage->load([
- 'source' => $source,
- 'langcode' => $language,
- ]);
- // If no alias was fetched and if a language was specified, fallbacks to
- // undefined language.
- if (!$alias && ($language !== LanguageInterface::LANGCODE_NOT_SPECIFIED)) {
- $alias = $this->aliasStorage->load([
- 'source' => $source,
- 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
- ]);
- }
- return $alias;
- }
-
- /**
- * {@inheritdoc}
- */
- public function deleteBySourcePrefix($source) {
- $pids = $this->loadBySourcePrefix($source);
- if ($pids) {
- $this->deleteMultiple($pids);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function deleteAll() {
- $this->database->truncate('url_alias')->execute();
- }
-
- /**
- * {@inheritdoc}
- */
- public function deleteEntityPathAll(EntityInterface $entity, $default_uri = NULL) {
- $this->deleteBySourcePrefix('/' . $entity->toUrl('canonical')->getInternalPath());
- if (isset($default_uri) && $entity->toUrl('canonical')->toString() != $default_uri) {
- $this->deleteBySourcePrefix($default_uri);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function loadBySourcePrefix($source) {
- $select = $this->database->select('url_alias', 'u')
- ->fields('u', array('pid'));
-
- $or_group = $select->orConditionGroup()
- ->condition('source', $source)
- ->condition('source', rtrim($source, '/') . '/%', 'LIKE');
-
- return $select
- ->condition($or_group)
- ->execute()
- ->fetchCol();
- }
-
- /**
- * {@inheritdoc}
- */
- public function countBySourcePrefix($source) {
- $select = $this->database->select('url_alias', 'u')
- ->fields('u', array('pid'));
-
- $or_group = $select->orConditionGroup()
- ->condition('source', $source)
- ->condition('source', rtrim($source, '/') . '/%', 'LIKE');
-
- return $select
- ->condition($or_group)
- ->countQuery()
- ->execute()
- ->fetchField();
- }
-
- /**
- * {@inheritdoc}
- */
- public function countAll() {
- return $this->database->select('url_alias')
- ->countQuery()
- ->execute()
- ->fetchField();
- }
-
- /**
- * Delete multiple URL aliases.
- *
- * Intent of this is to abstract a potential path_delete_multiple() function
- * for Drupal 7 or 8.
- *
- * @param int[] $pids
- * An array of path IDs to delete.
- */
- public function deleteMultiple($pids) {
- foreach ($pids as $pid) {
- $this->aliasStorage->delete(array('pid' => $pid));
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasStorageHelperInterface.php b/sites/all/modules/contrib/admin/pathauto/src/AliasStorageHelperInterface.php
deleted file mode 100644
index 9b3b2bd86..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/AliasStorageHelperInterface.php
+++ /dev/null
@@ -1,117 +0,0 @@
-alterInfo('pathauto_alias_types');
- $this->setCacheBackend($cache_backend, 'pathauto_alias_types');
- }
-
- /**
- * Returns plugin definitions that support a given token type.
- *
- * @param string $type
- * The type of token plugin must support to be useful.
- *
- * @return array
- * Plugin definitions.
- */
- public function getPluginDefinitionByType($type) {
- $definitions = array_filter($this->getDefinitions(), function ($definition) use ($type) {
- if (!empty($definition['types']) && in_array($type, $definition['types'])) {
- return TRUE;
- }
- return FALSE;
- });
- return $definitions;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFallbackPluginId($plugin_id, array $configuration = array()) {
- return 'broken';
- }
-
- /**
- * Gets the definition of all visible plugins for this type.
- *
- * @return array
- * An array of plugin definitions (empty array if no definitions were
- * found). Keys are plugin IDs.
- */
- public function getVisibleDefinitions() {
- $definitions = $this->getDefinitions();
- unset($definitions['broken']);
- return $definitions;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifier.php b/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifier.php
deleted file mode 100644
index 70784e6f4..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifier.php
+++ /dev/null
@@ -1,169 +0,0 @@
-configFactory = $config_factory;
- $this->aliasStorageHelper = $alias_storage_helper;
- $this->moduleHandler = $module_handler;
- $this->routeProvider = $route_provider;
- $this->aliasManager = $alias_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public function uniquify(&$alias, $source, $langcode) {
- $config = $this->configFactory->get('pathauto.settings');
-
- if (!$this->isReserved($alias, $source, $langcode)) {
- return;
- }
-
- // If the alias already exists, generate a new, hopefully unique, variant.
- $maxlength = min($config->get('max_length'), $this->aliasStorageHelper->getAliasSchemaMaxlength());
- $separator = $config->get('separator');
- $original_alias = $alias;
-
- $i = 0;
- do {
- // Append an incrementing numeric suffix until we find a unique alias.
- $unique_suffix = $separator . $i;
- $alias = Unicode::truncate($original_alias, $maxlength - Unicode::strlen($unique_suffix), TRUE) . $unique_suffix;
- $i++;
- } while ($this->isReserved($alias, $source, $langcode));
- }
-
- /**
- * {@inheritdoc}
- */
- public function isReserved($alias, $source, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED) {
- // Check if this alias already exists.
- if ($existing_source = $this->aliasManager->getPathByAlias($alias, $langcode)) {
- if ($existing_source != $alias) {
- // If it is an alias for the provided source, it is allowed to keep using
- // it. If not, then it is reserved.
- return $existing_source != $source;
- }
-
- }
-
- // Then check if there is a route with the same path.
- if ($this->isRoute($alias)) {
- return TRUE;
- }
- // Finally check if any other modules have reserved the alias.
- $args = array(
- $alias,
- $source,
- $langcode,
- );
- $implementations = $this->moduleHandler->getImplementations('pathauto_is_alias_reserved');
- foreach ($implementations as $module) {
-
- $result = $this->moduleHandler->invoke($module, 'pathauto_is_alias_reserved', $args);
-
- if (!empty($result)) {
- // As soon as the first module says that an alias is in fact reserved,
- // then there is no point in checking the rest of the modules.
- return TRUE;
- }
- }
-
- return FALSE;
- }
-
- /**
- * Verify if the given path is a valid route.
- *
- * @param string $path
- * A string containing a relative path.
- *
- * @return bool
- * TRUE if the path already exists.
- *
- * @throws \InvalidArgumentException
- */
- public function isRoute($path) {
- if (is_file(DRUPAL_ROOT . '/' . $path) || is_dir(DRUPAL_ROOT . '/' . $path)) {
- // Do not allow existing files or directories to get assigned an automatic
- // alias. Note that we do not need to use is_link() to check for symbolic
- // links since this returns TRUE for either is_file() or is_dir() already.
- return TRUE;
- }
-
- $routes = $this->routeProvider->getRoutesByPattern($path);
-
- // Only return true for an exact match, ignore placeholders.
- foreach ($routes as $route) {
- if ($route->getPath() == $path) {
- return TRUE;
- }
- }
-
- return FALSE;
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifierInterface.php b/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifierInterface.php
deleted file mode 100644
index 89649eab3..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/AliasUniquifierInterface.php
+++ /dev/null
@@ -1,43 +0,0 @@
-getSelectionConditions() as $id => $condition) {
- $criteria[$id] = $condition->getConfiguration();
- }
- $this->selection_criteria = $criteria;
-
- // Invalidate the static caches.
- \Drupal::service('pathauto.generator')->resetCaches();
- }
-
- /**
- * {@inheritdoc}
- */
- public static function postDelete(EntityStorageInterface $storage, array $entities) {
- parent::postDelete($storage, $entities);
- // Invalidate the static caches.
- \Drupal::service('pathauto.generator')->resetCaches();
- }
-
- /**
- * {@inheritdoc}
- */
- public function calculateDependencies() {
- parent::calculateDependencies();
-
- $this->calculatePluginDependencies($this->getAliasType());
-
- foreach ($this->getSelectionConditions() as $instance) {
- $this->calculatePluginDependencies($instance);
- }
-
- return $this->getDependencies();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getPattern() {
- return $this->pattern;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setPattern($pattern) {
- $this->pattern = $pattern;
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getType() {
- return $this->type;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAliasType() {
- if (!$this->aliasTypeCollection) {
- $this->aliasTypeCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.alias_type'), $this->getType(), ['default' => $this->getPattern()]);
- }
- return $this->aliasTypeCollection->get($this->getType());
- }
-
- /**
- * {@inheritdoc}
- */
- public function getWeight() {
- return $this->weight;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setWeight($weight) {
- $this->weight = $weight;
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getContexts() {
- $contexts = $this->getAliasType()->getContexts();
- foreach ($this->getRelationships() as $token => $definition) {
- /** @var \Drupal\ctools\TypedDataResolver $resolver */
- $resolver = \Drupal::service('ctools.typed_data.resolver');
- $context = $resolver->convertTokenToContext($token, $contexts);
- $context_definition = $context->getContextDefinition();
- if (!empty($definition['label'])) {
- $context_definition->setLabel($definition['label']);
- }
- $contexts[$token] = $context;
- }
- return $contexts;
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasRelationship($token) {
- return isset($this->relationships[$token]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function addRelationship($token, $label = NULL) {
- if (!$this->hasRelationship($token)) {
- $this->relationships[$token] = [
- 'label' => $label,
- ];
- }
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function replaceRelationship($token, $label) {
- if ($this->hasRelationship($token)) {
- $this->relationships[$token] = [
- 'label' => $label,
- ];
- }
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function removeRelationship($token) {
- unset($this->relationships[$token]);
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRelationships() {
- return $this->relationships;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSelectionConditions() {
- if (!$this->selectionConditionCollection) {
- $this->selectionConditionCollection = new ConditionPluginCollection(\Drupal::service('plugin.manager.condition'), $this->get('selection_criteria'));
- }
- return $this->selectionConditionCollection;
- }
-
- /**
- * {@inheritdoc}
- */
- public function addSelectionCondition(array $configuration) {
- $configuration['uuid'] = $this->uuidGenerator()->generate();
- $this->getSelectionConditions()->addInstanceId($configuration['uuid'], $configuration);
- return $configuration['uuid'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSelectionCondition($condition_id) {
- return $this->getSelectionConditions()->get($condition_id);
- }
-
- /**
- * {@inheritdoc}
- */
- public function removeSelectionCondition($condition_id) {
- $this->getSelectionConditions()->removeInstanceId($condition_id);
- return $this;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSelectionLogic() {
- return $this->selection_logic;
- }
-
- /**
- * {@inheritdoc}
- */
- public function applies($object) {
- if ($this->getAliasType()->applies($object)) {
- $definitions = $this->getAliasType()->getContextDefinitions();
- if (count($definitions) > 1) {
- throw new \Exception("Alias types do not support more than one context.");
- }
- $keys = array_keys($definitions);
- // Set the context object on our Alias plugin before retrieving contexts.
- $this->getAliasType()->setContextValue($keys[0], $object);
- /** @var \Drupal\Core\Plugin\Context\ContextInterface[] $base_contexts */
- $contexts = $this->getContexts();
- /** @var \Drupal\Core\Plugin\Context\ContextHandler $context_handler */
- $context_handler = \Drupal::service('context.handler');
- $conditions = $this->getSelectionConditions();
- foreach ($conditions as $condition) {
-
- // As the context object is kept and only the value is switched out,
- // it can over time grow to a huge number of cache contexts. Reset it
- // if there are 100 cache tags to prevent cache tag merging getting too
- // slow.
- foreach ($condition->getContextDefinitions() as $name => $context_definition) {
- if (count($condition->getContext($name)->getCacheTags()) > 100) {
- $condition->setContext($name, new Context($context_definition));
- }
- }
-
- if ($condition instanceof ContextAwarePluginInterface) {
- try {
- $context_handler->applyContextMapping($condition, $contexts);
- }
- catch (ContextException $e) {
- watchdog_exception('pathauto', $e);
- return FALSE;
- }
- }
- $result = $condition->execute();
- if ($this->getSelectionLogic() == 'and' && !$result) {
- return FALSE;
- }
- elseif ($this->getSelectionLogic() == 'or' && $result) {
- return TRUE;
- }
- }
- return TRUE;
- }
- return FALSE;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/EventSubscriber/PathautoSettingsCacheTag.php b/sites/all/modules/contrib/admin/pathauto/src/EventSubscriber/PathautoSettingsCacheTag.php
deleted file mode 100644
index 698d76b75..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/EventSubscriber/PathautoSettingsCacheTag.php
+++ /dev/null
@@ -1,68 +0,0 @@
-entityFieldManager = $entity_field_manager;
- $this->aliasTypeManager = $alias_type_manager;
- }
-
- /**
- * Invalidate the 'rendered' cache tag whenever the settings are modified.
- *
- * @param \Drupal\Core\Config\ConfigCrudEvent $event
- * The Event to process.
- */
- public function onSave(ConfigCrudEvent $event) {
- if ($event->getConfig()->getName() === 'pathauto.settings') {
- $config = $event->getConfig();
- $original_entity_types = $config->getOriginal('enabled_entity_types');
-
- // Clear cached field definitions if the values are changed.
- if ($original_entity_types != $config->get('enabled_entity_types')) {
- $this->entityFieldManager->clearCachedFieldDefinitions();
- $this->aliasTypeManager->clearCachedDefinitions();
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getSubscribedEvents() {
- $events[ConfigEvents::SAVE][] = ['onSave'];
- return $events;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoAdminDelete.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoAdminDelete.php
deleted file mode 100644
index 277c30700..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoAdminDelete.php
+++ /dev/null
@@ -1,193 +0,0 @@
-aliasTypeManager = $alias_type_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('plugin.manager.alias_type')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'pathauto_admin_delete';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $form['delete'] = [
- '#type' => 'fieldset',
- '#title' => $this->t('Choose aliases to delete'),
- '#tree' => TRUE,
- ];
-
- // First we do the "all" case.
- $storage_helper = \Drupal::service('pathauto.alias_storage_helper');
- $total_count = $storage_helper->countAll();
- $form['delete']['all_aliases'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('All aliases'),
- '#default_value' => FALSE,
- '#description' => $this->t('Delete all aliases. Number of aliases which will be deleted: %count.', ['%count' => $total_count]),
- ];
-
- // Next, iterate over all visible alias types.
- $definitions = $this->aliasTypeManager->getVisibleDefinitions();
-
- foreach ($definitions as $id => $definition) {
- /** @var \Drupal\pathauto\AliasTypeInterface $alias_type */
- $alias_type = $this->aliasTypeManager->createInstance($id);
- $count = $storage_helper->countBySourcePrefix($alias_type->getSourcePrefix());
- $form['delete']['plugins'][$id] = [
- '#type' => 'checkbox',
- '#title' => (string) $definition['label'],
- '#default_value' => FALSE,
- '#description' => $this->t('Delete aliases for all @label. Number of aliases which will be deleted: %count.', ['@label' => (string) $definition['label'], '%count' => $count]),
- ];
- }
-
- $form['options'] = [
- '#type' => 'fieldset',
- '#title' => $this->t('Delete options'),
- '#tree' => TRUE,
- ];
-
- // Provide checkbox for not deleting custom aliases.
- $form['options']['keep_custom_aliases'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Only delete automatically generated aliases'),
- '#default_value' => TRUE,
- '#description' => $this->t('When checked, aliases which have been manually set are not affected by this mass-deletion.'),
- ];
-
- // Warn them and give a button that shows we mean business.
- $form['warning'] = ['#value' => '
' . $this->t('Note: there is no confirmation. Be sure of your action before clicking the "Delete aliases now!" button. You may want to make a backup of the database and/or the url_alias table prior to using this feature.') . '
'];
- $form['buttons']['submit'] = [
- '#type' => 'submit',
- '#value' => $this->t('Delete aliases now!'),
- ];
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $delete_all = $form_state->getValue(['delete', 'all_aliases']);
- // Keeping custom aliases forces us to go the slow way to correctly check
- // the automatic/manual flag.
- if ($form_state->getValue(['options', 'keep_custom_aliases'])) {
- $batch = [
- 'title' => $this->t('Bulk deleting URL aliases'),
- 'operations' => [['Drupal\pathauto\Form\PathautoAdminDelete::batchStart', [$delete_all]]],
- 'finished' => 'Drupal\pathauto\Form\PathautoAdminDelete::batchFinished',
- ];
-
- if ($delete_all) {
- foreach (array_keys($form_state->getValue(['delete', 'plugins'])) as $id) {
- $batch['operations'][] = ['Drupal\pathauto\Form\PathautoAdminDelete::batchProcess', [$id]];
- }
- }
- else {
- foreach (array_keys(array_filter($form_state->getValue(['delete', 'plugins']))) as $id) {
- $batch['operations'][] = ['Drupal\pathauto\Form\PathautoAdminDelete::batchProcess', [$id]];
- }
- }
-
- batch_set($batch);
- }
- else if ($delete_all) {
- \Drupal::service('pathauto.alias_storage_helper')->deleteAll();
- $this->messenger()->addMessage($this->t('All of your path aliases have been deleted.'));
- }
- else {
- $storage_helper = \Drupal::service('pathauto.alias_storage_helper');
- foreach (array_keys(array_filter($form_state->getValue(['delete', 'plugins']))) as $id) {
- $alias_type = $this->aliasTypeManager->createInstance($id);
- $storage_helper->deleteBySourcePrefix((string) $alias_type->getSourcePrefix());
- $this->messenger()->addMessage($this->t('All of your %label path aliases have been deleted.', ['%label' => $alias_type->getLabel()]));
- }
- }
- }
-
- /**
- * Batch callback; record if aliases of all types must be deleted.
- */
- public static function batchStart($delete_all, &$context) {
- $context['results']['delete_all'] = $delete_all;
- $context['results']['deletions'] = [];
- }
-
- /**
- * Common batch processing callback for all operations.
- */
- public static function batchProcess($id, &$context) {
- /** @var \Drupal\pathauto\AliasTypeBatchUpdateInterface $alias_type */
- $alias_type = \Drupal::service('plugin.manager.alias_type')->createInstance($id);
- $alias_type->batchDelete($context);
- }
-
- /**
- * Batch finished callback.
- */
- public static function batchFinished($success, $results, $operations) {
- if ($success) {
- if ($results['delete_all']) {
- \Drupal::service('messenger')
- ->addMessage(t('All of your automatically generated path aliases have been deleted.'));
- }
- else if (isset($results['deletions'])) {
- foreach (array_values($results['deletions']) as $label) {
- \Drupal::service('messenger')
- ->addMessage(t('All of your automatically generated %label path aliases have been deleted.', [
- '%label' => $label,
- ]));
- }
- }
- }
- else {
- $error_operation = reset($operations);
- \Drupal::service('messenger')
- ->addMessage(t('An error occurred while processing @operation with arguments : @args', [
- '@operation' => $error_operation[0],
- '@args' => print_r($error_operation[0]),
- ]));
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoBulkUpdateForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoBulkUpdateForm.php
deleted file mode 100644
index 67a026652..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoBulkUpdateForm.php
+++ /dev/null
@@ -1,170 +0,0 @@
-aliasTypeManager = $alias_type_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('plugin.manager.alias_type')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'pathauto_bulk_update_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
-
- $form = array();
-
- $form['#update_callbacks'] = array();
-
- $form['update'] = array(
- '#type' => 'checkboxes',
- '#title' => $this->t('Select the types of paths for which to generate URL aliases'),
- '#options' => array(),
- '#default_value' => array(),
- );
-
- $definitions = $this->aliasTypeManager->getVisibleDefinitions();
-
- foreach ($definitions as $id => $definition) {
- $alias_type = $this->aliasTypeManager->createInstance($id);
- if ($alias_type instanceof AliasTypeBatchUpdateInterface) {
- $form['update']['#options'][$id] = $alias_type->getLabel();
- }
- }
-
- $form['action'] = array(
- '#type' => 'radios',
- '#title' => $this->t('Select which URL aliases to generate'),
- '#options' => ['create' => $this->t('Generate a URL alias for un-aliased paths only')],
- '#default_value' => 'create',
- );
-
- $config = $this->config('pathauto.settings');
-
- if ($config->get('update_action') == PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW) {
- // Existing aliases should not be updated.
- $form['warning'] = array(
- '#markup' => $this->t('Pathauto settings are set to ignore paths which already have a URL alias. You can only create URL aliases for paths having none.', [':url' => Url::fromRoute('pathauto.settings.form')->toString()]),
- );
- }
- else {
- $form['action']['#options']['update'] = $this->t('Update the URL alias for paths having an old URL alias');
- $form['action']['#options']['all'] = $this->t('Regenerate URL aliases for all paths');
- }
-
- $form['actions']['#type'] = 'actions';
- $form['actions']['submit'] = array(
- '#type' => 'submit',
- '#value' => $this->t('Update'),
- );
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $batch = array(
- 'title' => $this->t('Bulk updating URL aliases'),
- 'operations' => array(
- array('Drupal\pathauto\Form\PathautoBulkUpdateForm::batchStart', array()),
- ),
- 'finished' => 'Drupal\pathauto\Form\PathautoBulkUpdateForm::batchFinished',
- );
-
- $action = $form_state->getValue('action');
-
- foreach ($form_state->getValue('update') as $id) {
- if (!empty($id)) {
- $batch['operations'][] = array('Drupal\pathauto\Form\PathautoBulkUpdateForm::batchProcess', [$id, $action]);
- }
- }
-
- batch_set($batch);
- }
-
- /**
- * Batch callback; initialize the number of updated aliases.
- */
- public static function batchStart(&$context) {
- $context['results']['updates'] = 0;
- }
-
- /**
- * Common batch processing callback for all operations.
- *
- * Required to load our include the proper batch file.
- */
- public static function batchProcess($id, $action, &$context) {
- /** @var \Drupal\pathauto\AliasTypeBatchUpdateInterface $alias_type */
- $alias_type = \Drupal::service('plugin.manager.alias_type')->createInstance($id);
- $alias_type->batchUpdate($action, $context);
- }
-
- /**
- * Batch finished callback.
- */
- public static function batchFinished($success, $results, $operations) {
- if ($success) {
- if ($results['updates']) {
- \Drupal::service('messenger')->addMessage(\Drupal::translation()
- ->formatPlural($results['updates'], 'Generated 1 URL alias.', 'Generated @count URL aliases.'));
- }
- else {
- \Drupal::service('messenger')
- ->addMessage(t('No new URL aliases to generate.'));
- }
- }
- else {
- $error_operation = reset($operations);
- \Drupal::service('messenger')
- ->addMessage(t('An error occurred while processing @operation with arguments : @args'), [
- '@operation' => $error_operation[0],
- '@args' => print_r($error_operation[0]),
- ]);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoSettingsForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoSettingsForm.php
deleted file mode 100644
index 64a7f6053..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Form/PathautoSettingsForm.php
+++ /dev/null
@@ -1,273 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->entityFieldManager = $entity_field_manager;
- $this->aliasTypeManager = $alias_type_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('config.factory'),
- $container->get('entity_type.manager'),
- $container->get('entity_field.manager'),
- $container->get('plugin.manager.alias_type')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'pathauto_settings_form';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getEditableConfigNames() {
- return ['pathauto.settings'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $config = $this->config('pathauto.settings');
-
- $form['enabled_entity_types'] = [
- '#type' => 'details',
- '#open' => TRUE,
- '#title' => $this->t('Enabled entity types'),
- '#description' => $this->t('Enable to add a path field and allow to define alias patterns for the given type. Disabled types already define a path field themselves or currently have a pattern.'),
- '#tree' => TRUE,
- ];
-
- // Get all applicable entity types.
- foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) {
- // Disable a checkbox if it already exists and if the entity type has
- // patterns currently defined or if it isn't defined by us.
- $patterns_count = \Drupal::entityQuery('pathauto_pattern')
- ->condition('type', 'canonical_entities:' . $entity_type_id)
- ->count()
- ->execute();
-
- if (is_subclass_of($entity_type->getClass(), FieldableEntityInterface::class) && $entity_type->hasLinkTemplate('canonical')) {
- $field_definitions = $this->entityFieldManager->getBaseFieldDefinitions($entity_type_id);
- $form['enabled_entity_types'][$entity_type_id] = [
- '#type' => 'checkbox',
- '#title' => $entity_type->getLabel(),
- '#default_value' => isset($field_definitions['path']) || in_array($entity_type_id, $config->get('enabled_entity_types')),
- '#disabled' => isset($field_definitions['path']) && ($field_definitions['path']->getProvider() != 'pathauto' || $patterns_count),
- ];
- }
- }
-
- $form['verbose'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Verbose'),
- '#default_value' => $config->get('verbose'),
- '#description' => $this->t('Display alias changes (except during bulk updates).'),
- );
-
- $form['separator'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Separator'),
- '#size' => 1,
- '#maxlength' => 1,
- '#default_value' => $config->get('separator'),
- '#description' => $this->t('Character used to separate words in titles. This will replace any spaces and punctuation characters. Using a space or + character can cause unexpected results.'),
- );
-
- $form['case'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Character case'),
- '#default_value' => $config->get('case'),
- '#description' => $this->t('Convert token values to lowercase.'),
- );
-
- $max_length = \Drupal::service('pathauto.alias_storage_helper')->getAliasSchemaMaxlength();
-
- $help_link = '';
- if (\Drupal::moduleHandler()->moduleExists('help')) {
- $help_link = ' ' . $this->t('See Pathauto help for details.', [':pathauto-help' => Url::fromRoute('help.page', ['name' => 'pathauto'])->toString()]);
- }
-
- $form['max_length'] = array(
- '#type' => 'number',
- '#title' => $this->t('Maximum alias length'),
- '#size' => 3,
- '#maxlength' => 3,
- '#default_value' => $config->get('max_length'),
- '#min' => 1,
- '#max' => $max_length,
- '#description' => $this->t('Maximum length of aliases to generate. 100 is the recommended length. @max is the maximum possible length.', array('@max' => $max_length)) . $help_link,
- );
-
- $form['max_component_length'] = array(
- '#type' => 'number',
- '#title' => $this->t('Maximum component length'),
- '#size' => 3,
- '#maxlength' => 3,
- '#default_value' => $config->get('max_component_length'),
- '#min' => 1,
- '#max' => $max_length,
- '#description' => $this->t('Maximum text length of any component in the alias (e.g., [title]). 100 is the recommended length. @max is the maximum possible length.', ['@max' => $max_length]) . $help_link,
- );
-
- $description = $this->t('What should Pathauto do when updating an existing content item which already has an alias?');
- if (\Drupal::moduleHandler()->moduleExists('redirect')) {
- $description .= ' ' . $this->t('The Redirect module settings affect whether a redirect is created when an alias is deleted.', array(':url' => Url::fromRoute('redirect.settings')->toString()));
- }
- else {
- $description .= ' ' . $this->t('Considering installing the Redirect module to get redirects when your aliases change.', array(':url' => 'http://drupal.org/project/redirect'));
- }
-
- $form['update_action'] = array(
- '#type' => 'radios',
- '#title' => $this->t('Update action'),
- '#default_value' => $config->get('update_action'),
- '#options' => array(
- PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW => $this->t('Do nothing. Leave the old alias intact.'),
- PathautoGeneratorInterface::UPDATE_ACTION_LEAVE => $this->t('Create a new alias. Leave the existing alias functioning.'),
- PathautoGeneratorInterface::UPDATE_ACTION_DELETE => $this->t('Create a new alias. Delete the old alias.'),
- ),
- '#description' => $description,
- );
-
- $form['transliterate'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Transliterate prior to creating alias'),
- '#default_value' => $config->get('transliterate'),
- '#description' => $this->t('When a pattern includes certain characters (such as those with accents) should Pathauto attempt to transliterate them into the US-ASCII alphabet?'),
- );
-
- $form['reduce_ascii'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Reduce strings to letters and numbers'),
- '#default_value' => $config->get('reduce_ascii'),
- '#description' => $this->t('Filters the new alias to only letters and numbers found in the ASCII-96 set.'),
- );
-
- $form['ignore_words'] = array(
- '#type' => 'textarea',
- '#title' => $this->t('Strings to Remove'),
- '#default_value' => $config->get('ignore_words'),
- '#description' => $this->t('Words to strip out of the URL alias, separated by commas. Do not use this to remove punctuation.'),
- );
-
- $form['safe_tokens'] = array(
- '#type' => 'textarea',
- '#title' => $this->t('Safe tokens'),
- '#default_value' => implode(', ', $config->get('safe_tokens')),
- '#description' => $this->t('List of tokens that are safe to use in alias patterns and do not need to be cleaned. For example urls, aliases, machine names. Separated with a comma.'),
- );
-
- $form['punctuation'] = array(
- '#type' => 'details',
- '#title' => $this->t('Punctuation'),
- '#open' => FALSE,
- '#tree' => TRUE,
- );
-
- $punctuation = \Drupal::service('pathauto.alias_cleaner')->getPunctuationCharacters();
-
- foreach ($punctuation as $name => $details) {
- // Use the value from config if it exists.
- if ($config->get('punctuation.' . $name) !== NULL) {
- $details['default'] = $config->get('punctuation.' . $name);
- }
- else {
- // Otherwise use the correct default.
- $details['default'] = $details['value'] == $config->get('separator') ? PathautoGeneratorInterface::PUNCTUATION_REPLACE : PathautoGeneratorInterface::PUNCTUATION_REMOVE;
- }
- $form['punctuation'][$name] = array(
- '#type' => 'select',
- '#title' => $details['name'] . ' (' . Html::escape($details['value']) . ')',
- '#default_value' => $details['default'],
- '#options' => array(
- PathautoGeneratorInterface::PUNCTUATION_REMOVE => $this->t('Remove'),
- PathautoGeneratorInterface::PUNCTUATION_REPLACE => $this->t('Replace by separator'),
- PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING => $this->t('No action (do not replace)'),
- ),
- );
- }
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
-
- $config = $this->config('pathauto.settings');
-
- $form_state->cleanValues();
-
- foreach ($form_state->getValues() as $key => $value) {
- if ($key == 'enabled_entity_types') {
- $enabled_entity_types = [];
- foreach ($value as $entity_type_id => $enabled) {
- $field_definitions = $this->entityFieldManager->getBaseFieldDefinitions($entity_type_id);
- // Verify that the entity type is enabled and that it is not defined
- // or defined by us before adding it to the configuration, so that
- // we do not store an entity type that cannot be enabled or disabled.
- if ($enabled && (!isset($field_definitions['path']) || ($field_definitions['path']->getProvider() === 'pathauto'))) {
- $enabled_entity_types[] = $entity_type_id;
- }
- }
- $value = $enabled_entity_types;
- }
- elseif ($key == 'safe_tokens') {
- $value = array_filter(array_map('trim', explode(',', $value)));
- }
- $config->set($key, $value);
- }
- $config->save();
-
- parent::submitForm($form, $form_state);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternDisableForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PatternDisableForm.php
deleted file mode 100644
index 1e1ac3f9c..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternDisableForm.php
+++ /dev/null
@@ -1,54 +0,0 @@
-t('Are you sure you want to disable the pattern %label?', array('%label' => $this->entity->label()));
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('entity.pathauto_pattern.collection');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Disable');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return $this->t('Disabled patterns are ignored when generating aliases.');
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->entity->disable()->save();
- $this->messenger()->addMessage($this->t('Disabled pattern %label.', [
- '%label' => $this->entity->label(),
- ]));
-
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEditForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEditForm.php
deleted file mode 100644
index 454c4a1b1..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEditForm.php
+++ /dev/null
@@ -1,297 +0,0 @@
-get('plugin.manager.alias_type'),
- $container->get('entity_type.bundle.info'),
- $container->get('entity_type.manager'),
- $container->get('language_manager')
- );
- }
-
- /**
- * PatternEditForm constructor.
- *
- * @param \Drupal\pathauto\AliasTypeManager $manager
- * The alias type manager.
- * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
- * The entity type bundle info service.
- * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
- * The entity manager service.
- * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
- * The language manager service.
- */
- function __construct(AliasTypeManager $manager, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager) {
- $this->manager = $manager;
- $this->entityTypeBundleInfo = $entity_type_bundle_info;
- $this->entityTypeManager = $entity_type_manager;
- $this->languageManager = $language_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
-
- $options = [];
- foreach ($this->manager->getVisibleDefinitions() as $plugin_id => $plugin_definition) {
- $options[$plugin_id] = $plugin_definition['label'];
- }
- $form['type'] = [
- '#type' => 'select',
- '#title' => $this->t('Pattern type'),
- '#default_value' => $this->entity->getType(),
- '#options' => $options,
- '#required' => TRUE,
- '#limit_validation_errors' => array(array('type')),
- '#submit' => array('::submitSelectType'),
- '#executes_submit_callback' => TRUE,
- '#ajax' => array(
- 'callback' => '::ajaxReplacePatternForm',
- 'wrapper' => 'pathauto-pattern',
- 'method' => 'replace',
- ),
- ];
-
- $form['pattern_container'] = [
- '#type' => 'container',
- '#prefix' => '
',
- '#suffix' => '
',
- ];
-
- // if there is no type yet, stop here.
- if ($this->entity->getType()) {
-
- $alias_type = $this->entity->getAliasType();
-
- $form['pattern_container']['pattern'] = array(
- '#type' => 'textfield',
- '#title' => 'Path pattern',
- '#default_value' => $this->entity->getPattern(),
- '#size' => 65,
- '#maxlength' => 1280,
- '#element_validate' => array('token_element_validate', 'pathauto_pattern_validate'),
- '#after_build' => array('token_element_validate'),
- '#token_types' => $alias_type->getTokenTypes(),
- '#min_tokens' => 1,
- '#required' => TRUE,
- );
-
- // Show the token help relevant to this pattern type.
- $form['pattern_container']['token_help'] = array(
- '#theme' => 'token_tree_link',
- '#token_types' => $alias_type->getTokenTypes(),
- );
-
- // Expose bundle and language conditions.
- if ($alias_type->getDerivativeId() && $entity_type = $this->entityTypeManager->getDefinition($alias_type->getDerivativeId())) {
-
- $default_bundles = [];
- $default_languages = [];
- foreach ($this->entity->getSelectionConditions() as $condition_id => $condition) {
- if (in_array($condition->getPluginId(), ['entity_bundle:' . $entity_type->id(), 'node_type'])) {
- $default_bundles = $condition->getConfiguration()['bundles'];
- }
- elseif ($condition->getPluginId() == 'language') {
- $default_languages = $condition->getConfiguration()['langcodes'];
- }
- }
-
- if ($entity_type->hasKey('bundle') && $bundles = $this->entityTypeBundleInfo->getBundleInfo($entity_type->id())) {
- $bundle_options = [];
- foreach ($bundles as $id => $info) {
- $bundle_options[$id] = $info['label'];
- }
- $form['pattern_container']['bundles'] = array(
- '#title' => $entity_type->getBundleLabel(),
- '#type' => 'checkboxes',
- '#options' => $bundle_options,
- '#default_value' => $default_bundles,
- '#description' => $this->t('Check to which types this pattern should be applied. Leave empty to allow any.'),
- );
- }
-
- if ($this->languageManager->isMultilingual() && $entity_type->isTranslatable()) {
- $language_options = [];
- foreach ($this->languageManager->getLanguages() as $id => $language) {
- $language_options[$id] = $language->getName();
- }
- $form['pattern_container']['languages'] = array(
- '#title' => $this->t('Languages'),
- '#type' => 'checkboxes',
- '#options' => $language_options,
- '#default_value' => $default_languages,
- '#description' => $this->t('Check to which languages this pattern should be applied. Leave empty to allow any.'),
- );
- }
- }
- }
-
- $form['label'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Label'),
- '#maxlength' => 255,
- '#default_value' => $this->entity->label(),
- '#required' => TRUE,
- '#description' => $this->t('A short name to help you identify this pattern in the patterns list.'),
- );
-
- $form['id'] = array(
- '#type' => 'machine_name',
- '#title' => $this->t('ID'),
- '#maxlength' => 255,
- '#default_value' => $this->entity->id(),
- '#required' => TRUE,
- '#disabled' => !$this->entity->isNew(),
- '#machine_name' => array(
- 'exists' => 'Drupal\pathauto\Entity\PathautoPattern::load',
- ),
- );
-
- $form['status'] = [
- '#title' => $this->t('Enabled'),
- '#type' => 'checkbox',
- '#default_value' => $this->entity->status(),
- ];
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildEntity(array $form, FormStateInterface $form_state) {
- /** @var \Drupal\pathauto\PathautoPatternInterface $entity */
- $entity = parent::buildEntity($form, $form_state);
-
- // Will only be used for new patterns.
- $default_weight = 0;
-
- $alias_type = $entity->getAliasType();
- if ($alias_type->getDerivativeId() && $this->entityTypeManager->hasDefinition($alias_type->getDerivativeId())) {
- $entity_type = $alias_type->getDerivativeId();
- // First, remove bundle and language conditions.
- foreach ($entity->getSelectionConditions() as $condition_id => $condition) {
- if (in_array($condition->getPluginId(), ['entity_bundle:' . $entity_type, 'node_type', 'language'])) {
- $entity->removeSelectionCondition($condition_id);
- }
- }
-
- if ($bundles = array_filter((array) $form_state->getValue('bundles'))) {
- $default_weight -= 5;
- $plugin_id = $entity_type == 'node' ? 'node_type' : 'entity_bundle:' . $entity_type;
- $entity->addSelectionCondition(
- [
- 'id' => $plugin_id,
- 'bundles' => $bundles,
- 'negate' => FALSE,
- 'context_mapping' => [
- $entity_type => $entity_type,
- ]
- ]
- );
- }
-
- if ($languages = array_filter((array) $form_state->getValue('languages'))) {
- $default_weight -= 5;
- $language_mapping = $entity_type . ':' . $this->entityTypeManager->getDefinition($entity_type)->getKey('langcode') . ':language';
- $entity->addSelectionCondition(
- [
- 'id' => 'language',
- 'langcodes' => array_combine($languages, $languages),
- 'negate' => FALSE,
- 'context_mapping' => [
- 'language' => $language_mapping,
- ]
- ]
- );
- $entity->addRelationship($language_mapping, t('Language'));
- }
-
- }
-
- if ($entity->isNew()) {
- $entity->setWeight($default_weight);
- }
-
- return $entity;
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $form, FormStateInterface $form_state) {
- parent::save($form, $form_state);
- $this->messenger()->addMessage($this->t('Pattern %label saved.', [
- '%label' => $this->entity->label(),
- ]));
- $form_state->setRedirectUrl($this->entity->toUrl('collection'));
- }
-
- /**
- * Handles switching the type selector.
- */
- public function ajaxReplacePatternForm($form, FormStateInterface $form_state) {
- return $form['pattern_container'];
- }
-
- /**
- * Handles submit call when alias type is selected.
- */
- public function submitSelectType(array $form, FormStateInterface $form_state) {
- $this->entity = $this->buildEntity($form, $form_state);
- $form_state->setRebuild();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEnableForm.php b/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEnableForm.php
deleted file mode 100644
index 18f136b55..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Form/PatternEnableForm.php
+++ /dev/null
@@ -1,54 +0,0 @@
-t('Are you sure you want to enable the pattern %label?', array('%label' => $this->entity->label()));
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('entity.pathauto_pattern.collection');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Enable');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDescription() {
- return '';
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->entity->enable()->save();
- $this->messenger()->addMessage($this->t('Enabled pattern %label.', [
- '%label' => $this->entity->label(),
- ]));
-
- $form_state->setRedirectUrl($this->getCancelUrl());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/MessengerInterface.php b/sites/all/modules/contrib/admin/pathauto/src/MessengerInterface.php
deleted file mode 100644
index e31f48fac..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/MessengerInterface.php
+++ /dev/null
@@ -1,20 +0,0 @@
-ensureComputedValue();
-
- // Duplicate the logic instead of calling the parent due to the dynamic
- // arguments.
- $result = [];
- $args = array_slice(func_get_args(), 1);
- foreach ($this->list as $delta => $item) {
- // call_user_func_array() is way slower than a direct call so we avoid
- // using it if have no parameters.
- $result[$delta] = $args ? call_user_func_array([$item, $method], $args) : $item->{$method}();
- }
- return $result;
- }
-
- /**
- * @{inheritdoc}
- */
- protected function computeValue() {
- parent::computeValue();
-
- // For a new entity, default to creating a new alias.
- if ($this->getEntity()->isNew()) {
- $this->list[0]->set('pathauto', PathautoState::CREATE);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoGenerator.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoGenerator.php
deleted file mode 100644
index d70ce3b6f..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/PathautoGenerator.php
+++ /dev/null
@@ -1,379 +0,0 @@
-configFactory = $config_factory;
- $this->moduleHandler = $module_handler;
- $this->token = $token;
- $this->aliasCleaner = $alias_cleaner;
- $this->aliasStorageHelper = $alias_storage_helper;
- $this->aliasUniquifier = $alias_uniquifier;
- $this->messenger = $messenger;
- $this->stringTranslation = $string_translation;
- $this->tokenEntityMapper = $token_entity_mapper;
- $this->entityTypeManager = $entity_type_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public function createEntityAlias(EntityInterface $entity, $op) {
- // Retrieve and apply the pattern for this content type.
- $pattern = $this->getPatternByEntity($entity);
- if (empty($pattern)) {
- // No pattern? Do nothing (otherwise we may blow away existing aliases...)
- return NULL;
- }
-
- $source = '/' . $entity->toUrl()->getInternalPath();
- $config = $this->configFactory->get('pathauto.settings');
- $langcode = $entity->language()->getId();
-
- // Core does not handle aliases with language Not Applicable.
- if ($langcode == LanguageInterface::LANGCODE_NOT_APPLICABLE) {
- $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED;
- }
-
- // Build token data.
- $data = [
- $this->tokenEntityMapper->getTokenTypeForEntityType($entity->getEntityTypeId()) => $entity,
- ];
-
- // Allow other modules to alter the pattern.
- $context = array(
- 'module' => $entity->getEntityType()->getProvider(),
- 'op' => $op,
- 'source' => $source,
- 'data' => $data,
- 'bundle' => $entity->bundle(),
- 'language' => &$langcode,
- );
- $pattern_original = $pattern->getPattern();
- $this->moduleHandler->alter('pathauto_pattern', $pattern, $context);
- $pattern_altered = $pattern->getPattern();
-
- // Special handling when updating an item which is already aliased.
- $existing_alias = NULL;
- if ($op == 'update' || $op == 'bulkupdate') {
- if ($existing_alias = $this->aliasStorageHelper->loadBySource($source, $langcode)) {
- switch ($config->get('update_action')) {
- case PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW:
- // If an alias already exists,
- // and the update action is set to do nothing,
- // then gosh-darn it, do nothing.
- return NULL;
- }
- }
- }
-
- // Replace any tokens in the pattern.
- // Uses callback option to clean replacements. No sanitization.
- // Pass empty BubbleableMetadata object to explicitly ignore cacheablity,
- // as the result is never rendered.
- $alias = $this->token->replace($pattern->getPattern(), $data, array(
- 'clear' => TRUE,
- 'callback' => array($this->aliasCleaner, 'cleanTokenValues'),
- 'langcode' => $langcode,
- 'pathauto' => TRUE,
- ), new BubbleableMetadata());
-
- // Check if the token replacement has not actually replaced any values. If
- // that is the case, then stop because we should not generate an alias.
- // @see token_scan()
- $pattern_tokens_removed = preg_replace('/\[[^\s\]:]*:[^\s\]]*\]/', '', $pattern->getPattern());
- if ($alias === $pattern_tokens_removed) {
- return NULL;
- }
-
- $alias = $this->aliasCleaner->cleanAlias($alias);
-
- // Allow other modules to alter the alias.
- $context['source'] = &$source;
- $context['pattern'] = $pattern;
- $this->moduleHandler->alter('pathauto_alias', $alias, $context);
-
- // If we have arrived at an empty string, discontinue.
- if (!mb_strlen($alias)) {
- return NULL;
- }
-
- // If the alias already exists, generate a new, hopefully unique, variant.
- $original_alias = $alias;
- $this->aliasUniquifier->uniquify($alias, $source, $langcode);
- if ($original_alias != $alias) {
- // Alert the user why this happened.
- $this->messenger->addMessage($this->t('The automatically generated alias %original_alias conflicted with an existing alias. Alias changed to %alias.', array(
- '%original_alias' => $original_alias,
- '%alias' => $alias,
- )), $op);
- }
-
- // Return the generated alias if requested.
- if ($op == 'return') {
- return $alias;
- }
-
- // Build the new path alias array and send it off to be created.
- $path = array(
- 'source' => $source,
- 'alias' => $alias,
- 'language' => $langcode,
- );
-
- $return = $this->aliasStorageHelper->save($path, $existing_alias, $op);
-
- // Because there is no way to set an altered pattern to not be cached,
- // change it back to the original value.
- if ($pattern_altered !== $pattern_original) {
- $pattern->setPattern($pattern_original);
- }
-
- return $return;
- }
-
- /**
- * Loads pathauto patterns for a given entity type ID.
- *
- * @param string $entity_type_id
- * An entity type ID.
- *
- * @return \Drupal\pathauto\PathautoPatternInterface[]
- * A list of patterns, sorted by weight.
- */
- protected function getPatternByEntityType($entity_type_id) {
- if (!isset($this->patternsByEntityType[$entity_type_id])) {
- $ids = \Drupal::entityQuery('pathauto_pattern')
- ->condition('type', array_keys(\Drupal::service('plugin.manager.alias_type')
- ->getPluginDefinitionByType($this->tokenEntityMapper->getTokenTypeForEntityType($entity_type_id))))
- ->condition('status', 1)
- ->sort('weight')
- ->execute();
-
- $this->patternsByEntityType[$entity_type_id] = \Drupal::entityTypeManager()
- ->getStorage('pathauto_pattern')
- ->loadMultiple($ids);
- }
-
- return $this->patternsByEntityType[$entity_type_id];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getPatternByEntity(EntityInterface $entity) {
- $langcode = $entity->language()->getId();
- if (!isset($this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode])) {
- foreach ($this->getPatternByEntityType($entity->getEntityTypeId()) as $pattern) {
- if ($pattern->applies($entity)) {
- $this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode] = $pattern;
- break;
- }
- }
- // If still not set.
- if (!isset($this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode])) {
- $this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode] = NULL;
- }
- }
- return $this->patterns[$entity->getEntityTypeId()][$entity->id()][$langcode];
- }
-
- /**
- * {@inheritdoc}
- */
- public function resetCaches() {
- $this->patterns = [];
- $this->patternsByEntityType = [];
- $this->aliasCleaner->resetCaches();
- }
-
- /**
- * {@inheritdoc}
- */
- public function updateEntityAlias(EntityInterface $entity, $op, array $options = array()) {
- // Skip if the entity does not have the path field.
- if (!($entity instanceof ContentEntityInterface) || !$entity->hasField('path')) {
- return NULL;
- }
-
- // Skip if pathauto processing is disabled.
- if ($entity->path->pathauto != PathautoState::CREATE && empty($options['force'])) {
- return NULL;
- }
-
- // Only act if this is the default revision.
- if ($entity instanceof RevisionableInterface && !$entity->isDefaultRevision()) {
- return NULL;
- }
-
- $options += array('language' => $entity->language()->getId());
- $type = $entity->getEntityTypeId();
-
- // Skip processing if the entity has no pattern.
- if (!$this->getPatternByEntity($entity)) {
- return NULL;
- }
-
- // Deal with taxonomy specific logic.
- // @todo Update and test forum related code.
- if ($type == 'taxonomy_term') {
-
- $config_forum = $this->configFactory->get('forum.settings');
- if ($entity->getVocabularyId() == $config_forum->get('vocabulary')) {
- $type = 'forum';
- }
- }
-
- try {
- $result = $this->createEntityAlias($entity, $op);
- }
- catch (\InvalidArgumentException $e) {
- $this->messenger->addError($e->getMessage());
- return NULL;
- }
-
- // @todo Move this to a method on the pattern plugin.
- if ($type == 'taxonomy_term') {
- foreach ($this->loadTermChildren($entity->id()) as $subterm) {
- $this->updateEntityAlias($subterm, $op, $options);
- }
- }
-
- return $result;
- }
-
- /**
- * Finds all children of a term ID.
- *
- * @param int $tid
- * Term ID to retrieve parents for.
- *
- * @return \Drupal\taxonomy\TermInterface[]
- * An array of term objects that are the children of the term $tid.
- */
- protected function loadTermChildren($tid) {
- return $this->entityTypeManager->getStorage('taxonomy_term')->loadChildren($tid);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoGeneratorInterface.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoGeneratorInterface.php
deleted file mode 100644
index 337df3c53..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/PathautoGeneratorInterface.php
+++ /dev/null
@@ -1,90 +0,0 @@
-setLabel(t('Pathauto state'))
- ->setDescription(t('Whether an automated alias should be created or not.'))
- ->setComputed(TRUE)
- ->setClass('\Drupal\pathauto\PathautoState');
- return $properties;
- }
-
- /**
- * {@inheritdoc}
- */
- public function postSave($update) {
- // Only allow the parent implementation to act if pathauto will not create
- // an alias.
- if ($this->pathauto == PathautoState::SKIP) {
- parent::postSave($update);
- }
- $this->get('pathauto')->persist();
- }
-
- /**
- * {@inheritdoc}
- */
- public function isEmpty() {
- // Make sure that the pathauto state flag does not get lost if just that is
- // changed.
- return !$this->alias && !$this->get('pathauto')->hasValue();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoPatternInterface.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoPatternInterface.php
deleted file mode 100644
index 9782f2e05..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/PathautoPatternInterface.php
+++ /dev/null
@@ -1,181 +0,0 @@
-t('Label');
- $header['pattern'] = $this->t('Pattern');
- $header['type'] = $this->t('Pattern type');
- $header['conditions'] = $this->t('Conditions');
- return $header + parent::buildHeader();
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildRow(EntityInterface $entity) {
- /* @var \Drupal\pathauto\PathautoPatternInterface $entity */
- $row['label'] = $entity->label();
- $row['patern']['#markup'] = $entity->getPattern();
- $row['type']['#markup'] = $entity->getAliasType()->getLabel();
- $row['conditions']['#theme'] = 'item_list';
- foreach ($entity->getSelectionConditions() as $condition) {
- $row['conditions']['#items'][] = $condition->summary();
- }
- return $row + parent::buildRow($entity);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoState.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoState.php
deleted file mode 100644
index 4e1f63bc3..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/PathautoState.php
+++ /dev/null
@@ -1,159 +0,0 @@
-value === NULL) {
- // If no value has been set or loaded yet, try to load a value if this
- // entity has already been saved.
- $this->value = \Drupal::keyValue($this->getCollection())
- ->get(static::getPathautoStateKey($this->parent->getEntity()->id()));
- // If it was not yet saved or no value was found, then set the flag to
- // create the alias if there is a matching pattern.
- if ($this->value === NULL) {
- $entity = $this->parent->getEntity();
- $pattern = \Drupal::service('pathauto.generator')->getPatternByEntity($entity);
- $this->value = !empty($pattern) ? static::CREATE : static::SKIP;
- }
- }
- return $this->value;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setValue($value, $notify = TRUE) {
- $this->value = $value;
- // Notify the parent of any changes.
- if ($notify && isset($this->parent)) {
- $this->parent->onChange($this->name);
- }
- }
-
- /**
- * Returns TRUE if a value was set.
- */
- public function hasValue() {
- return $this->value !== NULL;
- }
-
- /**
- * Persists the state.
- */
- public function persist() {
- \Drupal::keyValue($this->getCollection())
- ->set(static::getPathautoStateKey($this->parent->getEntity()->id()), $this->getValue());
- }
-
- /**
- * Deletes the stored state.
- */
- public function purge() {
- \Drupal::keyValue($this->getCollection())
- ->delete(static::getPathautoStateKey($this->parent->getEntity()->id()));
- }
-
- /**
- * Returns the key value collection that should be used for the given entity.
- *
- * @return string
- */
- protected function getCollection() {
- return 'pathauto_state.' . $this->parent->getEntity()->getEntityTypeId();
- }
-
- /**
- * Deletes the URL aliases for multiple entities of the same type.
- *
- * @param string $entity_type_id
- * The entity type ID of entities being deleted.
- * @param int[] $pids_by_id
- * A list of path IDs keyed by entity ID.
- */
- public static function bulkDelete($entity_type_id, array $pids_by_id) {
- foreach ($pids_by_id as $id => $pid) {
- // Some key-values store entries have computed keys.
- $key = static::getPathautoStateKey($id);
- if ($key !== $id) {
- $pids_by_id[$key] = $pid;
- unset($pids_by_id[$id]);
- }
- }
- $states = \Drupal::keyValue("pathauto_state.$entity_type_id")
- ->getMultiple(array_keys($pids_by_id));
-
- $pids = [];
- foreach ($pids_by_id as $id => $pid) {
- // Only delete aliases that were created by this module.
- if (isset($states[$id]) && $states[$id] == PathautoState::CREATE) {
- $pids[] = $pid;
- }
- }
- \Drupal::service('pathauto.alias_storage_helper')->deleteMultiple($pids);
- }
-
- /**
- * Gets the key-value store entry key for 'pathauto_state.*' collections.
- *
- * Normally we want to use the entity ID as key for 'pathauto_state.*'
- * collection entries. But some entity types may use string IDs. When such IDs
- * are exceeding 128 characters, which is the limit for the 'name' column in
- * the {key_value} table, the insertion of the ID in {key_value} will fail.
- * Thus we test if we can use the plain ID or we need to store a hashed
- * version of the entity ID. Also, it is not possible to rely on the UUID as
- * entity types might not have one or might use a non-standard format.
- *
- * The code is inspired by
- * \Drupal\Core\Cache\DatabaseBackend::normalizeCid().
- *
- * @param int|string $entity_id
- * The entity id for which to compute the key.
- *
- * @return int|string
- * The key used to store the value in the key-value store.
- *
- * @see \Drupal\Core\Cache\DatabaseBackend::normalizeCid()
- */
- public static function getPathautoStateKey($entity_id) {
- $entity_id_is_ascii = mb_check_encoding($entity_id, 'ASCII');
- if ($entity_id_is_ascii && strlen($entity_id) <= 128) {
- // The original entity ID, if it's an ASCII of 128 characters or less.
- return $entity_id;
- }
- return Crypt::hashBase64($entity_id);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/PathautoWidget.php b/sites/all/modules/contrib/admin/pathauto/src/PathautoWidget.php
deleted file mode 100644
index 3ca049008..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/PathautoWidget.php
+++ /dev/null
@@ -1,71 +0,0 @@
-getEntity();
-
- // Taxonomy terms do not have an actual fieldset for path settings.
- // Merge in the defaults.
- // @todo Impossible to do this in widget, use another solution
- /*
- $form['path'] += array(
- '#type' => 'fieldset',
- '#title' => $this->t('URL path settings'),
- '#collapsible' => TRUE,
- '#collapsed' => empty($form['path']['alias']),
- '#group' => 'additional_settings',
- '#attributes' => array(
- 'class' => array('path-form'),
- ),
- '#access' => \Drupal::currentUser()->hasPermission('create url aliases') || \Drupal::currentUser()->hasPermission('administer url aliases'),
- '#weight' => 30,
- '#tree' => TRUE,
- '#element_validate' => array('path_form_element_validate'),
- );*/
-
- $pattern = \Drupal::service('pathauto.generator')->getPatternByEntity($entity);
- if (empty($pattern)) {
- return $element;
- }
-
- if (\Drupal::currentUser()->hasPermission('administer pathauto')) {
- $description = $this->t('Uncheck this to create a custom alias below. Configure URL alias patterns.', ['@admin_link' => Url::fromRoute('entity.pathauto_pattern.collection')->toString()]);
- }
- else {
- $description = $this->t('Uncheck this to create a custom alias below.');
- }
-
- $element['pathauto'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Generate automatic URL alias'),
- '#default_value' => $entity->path->pathauto,
- '#description' => $description,
- '#weight' => -1,
- );
-
- // Add JavaScript that will disable the path textfield when the automatic
- // alias checkbox is checked.
- $element['alias']['#states']['disabled']['input[name="path[' . $delta . '][pathauto]"]'] = array('checked' => TRUE);
-
- // Override path.module's vertical tabs summary.
- $element['alias']['#attached']['library'] = ['pathauto/widget'];
-
- return $element;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/Action/UpdateAction.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/Action/UpdateAction.php
deleted file mode 100644
index bfe0f48b1..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/Action/UpdateAction.php
+++ /dev/null
@@ -1,36 +0,0 @@
-path->pathauto = PathautoState::CREATE;
- \Drupal::service('pathauto.generator')->updateEntityAlias($entity, 'bulkupdate', array('message' => TRUE));
- }
-
- /**
- * {@inheritdoc}
- */
- public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
- $result = AccessResult::allowedIfHasPermission($account, 'create url aliases');
- return $return_as_object ? $result : $result->isAllowed();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/Deriver/EntityAliasTypeDeriver.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/Deriver/EntityAliasTypeDeriver.php
deleted file mode 100644
index c6b03311a..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/Deriver/EntityAliasTypeDeriver.php
+++ /dev/null
@@ -1,96 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->entityFieldManager = $entity_field_manager;
- $this->stringTranslation = $string_translation;
- $this->tokenEntityMapper = $token_entity_mapper;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, $base_plugin_id) {
- return new static(
- $container->get('entity_type.manager'),
- $container->get('entity_field.manager'),
- $container->get('string_translation'),
- $container->get('token.entity_mapper')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDerivativeDefinitions($base_plugin_definition) {
- foreach ($this->entityTypeManager->getDefinitions() as $entity_type_id => $entity_type) {
- // An entity type must have a canonical link template and support fields.
- if ($entity_type->hasLinkTemplate('canonical') && is_subclass_of($entity_type->getClass(), FieldableEntityInterface::class)) {
- $base_fields = $this->entityFieldManager->getBaseFieldDefinitions($entity_type_id);
- if (!isset($base_fields['path'])) {
- // The entity type does not have a path field and is therefore not
- // supported.
- continue;
- }
- $this->derivatives[$entity_type_id] = $base_plugin_definition;
- $this->derivatives[$entity_type_id]['label'] = $entity_type->getLabel();
- $this->derivatives[$entity_type_id]['types'] = [$this->tokenEntityMapper->getTokenTypeForEntityType($entity_type_id)];
- $this->derivatives[$entity_type_id]['provider'] = $entity_type->getProvider();
- $this->derivatives[$entity_type_id]['context'] = [
- $entity_type_id => new ContextDefinition("entity:$entity_type_id", $this->t('@label being aliased', ['@label' => $entity_type->getLabel()]))
- ];
- }
- }
- return $this->derivatives;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/Broken.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/Broken.php
deleted file mode 100644
index cc48771a3..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/Broken.php
+++ /dev/null
@@ -1,24 +0,0 @@
-t('Broken type');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php
deleted file mode 100644
index cdade9424..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php
+++ /dev/null
@@ -1,342 +0,0 @@
-moduleHandler = $module_handler;
- $this->languageManager = $language_manager;
- $this->entityTypeManager = $entity_type_manager;
- $this->keyValue = $key_value;
- $this->database = $database;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('module_handler'),
- $container->get('language_manager'),
- $container->get('entity_type.manager'),
- $container->get('keyvalue'),
- $container->get('database')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getLabel() {
- $definition = $this->getPluginDefinition();
- // Cast the admin label to a string since it is an object.
- // @see \Drupal\Core\StringTranslation\TranslationWrapper
- return (string) $definition['label'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function getTokenTypes() {
- $definition = $this->getPluginDefinition();
- return $definition['types'];
- }
-
- /**
- * {@inheritdoc}
- */
- public function batchUpdate($action, &$context) {
- if (!isset($context['sandbox']['current'])) {
- $context['sandbox']['count'] = 0;
- $context['sandbox']['current'] = 0;
- }
-
- $entity_type = $this->entityTypeManager->getDefinition($this->getEntityTypeId());
- $id_key = $entity_type->getKey('id');
-
- $query = $this->database->select($entity_type->get('base_table'), 'base_table');
- $query->leftJoin('url_alias', 'ua', "CONCAT('" . $this->getSourcePrefix() . "' , base_table.$id_key) = ua.source");
- $query->addField('base_table', $id_key, 'id');
-
- switch ($action) {
- case 'create':
- $query->isNull('ua.source');
- break;
-
- case 'update':
- $query->isNotNull('ua.source');
- break;
-
- case 'all':
- // Nothing to do. We want all paths.
- break;
-
- default:
- // Unknown action. Abort!
- return;
- }
- $query->condition('base_table.' . $id_key, $context['sandbox']['current'], '>');
- $query->orderBy('base_table.' . $id_key);
- $query->addTag('pathauto_bulk_update');
- $query->addMetaData('entity', $this->getEntityTypeId());
-
- // Get the total amount of items to process.
- if (!isset($context['sandbox']['total'])) {
- $context['sandbox']['total'] = $query->countQuery()->execute()->fetchField();
-
- // If there are no entities to update, then stop immediately.
- if (!$context['sandbox']['total']) {
- $context['finished'] = 1;
- return;
- }
- }
-
- $query->range(0, 25);
- $ids = $query->execute()->fetchCol();
-
- $updates = $this->bulkUpdate($ids);
- $context['sandbox']['count'] += count($ids);
- $context['sandbox']['current'] = !empty($ids) ? max($ids) : 0;
- $context['results']['updates'] += $updates;
- $context['message'] = $this->t('Updated alias for %label @id.', array('%label' => $entity_type->getLabel(), '@id' => end($ids)));
-
- if ($context['sandbox']['count'] != $context['sandbox']['total']) {
- $context['finished'] = $context['sandbox']['count'] / $context['sandbox']['total'];
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function batchDelete(&$context) {
- if (!isset($context['sandbox']['current'])) {
- $context['sandbox']['count'] = 0;
- $context['sandbox']['current'] = 0;
- }
-
- $entity_type = $this->entityTypeManager->getDefinition($this->getEntityTypeId());
- $id_key = $entity_type->getKey('id');
-
- $query = $this->database->select($entity_type->get('base_table'), 'base_table');
- $query->innerJoin('url_alias', 'ua', "CONCAT('" . $this->getSourcePrefix() . "' , base_table.$id_key) = ua.source");
- $query->addField('base_table', $id_key, 'id');
- $query->addField('ua', 'pid');
- $query->condition('ua.pid', $context['sandbox']['current'], '>');
- $query->orderBy('ua.pid');
- $query->addTag('pathauto_bulk_delete');
- $query->addMetaData('entity', $this->getEntityTypeId());
-
- // Get the total amount of items to process.
- if (!isset($context['sandbox']['total'])) {
- $context['sandbox']['total'] = $query->countQuery()->execute()->fetchField();
-
- // If there are no entities to delete, then stop immediately.
- if (!$context['sandbox']['total']) {
- $context['finished'] = 1;
- return;
- }
- }
-
- $query->range(0, 100);
- $pids_by_id = $query->execute()->fetchAllKeyed();
-
- PathautoState::bulkDelete($this->getEntityTypeId(), $pids_by_id);
- $context['sandbox']['count'] += count($pids_by_id);
- $context['sandbox']['current'] = max($pids_by_id);
- $context['results']['deletions'][] = $this->getLabel();
-
- if ($context['sandbox']['count'] != $context['sandbox']['total']) {
- $context['finished'] = $context['sandbox']['count'] / $context['sandbox']['total'];
- }
- }
-
- /**
- * Returns the entity type ID.
- *
- * @return string
- * The entity type ID.
- */
- protected function getEntityTypeId() {
- return $this->getDerivativeId();
- }
-
- /**
- * Update the URL aliases for multiple entities.
- *
- * @param array $ids
- * An array of entity IDs.
- * @param array $options
- * An optional array of additional options.
- *
- * @return int
- * The number of updated URL aliases.
- */
- protected function bulkUpdate(array $ids, array $options = array()) {
- $options += array('message' => FALSE);
- $updates = 0;
-
- $entities = $this->entityTypeManager->getStorage($this->getEntityTypeId())->loadMultiple($ids);
- foreach ($entities as $entity) {
- // Update aliases for the entity's default language and its translations.
- foreach ($entity->getTranslationLanguages() as $langcode => $language) {
- $translated_entity = $entity->getTranslation($langcode);
- $result = \Drupal::service('pathauto.generator')->updateEntityAlias($translated_entity, 'bulkupdate', $options);
- if ($result) {
- $updates++;
- }
- }
- }
-
- if (!empty($options['message'])) {
- $this->messenger->addMessage($this->translationManager
- ->formatPlural(count($ids), 'Updated 1 %label URL alias.', 'Updated @count %label URL aliases.'), [
- '%label' => $this->getLabel(),
- ]);
- }
-
- return $updates;
- }
-
- /**
- * Deletes the URL aliases for multiple entities.
- *
- * @param int[] $pids_by_id
- * A list of path IDs keyed by entity ID.
- *
- * @deprecated Use \Drupal\pathauto\PathautoState::bulkDelete() instead.
- */
- protected function bulkDelete(array $pids_by_id) {
- PathautoState::bulkDelete($this->getEntityTypeId(), $pids_by_id);
- }
-
- /**
- * {@inheritdoc}
- */
- public function calculateDependencies() {
- $dependencies = [];
- $dependencies['module'][] = $this->entityTypeManager->getDefinition($this->getEntityTypeId())->getProvider();
- return $dependencies;
- }
-
- /**
- * {@inheritdoc}
- */
- public function applies($object) {
- return $object instanceof FieldableEntityInterface && $object->getEntityTypeId() == $this->getEntityTypeId();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSourcePrefix() {
- if (empty($this->prefix)) {
- $entity_type = $this->entityTypeManager->getDefinition($this->getEntityTypeId());
- $path = $entity_type->getLinkTemplate('canonical');
- $this->prefix = substr($path, 0, strpos($path, '{'));
- }
- return $this->prefix;
- }
-
- /**
- * {@inheritdoc}
- */
- public function setContextValue($name, $value) {
- // Overridden to avoid merging existing cacheability metadata, which is not
- // relevant for alias type plugins.
- $this->context[$name] = new Context($this->getContextDefinition($name), $value);
- return $this;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/ForumAliasType.php b/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/ForumAliasType.php
deleted file mode 100644
index a572593ea..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Plugin/pathauto/AliasType/ForumAliasType.php
+++ /dev/null
@@ -1,106 +0,0 @@
-configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('module_handler'),
- $container->get('language_manager'),
- $container->get('entity_type.manager'),
- $container->get('keyvalue'),
- $container->get('database'),
- $container->get('config.factory')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- protected function getEntityTypeId() {
- return 'taxonomy_term';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSourcePrefix() {
- return '/forum/';
- }
-
- /**
- * {@inheritdoc}
- */
- public function applies($object) {
- if (parent::applies($object)) {
- /** @var \Drupal\taxonomy\TermInterface $object */
- $vid = $this->configFactory->get('forum.settings')->get('vocabulary');
- return $object->getVocabularyId() == $vid;
- }
- return FALSE;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoBulkUpdateTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoBulkUpdateTest.php
deleted file mode 100644
index 1db84e9d3..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoBulkUpdateTest.php
+++ /dev/null
@@ -1,157 +0,0 @@
-adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
-
- $this->patterns = array();
- $this->patterns['node'] = $this->createPattern('node', '/content/[node:title]');
- $this->patterns['user'] = $this->createPattern('user', '/users/[user:name]');
- $this->patterns['forum'] = $this->createPattern('forum', '/forums/[term:name]');
- }
-
- function testBulkUpdate() {
- // Create some nodes.
- $this->nodes = array();
- for ($i = 1; $i <= 5; $i++) {
- $node = $this->drupalCreateNode();
- $this->nodes[$node->id()] = $node;
- }
-
- // Clear out all aliases.
- $this->deleteAllAliases();
-
- // Bulk create aliases.
- $edit = array(
- 'update[canonical_entities:node]' => TRUE,
- 'update[canonical_entities:user]' => TRUE,
- 'update[forum]' => TRUE,
- );
- $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update'));
-
- // This has generated 8 aliases: 5 nodes, 2 users and 1 forum.
- $this->assertText('Generated 8 URL aliases.');
-
- // Check that aliases have actually been created.
- foreach ($this->nodes as $node) {
- $this->assertEntityAliasExists($node);
- }
- $this->assertEntityAliasExists($this->adminUser);
- // This is the default "General discussion" forum.
- $this->assertAliasExists(['source' => '/taxonomy/term/1']);
-
- // Add a new node.
- $new_node = $this->drupalCreateNode(array('path' => array('alias' => '', 'pathauto' => PathautoState::SKIP)));
-
- // Run the update again which should not run against any nodes.
- $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update'));
- $this->assertText('No new URL aliases to generate.');
- $this->assertNoEntityAliasExists($new_node);
-
- // Make sure existing aliases can be overridden.
- $this->drupalPostForm('admin/config/search/path/settings', ['update_action' => PathautoGeneratorInterface::UPDATE_ACTION_DELETE], t('Save configuration'));
-
- // Patterns did not change, so no aliases should be regenerated.
- $edit['action'] = 'all';
- $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update'));
- $this->assertText('No new URL aliases to generate.');
-
- // Update the node pattern, and leave other patterns alone. Existing nodes
- // should get a new alias, except the node above whose alias is manually
- // set. Other aliases must be left alone.
- $this->patterns['node']->delete();
- $this->patterns['node'] = $this->createPattern('node', '/archive/node-[node:nid]');
-
- $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update'));
- $this->assertText('Generated 5 URL aliases.');
-
- // Prevent existing aliases to be overridden. The bulk generate page should
- // only offer to create an alias for paths which have none.
- $this->drupalPostForm('admin/config/search/path/settings', ['update_action' => PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW], t('Save configuration'));
-
- $this->drupalGet('admin/config/search/path/update_bulk');
- $this->assertFieldByName('action', 'create');
- $this->assertText('Pathauto settings are set to ignore paths which already have a URL alias.');
- $this->assertNoFieldByName('action', 'update');
- $this->assertNoFieldByName('action', 'all');
- }
-
- /**
- * Tests alias generation for nodes that existed before installing Pathauto.
- */
- function testBulkUpdateExistingContent() {
- // Create a node.
- $node = $this->drupalCreateNode();
-
- // Delete its alias and Pathauto metadata.
- \Drupal::service('pathauto.alias_storage_helper')->deleteEntityPathAll($node);
- $node->path->first()->get('pathauto')->purge();
- \Drupal::entityTypeManager()->getStorage('node')->resetCache(array($node->id()));
-
- // Execute bulk generation.
- // Bulk create aliases.
- $edit = array(
- 'update[canonical_entities:node]' => TRUE,
- );
- $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update'));
-
- // Verify that the alias was created for the node.
- $this->assertText('Generated 1 URL alias.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoEnablingEntityTypesTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoEnablingEntityTypesTest.php
deleted file mode 100644
index acaa87be7..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoEnablingEntityTypesTest.php
+++ /dev/null
@@ -1,88 +0,0 @@
-drupalCreateContentType(array('type' => 'article'));
- $this->addDefaultCommentField('node', 'article');
-
- $permissions = array(
- 'administer pathauto',
- 'administer url aliases',
- 'create url aliases',
- 'administer nodes',
- 'post comments',
- );
- $this->adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
- }
-
- /**
- * A suite of tests to verify if the feature to enable and disable the
- * ability to define alias patterns for a given entity type works. Test with
- * the comment module, as it is not enabled by default.
- */
- function testEnablingEntityTypes() {
- // Verify that the comment entity type is not available when trying to add
- // a new pattern, nor "broken".
- $this->drupalGet('/admin/config/search/path/patterns/add');
- $this->assertEqual(count($this->cssSelect('option[value = "canonical_entities:comment"]:contains(Comment)')), 0);
- $this->assertEqual(count($this->cssSelect('option:contains(Broken)')), 0);
-
- // Enable the entity type and create a pattern for it.
- $this->drupalGet('/admin/config/search/path/settings');
- $edit = [
- 'enabled_entity_types[comment]' => TRUE,
- ];
- $this->drupalPostForm(NULL, $edit, 'Save configuration');
- $this->createPattern('comment', '/comment/[comment:body]');
-
- // Create a node, a comment type and a comment entity.
- $node = $this->drupalCreateNode(['type' => 'article']);
- $this->drupalGet('/node/' . $node->id());
- $edit = [
- 'comment_body[0][value]' => 'test-body',
- ];
- $this->drupalPostForm(NULL, $edit, 'Save');
-
- // Verify that an alias has been generated and that the type can no longer
- // be disabled.
- $this->assertAliasExists(['alias' => '/comment/test-body']);
- $this->drupalGet('/admin/config/search/path/settings');
- $this->assertEqual(count($this->cssSelect('input[name = "enabled_entity_types[comment]"][disabled = "disabled"]')), 1);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoLocaleTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoLocaleTest.php
deleted file mode 100644
index 5cef86a28..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoLocaleTest.php
+++ /dev/null
@@ -1,216 +0,0 @@
-drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
- }
-
- /**
- * Test that when an English node is updated, its old English alias is
- * updated and its newer French alias is left intact.
- */
- function testLanguageAliases() {
-
- $this->createPattern('node', '/content/[node:title]');
-
- // Add predefined French language.
- ConfigurableLanguage::createFromLangcode('fr')->save();
-
- $node = array(
- 'title' => 'English node',
- 'langcode' => 'en',
- 'path' => array(array(
- 'alias' => '/english-node',
- 'pathauto' => FALSE,
- )),
- );
- $node = $this->drupalCreateNode($node);
- $english_alias = \Drupal::service('path.alias_storage')->load(array('alias' => '/english-node', 'langcode' => 'en'));
- $this->assertTrue($english_alias, 'Alias created with proper language.');
-
- // Also save a French alias that should not be left alone, even though
- // it is the newer alias.
- $this->saveEntityAlias($node, '/french-node', 'fr');
-
- // Add an alias with the soon-to-be generated alias, causing the upcoming
- // alias update to generate a unique alias with the '-0' suffix.
- $this->saveAlias('/node/invalid', '/content/english-node', Language::LANGCODE_NOT_SPECIFIED);
-
- // Update the node, triggering a change in the English alias.
- $node->path->pathauto = PathautoState::CREATE;
- $node->save();
-
- // Check that the new English alias replaced the old one.
- $this->assertEntityAlias($node, '/content/english-node-0', 'en');
- $this->assertEntityAlias($node, '/french-node', 'fr');
- $this->assertAliasExists(array('pid' => $english_alias['pid'], 'alias' => '/content/english-node-0'));
-
- // Create a new node with the same title as before but without
- // specifying a language.
- $node = $this->drupalCreateNode(array('title' => 'English node', 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED));
-
- // Check that the new node had a unique alias generated with the '-0'
- // suffix.
- $this->assertEntityAlias($node, '/content/english-node-0', LanguageInterface::LANGCODE_NOT_SPECIFIED);
- }
-
- /**
- * Test that patterns work on multilingual content.
- */
- function testLanguagePatterns() {
-
- // Allow other modules to add additional permissions for the admin user.
- $permissions = array(
- 'administer pathauto',
- 'administer url aliases',
- 'create url aliases',
- 'bypass node access',
- 'access content overview',
- 'administer languages',
- 'translate any entity',
- 'administer content translation'
-
- );
- $admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($admin_user);
-
- // Add French language.
- $edit = array(
- 'predefined_langcode' => 'fr',
- );
- $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
-
- $this->enableArticleTranslation();
-
- // Create a pattern for English articles.
- $this->drupalGet('admin/config/search/path/patterns/add');
- $edit = array(
- 'type' => 'canonical_entities:node',
- );
- $this->drupalPostAjaxForm(NULL, $edit, 'type');
- $edit += array(
- 'pattern' => '/the-articles/[node:title]',
- 'label' => 'English articles',
- 'id' => 'english_articles',
- 'bundles[article]' => TRUE,
- 'languages[en]' => TRUE,
- );
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Pattern English articles saved.');
-
- // Create a pattern for French articles.
- $this->drupalGet('admin/config/search/path/patterns/add');
- $edit = array(
- 'type' => 'canonical_entities:node',
- );
- $this->drupalPostAjaxForm(NULL, $edit, 'type');
- $edit += array(
- 'pattern' => '/les-articles/[node:title]',
- 'label' => 'French articles',
- 'id' => 'french_articles',
- 'bundles[article]' => TRUE,
- 'languages[fr]' => TRUE,
- );
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Pattern French articles saved.');
-
- // Create a node and its translation. Assert aliases.
- $edit = array(
- 'title[0][value]' => 'English node',
- 'langcode[0][value]' => 'en',
- );
- $this->drupalPostForm('node/add/article', $edit, t('Save'));
- $english_node = $this->drupalGetNodeByTitle('English node');
- return;
- $this->assertAlias('/node/' . $english_node->id(), '/the-articles/english-node', 'en');
-
- $this->drupalGet('node/' . $english_node->id() . '/translations');
- $this->clickLink(t('Add'));
- $edit = array(
- 'title[0][value]' => 'French node',
- );
- $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
- $this->rebuildContainer();
- $english_node = $this->drupalGetNodeByTitle('English node');
- $french_node = $english_node->getTranslation('fr');
- $this->assertAlias('/node/' . $french_node->id(), '/les-articles/french-node', 'fr');
-
- // Bulk delete and Bulk generate patterns. Assert aliases.
- $this->deleteAllAliases();
- // Bulk create aliases.
- $edit = array(
- 'update[canonical_entities:node]' => TRUE,
- );
- $this->drupalPostForm('admin/config/search/path/update_bulk', $edit, t('Update'));
- $this->assertText(t('Generated 2 URL aliases.'));
- $this->assertAlias('/node/' . $english_node->id(), '/the-articles/english-node', 'en');
- $this->assertAlias('/node/' . $french_node->id(), '/les-articles/french-node', 'fr');
- }
-
- /**
- * Tests the alias created for a node with language Not Applicable.
- */
- public function testLanguageNotApplicable() {
- $this->drupalLogin($this->rootUser);
- $this->enableArticleTranslation();
-
- // Create a pattern for nodes.
- $pattern = $this->createPattern('node', '/content/[node:title]', -1);
- $pattern->save();
-
- // Create a node with language Not Applicable.
- $node = $this->createNode(['type' => 'article', 'title' => 'Test node', 'langcode' => LanguageInterface::LANGCODE_NOT_APPLICABLE]);
-
- // Check that the generated alias has language Not Specified.
- $alias = \Drupal::service('pathauto.alias_storage_helper')->loadBySource('/node/' . $node->id());
- $this->assertEqual($alias['langcode'], LanguageInterface::LANGCODE_NOT_SPECIFIED, 'PathautoGenerator::createEntityAlias() adjusts the alias langcode from Not Applicable to Not Specified.');
-
- // Check that the alias works.
- $this->drupalGet('content/test-node');
- $this->assertResponse(200);
- }
-
- /**
- * Enables content translation on articles.
- */
- protected function enableArticleTranslation() {
- // Enable content translation on articles.
- $this->drupalGet('admin/config/regional/content-language');
- $edit = array(
- 'entity_types[node]' => TRUE,
- 'settings[node][article][translatable]' => TRUE,
- 'settings[node][article][settings][language][language_alterable]' => TRUE,
- );
- $this->drupalPostForm(NULL, $edit, t('Save configuration'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoMassDeleteTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoMassDeleteTest.php
deleted file mode 100644
index 691e5a89c..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoMassDeleteTest.php
+++ /dev/null
@@ -1,201 +0,0 @@
-adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
-
- $this->createPattern('node', '/content/[node:title]');
- $this->createPattern('user', '/users/[user:name]');
- $this->createPattern('taxonomy_term', '/[term:vocabulary]/[term:name]');
- }
-
- /**
- * Tests the deletion of all the aliases.
- */
- function testDeleteAll() {
- // 1. Test that deleting all the aliases, of any type, works.
- $this->generateAliases();
- $edit = array(
- 'delete[all_aliases]' => TRUE,
- 'options[keep_custom_aliases]' => FALSE,
- );
- $this->drupalPostForm('admin/config/search/path/delete_bulk', $edit, t('Delete aliases now!'));
- $this->assertText(t('All of your path aliases have been deleted.'));
- $this->assertUrl('admin/config/search/path/delete_bulk');
-
- // Make sure that all of them are actually deleted.
- $aliases = \Drupal::database()->select('url_alias', 'ua')->fields('ua', array())->execute()->fetchAll();
- $this->assertEqual($aliases, array(), "All the aliases have been deleted.");
-
- // 2. Test deleting only specific (entity type) aliases.
- $manager = $this->container->get('plugin.manager.alias_type');
- $pathauto_plugins = array('canonical_entities:node' => 'nodes', 'canonical_entities:taxonomy_term' => 'terms', 'canonical_entities:user' => 'accounts');
- foreach ($pathauto_plugins as $pathauto_plugin => $attribute) {
- $this->generateAliases();
- $edit = array(
- 'delete[plugins][' . $pathauto_plugin . ']' => TRUE,
- 'options[keep_custom_aliases]' => FALSE,
- );
- $this->drupalPostForm('admin/config/search/path/delete_bulk', $edit, t('Delete aliases now!'));
- $alias_type = $manager->createInstance($pathauto_plugin);
- $this->assertRaw(t('All of your %label path aliases have been deleted.', array('%label' => $alias_type->getLabel())));
- // Check that the aliases were actually deleted.
- foreach ($this->{$attribute} as $entity) {
- $this->assertNoEntityAlias($entity);
- }
-
- // Check that the other aliases are not deleted.
- foreach ($pathauto_plugins as $_pathauto_plugin => $_attribute) {
- // Skip the aliases that should be deleted.
- if ($_pathauto_plugin == $pathauto_plugin) {
- continue;
- }
- foreach ($this->{$_attribute} as $entity) {
- $this->assertEntityAliasExists($entity);
- }
- }
- }
-
- // 3. Test deleting automatically generated aliases only.
- $this->generateAliases();
- $edit = array(
- 'delete[all_aliases]' => TRUE,
- 'options[keep_custom_aliases]' => TRUE,
- );
- $this->drupalPostForm('admin/config/search/path/delete_bulk', $edit, t('Delete aliases now!'));
- $this->assertText(t('All of your automatically generated path aliases have been deleted.'));
- $this->assertUrl('admin/config/search/path/delete_bulk');
-
- // Make sure that only custom aliases and aliases with no information about
- // their state still exist.
- $aliases = \Drupal::database()->select('url_alias', 'ua')->fields('ua', ['source'])->execute()->fetchCol();
- $this->assertEqual($aliases, ['/node/101', '/node/104', '/node/105'], 'Custom aliases still exist.');
- }
-
- /**
- * Helper function to generate aliases.
- */
- function generateAliases() {
- // Delete all aliases to avoid duplicated aliases. They will be recreated
- // below.
- $this->deleteAllAliases();
-
- // We generate a bunch of aliases for nodes, users and taxonomy terms. If
- // the entities are already created we just update them, otherwise we create
- // them.
- if (empty($this->nodes)) {
- // Create a large number of nodes (100+) to make sure that the batch code
- // works.
- for ($i = 1; $i <= 105; $i++) {
- // Set the alias of two nodes manually.
- $settings = ($i > 103) ? ['path' => ['alias' => "/custom_alias_$i", 'pathauto' => PathautoState::SKIP]] : [];
- $node = $this->drupalCreateNode($settings);
- $this->nodes[$node->id()] = $node;
- }
- }
- else {
- foreach ($this->nodes as $node) {
- if ($node->id() > 103) {
- // The alias is set manually.
- $node->set('path', ['alias' => '/custom_alias_' . $node->id()]);
- }
- $node->save();
- }
- }
- // Delete information about the state of an alias to make sure that aliases
- // with no such data are left alone by default.
- \Drupal::keyValue('pathauto_state.node')->delete(101);
-
- if (empty($this->accounts)) {
- for ($i = 1; $i <= 5; $i++) {
- $account = $this->drupalCreateUser();
- $this->accounts[$account->id()] = $account;
- }
- }
- else {
- foreach ($this->accounts as $id => $account) {
- $account->save();
- }
- }
-
- if (empty($this->terms)) {
- $vocabulary = $this->addVocabulary(array('name' => 'test vocabulary', 'vid' => 'test_vocabulary'));
- for ($i = 1; $i <= 5; $i++) {
- $term = $this->addTerm($vocabulary);
- $this->terms[$term->id()] = $term;
- }
- }
- else {
- foreach ($this->terms as $term) {
- $term->save();
- }
- }
-
- // Check that we have aliases for the entities.
- foreach (array('nodes', 'accounts', 'terms') as $attribute) {
- foreach ($this->{$attribute} as $entity) {
- $this->assertEntityAliasExists($entity);
- }
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoNodeWebTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoNodeWebTest.php
deleted file mode 100644
index a9376f7ac..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoNodeWebTest.php
+++ /dev/null
@@ -1,293 +0,0 @@
-drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- $this->drupalCreateContentType(array('type' => 'article'));
-
- // Allow other modules to add additional permissions for the admin user.
- $permissions = array(
- 'administer pathauto',
- 'administer url aliases',
- 'create url aliases',
- 'bypass node access',
- 'access content overview',
- );
- $this->adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
-
- $this->createPattern('node', '/content/[node:title]');
- }
-
- /**
- * Tests editing nodes with different settings.
- */
- function testNodeEditing() {
- // Ensure that the Pathauto checkbox is checked by default on the node add
- // form.
- $this->drupalGet('node/add/page');
- $this->assertFieldChecked('edit-path-0-pathauto');
-
- // Create a node by saving the node form.
- $title = ' Testing: node title [';
- $automatic_alias = '/content/testing-node-title';
- $this->drupalPostForm(NULL, array('title[0][value]' => $title), t('Save'));
- $node = $this->drupalGetNodeByTitle($title);
-
- // Look for alias generated in the form.
- $this->drupalGet("node/{$node->id()}/edit");
- $this->assertFieldChecked('edit-path-0-pathauto');
- $this->assertFieldByName('path[0][alias]', $automatic_alias, 'Generated alias visible in the path alias field.');
-
- // Check whether the alias actually works.
- $this->drupalGet($automatic_alias);
- $this->assertText($title, 'Node accessible through automatic alias.');
-
- // Manually set the node's alias.
- $manual_alias = '/content/' . $node->id();
- $edit = array(
- 'path[0][pathauto]' => FALSE,
- 'path[0][alias]' => $manual_alias,
- );
- $this->drupalPostForm($node->toUrl('edit-form'), $edit, t('Save'));
- $this->assertText(t('@type @title has been updated.', array('@type' => 'page', '@title' => $title)));
-
- // Check that the automatic alias checkbox is now unchecked by default.
- $this->drupalGet("node/{$node->id()}/edit");
- $this->assertNoFieldChecked('edit-path-0-pathauto');
- $this->assertFieldByName('path[0][alias]', $manual_alias);
-
- // Submit the node form with the default values.
- $this->drupalPostForm(NULL, array('path[0][pathauto]' => FALSE), t('Save'));
- $this->assertText(t('@type @title has been updated.', array('@type' => 'page', '@title' => $title)));
-
- // Test that the old (automatic) alias has been deleted and only accessible
- // through the new (manual) alias.
- $this->drupalGet($automatic_alias);
- $this->assertResponse(404, 'Node not accessible through automatic alias.');
- $this->drupalGet($manual_alias);
- $this->assertText($title, 'Node accessible through manual alias.');
-
- // Test that the manual alias is not kept for new nodes when the pathauto
- // checkbox is ticked.
- $title = 'Automatic Title';
- $edit = array(
- 'title[0][value]' => $title,
- 'path[0][pathauto]' => TRUE,
- 'path[0][alias]' => '/should-not-get-created',
- );
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
- $this->assertNoAliasExists(array('alias' => 'should-not-get-created'));
- $node = $this->drupalGetNodeByTitle($title);
- $this->assertEntityAlias($node, '/content/automatic-title');
-
- // Remove the pattern for nodes, the pathauto checkbox should not be
- // displayed.
- $ids = \Drupal::entityQuery('pathauto_pattern')
- ->condition('type', 'canonical_entities:node')
- ->execute();
- foreach (PathautoPattern::loadMultiple($ids) as $pattern) {
- $pattern->delete();
- }
-
- $this->drupalGet('node/add/article');
- $this->assertNoFieldById('edit-path-0-pathauto');
- $this->assertFieldByName('path[0][alias]', '');
-
- $edit = array();
- $edit['title'] = 'My test article';
- $this->drupalCreateNode($edit);
- //$this->drupalPostForm(NULL, $edit, t('Save'));
- $node = $this->drupalGetNodeByTitle($edit['title']);
-
- // Pathauto checkbox should still not exist.
- $this->drupalGet($node->toUrl('edit-form'));
- $this->assertNoFieldById('edit-path-0-pathauto');
- $this->assertFieldByName('path[0][alias]', '');
- $this->assertNoEntityAlias($node);
- }
-
- /**
- * Test node operations.
- */
- function testNodeOperations() {
- $node1 = $this->drupalCreateNode(array('title' => 'node1'));
- $node2 = $this->drupalCreateNode(array('title' => 'node2'));
-
- // Delete all current URL aliases.
- $this->deleteAllAliases();
-
- $this->drupalGet('admin/content');
-
- // Check which of the two nodes is first.
- if (strpos($this->getTextContent(), 'node1') < strpos($this->getTextContent(), 'node2')) {
- $index = 0;
- }
- else {
- $index = 1;
- }
-
- $edit = array(
- 'action' => 'pathauto_update_alias_node',
- 'node_bulk_form[' . $index . ']' => TRUE,
- );
- $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
- $this->assertText('Update URL alias was applied to 1 item.');
-
- $this->assertEntityAlias($node1, '/content/' . $node1->getTitle());
- $this->assertEntityAlias($node2, '/node/' . $node2->id());
- }
-
- /**
- * @todo Merge this with existing node test methods?
- */
- public function testNodeState() {
- $nodeNoAliasUser = $this->drupalCreateUser(array('bypass node access'));
- $nodeAliasUser = $this->drupalCreateUser(array('bypass node access', 'create url aliases'));
-
- $node = $this->drupalCreateNode(array(
- 'title' => 'Node version one',
- 'type' => 'page',
- 'path' => array(
- 'pathauto' => PathautoState::SKIP,
- ),
- ));
-
- $this->assertNoEntityAlias($node);
-
- // Set a manual path alias for the node.
- $node->path->alias = '/test-alias';
- $node->save();
-
- // Ensure that the pathauto field was saved to the database.
- \Drupal::entityTypeManager()->getStorage('node')->resetCache();
- $node = Node::load($node->id());
- $this->assertIdentical($node->path->pathauto, PathautoState::SKIP);
-
- // Ensure that the manual path alias was saved and an automatic alias was not generated.
- $this->assertEntityAlias($node, '/test-alias');
- $this->assertNoEntityAliasExists($node, '/content/node-version-one');
-
- // Save the node as a user who does not have access to path fieldset.
- $this->drupalLogin($nodeNoAliasUser);
- $this->drupalGet('node/' . $node->id() . '/edit');
- $this->assertNoFieldByName('path[0][pathauto]');
-
- $edit = array('title[0][value]' => 'Node version two');
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Basic page Node version two has been updated.');
-
- $this->assertEntityAlias($node, '/test-alias');
- $this->assertNoEntityAliasExists($node, '/content/node-version-one');
- $this->assertNoEntityAliasExists($node, '/content/node-version-two');
-
- // Load the edit node page and check that the Pathauto checkbox is unchecked.
- $this->drupalLogin($nodeAliasUser);
- $this->drupalGet('node/' . $node->id() . '/edit');
- $this->assertNoFieldChecked('edit-path-0-pathauto');
-
- // Edit the manual alias and save the node.
- $edit = array(
- 'title[0][value]' => 'Node version three',
- 'path[0][alias]' => '/manually-edited-alias',
- );
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Basic page Node version three has been updated.');
-
- $this->assertEntityAlias($node, '/manually-edited-alias');
- $this->assertNoEntityAliasExists($node, '/test-alias');
- $this->assertNoEntityAliasExists($node, '/content/node-version-one');
- $this->assertNoEntityAliasExists($node, '/content/node-version-two');
- $this->assertNoEntityAliasExists($node, '/content/node-version-three');
-
- // Programatically save the node with an automatic alias.
- \Drupal::entityTypeManager()->getStorage('node')->resetCache();
- $node = Node::load($node->id());
- $node->path->pathauto = PathautoState::CREATE;
- $node->save();
-
- // Ensure that the pathauto field was saved to the database.
- \Drupal::entityTypeManager()->getStorage('node')->resetCache();
- $node = Node::load($node->id());
- $this->assertIdentical($node->path->pathauto, PathautoState::CREATE);
-
- $this->assertEntityAlias($node, '/content/node-version-three');
- $this->assertNoEntityAliasExists($node, '/manually-edited-alias');
- $this->assertNoEntityAliasExists($node, '/test-alias');
- $this->assertNoEntityAliasExists($node, '/content/node-version-one');
- $this->assertNoEntityAliasExists($node, '/content/node-version-two');
-
- $node->delete();
- $this->assertNull(\Drupal::keyValue('pathauto_state.node')->get($node->id()), 'Pathauto state was deleted');
- }
-
-
- /**
- * Tests that nodes without a Pathauto pattern can set custom aliases.
- */
- public function testCustomAliasWithoutPattern() {
- // First, delete all patterns to be sure that there will be no match.
- $entity_ids = \Drupal::entityQuery('pathauto_pattern')->execute();
- $entities = PathautoPattern::loadMultiple($entity_ids);
- foreach ($entities as $entity) {
- $entity->delete();
- }
-
- // Next, create a node with a custom alias.
- $edit = [
- 'title[0][value]' => 'Sample article',
- 'path[0][alias]' => '/sample-article',
- ];
- $this->drupalPostForm('node/add/article', $edit, t('Save'));
- $this->assertText(t('article Sample article has been created.'));
-
- // Test the alias.
- $this->assertAliasExists(array('alias' => '/sample-article'));
- $this->drupalGet('sample-article');
- $this->assertResponse(200, 'A node without a pattern can have a custom alias.');
-
- // Now create a node through the API.
- $node = Node::create(['type' => 'article', 'title' => 'Sample article API', 'path' => ['alias' => '/sample-article-api']]);
- $node->save();
-
- // Test the alias.
- $this->assertAliasExists(['alias' => '/sample-article-api']);
- $this->drupalGet('sample-article-api');
- $this->assertResponse(200);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoSettingsFormWebTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoSettingsFormWebTest.php
deleted file mode 100644
index cbcb6b856..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoSettingsFormWebTest.php
+++ /dev/null
@@ -1,239 +0,0 @@
- FALSE,
- 'separator' => '-',
- 'case' => '1',
- 'max_length' => '100',
- 'max_component_length' => '100',
- 'update_action' => '2',
- 'transliterate' => '1',
- 'reduce_ascii' => FALSE,
- 'ignore_words' => 'a, an, as, at, before, but, by, for, from, is, in, into, like, of, off, on, onto, per, since, than, the, this, that, to, up, via, with',
- );
-
- /**
- * Punctuation form items with default values.
- *
- * @var array
- */
- protected $defaultPunctuations = array(
- 'punctuation[double_quotes]' => '0',
- 'punctuation[quotes]' => '0',
- 'punctuation[backtick]' => '0',
- 'punctuation[comma]' => '0',
- 'punctuation[period]' => '0',
- 'punctuation[hyphen]' => '1',
- 'punctuation[underscore]' => '0',
- 'punctuation[colon]' => '0',
- 'punctuation[semicolon]' => '0',
- 'punctuation[pipe]' => '0',
- 'punctuation[left_curly]' => '0',
- 'punctuation[left_square]' => '0',
- 'punctuation[right_curly]' => '0',
- 'punctuation[right_square]' => '0',
- 'punctuation[plus]' => '0',
- 'punctuation[equal]' => '0',
- 'punctuation[asterisk]' => '0',
- 'punctuation[ampersand]' => '0',
- 'punctuation[percent]' => '0',
- 'punctuation[caret]' => '0',
- 'punctuation[dollar]' => '0',
- 'punctuation[hash]' => '0',
- 'punctuation[exclamation]' => '0',
- 'punctuation[tilde]' => '0',
- 'punctuation[left_parenthesis]' => '0',
- 'punctuation[right_parenthesis]' => '0',
- 'punctuation[question_mark]' => '0',
- 'punctuation[less_than]' => '0',
- 'punctuation[greater_than]' => '0',
- 'punctuation[slash]' => '0',
- 'punctuation[back_slash]' => '0',
- );
-
- /**
- * {@inheritdoc}
- */
- function setUp() {
- parent::setUp();
-
- $this->drupalCreateContentType(array('type' => 'article'));
-
- $permissions = array(
- 'administer pathauto',
- 'notify of path changes',
- 'administer url aliases',
- 'create url aliases',
- 'bypass node access',
- );
- $this->adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
- $this->createPattern('node', '/content/[node:title]');
- }
-
- /**
- * Test if the default values are shown correctly in the form.
- */
- function testDefaultFormValues() {
- $this->drupalGet('/admin/config/search/path/settings');
- $this->assertNoFieldChecked('edit-verbose');
- $this->assertField('edit-separator', $this->defaultFormValues['separator']);
- $this->assertFieldChecked('edit-case');
- $this->assertField('edit-max-length', $this->defaultFormValues['max_length']);
- $this->assertField('edit-max-component-length', $this->defaultFormValues['max_component_length']);
- $this->assertFieldChecked('edit-update-action-2');
- $this->assertFieldChecked('edit-transliterate');
- $this->assertNoFieldChecked('edit-reduce-ascii');
- $this->assertField('edit-ignore-words', $this->defaultFormValues['ignore_words']);
- }
-
- /**
- * Test the verbose option.
- */
- function testVerboseOption() {
- $edit = array('verbose' => '1');
- $this->drupalPostForm('/admin/config/search/path/settings', $edit, t('Save configuration'));
- $this->assertText(t('The configuration options have been saved.'));
- $this->assertFieldChecked('edit-verbose');
-
- $title = 'Verbose settings test';
- $this->drupalGet('/node/add/article');
- $this->assertFieldChecked('edit-path-0-pathauto');
- $this->drupalPostForm(NULL, array('title[0][value]' => $title), t('Save'));
- $this->assertText('Created new alias /content/verbose-settings-test for');
-
- $node = $this->drupalGetNodeByTitle($title);
- $this->drupalPostForm('/node/' . $node->id() . '/edit', array('title[0][value]' => 'Updated title'), t('Save'));
- $this->assertText('Created new alias /content/updated-title for');
- $this->assertText('replacing /content/verbose-settings-test.');
- }
-
- /**
- * Tests generating aliases with different settings.
- */
- function testSettingsForm() {
- // Ensure the separator settings apply correctly.
- $this->checkAlias('My awesome content', '/content/my.awesome.content', array('separator' => '.'));
-
- // Ensure the character case setting works correctly.
- // Leave case the same as source token values.
- $this->checkAlias('My awesome Content', '/content/My-awesome-Content', array('case' => FALSE));
- $this->checkAlias('Change Lower', '/content/change-lower', array('case' => '1'));
-
- // Ensure the maximum alias length is working.
- $this->checkAlias('My awesome Content', '/content/my-awesome', array('max_length' => '23'));
-
- // Ensure the maximum component length is working.
- $this->checkAlias('My awesome Content', '/content/my', array('max_component_length' => '2'));
-
- // Ensure transliteration option is working.
- $this->checkAlias('è é àl ö äl ü', '/content/e-e-al-o-al-u', array('transliterate' => '1'));
- $this->checkAlias('è é àl äl ö ü', '/content/è-é-àl-äl-ö-ü', array('transliterate' => FALSE));
-
- $ignore_words = 'a, new, very, should';
- $this->checkAlias('a very new alias to test', '/content/alias-to-test', array('ignore_words' => $ignore_words));
- }
-
- /**
- * Test the punctuation setting form items.
- */
- function testPunctuationSettings() {
- // Test the replacement of punctuations.
- $settings = [];
- foreach ($this->defaultPunctuations as $key => $punctuation) {
- $settings[$key] = PathautoGeneratorInterface::PUNCTUATION_REPLACE;
- }
-
- $title = 'aa"b`c,d.e-f_g:h;i|j{k[l}m]n+o=p*q%r^s$t#u!v~w(x)y?z>1/2\3';
- $alias = '/content/aa-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z-1-2-3';
- $this->checkAlias($title, $alias, $settings);
-
- // Test the removal of punctuations.
- $settings = [];
- foreach ($this->defaultPunctuations as $key => $punctuation) {
- $settings[$key] = PathautoGeneratorInterface::PUNCTUATION_REMOVE;
- }
-
- $title = 'a"b`c,d.e-f_g:h;i|j{k[l}m]n+o=p*q%r^s$t#u!v~w(x)y?z>1/2\3';
- $alias = '/content/abcdefghijklmnopqrstuvwxyz123';
- $this->checkAlias($title, $alias, $settings);
-
- // Keep all punctuations in alias.
- $settings = [];
- foreach ($this->defaultPunctuations as $key => $punctuation) {
- $settings[$key] = PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING;
- }
-
- $title = 'al"b`c,d.e-f_g:h;i|j{k[l}m]n+o=p*q%r^s$t#u!v~w(x)y?z>1/2\3';
- $alias = '/content/al"b`c,d.e-f_g:h;i|j{k[l}m]n+o=p*q%r^s$t#u!v~w(x)y?z>1/2\3';
- $this->checkAlias($title, $alias, $settings);
- }
-
- /**
- * Helper method to check the an aliases.
- *
- * @param string $title
- * The node title to build the aliases from.
- * @param string $alias
- * The expected alias.
- * @param array $settings
- * The form values the alias should be generated with.
- */
- protected function checkAlias($title, $alias, $settings = array()) {
- // Submit the settings form.
- $edit = array_merge($this->defaultFormValues + $this->defaultPunctuations, $settings);
- $this->drupalPostForm('/admin/config/search/path/settings', $edit, t('Save configuration'));
- $this->assertText(t('The configuration options have been saved.'));
-
- // If we do not clear the caches here, AliasCleaner will use its
- // cleanStringCache instance variable. Due to that the creation of aliases
- // with $this->createNode() will only work correctly on the first call.
- \Drupal::service('pathauto.generator')->resetCaches();
-
- // Create a node and check if the settings applied.
- $node = $this->createNode(
- array(
- 'title' => $title,
- 'type' => 'article',
- )
- );
-
- $this->drupalGet($alias);
- $this->assertResponse(200);
- $this->assertEntityAlias($node, $alias);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTaxonomyWebTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTaxonomyWebTest.php
deleted file mode 100644
index 3b92569f7..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTaxonomyWebTest.php
+++ /dev/null
@@ -1,101 +0,0 @@
-adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
-
- $this->createPattern('taxonomy_term', '/[term:vocabulary]/[term:name]');
- }
-
- /**
- * Basic functional testing of Pathauto with taxonomy terms.
- */
- function testTermEditing() {
- $this->drupalGet('admin/structure');
- $this->drupalGet('admin/structure/taxonomy');
-
- // Add vocabulary "tags".
- $vocabulary = $this->addVocabulary(array('name' => 'tags', 'vid' => 'tags'));
-
- // Create term for testing.
- $name = 'Testing: term name [';
- $automatic_alias = '/tags/testing-term-name';
- $this->drupalPostForm('admin/structure/taxonomy/manage/tags/add', array('name[0][value]' => $name), 'Save');
- $name = trim($name);
- $this->assertText("Created new term $name.");
- $term = $this->drupalGetTermByName($name);
-
- // Look for alias generated in the form.
- $this->drupalGet("taxonomy/term/{$term->id()}/edit");
- $this->assertFieldChecked('edit-path-0-pathauto');
- $this->assertFieldByName('path[0][alias]', $automatic_alias, 'Generated alias visible in the path alias field.');
-
- // Check whether the alias actually works.
- $this->drupalGet($automatic_alias);
- $this->assertText($name, 'Term accessible through automatic alias.');
-
- // Manually set the term's alias.
- $manual_alias = '/tags/' . $term->id();
- $edit = array(
- 'path[0][pathauto]' => FALSE,
- 'path[0][alias]' => $manual_alias,
- );
- $this->drupalPostForm("taxonomy/term/{$term->id()}/edit", $edit, t('Save'));
- $this->assertText("Updated term $name.");
-
- // Check that the automatic alias checkbox is now unchecked by default.
- $this->drupalGet("taxonomy/term/{$term->id()}/edit");
- $this->assertNoFieldChecked('edit-path-0-pathauto');
- $this->assertFieldByName('path[0][alias]', $manual_alias);
-
- // Submit the term form with the default values.
- $this->drupalPostForm(NULL, array('path[0][pathauto]' => FALSE), t('Save'));
- $this->assertText("Updated term $name.");
-
- // Test that the old (automatic) alias has been deleted and only accessible
- // through the new (manual) alias.
- $this->drupalGet($automatic_alias);
- $this->assertResponse(404, 'Term not accessible through automatic alias.');
- $this->drupalGet($manual_alias);
- $this->assertText($name, 'Term accessible through manual alias.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTestHelperTrait.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTestHelperTrait.php
deleted file mode 100644
index 8c5c97045..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoTestHelperTrait.php
+++ /dev/null
@@ -1,190 +0,0 @@
- mb_strtolower($this->randomMachineName()),
- 'type' => $type,
- 'pattern' => $pattern,
- 'weight' => $weight,
- ]);
- $pattern->save();
- return $pattern;
- }
-
- /**
- * Add a bundle condition to a pathauto pattern.
- *
- * @param \Drupal\pathauto\PathautoPatternInterface $pattern
- * The pattern.
- * @param string $entity_type
- * The entity type ID.
- * @param string $bundle
- * The bundle.
- */
- protected function addBundleCondition(PathautoPatternInterface $pattern, $entity_type, $bundle) {
- $plugin_id = $entity_type == 'node' ? 'node_type' : 'entity_bundle:' . $entity_type;
-
- $pattern->addSelectionCondition(
- [
- 'id' => $plugin_id,
- 'bundles' => [
- $bundle => $bundle,
- ],
- 'negate' => FALSE,
- 'context_mapping' => [
- $entity_type => $entity_type,
- ]
- ]
- );
- }
-
- public function assertToken($type, $object, $token, $expected) {
- $bubbleable_metadata = new BubbleableMetadata();
- $tokens = \Drupal::token()->generate($type, array($token => $token), array($type => $object), [], $bubbleable_metadata);
- $tokens += array($token => '');
- $this->assertIdentical($tokens[$token], $expected, t("Token value for [@type:@token] was '@actual', expected value '@expected'.", array('@type' => $type, '@token' => $token, '@actual' => $tokens[$token], '@expected' => $expected)));
- }
-
- public function saveAlias($source, $alias, $langcode = Language::LANGCODE_NOT_SPECIFIED) {
- \Drupal::service('path.alias_storage')->delete(array('source' => $source, 'language', 'langcode' => $langcode));
- return \Drupal::service('path.alias_storage')->save($source, $alias, $langcode);
- }
-
- public function saveEntityAlias(EntityInterface $entity, $alias, $langcode = NULL) {
- // By default, use the entity language.
- if (!$langcode) {
- $langcode = $entity->language()->getId();
- }
- return $this->saveAlias('/' . $entity->toUrl()->getInternalPath(), $alias, $langcode);
- }
-
- public function assertEntityAlias(EntityInterface $entity, $expected_alias, $langcode = NULL) {
- // By default, use the entity language.
- if (!$langcode) {
- $langcode = $entity->language()->getId();
- }
- $this->assertAlias('/' . $entity->toUrl()->getInternalPath(), $expected_alias, $langcode);
- }
-
- public function assertEntityAliasExists(EntityInterface $entity) {
- return $this->assertAliasExists(array('source' => '/' . $entity->toUrl()->getInternalPath()));
- }
-
- public function assertNoEntityAlias(EntityInterface $entity, $langcode = NULL) {
- // By default, use the entity language.
- if (!$langcode) {
- $langcode = $entity->language()->getId();
- }
- $this->assertEntityAlias($entity, '/' . $entity->toUrl()->getInternalPath(), $langcode);
- }
-
- public function assertNoEntityAliasExists(EntityInterface $entity, $alias = NULL) {
- $path = array('source' => '/' . $entity->toUrl()->getInternalPath());
- if (!empty($alias)) {
- $path['alias'] = $alias;
- }
- $this->assertNoAliasExists($path);
- }
-
- public function assertAlias($source, $expected_alias, $langcode = Language::LANGCODE_NOT_SPECIFIED) {
- \Drupal::service('path.alias_manager')->cacheClear($source);
- $this->assertEqual($expected_alias, \Drupal::service('path.alias_manager')->getAliasByPath($source, $langcode), t("Alias for %source with language '@language' is correct.",
- array('%source' => $source, '@language' => $langcode)));
- }
-
- public function assertAliasExists($conditions) {
- $path = \Drupal::service('path.alias_storage')->load($conditions);
- $this->assertTrue($path, t('Alias with conditions @conditions found.', array('@conditions' => var_export($conditions, TRUE))));
- return $path;
- }
-
- public function assertNoAliasExists($conditions) {
- $alias = \Drupal::service('path.alias_storage')->load($conditions);
- $this->assertFalse($alias, t('Alias with conditions @conditions not found.', array('@conditions' => var_export($conditions, TRUE))));
- }
-
- public function deleteAllAliases() {
- \Drupal::database()->delete('url_alias')->execute();
- \Drupal::service('path.alias_manager')->cacheClear();
- }
-
- /**
- * @param array $values
- *
- * @return \Drupal\taxonomy\VocabularyInterface
- */
- public function addVocabulary(array $values = array()) {
- $name = mb_strtolower($this->randomMachineName(5));
- $values += array(
- 'name' => $name,
- 'vid' => $name,
- );
- $vocabulary = Vocabulary::create($values);
- $vocabulary->save();
-
- return $vocabulary;
- }
-
- public function addTerm(VocabularyInterface $vocabulary, array $values = array()) {
- $values += array(
- 'name' => mb_strtolower($this->randomMachineName(5)),
- 'vid' => $vocabulary->id(),
- );
-
- $term = Term::create($values);
- $term->save();
- return $term;
- }
-
- public function assertEntityPattern($entity_type, $bundle, $langcode = Language::LANGCODE_NOT_SPECIFIED, $expected) {
-
- $values = [
- 'langcode' => $langcode,
- \Drupal::entityTypeManager()->getDefinition($entity_type)->getKey('bundle') => $bundle,
- ];
- $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->create($values);
-
- $pattern = \Drupal::service('pathauto.generator')->getPatternByEntity($entity);
- $this->assertIdentical($expected, $pattern->getPattern());
- }
-
- public function drupalGetTermByName($name, $reset = FALSE) {
- if ($reset) {
- // @todo - implement cache reset.
- }
- $terms = \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties(array('name' => $name));
- return !empty($terms) ? reset($terms) : FALSE;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUiTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUiTest.php
deleted file mode 100644
index b6b9e6643..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUiTest.php
+++ /dev/null
@@ -1,191 +0,0 @@
-drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
- $this->drupalCreateContentType(array('type' => 'article'));
-
- // Allow other modules to add additional permissions for the admin user.
- $permissions = array(
- 'administer pathauto',
- 'administer url aliases',
- 'create url aliases',
- 'administer nodes',
- 'bypass node access',
- 'access content overview',
- );
- $this->adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
- }
-
- function testSettingsValidation() {
- $edit = array();
- $edit['max_length'] = 'abc';
- $edit['max_component_length'] = 'abc';
- $this->drupalPostForm('admin/config/search/path/settings', $edit, 'Save configuration');
- /*$this->assertText('The field Maximum alias length is not a valid number.');
- $this->assertText('The field Maximum component length is not a valid number.');*/
- $this->assertNoText('The configuration options have been saved.');
-
- $edit['max_length'] = '0';
- $edit['max_component_length'] = '0';
- $this->drupalPostForm('admin/config/search/path/settings', $edit, 'Save configuration');
- /*$this->assertText('The field Maximum alias length cannot be less than 1.');
- $this->assertText('The field Maximum component length cannot be less than 1.');*/
- $this->assertNoText('The configuration options have been saved.');
-
- $edit['max_length'] = '999';
- $edit['max_component_length'] = '999';
- $this->drupalPostForm('admin/config/search/path/settings', $edit, 'Save configuration');
- /*$this->assertText('The field Maximum alias length cannot be greater than 255.');
- $this->assertText('The field Maximum component length cannot be greater than 255.');*/
- $this->assertNoText('The configuration options have been saved.');
-
- $edit['max_length'] = '50';
- $edit['max_component_length'] = '50';
- $this->drupalPostForm('admin/config/search/path/settings', $edit, 'Save configuration');
- $this->assertText('The configuration options have been saved.');
- }
-
- function testPatternsWorkflow() {
- // Try to save an empty pattern, should not be allowed.
- $this->drupalGet('admin/config/search/path/patterns/add');
- $edit = array(
- 'type' => 'canonical_entities:node',
- );
- $this->drupalPostAjaxForm(NULL, $edit, 'type');
- $edit += array(
- 'bundles[page]' => TRUE,
- 'label' => 'Page pattern',
- 'id' => 'page_pattern',
- );
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Path pattern field is required.');
- $this->assertNoText('The configuration options have been saved.');
-
- // Try to save an invalid pattern.
- $edit += array(
- 'pattern' => '[node:title]/[user:name]/[term:name]',
- );
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Path pattern is using the following invalid tokens: [user:name], [term:name].');
- $this->assertNoText('The configuration options have been saved.');
-
- $edit['pattern'] = '#[node:title]';
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('The Path pattern is using the following invalid characters: #.');
- $this->assertNoText('The configuration options have been saved.');
-
- // Checking whitespace ending of the string.
- $edit['pattern'] = '[node:title] ';
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('The Path pattern doesn\'t allow the patterns ending with whitespace.');
- $this->assertNoText('The configuration options have been saved.');
-
- // Fix the pattern, then check that it gets saved successfully.
- $edit['pattern'] = '[node:title]';
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertText('Pattern Page pattern saved.');
-
- \Drupal::service('pathauto.generator')->resetCaches();
-
- // Create a node with pattern enabled and check if the pattern applies.
- $title = 'Page Pattern enabled';
- $alias = '/page-pattern-enabled';
- $node = $this->createNode(['title' => $title, 'type' => 'page']);
- $this->drupalGet($alias);
- $this->assertResponse(200);
- $this->assertEntityAlias($node, $alias);
-
- // Edit workflow, set a new label and weight for the pattern.
- $this->drupalPostForm('/admin/config/search/path/patterns', ['entities[page_pattern][weight]' => '4'], t('Save'));
- $this->clickLink(t('Edit'));
- $destination_query = ['query' => ['destination' => Url::fromRoute('entity.pathauto_pattern.collection')->toString()]];
- $this->assertUrl('/admin/config/search/path/patterns/page_pattern', $destination_query);
- $this->assertFieldByName('pattern', '[node:title]');
- $this->assertFieldByName('label', 'Page pattern');
- $this->assertFieldChecked('edit-status');
- $this->assertLink(t('Delete'));
-
- $edit = array('label' => 'Test');
- $this->drupalPostForm('/admin/config/search/path/patterns/page_pattern', $edit, t('Save'));
- $this->assertText('Pattern Test saved.');
- // Check that the pattern weight did not change.
- $this->assertOptionSelected('edit-entities-page-pattern-weight', '4');
-
- // Disable workflow.
- $this->drupalGet('/admin/config/search/path/patterns');
- $this->assertNoLink(t('Enable'));
- $this->clickLink(t('Disable'));
- $this->assertUrl('/admin/config/search/path/patterns/page_pattern/disable', $destination_query);
- $this->drupalPostForm(NULL, [], t('Disable'));
- $this->assertText('Disabled pattern Test.');
-
- // Load the pattern from storage and check if its disabled.
- $pattern = PathautoPattern::load('page_pattern');
- $this->assertFalse($pattern->status());
-
- \Drupal::service('pathauto.generator')->resetCaches();
-
- // Create a node with pattern disabled and check that we have no new alias.
- $title = 'Page Pattern disabled';
- $node = $this->createNode(['title' => $title, 'type' => 'page']);
- $this->assertNoEntityAlias($node);
-
- // Enable workflow.
- $this->drupalGet('/admin/config/search/path/patterns');
- $this->assertNoLink(t('Disable'));
- $this->clickLink(t('Enable'));
- $this->assertUrl('/admin/config/search/path/patterns/page_pattern/enable', $destination_query);
- $this->drupalPostForm(NULL, [], t('Enable'));
- $this->assertText('Enabled pattern Test.');
-
- // Reload pattern from storage and check if its enabled.
- $pattern = PathautoPattern::load('page_pattern');
- $this->assertTrue($pattern->status());
-
- // Delete workflow.
- $this->drupalGet('/admin/config/search/path/patterns');
- $this->clickLink(t('Delete'));
- $this->assertUrl('/admin/config/search/path/patterns/page_pattern/delete', $destination_query);
- $this->assertText(t('This action cannot be undone.'));
- $this->drupalPostForm(NULL, [], t('Delete'));
- $this->assertText('The pathauto pattern Test has been deleted.');
-
- $this->assertFalse(PathautoPattern::load('page_pattern'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUserWebTest.php b/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUserWebTest.php
deleted file mode 100644
index 8d73a3f34..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/Tests/PathautoUserWebTest.php
+++ /dev/null
@@ -1,90 +0,0 @@
-adminUser = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->adminUser);
-
- $this->createPattern('user', '/users/[user:name]');
- }
-
- /**
- * Basic functional testing of Pathauto with users.
- */
- function testUserEditing() {
- // There should be no Pathauto checkbox on user forms.
- $this->drupalGet('user/' . $this->adminUser->id() . '/edit');
- $this->assertNoFieldById('path[0][pathauto]');
- }
-
- /**
- * Test user operations.
- */
- function testUserOperations() {
- $account = $this->drupalCreateUser();
-
- // Delete all current URL aliases.
- $this->deleteAllAliases();
-
- // Find the position of just created account in the user_admin_people view.
- $view = Views::getView('user_admin_people');
- $view->initDisplay();
- $view->preview('page_1');
-
- foreach ($view->result as $key => $row) {
- if ($view->field['name']->getValue($row) == $account->getUsername()) {
- break;
- }
- }
-
- $edit = array(
- 'action' => 'pathauto_update_alias_user',
- "user_bulk_form[$key]" => TRUE,
- );
- $this->drupalPostForm('admin/people', $edit, t('Apply to selected items'));
- $this->assertText('Update URL alias was applied to 1 item.');
-
- $this->assertEntityAlias($account, '/users/' . mb_strtolower($account->getUsername()));
- $this->assertEntityAlias($this->adminUser, '/user/' . $this->adminUser->id());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/src/VerboseMessenger.php b/sites/all/modules/contrib/admin/pathauto/src/VerboseMessenger.php
deleted file mode 100644
index a151b9507..000000000
--- a/sites/all/modules/contrib/admin/pathauto/src/VerboseMessenger.php
+++ /dev/null
@@ -1,79 +0,0 @@
-configFactory = $config_factory;
- $this->account = $account;
- $this->messenger = $messenger;
- }
-
- /**
- * {@inheritdoc}
- */
- public function addMessage($message, $op = NULL) {
-
- if (!isset($this->isVerbose)) {
- $config = $this->configFactory->get('pathauto.settings');
- $this->isVerbose = $config->get('verbose') && $this->account->hasPermission('notify of path changes');
- }
-
- if (!$this->isVerbose || (isset($op) && in_array($op, array('bulkupdate', 'return')))) {
- return FALSE;
- }
-
- if ($message) {
- $this->messenger->addMessage($message);
- }
-
- return TRUE;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/pathauto_string_id_test.info.yml b/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/pathauto_string_id_test.info.yml
deleted file mode 100644
index c95b45a7d..000000000
--- a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/pathauto_string_id_test.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: 'Pathauto testing module'
-type: module
-# core: '8.x'
-description: 'Pathauto for Entity with string ID.'
-package: Testing
-dependencies:
- - token
-
-# Information added by Drupal.org packaging script on 2018-09-08
-version: '8.x-1.3'
-core: '8.x'
-project: 'pathauto'
-datestamp: 1536407890
diff --git a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/src/Entity/PathautoStringIdTest.php b/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/src/Entity/PathautoStringIdTest.php
deleted file mode 100644
index afaa157f4..000000000
--- a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_string_id_test/src/Entity/PathautoStringIdTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
-setLabel('ID')
- ->setReadOnly(TRUE)
- // A bigger value will not be allowed to build the index.
- ->setSetting('max_length', 191);
- $fields['name'] = BaseFieldDefinition::create('string')
- ->setLabel('Name');
- $fields['path'] = BaseFieldDefinition::create('path')
- ->setLabel('Path')
- ->setComputed(TRUE);
-
- return $fields;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/config/install/views.view.articles.yml b/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/config/install/views.view.articles.yml
deleted file mode 100644
index 249516f5c..000000000
--- a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/config/install/views.view.articles.yml
+++ /dev/null
@@ -1,231 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - node
- - taxonomy
- - user
-id: articles
-label: articles
-module: pathauto_views_test
-description: ''
-tag: ''
-base_table: node_field_data
-base_field: nid
-core: 8.x
-display:
- default:
- display_plugin: default
- id: default
- display_title: Master
- position: 0
- display_options:
- access:
- type: perm
- options:
- perm: 'access content'
- 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: Apply
- 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: full
- 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: '‹ Previous'
- next: 'Next ›'
- first: '« First'
- last: 'Last »'
- quantity: 9
- style:
- type: default
- row:
- type: 'entity:node'
- options:
- view_mode: teaser
- fields:
- title:
- id: title
- table: node_field_data
- field: title
- entity_type: node
- entity_field: title
- label: ''
- alter:
- alter_text: false
- make_link: false
- absolute: false
- trim: false
- word_boundary: false
- ellipsis: false
- strip_tags: false
- html: false
- hide_empty: false
- empty_zero: false
- settings:
- link_to_entity: true
- plugin_id: field
- relationship: none
- group_type: group
- admin_label: ''
- exclude: false
- element_type: ''
- element_class: ''
- element_label_type: ''
- element_label_class: ''
- element_label_colon: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_alter_empty: true
- click_sort_column: value
- type: string
- group_column: value
- 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
- filters:
- status:
- value: '1'
- table: node_field_data
- field: status
- plugin_id: boolean
- entity_type: node
- entity_field: status
- id: status
- expose:
- operator: ''
- group: 1
- type:
- id: type
- table: node_field_data
- field: type
- value:
- article: article
- entity_type: node
- entity_field: type
- plugin_id: bundle
- sorts:
- created:
- id: created
- table: node_field_data
- field: created
- order: DESC
- entity_type: node
- entity_field: created
- plugin_id: date
- relationship: none
- group_type: group
- admin_label: ''
- exposed: false
- expose:
- label: ''
- granularity: second
- title: articles
- header: { }
- footer: { }
- empty: { }
- relationships: { }
- arguments:
- tid:
- id: tid
- table: taxonomy_index
- field: tid
- 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: { }
- break_phrase: false
- add_table: false
- require_value: false
- reduce_duplicates: false
- plugin_id: taxonomy_index_tid
- display_extenders: { }
- cache_metadata:
- max-age: -1
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - 'user.node_grants:view'
- - user.permissions
- tags: { }
- page_1:
- display_plugin: page
- id: page_1
- display_title: Page
- position: 1
- display_options:
- display_extenders: { }
- path: articles
- cache_metadata:
- max-age: -1
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - 'user.node_grants:view'
- - user.permissions
- tags: { }
diff --git a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/pathauto_views_test.info.yml b/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/pathauto_views_test.info.yml
deleted file mode 100644
index c11eb783a..000000000
--- a/sites/all/modules/contrib/admin/pathauto/tests/modules/pathauto_views_test/pathauto_views_test.info.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: 'Views Test Config'
-type: module
-description: 'Provides default views for tests.'
-package: Testing
-# version: VERSION
-# core: 8.x
-dependencies:
- - views
-
-# Information added by Drupal.org packaging script on 2018-09-08
-version: '8.x-1.3'
-core: '8.x'
-project: 'pathauto'
-datestamp: 1536407890
diff --git a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoEntityWithStringIdTest.php b/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoEntityWithStringIdTest.php
deleted file mode 100644
index e72f42d40..000000000
--- a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoEntityWithStringIdTest.php
+++ /dev/null
@@ -1,130 +0,0 @@
-register('keyvalue.database', KeyValueDatabaseFactory::class)
- ->addArgument(new PhpSerialize())
- ->addArgument($container->get('database'))
- ->addTag('persist');
- $container->setAlias('keyvalue', 'keyvalue.database');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- parent::setUp();
- $this->installSchema('system', ['key_value']);
- $this->installConfig(['system', 'pathauto']);
- $this->installEntitySchema('pathauto_string_id_test');
- $this->createPattern('pathauto_string_id_test', '/[pathauto_string_id_test:name]');
- /** @var \Drupal\pathauto\AliasTypeManager $alias_type_manager */
- $alias_type_manager = $this->container->get('plugin.manager.alias_type');
- $this->aliasType = $alias_type_manager->createInstance('canonical_entities:pathauto_string_id_test');
- }
-
- /**
- * Test aliasing entities with long string ID.
- *
- * @dataProvider entityWithStringIdProvider
- *
- * @param string|int $id
- * The entity ID
- * @param string $expected_key
- * The expected key for 'pathauto_state.*' collections.
- */
- public function testEntityWithStringId($id, $expected_key) {
- $entity = PathautoStringIdTest::create([
- 'id' => $id,
- 'name' => $name = $this->randomMachineName(),
- ]);
- $entity->save();
-
- // Check that the path was generated.
- $this->assertEntityAlias($entity, mb_strtolower("/$name"));
- // Check that the path auto state was saved with the expected key.
- $value = \Drupal::keyValue('pathauto_state.pathauto_string_id_test')->get($expected_key);
- $this->assertEquals(PathautoState::CREATE, $value);
-
- $context = [];
- // Batch delete uses the key-value store collection 'pathauto_state.*. We
- // test that after a bulk delete all aliases are removed. Running only once
- // the batch delete process is enough as the batch size is 100.
- $this->aliasType->batchDelete($context);
-
- // Check that the paths were removed on batch delete.
- $this->assertNoEntityAliasExists($entity, "/$name");
- }
-
- /**
- * Provides test cases for ::testEntityWithStringId().
- *
- * @see \Drupal\Tests\pathauto\Kernel\PathautoEntityWithStringIdTest::testEntityWithStringId()
- */
- public function entityWithStringIdProvider() {
- return [
- 'ascii with less or equal 128 chars' => [
- str_repeat('a', 128), str_repeat('a', 128)
- ],
- 'ascii with over 128 chars' => [
- str_repeat('a', 191), Crypt::hashBase64(str_repeat('a', 191))
- ],
- 'non-ascii with less or equal 128 chars' => [
- str_repeat('社', 128), Crypt::hashBase64(str_repeat('社', 128))
- ],
- 'non-ascii with over 128 chars' => [
- str_repeat('社', 191), Crypt::hashBase64(str_repeat('社', 191))
- ],
- 'simulating an integer id' => [
- 123, '123'
- ],
- ];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoKernelTest.php b/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoKernelTest.php
deleted file mode 100644
index 1fffa4d08..000000000
--- a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoKernelTest.php
+++ /dev/null
@@ -1,586 +0,0 @@
-installConfig(array('pathauto', 'taxonomy', 'system', 'node'));
-
- $this->installEntitySchema('user');
- $this->installEntitySchema('node');
- $this->installEntitySchema('taxonomy_term');
-
- ConfigurableLanguage::createFromLangcode('fr')->save();
-
- $this->installSchema('node', array('node_access'));
- $this->installSchema('system', array('url_alias', 'sequences', 'router'));
-
- $type = NodeType::create(['type' => 'page']);
- $type->save();
- node_add_body_field($type);
-
- $this->nodePattern = $this->createPattern('node', '/content/[node:title]');
- $this->userPattern = $this->createPattern('user', '/users/[user:name]');
-
- \Drupal::service('router.builder')->rebuild();
-
- $this->currentUser = User::create(array('name' => $this->randomMachineName()));
- $this->currentUser->save();
- }
-
- /**
- * Test _pathauto_get_schema_alias_maxlength().
- */
- public function testGetSchemaAliasMaxLength() {
- $this->assertIdentical(\Drupal::service('pathauto.alias_storage_helper')->getAliasSchemaMaxlength(), 255);
- }
-
- /**
- * Test pathauto_pattern_load_by_entity().
- */
- public function testPatternLoadByEntity() {
- $pattern = $this->createPattern('node', '/article/[node:title]', -1);
- $this->addBundleCondition($pattern, 'node', 'article');
- $pattern->save();
-
- $pattern = $this->createPattern('node', '/article/en/[node:title]', -2);
- $this->addBundleCondition($pattern, 'node', 'article');
- $pattern->addSelectionCondition(
- [
- 'id' => 'language',
- 'langcodes' => [
- 'en' => 'en',
- ],
- 'negate' => FALSE,
- 'context_mapping' => [
- 'language' => 'node:langcode:language',
- ]
- ]
- );
-
- $pattern->addRelationship('node:langcode:language');
- $pattern->save();
-
- $pattern = $this->createPattern('node', '/[node:title]', -1);
- $this->addBundleCondition($pattern, 'node', 'page');
- $pattern->save();
-
- $tests = array(
- array(
- 'entity' => 'node',
- 'values' => [
- 'title' => 'Article fr',
- 'type' => 'article',
- 'langcode' => 'fr',
- ],
- 'expected' => '/article/[node:title]',
- ),
- array(
- 'entity' => 'node',
- 'values' => [
- 'title' => 'Article en',
- 'type' => 'article',
- 'langcode' => 'en',
- ],
- 'expected' => '/article/en/[node:title]',
- ),
- array(
- 'entity' => 'node',
- 'values' => [
- 'title' => 'Article und',
- 'type' => 'article',
- 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
- ],
- 'expected' => '/article/[node:title]',
- ),
- array(
- 'entity' => 'node',
- 'values' => [
- 'title' => 'Page',
- 'type' => 'page',
- ],
- 'expected' => '/[node:title]',
- ),
- array(
- 'entity' => 'user',
- 'values' => [
- 'name' => 'User',
- ],
- 'expected' => '/users/[user:name]',
- ),
- );
- foreach ($tests as $test) {
- $entity = \Drupal::entityTypeManager()->getStorage($test['entity'])->create($test['values']);
- $entity->save();
- $actual = \Drupal::service('pathauto.generator')->getPatternByEntity($entity);
- $this->assertIdentical($actual->getPattern(), $test['expected'], t("Correct pattern returned for @entity_type with @values", array(
- '@entity' => $test['entity'],
- '@values' => print_r($test['values'], TRUE),
- )));
- }
- }
-
- /**
- * Test potential conflicts with the same alias in different languages.
- */
- public function testSameTitleDifferentLanguages() {
- // Create two English articles with the same title.
- $edit = [
- 'title' => 'Sample page',
- 'type' => 'page',
- 'langcode' => 'en',
- ];
- $node1 = $this->drupalCreateNode($edit);
- $this->assertEntityAlias($node1, '/content/sample-page', 'en');
-
- $node2 = $this->drupalCreateNode($edit);
- $this->assertEntityAlias($node2, '/content/sample-page-0', 'en');
-
- // Now, create a French article with the same title, and verify that it gets
- // the basic alias with the correct langcode.
- $edit['langcode'] = 'fr';
- $node3 = $this->drupalCreateNode($edit);
- $this->assertEntityAlias($node3, '/content/sample-page', 'fr');
- }
-
- /**
- * Test pathauto_cleanstring().
- */
- public function testCleanString() {
-
- // Test with default settings defined in pathauto.settings.yml.
- $this->installConfig(array('pathauto'));
- \Drupal::service('pathauto.generator')->resetCaches();
-
- $tests = array();
-
- // Test the 'ignored words' removal.
- $tests['this'] = 'this';
- $tests['this with that'] = 'this-with-that';
- $tests['this thing with that thing'] = 'thing-thing';
-
- // Test 'ignored words' removal and duplicate separator removal.
- $tests[' - Pathauto is the greatest - module ever - '] = 'pathauto-greatest-module-ever';
-
- // Test length truncation and lowering of strings.
- $long_string = $this->randomMachineName(120);
- $tests[$long_string] = strtolower(substr($long_string, 0, 100));
-
- // Test that HTML tags are removed.
- $tests['This text has HTML tags.'] = 'text-has-html-tags';
- $tests[Html::escape('This text has HTML tags.')] = 'text-has-html-tags';
-
- // Transliteration.
- $tests['ľščťžýáíéňô'] = 'lsctzyaieno';
-
- foreach ($tests as $input => $expected) {
- $output = \Drupal::service('pathauto.alias_cleaner')->cleanString($input);
- $this->assertEqual($output, $expected, t("Drupal::service('pathauto.alias_cleaner')->cleanString('@input') expected '@expected', actual '@output'", array(
- '@input' => $input,
- '@expected' => $expected,
- '@output' => $output,
- )));
- }
- }
-
- /**
- * Test pathauto_clean_alias().
- */
- public function testCleanAlias() {
- $tests = array();
- $tests['one/two/three'] = '/one/two/three';
- $tests['/one/two/three/'] = '/one/two/three';
- $tests['one//two///three'] = '/one/two/three';
- $tests['one/two--three/-/--/-/--/four---five'] = '/one/two-three/four-five';
- $tests['one/-//three--/four'] = '/one/three/four';
-
- foreach ($tests as $input => $expected) {
- $output = \Drupal::service('pathauto.alias_cleaner')->cleanAlias($input);
- $this->assertEqual($output, $expected, t("Drupal::service('pathauto.generator')->cleanAlias('@input') expected '@expected', actual '@output'", array(
- '@input' => $input,
- '@expected' => $expected,
- '@output' => $output,
- )));
- }
- }
-
- /**
- * Test pathauto_path_delete_multiple().
- */
- public function testPathDeleteMultiple() {
- $this->saveAlias('/node/1', '/node-1-alias');
- $this->saveAlias('/node/1/view', '/node-1-alias/view');
- $this->saveAlias('/node/1', '/node-1-alias-en', 'en');
- $this->saveAlias('/node/1', '/node-1-alias-fr', 'fr');
- $this->saveAlias('/node/2', '/node-2-alias');
- $this->saveAlias('/node/10', '/node-10-alias');
-
- \Drupal::service('pathauto.alias_storage_helper')->deleteBySourcePrefix('/node/1');
- $this->assertNoAliasExists(array('source' => "/node/1"));
- $this->assertNoAliasExists(array('source' => "/node/1/view"));
- $this->assertAliasExists(array('source' => "/node/2"));
- $this->assertAliasExists(array('source' => "/node/10"));
- }
-
- /**
- * Test the different update actions in \Drupal::service('pathauto.generator')->createEntityAlias().
- */
- public function testUpdateActions() {
- $config = $this->config('pathauto.settings');
-
- // Test PATHAUTO_UPDATE_ACTION_NO_NEW with unaliased node and 'insert'.
- $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW);
- $config->save();
- $node = $this->drupalCreateNode(array('title' => 'First title'));
- $this->assertEntityAlias($node, '/content/first-title');
-
- $node->path->pathauto = PathautoState::CREATE;
-
- // Default action is PATHAUTO_UPDATE_ACTION_DELETE.
- $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_DELETE);
- $config->save();
- $node->setTitle('Second title');
- $node->save();
- $this->assertEntityAlias($node, '/content/second-title');
- $this->assertNoAliasExists(array('alias' => '/content/first-title'));
-
- // Test PATHAUTO_UPDATE_ACTION_LEAVE.
- $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_LEAVE);
- $config->save();
- $node->setTitle('Third title');
- $node->save();
- $this->assertEntityAlias($node, '/content/third-title');
- $this->assertAliasExists(array('source' => '/' . $node->toUrl()->getInternalPath(), 'alias' => '/content/second-title'));
-
- $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_DELETE);
- $config->save();
- $node->setTitle('Fourth title');
- $node->save();
- $this->assertEntityAlias($node, '/content/fourth-title');
- $this->assertNoAliasExists(array('alias' => '/content/third-title'));
- // The older second alias is not deleted yet.
- $older_path = $this->assertAliasExists(array('source' => '/' . $node->toUrl()->getInternalPath(), 'alias' => '/content/second-title'));
- \Drupal::service('path.alias_storage')->delete($older_path);
-
- $config->set('update_action', PathautoGeneratorInterface::UPDATE_ACTION_NO_NEW);
- $config->save();
- $node->setTitle('Fifth title');
- $node->save();
- $this->assertEntityAlias($node, '/content/fourth-title');
- $this->assertNoAliasExists(array('alias' => '/content/fifth-title'));
-
- // Test PATHAUTO_UPDATE_ACTION_NO_NEW with unaliased node and 'update'.
- $this->deleteAllAliases();
- $node->save();
- $this->assertEntityAlias($node, '/content/fifth-title');
-
- // Test PATHAUTO_UPDATE_ACTION_NO_NEW with unaliased node and 'bulkupdate'.
- $this->deleteAllAliases();
- $node->setTitle('Sixth title');
- \Drupal::service('pathauto.generator')->updateEntityAlias($node, 'bulkupdate');
- $this->assertEntityAlias($node, '/content/sixth-title');
- }
-
- /**
- * Test that \Drupal::service('pathauto.generator')->createEntityAlias() will
- * not create an alias for a pattern that does not get any tokens replaced.
- */
- public function testNoTokensNoAlias() {
- $this->installConfig(['filter']);
- $this->nodePattern
- ->setPattern('/content/[node:body]')
- ->save();
-
- $node = $this->drupalCreateNode();
- $this->assertNoEntityAliasExists($node);
-
- $node->body->value = 'hello';
- $node->save();
- $this->assertEntityAlias($node, '/content/hello');
- }
-
- /**
- * Test the handling of path vs non-path tokens in pathauto_clean_token_values().
- */
- public function testPathTokens() {
- $this->createPattern('taxonomy_term', '/[term:parent:url:path]/[term:name]');
-
- $vocab = $this->addVocabulary();
-
- $term1 = $this->addTerm($vocab, array('name' => 'Parent term'));
- $this->assertEntityAlias($term1, '/parent-term');
-
- $term2 = $this->addTerm($vocab, array('name' => 'Child term', 'parent' => $term1->id()));
- $this->assertEntityAlias($term2, '/parent-term/child-term');
-
- $this->saveEntityAlias($term1, '/My Crazy/Alias/');
- $term2->save();
- $this->assertEntityAlias($term2, '/My Crazy/Alias/child-term');
- }
-
- /**
- * Test using fields for path structures.
- */
- function testParentChildPathTokens() {
- // First create a field which will be used to create the path. It must
- // begin with a letter.
- $this->installEntitySchema('taxonomy_term');
-
- Vocabulary::create(['vid' => 'tags'])->save();
-
- $fieldname = 'a' . mb_strtolower($this->randomMachineName());
- $field_storage = FieldStorageConfig::create(['entity_type' => 'taxonomy_term', 'field_name' => $fieldname, 'type' => 'string']);
- $field_storage->save();
- $field = FieldConfig::create(['field_storage' => $field_storage, 'bundle' => 'tags']);
- $field->save();
-
- $display = entity_get_display('taxonomy_term', 'tags', 'default');
- $display->setComponent($fieldname, ['type' => 'string']);
- $display->save();
-
- // Make the path pattern of a field use the value of this field appended
- // to the parent taxonomy term's pattern if there is one.
- $this->createPattern('taxonomy_term', '/[term:parents:join-path]/[term:' . $fieldname . ']');
-
- // Start by creating a parent term.
- $parent = Term::create(['vid' => 'tags', $fieldname => $this->randomMachineName(), 'name' => $this->randomMachineName()]);
- $parent->save();
-
- // Create the child term.
- $child = Term::create(['vid' => 'tags', $fieldname => $this->randomMachineName(), 'parent' => $parent, 'name' => $this->randomMachineName()]);
- $child->save();
- $this->assertEntityAlias($child, '/' . mb_strtolower($parent->getName() . '/' . $child->$fieldname->value));
-
- // Re-saving the parent term should not modify the child term's alias.
- $parent->save();
- $this->assertEntityAlias($child, '/' . mb_strtolower($parent->getName() . '/' . $child->$fieldname->value));
- }
-
- /**
- * Tests aliases on taxonomy terms.
- */
- public function testTaxonomyPattern() {
- // Create a vocabulary and test that it's pattern variable works.
- $vocab = $this->addVocabulary(array('vid' => 'name'));
- $this->createPattern('taxonomy_term', 'base');
- $pattern = $this->createPattern('taxonomy_term', 'bundle', -1);
- $this->addBundleCondition($pattern, 'taxonomy_term', 'name');
- $pattern->save();
- $this->assertEntityPattern('taxonomy_term', 'name', Language::LANGCODE_NOT_SPECIFIED, 'bundle');
- }
-
- function testNoExistingPathAliases() {
- $this->config('pathauto.settings')
- ->set('punctuation.period', PathautoGeneratorInterface::PUNCTUATION_DO_NOTHING)
- ->save();
-
- $this->nodePattern
- ->setPattern('[node:title]')
- ->save();
-
- // Check that Pathauto does not create an alias of '/admin'.
- $node = $this->drupalCreateNode(array('title' => 'Admin', 'type' => 'page'));
- $this->assertEntityAlias($node, '/admin-0');
-
- // Check that Pathauto does not create an alias of '/modules'.
- $node->setTitle('Modules');
- $node->save();
- $this->assertEntityAlias($node, '/modules-0');
-
- // Check that Pathauto does not create an alias of '/index.php'.
- $node->setTitle('index.php');
- $node->save();
- $this->assertEntityAlias($node, '/index.php-0');
-
- // Check that a safe value gets an automatic alias. This is also a control
- // to ensure the above tests work properly.
- $node->setTitle('Safe value');
- $node->save();
- $this->assertEntityAlias($node, '/safe-value');
- }
-
- /**
- * Test programmatic entity creation for aliases.
- */
- function testProgrammaticEntityCreation() {
- $this->createPattern('taxonomy_term', '/[term:vocabulary]/[term:name]');
- $node = $this->drupalCreateNode(array('title' => 'Test node', 'path' => array('pathauto' => TRUE)));
- $this->assertEntityAlias($node, '/content/test-node');
-
- $vocabulary = $this->addVocabulary(array('name' => 'Tags'));
- $term = $this->addTerm($vocabulary, array('name' => 'Test term', 'path' => array('pathauto' => TRUE)));
- $this->assertEntityAlias($term, '/tags/test-term');
-
- $edit['name'] = 'Test user';
- $edit['mail'] = 'test-user@example.com';
- $edit['pass'] = user_password();
- $edit['path'] = array('pathauto' => TRUE);
- $edit['status'] = 1;
- $account = User::create($edit);
- $account->save();
- $this->assertEntityAlias($account, '/users/test-user');
- }
-
- /**
- * Tests word safe alias truncating.
- */
- function testPathAliasUniquifyWordsafe() {
- $this->config('pathauto.settings')
- ->set('max_length', 26)
- ->save();
-
- $node_1 = $this->drupalCreateNode(array('title' => 'thequick brownfox jumpedover thelazydog', 'type' => 'page'));
- $node_2 = $this->drupalCreateNode(array('title' => 'thequick brownfox jumpedover thelazydog', 'type' => 'page'));
-
- // Check that alias uniquifying is truncating with $wordsafe param set to
- // TRUE.
- // If it doesn't path alias result would be content/thequick-brownf-0
- $this->assertEntityAlias($node_1, '/content/thequick-brownfox');
- $this->assertEntityAlias($node_2, '/content/thequick-0');
- }
-
- /**
- * Test if aliases are (not) generated with enabled/disabled patterns.
- */
- function testPatternStatus() {
- // Create a node to get an alias for.
- $title = 'Pattern enabled';
- $alias = '/content/pattern-enabled';
- $node1 = $this->drupalCreateNode(['title' => $title, 'type' => 'page']);
- $this->assertEntityAlias($node1, $alias);
-
- // Disable the pattern, save the node again and make sure the alias is still
- // working.
- $this->nodePattern->setStatus(FALSE)->save();
-
- $node1->save();
- $this->assertEntityAlias($node1, $alias);
-
- // Create a new node with disabled pattern and make sure there is no new
- // alias created.
- $title = 'Pattern disabled';
- $node2 = $this->drupalCreateNode(['title' => $title, 'type' => 'page']);
- $this->assertNoEntityAlias($node2);
- }
-
- /**
- * Tests that enabled entity types generates the necessary fields and plugins.
- */
- public function testSettingChangeInvalidatesCache() {
-
- $this->installConfig(['pathauto']);
-
- $this->enableModules(['entity_test']);
-
- $definitions = \Drupal::service('plugin.manager.alias_type')->getDefinitions();
- $this->assertFalse(isset($definitions['canonical_entities:entity_test']));
-
- $fields = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions('entity_test');
- $this->assertFalse(isset($fields['path']));
-
- $this->config('pathauto.settings')
- ->set('enabled_entity_types', ['user', 'entity_test'])
- ->save();
-
- $definitions = \Drupal::service('plugin.manager.alias_type')->getDefinitions();
- $this->assertTrue(isset($definitions['canonical_entities:entity_test']));
-
- $fields = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions('entity_test');
- $this->assertTrue(isset($fields['path']));
-
- }
-
- /**
- * Tests that aliases are only generated for default revisions.
- */
- public function testDefaultRevision() {
- $node1 = $this->drupalCreateNode(['title' => 'Default revision', 'type' => 'page']);
- $this->assertEntityAlias($node1, '/content/default-revision');
-
- $node1->setNewRevision(TRUE);
- $node1->isDefaultRevision(FALSE);
- $node1->setTitle('New non-default-revision');
- $node1->save();
-
- $this->assertEntityAlias($node1, '/content/default-revision');
- }
-
- /**
- * Tests that the pathauto state property gets set to CREATED for new nodes.
- *
- * In some cases, this can trigger $node->path to be set up with no default
- * value for the pathauto property.
- */
- public function testCreateNodeWhileAccessingPath() {
- $node = Node::create([
- 'type' => 'article',
- 'title' => 'TestAlias',
- ]);
- $node->path->langcode;
- $node->save();
- $this->assertEntityAlias($node, '/content/testalias');
- }
-
- /**
- * Creates a node programmatically.
- *
- * @param array $settings
- * The array of values for the node.
- *
- * @return \Drupal\node\Entity\Node
- * The created node.
- */
- protected function drupalCreateNode(array $settings = array()) {
- // Populate defaults array.
- $settings += array(
- 'title' => $this->randomMachineName(8),
- 'type' => 'page',
- );
-
- $node = Node::create($settings);
- $node->save();
-
- return $node;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoTokenTest.php b/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoTokenTest.php
deleted file mode 100644
index 1a05007f6..000000000
--- a/sites/all/modules/contrib/admin/pathauto/tests/src/Kernel/PathautoTokenTest.php
+++ /dev/null
@@ -1,114 +0,0 @@
-installConfig(array('pathauto'));
-
- $array = array(
- 'test first arg',
- 'The Array / value',
- );
-
- $tokens = array(
- 'join-path' => 'test-first-arg/array-value',
- );
- $data['array'] = $array;
- $replacements = $this->assertTokens('array', $data, $tokens);
-
- // Ensure that the cleanTokenValues() method does not alter this token value.
- /* @var \Drupal\pathauto\AliasCleanerInterface $alias_cleaner */
- $alias_cleaner = \Drupal::service('pathauto.alias_cleaner');
- $alias_cleaner->cleanTokenValues($replacements, $data, array());
- $this->assertEqual($replacements['[array:join-path]'], 'test-first-arg/array-value');
-
- // Test additional token cleaning and its configuration.
- $safe_tokens = $this->config('pathauto.settings')->get('safe_tokens');
- $safe_tokens[] = 'safe';
- $this->config('pathauto.settings')
- ->set('safe_tokens', $safe_tokens)
- ->save();
-
- $safe_tokens = [
- '[example:path]',
- '[example:url]',
- '[example:url-brief]',
- '[example:login-url]',
- '[example:login-url:relative]',
- '[example:url:relative]',
- '[example:safe]',
- ];
- $unsafe_tokens = [
- '[example:path_part]',
- '[example:something_url]',
- '[example:unsafe]',
- ];
- foreach ($safe_tokens as $token) {
- $replacements = [
- $token => 'this/is/a/path',
- ];
- $alias_cleaner->cleanTokenValues($replacements);
- $this->assertEquals('this/is/a/path', $replacements[$token], "Token $token cleaned.");
- }
- foreach ($unsafe_tokens as $token) {
- $replacements = [
- $token => 'This is not a / path',
- ];
- $alias_cleaner->cleanTokenValues($replacements);
- $this->assertEquals('not-path', $replacements[$token], "Token $token not cleaned.");
- }
- }
-
- /**
- * Function copied from TokenTestHelper::assertTokens().
- */
- public function assertTokens($type, array $data, array $tokens, array $options = array()) {
- $input = $this->mapTokenNames($type, array_keys($tokens));
- $bubbleable_metadata = new BubbleableMetadata();
- $replacements = \Drupal::token()->generate($type, $input, $data, $options, $bubbleable_metadata);
- foreach ($tokens as $name => $expected) {
- $token = $input[$name];
- if (!isset($expected)) {
- $this->assertTrue(!isset($values[$token]), t("Token value for @token was not generated.", array('@type' => $type, '@token' => $token)));
- }
- elseif (!isset($replacements[$token])) {
- $this->fail(t("Token value for @token was not generated.", array('@type' => $type, '@token' => $token)));
- }
- elseif (!empty($options['regex'])) {
- $this->assertTrue(preg_match('/^' . $expected . '$/', $replacements[$token]), t("Token value for @token was '@actual', matching regular expression pattern '@expected'.", array('@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected)));
- }
- else {
- $this->assertIdentical($replacements[$token], $expected, t("Token value for @token was '@actual', expected value '@expected'.", array('@type' => $type, '@token' => $token, '@actual' => $replacements[$token], '@expected' => $expected)));
- }
- }
-
- return $replacements;
- }
-
- public function mapTokenNames($type, array $tokens = array()) {
- $return = array();
- foreach ($tokens as $token) {
- $return[$token] = "[$type:$token]";
- }
- return $return;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/pathauto/tests/src/Unit/VerboseMessengerTest.php b/sites/all/modules/contrib/admin/pathauto/tests/src/Unit/VerboseMessengerTest.php
deleted file mode 100644
index 13c5c058e..000000000
--- a/sites/all/modules/contrib/admin/pathauto/tests/src/Unit/VerboseMessengerTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
-getConfigFactoryStub(['pathauto.settings' => ['verbose' => TRUE]]);
- $account = $this->createMock(AccountInterface::class);
- $account->expects($this->once())
- ->method('hasPermission')
- ->withAnyParameters()
- ->willReturn(TRUE);
- $messenger = $this->createMock(MessengerInterface::class);
-
- $this->messenger = new VerboseMessenger($config_factory, $account, $messenger);
- }
-
- /**
- * Tests add messages.
- *
- * @covers ::addMessage
- */
- public function testAddMessage() {
- $this->assertTrue($this->messenger->addMessage("Test message"), "The message was added");
- }
-
- /**
- * @covers ::addMessage
- */
- public function testDoNotAddMessageWhileBulkupdate() {
- $this->assertFalse($this->messenger->addMessage("Test message", "bulkupdate"), "The message was NOT added");
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/permissions_filter/LICENSE.txt b/sites/all/modules/contrib/admin/permissions_filter/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/permissions_filter/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/permissions_filter/README.txt b/sites/all/modules/contrib/admin/permissions_filter/README.txt
deleted file mode 100644
index e2a928552..000000000
--- a/sites/all/modules/contrib/admin/permissions_filter/README.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-The permission Filter module is a simple approach to provide a search
-functionality in the people/permission page. It will help site admin to
-get the desired result without scrolling down.
-
- Install
- -------
- Simply install Permission Filter like you would install any other module.
-
- 1) Copy the permission_filter folder in the modules folder in your Drupal docroot.
-
- 2) Enable the module using Manage -> Extend (/admin/modules).
-
- 3) Goto People --> Permissions (/admin/people/permissions).
-
diff --git a/sites/all/modules/contrib/admin/permissions_filter/js/permissions_filter.js b/sites/all/modules/contrib/admin/permissions_filter/js/permissions_filter.js
deleted file mode 100644
index 31b616dd7..000000000
--- a/sites/all/modules/contrib/admin/permissions_filter/js/permissions_filter.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * @file
- * Permission page behaviors.
- */
-
-(function ($, Drupal, debounce) {
-
- 'use strict';
- Drupal.behaviors.permissionTableFilterByText = {
- attach: function (context, settings) {
- var $input = $('input.table-filter-text').once('table-filter-text');
- var $table = $($input.attr('data-table'));
- var $rowsAndDetails;
- var $rows;
- var $details;
- var searching = false;
-
- function hidePackageDetails(index, element) {
- var $packDetails = $(element);
- var $visibleRows = $packDetails.find('tbody tr:visible');
- $packDetails.toggle($visibleRows.length > 0);
- }
-
- function filterPermissionList(e) {
- var query = $(e.target).val();
- // Case insensitive expression to find query at the beginning of a word.
- var re = new RegExp('\\b' + query, 'i');
-
- function showPermissionRow(index, row) {
- var $row = $(row);
- var $sources = $row.find('.table-filter-text-source, .module, .permission');
- var textMatch = $sources.text().search(re) !== -1;
- $row.closest('tr').toggle(textMatch);
- }
- // Search over all rows and packages.
- $rowsAndDetails.show();
-
- // Filter if the length of the query is at least 2 characters.
- if (query.length >= 2) {
- searching = true;
- $rows.each(showPermissionRow);
- $details.not('[open]').attr('data-drupal-system-state', 'forced-open');
- $details.attr('open', true).each(hidePackageDetails);
-
- Drupal.announce(
- Drupal.t(
- '!permissions permissions are available in the modified list.',
- {'!permissions': $rowsAndDetails.find('tbody tr:visible').length}
- )
- );
- }
- else if (searching) {
- searching = false;
- $rowsAndDetails.show();
- $details.filter('[data-drupal-system-state="forced-open"]')
- .removeAttr('data-drupal-system-state')
- .attr('open', false);
- }
- }
-
- function preventEnterKey(event) {
- if (event.which === 13) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
-
- if ($table.length) {
- $rowsAndDetails = $table.find('tr, details');
- $rows = $table.find('tbody tr');
- $details = $rowsAndDetails.filter('.js-permissions');
-
- $input.on({
- keyup: debounce(filterPermissionList, 200),
- keydown: preventEnterKey
- });
- }
- }
- };
-
-}(jQuery, Drupal, Drupal.debounce));
diff --git a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.info.yml b/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.info.yml
deleted file mode 100644
index 17af6cf51..000000000
--- a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.info.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: Permission Filter
-type: module
-description: Create a filter for permission page.
-# core: 8.x
-package: Other
-
-# Information added by Drupal.org packaging script on 2016-10-26
-version: '8.x-1.0'
-core: '8.x'
-project: 'permissions_filter'
-datestamp: 1477463041
diff --git a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.libraries.yml b/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.libraries.yml
deleted file mode 100644
index 7400ca82e..000000000
--- a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.libraries.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-permissions_js:
- version: VERSION
- js:
- js/permissions_filter.js: {}
- dependencies:
- - core/jquery
- - core/drupal
- - core/drupal.debounce
- - core/jquery.once
\ No newline at end of file
diff --git a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.module b/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.module
deleted file mode 100755
index 267a027f9..000000000
--- a/sites/all/modules/contrib/admin/permissions_filter/permissions_filter.module
+++ /dev/null
@@ -1,49 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('Create a filter for permission page.') . '
';
- return $output;
-
- default:
- }
-}
-
-/**
- * Implements hook_form_alter() on behalf of permissions_filter.module.
- */
-function permissions_filter_form_alter(&$form, FormStateInterface $form_state, $form_id) {
- if ($form_id == 'user_admin_permissions') {
- $form['filters'] = array(
- '#type' => 'container',
- '#attributes' => array(
- 'class' => array('table-filter', 'js-show'),
- ),
- '#weight' => -1,
- );
- $form['filters']['search_permission'] = array(
- '#type' => 'search',
- '#title' => t('Enter a part of the Permission name or description'),
- '#title_display' => 'invisible',
- '#size' => 30,
- '#placeholder' => t('Filter by name or description'),
- '#description' => t('Enter a part of the permission'),
- '#attributes' => array(
- 'class' => array('table-filter-text'),
- 'data-table' => '#user-admin-permissions',
- 'autocomplete' => 'off',
- ),
- );
- $form['#attached']['library'][] = 'permissions_filter/permissions_js';
- }
-}
diff --git a/sites/all/modules/contrib/admin/piwik/.eslintrc b/sites/all/modules/contrib/admin/piwik/.eslintrc
deleted file mode 100644
index c7e9cdfe2..000000000
--- a/sites/all/modules/contrib/admin/piwik/.eslintrc
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "globals": {
- "_paq": true
- }
-}
diff --git a/sites/all/modules/contrib/admin/piwik/LICENSE.txt b/sites/all/modules/contrib/admin/piwik/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/piwik/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/piwik/README.txt b/sites/all/modules/contrib/admin/piwik/README.txt
deleted file mode 100644
index d7c05f410..000000000
--- a/sites/all/modules/contrib/admin/piwik/README.txt
+++ /dev/null
@@ -1,109 +0,0 @@
-
-Module: Piwik - Web analytics
-Author: Alexander Hass
-
-
-Description
-===========
-Adds the Piwik tracking system to your website.
-
-Requirements
-============
-
-* Piwik installation
-* Piwik website ID
-
-
-Installation
-============
-* Copy the 'piwik' module directory in to your Drupal 'modules'
-directory as usual.
-
-
-Usage
-=====
-In the settings page enter your Piwik website ID.
-
-All pages will now have the required JavaScript added to the
-HTML footer can confirm this by viewing the page source from
-your browser.
-
-Page specific tracking
-====================================================
-The default is set to "Add to every page except the listed pages". By
-default the following pages are listed for exclusion:
-
-/admin
-/admin/*
-/batch
-/node/add*
-/node/*/*
-/user/*/*
-
-These defaults are changeable by the website administrator or any other
-user with 'Administer Piwik' permission.
-
-Like the blocks visibility settings in Drupal core, there is a choice for
-"Add if the following PHP code returns TRUE." Sample PHP snippets that can be
-used in this textarea can be found on the handbook page "Overview-approach to
-block visibility" at http://drupal.org/node/64135.
-
-Custom variables
-=================
-One example for custom variables tracking is the "User roles" tracking. Enter
-the below configuration data into the custom variables settings form under
-admin/config/system/piwik.
-
-Slot: 1
-Name: User roles
-Value: [current-user:piwik-role-names]
-Scope: Visitor
-
-Slot: 1
-Name: User ids
-Value: [current-user:piwik-role-ids]
-Scope: Visitor
-
-More details about custom variables can be found in the Piwik API documentation
-at http://piwik.org/docs/javascript-tracking/#toc-custom-variables.
-
-
-Advanced Settings
-=================
-You can include additional JavaScript snippets in the custom javascript
-code textarea. These can be found on various blog posts, or on the
-official Piwik pages. Support is not provided for any customisations
-you include.
-
-To speed up page loading you may also cache the Piwik "piwik.js"
-file locally.
-
-Known issues
-============
-Drupal requirements (http://drupal.org/requirements) tell you to configure
-PHP with "session.save_handler = user", but your Piwik installation may
-not work with this configuration and gives you a server error 500.
-
-1. You are able to workaround with the PHP default in your php.ini:
-
- [Session]
- session.save_handler = files
-
-2. With Apache you may overwrite the PHP setting for the Piwik directory only.
- If Piwik is installed in /piwik you are able to create a .htaccess file in
- this directory with the below code:
-
- # PHP 4, Apache 1.
-
- php_value session.save_handler files
-
-
- # PHP 4, Apache 2.
-
- php_value session.save_handler files
-
-
- # PHP 5, Apache 1 and 2.
-
- php_value session.save_handler files
-
diff --git a/sites/all/modules/contrib/admin/piwik/composer.json b/sites/all/modules/contrib/admin/piwik/composer.json
deleted file mode 100644
index 5419bea3c..000000000
--- a/sites/all/modules/contrib/admin/piwik/composer.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "drupal/piwik",
- "description": "Adds Piwik javascript tracking code to all your site's pages",
- "type": "drupal-module",
- "homepage": "https://www.drupal.org/project/piwik",
- "authors": [
- {
- "name": "hass",
- "homepage": "https://www.drupal.org/u/hass"
- },
- {
- "name": "See other contributors",
- "homepage":"https://www.drupal.org/node/247808/committers"
- }
- ],
- "support": {
- "issues": "https://www.drupal.org/project/issues/piwik",
- "source": "http://git.drupal.org/project/piwik.git"
- },
- "license": "GPL-2.0+",
- "require": {
- "drupal/matomo": "^1.0"
- }
-}
diff --git a/sites/all/modules/contrib/admin/piwik/config/install/piwik.settings.yml b/sites/all/modules/contrib/admin/piwik/config/install/piwik.settings.yml
deleted file mode 100644
index d00da26d6..000000000
--- a/sites/all/modules/contrib/admin/piwik/config/install/piwik.settings.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-site_id: ''
-url_http: ''
-url_https: ''
-domain_mode: 0
-visibility:
- request_path_mode: 0
- request_path_pages: "/admin\n/admin/*\n/batch\n/node/add*\n/node/*/*\n/user/*/*"
- user_role_mode: 0
- user_role_roles: { }
- user_account_mode: 0
-track:
- mailto: true
- files: true
- files_extensions: '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip'
- colorbox: true
- userid: false
- messages: { }
- site_search: false
-privacy:
- donottrack: true
-custom:
- variable: { }
-codesnippet:
- before: ''
- after: ''
-translation_set: false
-cache: false
-page_title_hierarchy: false
-page_title_hierarchy_exclude_home: true
diff --git a/sites/all/modules/contrib/admin/piwik/config/schema/piwik.schema.yml b/sites/all/modules/contrib/admin/piwik/config/schema/piwik.schema.yml
deleted file mode 100644
index 442ec6044..000000000
--- a/sites/all/modules/contrib/admin/piwik/config/schema/piwik.schema.yml
+++ /dev/null
@@ -1,120 +0,0 @@
-# Schema for the configuration files of the piwik module.
-
-piwik.settings:
- type: config_object
- label: 'Piwik settings'
- mapping:
- site_id:
- type: string
- label: 'Piwik site ID'
- url_http:
- type: string
- label: 'Piwik HTTP URL'
- url_https:
- type: string
- label: 'Piwik HTTPS URL'
- domain_mode:
- type: integer
- label: 'What are you tracking?'
- visibility:
- type: mapping
- label: 'Visibility'
- mapping:
- request_path_mode:
- type: integer
- label: 'Add tracking to specific pages'
- request_path_pages:
- type: string
- label: 'Pages by their paths'
- user_role_mode:
- type: integer
- label: 'Add tracking for specific roles'
- user_role_roles:
- type: sequence
- label: 'Roles'
- sequence:
- type: string
- label: 'Role'
- user_account_mode:
- type: integer
- label: 'Allow users to customize tracking on their account page'
- track:
- type: mapping
- label: 'Links and downloads'
- mapping:
- mailto:
- type: boolean
- label: 'Track clicks on mailto links'
- files:
- type: boolean
- label: 'Track downloads'
- files_extensions:
- type: string
- label: 'File extension list'
- colorbox:
- type: boolean
- label: 'Track content in colorbox modal dialogs'
- userid:
- type: boolean
- label: 'Track User ID'
- messages:
- type: sequence
- label: 'Track messages of type'
- sequence:
- type: string
- label: 'Message type'
- site_search:
- type: boolean
- label: 'Track internal search'
- privacy:
- type: mapping
- label: 'Privacy'
- mapping:
- donottrack:
- type: boolean
- label: 'Universal web tracking opt-out'
- custom:
- type: mapping
- label: 'Custom variables'
- mapping:
- variable:
- type: sequence
- label: 'Custom variable'
- sequence:
- type: mapping
- label: 'Variable'
- mapping:
- slot:
- type: integer
- label: 'Slot number'
- name:
- type: string
- label: 'The custom variable name.'
- value:
- type: string
- label: 'The custom variable value.'
- scope:
- type: string
- label: 'The scope for the custom variable.'
- codesnippet:
- type: mapping
- label: 'Custom code snippets'
- mapping:
- before:
- type: string
- label: 'Code snippet (before)'
- after:
- type: string
- label: 'Code snippet (after)'
- translation_set:
- type: boolean
- label: 'Track translation sets as one unit'
- cache:
- type: boolean
- label: 'Locally cache tracking code file'
- page_title_hierarchy:
- type: boolean
- label: 'Show page titles as hierarchy like breadcrumbs'
- page_title_hierarchy_exclude_home:
- type: boolean
- label: 'Hide home page from hierarchy'
diff --git a/sites/all/modules/contrib/admin/piwik/js/piwik.admin.js b/sites/all/modules/contrib/admin/piwik/js/piwik.admin.js
deleted file mode 100644
index 04cc91393..000000000
--- a/sites/all/modules/contrib/admin/piwik/js/piwik.admin.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * @file
- * Piwik admin behaviors.
- */
-
-(function ($, window) {
-
- "use strict";
-
- /**
- * Provide the summary information for the tracking settings vertical tabs.
- */
- Drupal.behaviors.trackingSettingsSummary = {
- attach: function () {
- // Make sure this behavior is processed only if drupalSetSummary is defined.
- if (typeof jQuery.fn.drupalSetSummary === 'undefined') {
- return;
- }
-
- $('#edit-page-visibility-settings').drupalSetSummary(function (context) {
- var $radio = $('input[name="piwik_visibility_request_path_mode"]:checked', context);
- if ($radio.val() === '0') {
- if (!$('textarea[name="piwik_visibility_request_path_pages"]', context).val()) {
- return Drupal.t('Not restricted');
- }
- else {
- return Drupal.t('All pages with exceptions');
- }
- }
- else {
- return Drupal.t('Restricted to certain pages');
- }
- });
-
- $('#edit-role-visibility-settings').drupalSetSummary(function (context) {
- var vals = [];
- $('input[type="checkbox"]:checked', context).each(function () {
- vals.push($.trim($(this).next('label').text()));
- });
- if (!vals.length) {
- return Drupal.t('Not restricted');
- }
- else if ($('input[name="piwik_visibility_user_role_mode"]:checked', context).val() === '1') {
- return Drupal.t('Excepted: @roles', {'@roles': vals.join(', ')});
- }
- else {
- return vals.join(', ');
- }
- });
-
- $('#edit-user-visibility-settings').drupalSetSummary(function (context) {
- var $radio = $('input[name="piwik_visibility_user_account_mode"]:checked', context);
- if ($radio.val() === '0') {
- return Drupal.t('Not customizable');
- }
- else if ($radio.val() === '1') {
- return Drupal.t('On by default with opt out');
- }
- else {
- return Drupal.t('Off by default with opt in');
- }
- });
-
- $('#edit-linktracking').drupalSetSummary(function (context) {
- var vals = [];
- if ($('input#edit-piwik-trackmailto', context).is(':checked')) {
- vals.push(Drupal.t('Mailto links'));
- }
- if ($('input#edit-piwik-trackfiles', context).is(':checked')) {
- vals.push(Drupal.t('Outbound links'));
- vals.push(Drupal.t('Downloads'));
- }
- if ($('input#edit-piwik-trackcolorbox', context).is(':checked')) {
- vals.push(Drupal.t('Colorbox'));
- }
- if (!vals.length) {
- return Drupal.t('Not tracked');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
-
- $('#edit-messagetracking').drupalSetSummary(function (context) {
- var vals = [];
- $('input[type="checkbox"]:checked', context).each(function () {
- vals.push($.trim($(this).next('label').text()));
- });
- if (!vals.length) {
- return Drupal.t('Not tracked');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
-
- $('#edit-search').drupalSetSummary(function (context) {
- var vals = [];
- if ($('input#edit-piwik-site-search', context).is(':checked')) {
- vals.push(Drupal.t('Site search'));
- }
- if (!vals.length) {
- return Drupal.t('Not tracked');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
-
- $('#edit-domain-tracking').drupalSetSummary(function (context) {
- var $radio = $('input[name="piwik_domain_mode"]:checked', context);
- if ($radio.val() === '0') {
- return Drupal.t('A single domain');
- }
- else if ($radio.val() === '1') {
- return Drupal.t('One domain with multiple subdomains');
- }
- });
-
- $('#edit-privacy').drupalSetSummary(function (context) {
- var vals = [];
- if ($('input#edit-piwik-privacy-donottrack', context).is(':checked')) {
- vals.push(Drupal.t('Universal web tracking opt-out'));
- }
- if (!vals.length) {
- return Drupal.t('No privacy');
- }
- return Drupal.t('@items enabled', {'@items': vals.join(', ')});
- });
- }
- };
-
-})(jQuery, window);
diff --git a/sites/all/modules/contrib/admin/piwik/js/piwik.js b/sites/all/modules/contrib/admin/piwik/js/piwik.js
deleted file mode 100644
index 9a89bfc2c..000000000
--- a/sites/all/modules/contrib/admin/piwik/js/piwik.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * @file
- * Attaches several event listener to a web page.
- */
-
-(function ($, drupalSettings) {
-
- "use strict";
-
- $(document).ready(function () {
-
- // Attach mousedown, keyup, touchstart events to document only and catch
- // clicks on all elements.
- $(document.body).bind("mousedown keyup touchstart", function (event) {
-
- // Catch the closest surrounding link of a clicked element.
- $(event.target).closest("a,area").each(function () {
-
- if (drupalSettings.piwik.trackMailto && $(this).is("a[href^='mailto:'],area[href^='mailto:']")) {
- // Mailto link clicked.
- _paq.push(["trackEvent", "Mails", "Click", this.href.substring(7)]);
- }
-
- });
- });
-
- // Colorbox: This event triggers when the transition has completed and the
- // newly loaded content has been revealed.
- if (drupalSettings.piwik.trackColorbox) {
- $(document).bind("cbox_complete", function () {
- var href = $.colorbox.element().attr("href");
- if (href) {
- _paq.push(["setCustomUrl", href]);
- _paq.push(["trackPageView"]);
- }
- });
- }
-
- });
-
-})(jQuery, drupalSettings);
diff --git a/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_settings.yml b/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_settings.yml
deleted file mode 100644
index 03777c171..000000000
--- a/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_settings.yml
+++ /dev/null
@@ -1,68 +0,0 @@
-id: d6_piwik_settings
-label: Piwik 6 configuration
-migration_tags:
- - Drupal 6
-source:
- plugin: variable
- variables:
- - piwik_cache
- - piwik_codesnippet_after
- - piwik_codesnippet_before
- - piwik_custom
- - piwik_domain_mode
- - piwik_pages
- - piwik_privacy_donottrack
- - piwik_roles
- - piwik_site_id
- - piwik_site_search
- - piwik_trackmessages
- - piwik_track
- - piwik_trackfiles_extensions
- - piwik_trackmailto
- - piwik_trackuserid
- - piwik_translation_set
- - piwik_url_http
- - piwik_url_https
- - piwik_visibility_pages
- - piwik_visibility_roles
- - piwik_page_title_hierarchy
- - piwik_page_title_hierarchy_exclude_home
-process:
- cache: piwik_cache
- 'codesnippet/after': piwik_codesnippet_after
- 'codesnippet/before': piwik_codesnippet_before
- domain_mode: piwik_domain_mode
- 'privacy/donottrack': piwik_privacy_donottrack
- site_id: piwik_site_id
- 'track/files': piwik_track
- 'track/files_extensions': piwik_trackfiles_extensions
- 'track/mailto': piwik_trackmailto
- 'track/messages': piwik_trackmessages
- 'track/site_search': piwik_site_search
- 'track/userid': piwik_trackuserid
- 'translation_set': piwik_translation_set
- url_http: piwik_url_http
- url_https: piwik_url_https
- 'visibility/user_account_mode': piwik_custom
- 'visibility/request_path_mode': piwik_visibility_pages
- 'visibility/request_path_pages':
- plugin: piwik_visibility_pages
- source:
- - piwik_visibility_pages
- - piwik_pages
- # If Piwik uses PHP visibility, don't migrate it unless the PHP module is
- # enabled.
- skip_php: true
- 'visibility/user_role_mode': piwik_visibility_roles
- 'visibility/user_role_roles':
- plugin: piwik_visibility_roles
- source:
- - piwik_roles
- page_title_hierarchy: piwik_page_title_hierarchy
- page_title_hierarchy_exclude_home: piwik_page_title_hierarchy_exclude_home
-destination:
- plugin: config
- config_name: piwik.settings
-migration_dependencies:
- optional:
- - d6_user_role
diff --git a/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_user_settings.yml b/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_user_settings.yml
deleted file mode 100644
index 1d2120239..000000000
--- a/sites/all/modules/contrib/admin/piwik/migration_templates/d6_piwik_user_settings.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-id: d6_piwik_user_settings
-label: Piwik user settings
-migration_tags:
- - Drupal 6
-source:
- plugin: d6_user
- constants:
- key: user_account_users
- module: piwik
-process:
- uid: uid
- key: 'constants/key'
- module: 'constants/module'
- settings:
- # Based on skip_row_if_not_set
- plugin: piwik_skip_row_if_not_set
- key: custom
- module: piwik
- source: data
-destination:
- plugin: user_data
-migration_dependencies:
- required:
- - d6_user
diff --git a/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_settings.yml b/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_settings.yml
deleted file mode 100644
index 28e70388b..000000000
--- a/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_settings.yml
+++ /dev/null
@@ -1,75 +0,0 @@
-id: d7_piwik_settings
-label: Piwik 7 configuration
-migration_tags:
- - Drupal 7
-source:
- plugin: variable
- variables:
- - piwik_cache
- - piwik_codesnippet_after
- - piwik_codesnippet_before
- - piwik_custom
- - piwik_custom_var
- - piwik_domain_mode
- - piwik_pages
- - piwik_privacy_donottrack
- - piwik_roles
- - piwik_site_id
- - piwik_site_search
- - piwik_track
- - piwik_trackcolorbox
- - piwik_trackfiles_extensions
- - piwik_trackmailto
- - piwik_trackmessages
- - piwik_trackuserid
- - piwik_translation_set
- - piwik_url_http
- - piwik_url_https
- - piwik_visibility_pages
- - piwik_visibility_roles
- - piwik_page_title_hierarchy
- - piwik_page_title_hierarchy_exclude_home
-process:
- cache: piwik_cache
- 'codesnippet/after': piwik_codesnippet_after
- 'codesnippet/before': piwik_codesnippet_before
- 'custom/variable':
- plugin: piwik_custom_vars
- source:
- - piwik_custom_var
- domain_mode: piwik_domain_mode
- 'privacy/donottrack': piwik_privacy_donottrack
- site_id: piwik_site_id
- 'track/colorbox': piwik_trackcolorbox
- 'track/files': piwik_track
- 'track/files_extensions': piwik_trackfiles_extensions
- 'track/mailto': piwik_trackmailto
- 'track/messages': piwik_trackmessages
- 'track/site_search': piwik_site_search
- 'track/userid': piwik_trackuserid
- 'translation_set': piwik_translation_set
- url_http: piwik_url_http
- url_https: piwik_url_https
- 'visibility/user_account_mode': piwik_custom
- 'visibility/request_path_mode': piwik_visibility_pages
- 'visibility/request_path_pages':
- plugin: piwik_visibility_pages
- source:
- - piwik_visibility_pages
- - piwik_pages
- # If Piwik uses PHP visibility, don't migrate it unless the PHP module is
- # enabled.
- skip_php: true
- 'visibility/user_role_mode': piwik_visibility_roles
- 'visibility/user_role_roles':
- plugin: piwik_visibility_roles
- source:
- - piwik_roles
- page_title_hierarchy: piwik_page_title_hierarchy
- page_title_hierarchy_exclude_home: piwik_page_title_hierarchy_exclude_home
-destination:
- plugin: config
- config_name: piwik.settings
-migration_dependencies:
- optional:
- - d7_user_role
diff --git a/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_user_settings.yml b/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_user_settings.yml
deleted file mode 100644
index f62a1a4bb..000000000
--- a/sites/all/modules/contrib/admin/piwik/migration_templates/d7_piwik_user_settings.yml
+++ /dev/null
@@ -1,24 +0,0 @@
-id: d7_piwik_user_settings
-label: Piwik user settings
-migration_tags:
- - Drupal 7
-source:
- plugin: d7_user
- constants:
- key: user_account_users
- module: piwik
-process:
- uid: uid
- key: 'constants/key'
- module: 'constants/module'
- settings:
- # Based on skip_row_if_not_set
- plugin: piwik_skip_row_if_not_set
- key: custom
- module: piwik
- source: data
-destination:
- plugin: user_data
-migration_dependencies:
- required:
- - d7_user
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.info.yml b/sites/all/modules/contrib/admin/piwik/piwik.info.yml
deleted file mode 100644
index 8a5bf7f95..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.info.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-name: 'Piwik Web Analytics'
-type: module
-description: "Adds Piwik javascript tracking code to all your site's pages."
-package: Statistics
-# core: 8.x
-configure: piwik.admin_settings_form
-test_dependencies:
- - php:php
- - token:token
-dependencies:
- - matomo
-
-# Information added by Drupal.org packaging script on 2018-06-08
-version: '8.x-1.4'
-core: '8.x'
-project: 'piwik'
-datestamp: 1528483684
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.install b/sites/all/modules/contrib/admin/piwik/piwik.install
deleted file mode 100644
index 08cfbb8b9..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.install
+++ /dev/null
@@ -1,132 +0,0 @@
-moduleExists('matomo')) {
- // https://matomo.org/blog/2018/01/piwik-is-now-matomo/
- $requirements['piwik_matomo_is_installed'] = array(
- 'title' => t('Piwik is now Matomo!'),
- 'value' => t('Fails'),
- 'severity' => REQUIREMENT_ERROR,
- 'description' => t('Piwik has been renamed to Matomo Analytics. Piwik module is blocked now and cannot re-enabled! Please remove piwik module from your system. It is no longer used.'),
- );
- }
- break;
-
- case 'runtime':
- $config = \Drupal::config('piwik.settings');
-
- // Raise warning if Piwik user account has not been set yet.
- if (!preg_match('/^\d{1,}$/', $config->get('site_id'))) {
- $requirements['piwik_site_id'] = [
- 'title' => t('Piwik module'),
- 'description' => t('Piwik module has not been configured yet. Please configure its settings from the Piwik settings page.', [':url' => Url::fromRoute('piwik.admin_settings_form')->toString()]),
- 'severity' => REQUIREMENT_WARNING,
- 'value' => t('Not configured'),
- ];
- }
- break;
- }
-
- return $requirements;
-}
-
-/**
- * Install Matomo module and migrate all settings.
- */
-function piwik_update_8200() {
- // Make the update hook failing so it can re-run later again.
- if (!module_load_include('module', 'matomo', 'matomo')) {
- throw new DrupalUpdateException(t('Matomo module is missing. Download it and re-run update.php'));
- }
-
- $module_enabled = \Drupal::service('module_installer')->install(array('matomo'));
- if ($module_enabled) {
- $messages[] = t('Successfully installed matomo module.');
-
- $piwik_config = \Drupal::configFactory()->getEditable('piwik.settings');
- $matomo_config = \Drupal::configFactory()->getEditable('matomo.settings');
- $matomo_config
- ->set('site_id', $piwik_config->get('site_id'))
- ->set('url_http', $piwik_config->get('url_http'))
- ->set('url_https', $piwik_config->get('url_https'))
- ->set('codesnippet.before', $piwik_config->get('codesnippet.before'))
- ->set('codesnippet.after', $piwik_config->get('codesnippet.after'))
- ->set('custom.variable', $piwik_config->get('custom.variable'))
- ->set('domain_mode', $piwik_config->get('domain_mode'))
- ->set('track.files', $piwik_config->get('track.files'))
- ->set('track.files_extensions', $piwik_config->get('track.files_extensions'))
- ->set('track.colorbox', $piwik_config->get('track.colorbox'))
- ->set('track.userid', $piwik_config->get('track.userid'))
- ->set('track.mailto', $piwik_config->get('track.mailto'))
- ->set('track.messages', $piwik_config->get('track.messages'))
- ->set('track.site_search', $piwik_config->get('track.site_search'))
- ->set('translation_set', $piwik_config->get('translation_set'))
- ->set('privacy.donottrack', $piwik_config->get('privacy.donottrack'))
- ->set('cache', $piwik_config->get('cache'))
- ->set('visibility.request_path_mode', $piwik_config->get('visibility.request_path_mode'))
- ->set('visibility.request_path_pages', $piwik_config->get('visibility.request_path_pages'))
- ->set('visibility.user_account_mode', $piwik_config->get('visibility.user_account_mode'))
- ->set('visibility.user_role_mode', $piwik_config->get('visibility.user_role_mode'))
- ->set('visibility.user_role_roles', $piwik_config->get('visibility.user_role_roles'))
- ->save();
- $messages[] = t('Copied settings from piwik to matomo module.');
-
- // Migrate piwik permissions to matomo.
- $permissions = array(
- 'administer piwik' => 'administer matomo',
- 'opt-in or out of piwik tracking' => 'opt-in or out of matomo tracking',
- 'use PHP for piwik tracking visibility' => 'use php for matomo tracking visibility',
- 'add JS snippets for piwik' => 'add js snippets for matomo',
- );
- foreach (user_roles(FALSE) as $rid => $name) {
- $role = \Drupal\user\Entity\Role::load($rid);
- foreach ($permissions as $permission_old_key => $permission_new_key) {
- if ($role->hasPermission($permission_old_key)) {
- $role->grantPermission($permission_new_key);
- $messages[] = t('Role "@rid" has permission "@permission_old_key" and "@permission_new_key" granted.', array('@rid' => $rid, '@permission_old_key' => $permission_old_key, '@permission_new_key' => $permission_new_key));
- }
- }
- $role->save();
- }
- $messages[] = t('Copied piwik permissions to matomo module.');
-
- // Uninstall piwik module.
- $module_uninstalled = \Drupal::service('module_installer')->uninstall(array('piwik'), FALSE);
- if ($module_uninstalled) {
- $messages[] = t('Successfully uninstalled piwik module. Please remove piwik from your system.');
- drupal_set_message('Piwik is now Matomo! Matomo has been installed. Please remove Piwik module from your system.', 'warning');
- }
- else {
- $messages[] = t('FAILED to uninstall piwik module.');
-
- // Unconfigure piwik to remove piwik tracking code; if piwik module may failed to disable.
- $piwik_config->set('site_id', '');
- $messages[] = t('Unconfigured site_id in piwik module to disable double tracking.');
- }
- }
-
- return empty($messages) ? t('FAILED to migrate piwik to matomo module. Please uninstall piwik module and install matomo module manually!') : implode(' ', $messages);
-}
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.libraries.yml b/sites/all/modules/contrib/admin/piwik/piwik.libraries.yml
deleted file mode 100644
index 3d9dfd9b6..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.libraries.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-piwik:
- version: VERSION
- js:
- js/piwik.js: {}
- dependencies:
- - core/jquery
- - core/drupalSettings
-
-piwik.admin:
- version: VERSION
- js:
- js/piwik.admin.js: {}
- dependencies:
- - core/jquery
- - core/drupal
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.links.menu.yml b/sites/all/modules/contrib/admin/piwik/piwik.links.menu.yml
deleted file mode 100644
index 954821cb8..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.links.menu.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-piwik.admin_settings_form:
- title: 'Piwik'
- parent: system.admin_config_system
- description: 'Configure the settings used to generate your Piwik tracking code.'
- route_name: piwik.admin_settings_form
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.links.task.yml b/sites/all/modules/contrib/admin/piwik/piwik.links.task.yml
deleted file mode 100644
index cfce6be59..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.links.task.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-piwik.admin_settings_form_tab:
- route_name: piwik.admin_settings_form
- title: Settings
- base_route: piwik.admin_settings_form
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.module b/sites/all/modules/contrib/admin/piwik/piwik.module
deleted file mode 100644
index 18dd4b3e5..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.module
+++ /dev/null
@@ -1,727 +0,0 @@
-
- */
-
-use Drupal\Component\Serialization\Json;
-use Drupal\Component\Utility\Crypt;
-use Drupal\Component\Utility\Unicode;
-use Drupal\Component\Utility\UrlHelper;
-use Drupal\Core\Cache\Cache;
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\Core\Site\Settings;
-use Drupal\Core\Url;
-use Drupal\node\NodeInterface;
-use GuzzleHttp\Exception\RequestException;
-use Drupal\piwik\Component\Render\PiwikJavaScriptSnippet;
-
-/**
- * Define the default file extension list that should be tracked as download.
- */
-define('PIWIK_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc(x|m)?|dot(x|m)?|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt(x|m)?|pot(x|m)?|pps(x|m)?|ppam|sld(x|m)?|thmx|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls(x|m|b)?|xlt(x|m)|xlam|xml|z|zip');
-
-/**
- * Implements hook_help().
- */
-function piwik_help($route_name, RouteMatchInterface $route_match) {
- switch ($route_name) {
- case 'piwik.admin_settings_form':
- return t('Piwik - Web analytics is an open source (GPL license) web analytics software. It gives interesting reports on your website visitors, your popular pages, the search engines keywords they used, the language they speak... and so much more. Piwik aims to be an open source alternative to Google Analytics.', [':pk_url' => 'http://www.piwik.org/']);
- }
-}
-
-/**
- * Implements hook_page_attachments().
- *
- * Insert JavaScript to the appropriate scope/region of the page.
- */
-function piwik_page_attachments(array &$page) {
- $account = \Drupal::currentUser();
- $config = \Drupal::config('piwik.settings');
- $id = $config->get('site_id');
- $request = \Drupal::request();
-
- // Add module cache tags.
- $page['#cache']['tags'] = Cache::mergeTags(isset($page['#cache']['tags']) ? $page['#cache']['tags'] : [], $config->getCacheTags());
-
- // Get page http status code for visibility filtering.
- $status = NULL;
- if ($exception = $request->attributes->get('exception')) {
- $status = $exception->getStatusCode();
- }
- $trackable_status_codes = [
- // "Forbidden" status code.
- '403',
- // "Not Found" status code.
- '404',
- ];
-
- // 1. Check if the piwik account number has a valid value.
- // 2. Track page views based on visibility value.
- // 3. Check if we should track the currently active user's role.
- if (preg_match('/^\d{1,}$/', $id) && (_piwik_visibility_pages() || in_array($status, $trackable_status_codes)) && _piwik_visibility_user($account)) {
-
- $url_http = $config->get('url_http');
- $url_https = $config->get('url_https');
-
- $set_custom_url = '';
- $set_document_title = '';
- $set_custom_data = [];
-
- // Add link tracking.
- $link_settings = [];
- $link_settings['trackMailto'] = $config->get('track.mailto');
-
- if ((\Drupal::moduleHandler()->moduleExists('colorbox')) && $track_colorbox = $config->get('track.colorbox')) {
- $link_settings['trackColorbox'] = $track_colorbox;
- }
-
- $page['#attached']['drupalSettings']['piwik'] = $link_settings;
- $page['#attached']['library'][] = 'piwik/piwik';
-
- // Piwik can show a tree view of page titles that represents the site
- // structure if setDocumentTitle() provides the page titles as a "/"
- // delimited list. This may makes it easier to browse through the statistics
- // of page titles on larger sites.
- if ($config->get('page_title_hierarchy') == TRUE) {
- $titles = _piwik_get_hierarchy_titles();
-
- // Remove all empty titles.
- $titles = array_filter($titles);
-
- if (!empty($titles)) {
- // Encode title, at least to keep "/" intact.
- $titles = array_map('rawurlencode', $titles);
-
- $set_document_title = Json::encode(implode('/', $titles));
- }
- }
-
- // Add messages tracking.
- $message_events = '';
- if ($message_types = $config->get('track.messages')) {
- $message_types = array_values(array_filter($message_types));
- $status_heading = [
- 'status' => t('Status message'),
- 'warning' => t('Warning message'),
- 'error' => t('Error message'),
- ];
-
- foreach (drupal_get_messages(NULL, FALSE) as $type => $messages) {
- // Track only the selected message types.
- if (in_array($type, $message_types)) {
- foreach ($messages as $message) {
- $message_events .= '_paq.push(["trackEvent", ' . Json::encode(t('Messages')) . ', ' . Json::encode($status_heading[$type]) . ', ' . Json::encode(strip_tags($message)) . ']);';
- }
- }
- }
- }
-
- // If this node is a translation of another node, pass the original
- // node instead.
- if (\Drupal::moduleHandler()->moduleExists('content_translation') && $config->get('translation_set')) {
- // Check if we have a node object, it has translation enabled, and its
- // language code does not match its source language code.
- if ($request->attributes->has('node')) {
- $node = $request->attributes->get('node');
- if ($node instanceof NodeInterface && \Drupal::service('entity.repository')->getTranslationFromContext($node) !== $node->getUntranslated()) {
- $set_custom_url = Json::encode(Url::fromRoute('entity.node.canonical', ['node' => $node->id()], ['language' => $node->getUntranslated()->language()])->toString());
- }
- }
- }
-
- // Track access denied (403) and file not found (404) pages.
- if ($status == '403') {
- $set_document_title = '"403/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)';
- }
- elseif ($status == '404') {
- $set_document_title = '"404/URL = " + encodeURIComponent(document.location.pathname+document.location.search) + "/From = " + encodeURIComponent(document.referrer)';
- }
-
- // #2693595: User has entered an invalid login and clicked on forgot
- // password link. This link contains the username or email address and may
- // get send to Google if we do not override it. Override only if 'name'
- // query param exists. Last custom url condition, this need to win.
- //
- // URLs to protect are:
- // - user/password?name=username
- // - user/password?name=foo@example.com
- if (\Drupal::routeMatch()->getRouteName() == 'user.pass' && $request->query->has('name')) {
- $set_custom_url = Json::encode(Url::fromRoute('user.pass')->toString());
- }
-
- // Add custom variables.
- $piwik_custom_vars = $config->get('custom.variable');
- $custom_variable = '';
- for ($i = 1; $i < 6; $i++) {
- $custom_var_name = !empty($piwik_custom_vars[$i]['name']) ? $piwik_custom_vars[$i]['name'] : '';
- if (!empty($custom_var_name)) {
- $custom_var_value = !empty($piwik_custom_vars[$i]['value']) ? $piwik_custom_vars[$i]['value'] : '';
- $custom_var_scope = !empty($piwik_custom_vars[$i]['scope']) ? $piwik_custom_vars[$i]['scope'] : 'visit';
-
- $types = [];
- if ($request->attributes->has('node')) {
- $node = $request->attributes->get('node');
- if ($node instanceof NodeInterface) {
- $types += ['node' => $node];
- }
- }
- $custom_var_name = \Drupal::token()->replace($custom_var_name, $types, ['clear' => TRUE]);
- $custom_var_value = \Drupal::token()->replace($custom_var_value, $types, ['clear' => TRUE]);
-
- // Suppress empty custom names and/or variables.
- if (!Unicode::strlen(trim($custom_var_name)) || !Unicode::strlen(trim($custom_var_value))) {
- continue;
- }
-
- // Custom variables names and values are limited to 200 characters in
- // length. It is recommended to store values that are as small as
- // possible to ensure that the Piwik Tracking request URL doesn't go
- // over the URL limit for the webserver or browser.
- $custom_var_name = rtrim(substr($custom_var_name, 0, 200));
- $custom_var_value = rtrim(substr($custom_var_value, 0, 200));
-
- // Add variables to tracker.
- $custom_variable .= '_paq.push(["setCustomVariable", ' . Json::encode($i) . ', ' . Json::encode($custom_var_name) . ', ' . Json::encode($custom_var_value) . ', ' . Json::encode($custom_var_scope) . ']);';
- }
- }
-
- // Add any custom code snippets if specified.
- $codesnippet_before = $config->get('codesnippet.before');
- $codesnippet_after = $config->get('codesnippet.after');
-
- // Build tracker code.
- // @see http://piwik.org/docs/javascript-tracking/#toc-asynchronous-tracking
- $script = 'var _paq = _paq || [];';
- $script .= '(function(){';
- $script .= 'var u=(("https:" == document.location.protocol) ? "' . UrlHelper::filterBadProtocol($url_https) . '" : "' . UrlHelper::filterBadProtocol($url_http) . '");';
- $script .= '_paq.push(["setSiteId", ' . Json::encode($id) . ']);';
- $script .= '_paq.push(["setTrackerUrl", u+"piwik.php"]);';
-
- // Track logged in users across all devices.
- if ($config->get('track.userid') && $account->isAuthenticated()) {
- $script .= '_paq.push(["setUserId", ' . Json::encode(piwik_user_id_hash($account->id())) . ']);';
- }
-
- // Set custom data.
- if (!empty($set_custom_data)) {
- foreach ($set_custom_data as $custom_data) {
- $script .= '_paq.push(["setCustomData", ' . $custom_data . ']);';
- }
- }
- // Set custom url.
- if (!empty($set_custom_url)) {
- $script .= '_paq.push(["setCustomUrl", ' . $set_custom_url . ']);';
- }
- // Set custom document title.
- if (!empty($set_document_title)) {
- $script .= '_paq.push(["setDocumentTitle", ' . $set_document_title . ']);';
- }
-
- // Custom file download extensions.
- if ($config->get('track.files') && !($config->get('track.files_extensions') == PIWIK_TRACKFILES_EXTENSIONS)) {
- $script .= '_paq.push(["setDownloadExtensions", ' . Json::encode($config->get('track.files_extensions')) . ']);';
- }
-
- // Disable tracking for visitors who have opted out from tracking via DNT
- // (Do-Not-Track) header.
- if ($config->get('privacy.donottrack')) {
- $script .= '_paq.push(["setDoNotTrack", 1]);';
- }
-
- // Domain tracking type.
- global $cookie_domain;
- $domain_mode = $config->get('domain_mode');
-
- // Per RFC 2109, cookie domains must contain at least one dot other than the
- // first. For hosts such as 'localhost' or IP Addresses we don't set a
- // cookie domain.
- if ($domain_mode == 1 && count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
- $script .= '_paq.push(["setCookieDomain", ' . Json::encode($cookie_domain) . ']);';
- }
-
- // Ordering $custom_variable before $codesnippet_before allows users to add
- // custom code snippets that may use deleteCustomVariable() and/or
- // getCustomVariable().
- if (!empty($custom_variable)) {
- $script .= $custom_variable;
- }
- if (!empty($codesnippet_before)) {
- $script .= $codesnippet_before;
- }
-
- // Site search tracking support.
- // NOTE: It's recommended not to call trackPageView() on the Site Search
- // Result page.
- if (\Drupal::moduleHandler()->moduleExists('search') && $config->get('track.site_search') && (strpos(\Drupal::routeMatch()->getRouteName(), 'search.view') === 0) && $keys = ($request->query->has('keys') ? trim($request->get('keys')) : '')) {
- // Parameters:
- // 1. Search keyword searched for. Example: "Banana"
- // 2. Search category selected in your search engine. If you do not need
- // this, set to false. Example: "Organic Food"
- // 3. Number of results on the Search results page. Zero indicates a
- // 'No Result Search Keyword'. Set to false if you don't know.
- //
- // hook_preprocess_search_results() is not executed if search result is
- // empty. Make sure the counter is set to 0 if there are no results.
- $script .= '_paq.push(["trackSiteSearch", ' . Json::encode($keys) . ', false, (window.piwik_search_results) ? window.piwik_search_results : 0]);';
- }
- else {
- $script .= '_paq.push(["trackPageView"]);';
- }
-
- // Add link tracking.
- if ($config->get('track.files')) {
- // Disable tracking of links with ".no-tracking" and ".colorbox" classes.
- $ignore_classes = [
- 'no-tracking',
- 'colorbox',
- ];
- // Disable the download & outlink tracking for specific CSS classes.
- // Custom code snippets with 'setIgnoreClasses' will override the value.
- // @see http://developer.piwik.org/api-reference/tracking-javascript#disable-the-download-amp-outlink-tracking-for-specific-css-classes
- $script .= '_paq.push(["setIgnoreClasses", ' . Json::encode($ignore_classes) . ']);';
-
- // Enable download & outlink link tracking.
- $script .= '_paq.push(["enableLinkTracking"]);';
- }
-
- if (!empty($message_events)) {
- $script .= $message_events;
- }
- if (!empty($codesnippet_after)) {
- $script .= $codesnippet_after;
- }
-
- $script .= 'var d=document,';
- $script .= 'g=d.createElement("script"),';
- $script .= 's=d.getElementsByTagName("script")[0];';
- $script .= 'g.type="text/javascript";';
- $script .= 'g.defer=true;';
- $script .= 'g.async=true;';
-
- // Should a local cached copy of the tracking code be used?
- if ($config->get('cache') && $url = _piwik_cache($url_http . 'piwik.js')) {
- // A dummy query-string is added to filenames, to gain control over
- // browser-caching. The string changes on every update or full cache
- // flush, forcing browsers to load a new copy of the files, as the
- // URL changed.
- $query_string = '?' . (\Drupal::state()->get('system.css_js_query_string') ?: '0');
-
- $script .= 'g.src="' . $url . $query_string . '";';
- }
- else {
- $script .= 'g.src=u+"piwik.js";';
- }
-
- $script .= 's.parentNode.insertBefore(g,s);';
- $script .= '})();';
-
- // Add tracker code.
- $page['#attached']['html_head'][] = [
- [
- '#tag' => 'script',
- '#value' => new PiwikJavaScriptSnippet($script),
- ],
- 'piwik_tracking_script',
- ];
- }
-}
-
-/**
- * Generate user id hash to implement USER_ID.
- *
- * The USER_ID value should be a unique, persistent, and non-personally
- * identifiable string identifier that represents a user or signed-in
- * account across devices.
- *
- * @param int $uid
- * User id.
- *
- * @return string
- * User id hash.
- */
-function piwik_user_id_hash($uid) {
- return Crypt::hmacBase64($uid, \Drupal::service('private_key')->get() . Settings::getHashSalt());
-}
-
-/**
- * Implements hook_entity_extra_field_info().
- */
-function piwik_entity_extra_field_info() {
- $extra['user']['user']['form']['piwik'] = [
- 'label' => t('Piwik settings'),
- 'description' => t('Piwik module form element.'),
- 'weight' => 3,
- ];
-
- return $extra;
-}
-
-/**
- * Implements hook_form_FORM_ID_alter().
- *
- * Allow users to decide if tracking code will be added to pages or not.
- */
-function piwik_form_user_form_alter(&$form, FormStateInterface $form_state) {
- $config = \Drupal::config('piwik.settings');
- $account = $form_state->getFormObject()->getEntity();
-
- if ($account->hasPermission('opt-in or out of piwik tracking') && ($visibility_users = $config->get('visibility.user_account_mode')) != 0 && _piwik_visibility_roles($account)) {
- $account_data_piwik = \Drupal::service('user.data')->get('piwik', $account->id());
-
- $form['piwik'] = [
- '#type' => 'details',
- '#title' => t('Piwik settings'),
- '#weight' => 3,
- '#open' => TRUE,
- ];
-
- switch ($visibility_users) {
- case 1:
- $description = t('Users are tracked by default, but you are able to opt out.');
- break;
-
- case 2:
- $description = t('Users are not tracked by default, but you are able to opt in.');
- break;
- }
-
- // Disable tracking for visitors who have opted out from tracking via DNT
- // (Do-Not-Track) header.
- $disabled = FALSE;
- if ($config->get('privacy.donottrack') && !empty($_SERVER['HTTP_DNT'])) {
- $disabled = TRUE;
-
- // Override settings value.
- $account_data_piwik['users'] = FALSE;
-
- $description .= '';
- $description .= ' ' . t('You have opted out from tracking via browser privacy settings.');
- $description .= '';
- }
-
- $form['piwik']['user_account_users'] = [
- '#type' => 'checkbox',
- '#title' => t('Enable user tracking'),
- '#description' => $description,
- '#default_value' => isset($account_data_piwik['user_account_users']) ? $account_data_piwik['user_account_users'] : ($visibility_users == 1),
- '#disabled' => $disabled,
- ];
-
- // hook_user_update() is missing in D8, add custom submit handler.
- $form['actions']['submit']['#submit'][] = 'piwik_user_profile_form_submit';
- }
-}
-
-/**
- * Submit callback for user profile form to save the Piwik setting.
- */
-function piwik_user_profile_form_submit($form, FormStateInterface $form_state) {
- $account = $form_state->getFormObject()->getEntity();
- if ($account->id() && $form_state->hasValue('user_account_users')) {
- \Drupal::service('user.data')->set('piwik', $account->id(), 'user_account_users', (int) $form_state->getValue('user_account_users'));
- }
-}
-
-/**
- * Implements hook_cron().
- */
-function piwik_cron() {
- $config = \Drupal::config('piwik.settings');
-
- // Regenerate the piwik.js every day.
- if (REQUEST_TIME - \Drupal::state()->get('piwik.last_cache') >= 86400 && $config->get('cache')) {
- _piwik_cache($config->get('url_http') . 'piwik.js', TRUE);
- \Drupal::state()->set('piwik.last_cache', REQUEST_TIME);
- }
-}
-
-/**
- * Implements hook_preprocess_item_list__search_results().
- *
- * Collects and adds the number of search results to the head.
- */
-function piwik_preprocess_item_list__search_results(&$variables) {
- $config = \Drupal::config('piwik.settings');
-
- // Only run on search results list.
- if ($config->get('track.site_search')) {
- // There is no search result $variable available that hold the number of
- // items found. The variable $variables['items'] has the current page items
- // only. But the pager item mumber can tell the number of search results.
- global $pager_total_items;
-
- $variables['#attached']['html_head'][] = [
- [
- '#tag' => 'script',
- '#value' => 'window.piwik_search_results = ' . intval($pager_total_items[0]) . ';',
- '#weight' => JS_LIBRARY - 1,
- ],
- 'piwik_search_script',
- ];
- }
-}
-
-/**
- * Download/Synchronize/Cache tracking code file locally.
- *
- * @param string $location
- * The full URL to the external javascript file.
- * @param bool $synchronize
- * Synchronize to local cache if remote file has changed.
- *
- * @return mixed
- * The path to the local javascript file on success, boolean FALSE on failure.
- */
-function _piwik_cache($location, $synchronize = FALSE) {
- $path = 'public://piwik';
- $file_destination = $path . '/' . basename($location);
-
- if (!file_exists($file_destination) || $synchronize) {
- // Download the latest tracking code.
- try {
- $data = \Drupal::httpClient()
- ->get($location)
- ->getBody(TRUE);
-
- if (file_exists($file_destination)) {
- // Synchronize tracking code and and replace local file if outdated.
- $data_hash_local = Crypt::hashBase64(file_get_contents($file_destination));
- $data_hash_remote = Crypt::hashBase64($data);
- // Check that the files directory is writable.
- if ($data_hash_local != $data_hash_remote && file_prepare_directory($path)) {
- // Save updated tracking code file to disk.
- file_unmanaged_save_data($data, $file_destination, FILE_EXISTS_REPLACE);
- // Based on Drupal Core class AssetDumper.
- if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) {
- file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE);
- }
- \Drupal::logger('piwik')->info('Locally cached tracking code file has been updated.');
-
- // Change query-strings on css/js files to enforce reload for all
- // users.
- _drupal_flush_css_js();
- }
- }
- else {
- // Check that the files directory is writable.
- if (file_prepare_directory($path, FILE_CREATE_DIRECTORY)) {
- // There is no need to flush JS here as core refreshes JS caches
- // automatically, if new files are added.
- file_unmanaged_save_data($data, $file_destination, FILE_EXISTS_REPLACE);
- // Based on Drupal Core class AssetDumper.
- if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) {
- file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE);
- }
- \Drupal::logger('piwik')->info('Locally cached tracking code file has been saved.');
-
- // Return the local JS file path.
- return file_url_transform_relative(file_create_url($file_destination));
- }
- }
- }
- catch (RequestException $exception) {
- watchdog_exception('piwik', $exception);
- }
- }
- else {
- // Return the local JS file path.
- return file_url_transform_relative(file_create_url($file_destination));
- }
-}
-
-/**
- * Delete cached files and directory.
- */
-function piwik_clear_js_cache() {
- $path = 'public://piwik';
- if (file_prepare_directory($path)) {
- file_scan_directory($path, '/.*/', ['callback' => 'file_unmanaged_delete']);
- \Drupal::service('file_system')->rmdir($path);
-
- // Change query-strings on css/js files to enforce reload for all users.
- _drupal_flush_css_js();
-
- \Drupal::logger('piwik')->info('Local cache has been purged.');
- }
-}
-
-/**
- * Tracking visibility check for an user object.
- *
- * @param object $account
- * A user object containing an array of roles to check.
- *
- * @return bool
- * TRUE if the current user is being tracked by Piwik, otherwise FALSE.
- */
-function _piwik_visibility_user($account) {
- $config = \Drupal::config('piwik.settings');
- $enabled = FALSE;
-
- // Is current user a member of a role that should be tracked?
- if (_piwik_visibility_roles($account)) {
-
- // Use the user's block visibility setting, if necessary.
- if (($visibility_user_account_mode = $config->get('visibility.user_account_mode')) != 0) {
- $user_data_piwik = \Drupal::service('user.data')->get('piwik', $account->id());
- if ($account->id() && isset($user_data_piwik['user_account_users'])) {
- $enabled = $user_data_piwik['user_account_users'];
- }
- else {
- $enabled = ($visibility_user_account_mode == 1);
- }
- }
- else {
- $enabled = TRUE;
- }
-
- }
-
- return $enabled;
-}
-
-/**
- * Tracking visibility check for user roles.
- *
- * Based on visibility setting this function returns TRUE if Piwik code should
- * be added for the current role and otherwise FALSE.
- *
- * @param object $account
- * A user object containing an array of roles to check.
- *
- * @return bool
- * TRUE if JS code should be added for the current role and otherwise FALSE.
- */
-function _piwik_visibility_roles($account) {
- $config = \Drupal::config('piwik.settings');
- $enabled = $visibility_user_role_mode = $config->get('visibility.user_role_mode');
- $user_role_roles = $config->get('visibility.user_role_roles');
-
- if (count($user_role_roles) > 0) {
- // One or more roles are selected.
- foreach (array_values($account->getRoles()) as $user_role) {
- // Is the current user a member of one of these roles?
- if (in_array($user_role, $user_role_roles)) {
- // Current user is a member of a role that should be tracked/excluded
- // from tracking.
- $enabled = !$visibility_user_role_mode;
- break;
- }
- }
- }
- else {
- // No role is selected for tracking, therefore all roles should be tracked.
- $enabled = TRUE;
- }
-
- return $enabled;
-}
-
-/**
- * Tracking visibility check for pages.
- *
- * Based on visibility setting this function returns TRUE if JS code should
- * be added to the current page and otherwise FALSE.
- */
-function _piwik_visibility_pages() {
- static $page_match;
-
- // Cache visibility result if function is called more than once.
- if (!isset($page_match)) {
- $config = \Drupal::config('piwik.settings');
- $visibility_request_path_mode = $config->get('visibility.request_path_mode');
- $visibility_request_path_pages = $config->get('visibility.request_path_pages');
-
- // Match path if necessary.
- if (!empty($visibility_request_path_pages)) {
- // Convert path to lowercase. This allows comparison of the same path
- // with different case. Ex: /Page, /page, /PAGE.
- $pages = Unicode::strtolower($visibility_request_path_pages);
- if ($visibility_request_path_mode < 2) {
- // Compare the lowercase path alias (if any) and internal path.
- $path = \Drupal::service('path.current')->getPath();
- $path_alias = Unicode::strtolower(\Drupal::service('path.alias_manager')->getAliasByPath($path));
- $page_match = \Drupal::service('path.matcher')->matchPath($path_alias, $pages) || (($path != $path_alias) && \Drupal::service('path.matcher')->matchPath($path, $pages));
- // When $visibility_request_path_mode has a value of 0, the tracking
- // code is displayed on all pages except those listed in $pages. When
- // set to 1, it is displayed only on those pages listed in $pages.
- $page_match = !($visibility_request_path_mode xor $page_match);
- }
- elseif (\Drupal::moduleHandler()->moduleExists('php')) {
- $page_match = php_eval($visibility_request_path_pages);
- }
- else {
- $page_match = FALSE;
- }
- }
- else {
- $page_match = TRUE;
- }
-
- }
- return $page_match;
-}
-
-/**
- * Get the page titles trail for the current page.
- *
- * Based on menu_get_active_breadcrumb().
- *
- * @return array
- * All page titles, including current page.
- */
-function _piwik_get_hierarchy_titles() {
- $titles = [];
- $path = Url::fromRoute('')->toString();
- $config = \Drupal::config('system.site');
- $piwik_conf = \Drupal::config('piwik.settings');
-
- // No breadcrumb for the front page.
- if (($path === Url::fromUserInput($config->get('page.front'))->toString())) {
- return $titles;
- }
-
- // Load up the menu tree.
- // TODO: Check this is a sane approach.
- $menu_tree = \Drupal::menuTree();
- $menu_name = \Drupal::config('system.menu.main')->get('id');
-
- // Build the typical default set of menu tree parameters.
- $parameters = $menu_tree->getCurrentRouteMenuTreeParameters($menu_name);
-
- // Load the tree based on this set of parameters.
- $tree = $menu_tree->load($menu_name, $parameters);
-
- // Transform the tree using the manipulators.
- $manipulators = [
- // Only show links that are accessible for the current user.
- ['callable' => 'menu.default_tree_manipulators:checkAccess'],
- // Use the default sorting of menu links.
- ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
- // Fatten the menu.
- ['callable' => 'menu.default_tree_manipulators:flatten'],
- ];
- $tree = $menu_tree->transform($tree, $manipulators);
-
- if (!empty($tree)) {
- foreach ($tree as $menu_item) {
- // If the item is in the active trail and we don't have a front page link
- // when we have set to exclude home from the breadcrumbs then add the
- // title.
- if ($menu_item->inActiveTrail && !($piwik_conf->get('page_title_hierarchy_exclude_home') && $menu_item->link->getRouteName() == '')) {
- $titles[] = $menu_item->link->getTitle();
- }
- }
- }
-
- return $titles;
-}
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.permissions.yml b/sites/all/modules/contrib/admin/piwik/piwik.permissions.yml
deleted file mode 100644
index 50cefde64..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.permissions.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-administer piwik:
- title: 'Administer Piwik'
- description: 'Perform maintenance tasks for Piwik.'
-opt-in or out of piwik tracking:
- title: 'Opt-in or out of tracking'
- description: 'Allow users to decide if tracking code will be added to pages or not.'
-use PHP for piwik tracking visibility:
- title: 'Use PHP for tracking visibility'
- description: 'Enter PHP code in the field for tracking visibility settings.'
- restrict access: true
-add JS snippets for piwik:
- title: 'Add JavaScript snippets'
- description: 'Enter JavaScript code snippets for advanced Piwik functionality.'
- restrict access: true
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.routing.yml b/sites/all/modules/contrib/admin/piwik/piwik.routing.yml
deleted file mode 100644
index a3c98a06a..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-piwik.admin_settings_form:
- path: '/admin/config/system/piwik'
- defaults:
- _form: '\Drupal\piwik\Form\PiwikAdminSettingsForm'
- _title: 'Piwik'
- requirements:
- _permission: 'administer piwik'
diff --git a/sites/all/modules/contrib/admin/piwik/piwik.tokens.inc b/sites/all/modules/contrib/admin/piwik/piwik.tokens.inc
deleted file mode 100644
index be6fcad81..000000000
--- a/sites/all/modules/contrib/admin/piwik/piwik.tokens.inc
+++ /dev/null
@@ -1,60 +0,0 @@
- t('User role names'),
- 'description' => t('The role names the user account is a member of as comma separated list.'),
- 'needs-data' => 'user',
- ];
- $user['piwik-role-ids'] = [
- 'name' => t('User role ids'),
- 'description' => t('The role ids the user account is a member of as comma separated list.'),
- 'needs-data' => 'user',
- ];
-
- return [
- 'tokens' => ['user' => $user],
- ];
-}
-
-/**
- * Implements hook_tokens().
- */
-function piwik_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
- $sanitize = !empty($options['sanitize']);
- $replacements = [];
-
- if ($type == 'user' && !empty($data['user'])) {
- $account = $data['user'];
-
- foreach ($tokens as $name => $original) {
- switch ($name) {
- // Basic user account information.
- case 'piwik-role-names':
- $names = implode(',', $account->getRoles());
- $replacements[$original] = $sanitize ? Html::escape($names) : $names;
- $bubbleable_metadata->addCacheableDependency($account);
- break;
-
- case 'piwik-role-ids':
- $ids = implode(',', array_keys($account->getRoles()));
- $replacements[$original] = $sanitize ? Html::escape($ids) : $ids;
- $bubbleable_metadata->addCacheableDependency($account);
- break;
- }
- }
- }
-
- return $replacements;
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Component/Render/PiwikJavaScriptSnippet.php b/sites/all/modules/contrib/admin/piwik/src/Component/Render/PiwikJavaScriptSnippet.php
deleted file mode 100644
index 72f21947b..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Component/Render/PiwikJavaScriptSnippet.php
+++ /dev/null
@@ -1,43 +0,0 @@
-string = (string) $string;
- }
-
- /**
- * {@inheritdoc}
- */
- public function __toString() {
- return $this->string;
- }
-
- /**
- * {@inheritdoc}
- */
- public function jsonSerialize() {
- return $this->__toString();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Form/PiwikAdminSettingsForm.php b/sites/all/modules/contrib/admin/piwik/src/Form/PiwikAdminSettingsForm.php
deleted file mode 100644
index 68e4d3e13..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Form/PiwikAdminSettingsForm.php
+++ /dev/null
@@ -1,717 +0,0 @@
-config('piwik.settings');
-
- $form['general'] = [
- '#type' => 'details',
- '#title' => $this->t('General settings'),
- '#open' => TRUE,
- ];
-
- $form['general']['piwik_site_id'] = [
- '#default_value' => $config->get('site_id'),
- '#description' => $this->t('The user account number is unique to the websites domain. Click the Settings link in your Piwik account, then the Websites tab and enter the appropriate site ID into this field.'),
- '#maxlength' => 20,
- '#required' => TRUE,
- '#size' => 15,
- '#title' => $this->t('Piwik site ID'),
- '#type' => 'textfield',
- ];
- $form['general']['piwik_url_http'] = [
- '#default_value' => $config->get('url_http'),
- '#description' => $this->t('The URL to your Piwik base directory. Example: "http://www.example.com/piwik/".'),
- '#maxlength' => 255,
- '#required' => TRUE,
- '#size' => 80,
- '#title' => $this->t('Piwik HTTP URL'),
- '#type' => 'textfield',
- ];
- $form['general']['piwik_url_https'] = [
- '#default_value' => $config->get('url_https'),
- '#description' => $this->t('The URL to your Piwik base directory with SSL certificate installed. Required if you track a SSL enabled website. Example: "https://www.example.com/piwik/".'),
- '#maxlength' => 255,
- '#size' => 80,
- '#title' => $this->t('Piwik HTTPS URL'),
- '#type' => 'textfield',
- ];
- // Required for automated form save testing only.
- $form['general']['piwik_url_skiperror'] = [
- '#type' => 'hidden',
- '#default_value' => FALSE,
- ];
-
- // Visibility settings.
- $form['tracking_scope'] = [
- '#type' => 'vertical_tabs',
- '#title' => $this->t('Tracking scope'),
- '#attached' => [
- 'library' => [
- 'piwik/piwik.admin',
- ],
- ],
- ];
-
- $form['tracking']['domain_tracking'] = [
- '#type' => 'details',
- '#title' => $this->t('Domains'),
- '#group' => 'tracking_scope',
- ];
-
- global $cookie_domain;
- $multiple_sub_domains = [];
- foreach (['www', 'app', 'shop'] as $subdomain) {
- if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
- $multiple_sub_domains[] = $subdomain . $cookie_domain;
- }
- // IP addresses or localhost.
- else {
- $multiple_sub_domains[] = $subdomain . '.example.com';
- }
- }
-
- $form['tracking']['domain_tracking']['piwik_domain_mode'] = [
- '#type' => 'radios',
- '#title' => $this->t('What are you tracking?'),
- '#options' => [
- 0 => $this->t('A single domain (default)'),
- 1 => $this->t('One domain with multiple subdomains'),
- ],
- 0 => [
- '#description' => $this->t('Domain: @domain', ['@domain' => $_SERVER['HTTP_HOST']]),
- ],
- 1 => [
- '#description' => $this->t('Examples: @domains', ['@domains' => implode(', ', $multiple_sub_domains)]),
- ],
- '#default_value' => $config->get('domain_mode'),
- ];
-
- // Page specific visibility configurations.
- $account = \Drupal::currentUser();
- $php_access = $account->hasPermission('use PHP for piwik tracking visibility');
- $visibility_request_path_pages = $config->get('visibility.request_path_pages');
-
- $form['tracking']['page_visibility_settings'] = [
- '#type' => 'details',
- '#title' => $this->t('Pages'),
- '#group' => 'tracking_scope',
- ];
-
- if ($config->get('visibility.request_path_mode') == 2 && !$php_access) {
- // No permission to change PHP snippets, but keep existing settings.
- $form['tracking']['page_visibility_settings'] = [];
- $form['tracking']['page_visibility_settings']['piwik_visibility_request_path_mode'] = ['#type' => 'value', '#value' => 2];
- $form['tracking']['page_visibility_settings']['piwik_visibility_request_path_pages'] = ['#type' => 'value', '#value' => $visibility_request_path_pages];
- }
- else {
- $options = [
- t('Every page except the listed pages'),
- t('The listed pages only'),
- ];
- $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", ['%blog' => '/blog', '%blog-wildcard' => '/blog/*', '%front' => '']);
-
- if (\Drupal::moduleHandler()->moduleExists('php') && $php_access) {
- $options[] = t('Pages on which this PHP code returns TRUE (experts only)');
- $title = t('Pages or PHP code');
- $description .= ' ' . t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', ['%php' => '']);
- }
- else {
- $title = t('Pages');
- }
- $form['tracking']['page_visibility_settings']['piwik_visibility_request_path_mode'] = [
- '#type' => 'radios',
- '#title' => $this->t('Add tracking to specific pages'),
- '#options' => $options,
- '#default_value' => $config->get('visibility.request_path_mode'),
- ];
- $form['tracking']['page_visibility_settings']['piwik_visibility_request_path_pages'] = [
- '#type' => 'textarea',
- '#title' => $title,
- '#title_display' => 'invisible',
- '#default_value' => !empty($visibility_request_path_pages) ? $visibility_request_path_pages : '',
- '#description' => $description,
- '#rows' => 10,
- ];
- }
-
- // Render the role overview.
- $visibility_user_role_roles = $config->get('visibility.user_role_roles');
-
- $form['tracking']['role_visibility_settings'] = [
- '#type' => 'details',
- '#title' => $this->t('Roles'),
- '#group' => 'tracking_scope',
- ];
-
- $form['tracking']['role_visibility_settings']['piwik_visibility_user_role_mode'] = [
- '#type' => 'radios',
- '#title' => $this->t('Add tracking for specific roles'),
- '#options' => [
- t('Add to the selected roles only'),
- t('Add to every role except the selected ones'),
- ],
- '#default_value' => $config->get('visibility.user_role_mode'),
- ];
- $form['tracking']['role_visibility_settings']['piwik_visibility_user_role_roles'] = [
- '#type' => 'checkboxes',
- '#title' => $this->t('Roles'),
- '#default_value' => !empty($visibility_user_role_roles) ? $visibility_user_role_roles : [],
- '#options' => array_map('\Drupal\Component\Utility\Html::escape', user_role_names()),
- '#description' => $this->t('If none of the roles are selected, all users will be tracked. If a user has any of the roles checked, that user will be tracked (or excluded, depending on the setting above).'),
- ];
-
- // Standard tracking configurations.
- $visibility_user_account_mode = $config->get('visibility.user_account_mode');
-
- $form['tracking']['user_visibility_settings'] = [
- '#type' => 'details',
- '#title' => $this->t('Users'),
- '#group' => 'tracking_scope',
- ];
- $t_permission = ['%permission' => $this->t('opt-in or out of tracking')];
- $form['tracking']['user_visibility_settings']['piwik_visibility_user_account_mode'] = [
- '#type' => 'radios',
- '#title' => $this->t('Allow users to customize tracking on their account page'),
- '#options' => [
- t('No customization allowed'),
- t('Tracking on by default, users with %permission permission can opt out', $t_permission),
- t('Tracking off by default, users with %permission permission can opt in', $t_permission),
- ],
- '#default_value' => !empty($visibility_user_account_mode) ? $visibility_user_account_mode : 0,
- ];
- $form['tracking']['user_visibility_settings']['piwik_trackuserid'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track User ID'),
- '#default_value' => $config->get('track.userid'),
- '#description' => $this->t('User ID enables the analysis of groups of sessions, across devices, using a unique, persistent, and non-personally identifiable ID string representing a user. Learn more about the benefits of using User ID.', [':url' => 'http://piwik.org/docs/user-id/']),
- ];
-
- // Link specific configurations.
- $form['tracking']['linktracking'] = [
- '#type' => 'details',
- '#title' => $this->t('Links and downloads'),
- '#group' => 'tracking_scope',
- ];
- $form['tracking']['linktracking']['piwik_trackmailto'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track clicks on mailto links'),
- '#default_value' => $config->get('track.mailto'),
- ];
- $form['tracking']['linktracking']['piwik_trackfiles'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track clicks on outbound links and downloads (clicks on file links) for the following extensions'),
- '#default_value' => $config->get('track.files'),
- ];
- $form['tracking']['linktracking']['piwik_trackfiles_extensions'] = [
- '#title' => $this->t('List of download file extensions'),
- '#title_display' => 'invisible',
- '#type' => 'textfield',
- '#default_value' => $config->get('track.files_extensions'),
- '#description' => $this->t('A file extension list separated by the | character that will be tracked as download when clicked. Regular expressions are supported. For example: @extensions', ['@extensions' => PIWIK_TRACKFILES_EXTENSIONS]),
- '#maxlength' => 500,
- '#states' => [
- 'enabled' => [
- ':input[name="piwik_trackfiles"]' => ['checked' => TRUE],
- ],
- // Note: Form required marker is not visible as title is invisible.
- 'required' => [
- ':input[name="piwik_trackfiles"]' => ['checked' => TRUE],
- ],
- ],
- ];
-
- $colorbox_dependencies = '
';
-
- $form['tracking']['search']['piwik_site_search'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track internal search'),
- '#description' => $this->t('If checked, internal search keywords are tracked.') . $site_search_dependencies,
- '#default_value' => $config->get('track.site_search'),
- '#disabled' => (\Drupal::moduleHandler()->moduleExists('search') ? FALSE : TRUE),
- ];
-
- // Privacy specific configurations.
- $form['tracking']['privacy'] = [
- '#type' => 'details',
- '#title' => $this->t('Privacy'),
- '#group' => 'tracking_scope',
- ];
- $form['tracking']['privacy']['piwik_privacy_donottrack'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Universal web tracking opt-out'),
- '#description' => $this->t('If enabled and your Piwik server receives the Do-Not-Track header from the client browser, the Piwik server will not track the user. Compliance with Do Not Track could be purely voluntary, enforced by industry self-regulation, or mandated by state or federal law. Please accept your visitors privacy. If they have opt-out from tracking and advertising, you should accept their personal decision.'),
- '#default_value' => $config->get('privacy.donottrack'),
- ];
-
- // Piwik page title tree view settings.
- $form['page_title_hierarchy'] = [
- '#type' => 'details',
- '#title' => $this->t('Page titles hierarchy'),
- '#description' => $this->t('This functionality enables a dynamically expandable tree view of your site page titles in your Piwik statistics. See in Piwik statistics under Actions > Page titles.'),
- '#group' => 'page_title_hierarchy',
- ];
- $form['page_title_hierarchy']['piwik_page_title_hierarchy'] = [
- '#type' => 'checkbox',
- '#title' => $this->t("Show page titles as hierarchy like breadcrumbs"),
- '#description' => $this->t('By default Piwik tracks the current page title and shows you a flat list of the most popular titles. This enables a breadcrumbs like tree view.'),
- '#default_value' => $config->get('page_title_hierarchy'),
- ];
- $form['page_title_hierarchy']['piwik_page_title_hierarchy_exclude_home'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Hide home page from hierarchy'),
- '#description' => $this->t('If enabled, the "Home" item will be removed from the hierarchy to flatten the structure in the Piwik statistics. Hits to the home page will still be counted, but for other pages the hierarchy will start at level Home+1.'),
- '#default_value' => $config->get('page_title_hierarchy_exclude_home'),
- ];
-
- // Custom variables.
- $form['piwik_custom_var'] = [
- '#description' => $this->t('You can add Piwiks Custom Variables here. These will be added to every page that Piwik tracking code appears on. Custom variable names and values are limited to 200 characters in length. Keep the names and values as short as possible and expect long values to get trimmed. You may use tokens in custom variable names and values. Global and user tokens are always available; on node pages, node tokens are also available.', [':custom_var_documentation' => 'http://piwik.org/docs/custom-variables/']),
- '#title' => $this->t('Custom variables'),
- '#tree' => TRUE,
- '#type' => 'details',
- ];
-
- $form['piwik_custom_var']['slots'] = [
- '#type' => 'table',
- '#header' => [
- ['data' => $this->t('Slot')],
- ['data' => $this->t('Name')],
- ['data' => $this->t('Value')],
- ['data' => $this->t('Scope')],
- ],
- ];
-
- $piwik_custom_vars = $config->get('custom.variable');
-
- // Piwik supports up to 5 custom variables.
- for ($i = 1; $i < 6; $i++) {
- $form['piwik_custom_var']['slots'][$i]['slot'] = [
- '#default_value' => $i,
- '#description' => $this->t('Slot number'),
- '#disabled' => TRUE,
- '#size' => 1,
- '#title' => $this->t('Custom variable slot #@slot', ['@slot' => $i]),
- '#title_display' => 'invisible',
- '#type' => 'textfield',
- ];
- $form['piwik_custom_var']['slots'][$i]['name'] = [
- '#default_value' => isset($piwik_custom_vars[$i]['name']) ? $piwik_custom_vars[$i]['name'] : '',
- '#description' => $this->t('The custom variable name.'),
- '#maxlength' => 100,
- '#size' => 20,
- '#title' => $this->t('Custom variable name #@slot', ['@slot' => $i]),
- '#title_display' => 'invisible',
- '#type' => 'textfield',
- ];
- $form['piwik_custom_var']['slots'][$i]['value'] = [
- '#default_value' => isset($piwik_custom_vars[$i]['value']) ? $piwik_custom_vars[$i]['value'] : '',
- '#description' => $this->t('The custom variable value.'),
- '#maxlength' => 255,
- '#title' => $this->t('Custom variable value #@slot', ['@slot' => $i]),
- '#title_display' => 'invisible',
- '#type' => 'textfield',
- '#element_validate' => [[get_class($this), 'tokenElementValidate']],
- '#token_types' => ['node'],
- ];
- if (\Drupal::moduleHandler()->moduleExists('token')) {
- $form['piwik_custom_var']['slots'][$i]['value']['#element_validate'][] = 'token_element_validate';
- }
- $form['piwik_custom_var']['slots'][$i]['scope'] = [
- '#default_value' => isset($piwik_custom_vars[$i]['scope']) ? $piwik_custom_vars[$i]['scope'] : '',
- '#description' => $this->t('The scope for the custom variable.'),
- '#title' => $this->t('Custom variable slot #@slot', ['@slot' => $i]),
- '#title_display' => 'invisible',
- '#type' => 'select',
- '#options' => [
- 'visit' => $this->t('Visit'),
- 'page' => $this->t('Page'),
- ],
- ];
- }
-
- $form['piwik_custom_var']['piwik_custom_var_description'] = [
- '#type' => 'item',
- '#description' => $this->t("You can supplement Piwiks' basic IP address tracking of visitors by segmenting users based on custom variables. Make sure you will not associate (or permit any third party to associate) any data gathered from your websites (or such third parties' websites) with any personally identifying information from any source as part of your use (or such third parties' use) of the Piwik' service."),
- ];
- if (\Drupal::moduleHandler()->moduleExists('token')) {
- $form['piwik_custom_var']['piwik_custom_var_token_tree'] = [
- '#theme' => 'token_tree_link',
- '#token_types' => ['node'],
- ];
- }
-
- // Advanced feature configurations.
- $form['advanced'] = [
- '#type' => 'details',
- '#title' => $this->t('Advanced settings'),
- '#open' => FALSE,
- ];
-
- $form['advanced']['piwik_cache'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Locally cache tracking code file'),
- '#description' => $this->t('If checked, the tracking code file is retrieved from your Piwik site and cached locally. It is updated daily to ensure updates to tracking code are reflected in the local copy.'),
- '#default_value' => $config->get('cache'),
- ];
-
- // Allow for tracking of the originating node when viewing translation sets.
- if (\Drupal::moduleHandler()->moduleExists('content_translation')) {
- $form['advanced']['piwik_translation_set'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Track translation sets as one unit'),
- '#description' => $this->t('When a node is part of a translation set, record statistics for the originating node instead. This allows for a translation set to be treated as a single unit.'),
- '#default_value' => $config->get('translation_set'),
- ];
- }
-
- $user_access_add_js_snippets = !$this->currentUser()->hasPermission('add JS snippets for piwik');
- $user_access_add_js_snippets_permission_warning = $user_access_add_js_snippets ? ' ' . $this->t('This field has been disabled because you do not have sufficient permissions to edit it.') . '' : '';
- $form['advanced']['codesnippet'] = [
- '#type' => 'details',
- '#title' => $this->t('Custom JavaScript code'),
- '#open' => TRUE,
- '#description' => $this->t('You can add custom Piwik code snippets here. These will be added to every page that Piwik appears on. Do not include the <script> tags, and always end your code with a semicolon (;).', [':snippets' => 'http://piwik.org/docs/javascript-tracking/']),
- ];
- $form['advanced']['codesnippet']['piwik_codesnippet_before'] = [
- '#type' => 'textarea',
- '#title' => $this->t('Code snippet (before)'),
- '#default_value' => $config->get('codesnippet.before'),
- '#disabled' => $user_access_add_js_snippets,
- '#rows' => 5,
- '#description' => $this->t('Code in this textarea will be added before _paq.push(["trackPageView"]).') . $user_access_add_js_snippets_permission_warning,
- ];
- $form['advanced']['codesnippet']['piwik_codesnippet_after'] = [
- '#type' => 'textarea',
- '#title' => $this->t('Code snippet (after)'),
- '#default_value' => $config->get('codesnippet.after'),
- '#disabled' => $user_access_add_js_snippets,
- '#rows' => 5,
- '#description' => $this->t('Code in this textarea will be added after _paq.push(["trackPageView"]). This is useful if you\'d like to track a site in two accounts.') . $user_access_add_js_snippets_permission_warning,
- ];
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- parent::validateForm($form, $form_state);
-
- // Custom variables validation.
- foreach ($form_state->getValue(['piwik_custom_var', 'slots']) as $custom_var) {
- $form_state->setValue(['piwik_custom_var', 'slots', $custom_var['slot'], 'name'], trim($custom_var['name']));
- $form_state->setValue(['piwik_custom_var', 'slots', $custom_var['slot'], 'value'], trim($custom_var['value']));
-
- // Validate empty names/values.
- if (empty($custom_var['name']) && !empty($custom_var['value'])) {
- $form_state->setErrorByName("piwik_custom_var][slots][" . $custom_var['slot'] . "][name", t('The custom variable @slot-number requires a Name if a Value has been provided.', ['@slot-number' => $custom_var['slot']]));
- }
- elseif (!empty($custom_var['name']) && empty($custom_var['value'])) {
- $form_state->setErrorByName("piwik_custom_var][slots][" . $custom_var['slot'] . "][value", t('The custom variable @slot-number requires a Value if a Name has been provided.', ['@slot-number' => $custom_var['slot']]));
- }
- }
- $form_state->setValue('piwik_custom_var', $form_state->getValue(['piwik_custom_var', 'slots']));
-
- // Trim some text area values.
- $form_state->setValue('piwik_site_id', trim($form_state->getValue('piwik_site_id')));
- $form_state->setValue('piwik_visibility_request_path_pages', trim($form_state->getValue('piwik_visibility_request_path_pages')));
- $form_state->setValue('piwik_codesnippet_before', trim($form_state->getValue('piwik_codesnippet_before')));
- $form_state->setValue('piwik_codesnippet_after', trim($form_state->getValue('piwik_codesnippet_after')));
- $form_state->setValue('piwik_visibility_user_role_roles', array_filter($form_state->getValue('piwik_visibility_user_role_roles')));
- $form_state->setValue('piwik_trackmessages', array_filter($form_state->getValue('piwik_trackmessages')));
-
- if (!preg_match('/^\d{1,}$/', $form_state->getValue('piwik_site_id'))) {
- $form_state->setErrorByName('piwik_site_id', t('A valid Piwik site ID is an integer only.'));
- }
-
- $url = $form_state->getValue('piwik_url_http') . 'piwik.php';
- try {
- $result = \Drupal::httpClient()->get($url);
- if ($result->getStatusCode() != 200 && $form_state->getValue('piwik_url_skiperror') == FALSE) {
- $form_state->setErrorByName('piwik_url_http', t('The validation of "@url" failed with error "@error" (HTTP code @code).', [
- '@url' => UrlHelper::filterBadProtocol($url),
- '@error' => $result->getReasonPhrase(),
- '@code' => $result->getStatusCode(),
- ]));
- }
- }
- catch (RequestException $exception) {
- $form_state->setErrorByName('piwik_url_http', t('The validation of "@url" failed with an exception "@error" (HTTP code @code).', [
- '@url' => UrlHelper::filterBadProtocol($url),
- '@error' => $exception->getMessage(),
- '@code' => $exception->getCode(),
- ]));
- }
-
- $piwik_url_https = $form_state->getValue('piwik_url_https');
- if (!empty($piwik_url_https)) {
- $url = $piwik_url_https . 'piwik.php';
- try {
- $result = \Drupal::httpClient()->get($url);
- if ($result->getStatusCode() != 200 && $form_state->getValue('piwik_url_skiperror') == FALSE) {
- $form_state->setErrorByName('piwik_url_https', t('The validation of "@url" failed with error "@error" (HTTP code @code).', [
- '@url' => UrlHelper::filterBadProtocol($url),
- '@error' => $result->getReasonPhrase(),
- '@code' => $result->getStatusCode(),
- ]));
- }
- }
- catch (RequestException $exception) {
- $form_state->setErrorByName('piwik_url_https', t('The validation of "@url" failed with an exception "@error" (HTTP code @code).', [
- '@url' => UrlHelper::filterBadProtocol($url),
- '@error' => $exception->getMessage(),
- '@code' => $exception->getCode(),
- ]));
- }
- }
-
- // Verify that every path is prefixed with a slash, but don't check PHP
- // code snippets.
- if ($form_state->getValue('piwik_visibility_request_path_mode') != 2) {
- $pages = preg_split('/(\r\n?|\n)/', $form_state->getValue('piwik_visibility_request_path_pages'));
- foreach ($pages as $page) {
- if (strpos($page, '/') !== 0 && $page !== '') {
- $form_state->setErrorByName('piwik_visibility_request_path_pages', t('Path "@page" not prefixed with slash.', ['@page' => $page]));
- // Drupal forms show one error only.
- break;
- }
- }
- }
-
- // Clear obsolete local cache if cache has been disabled.
- if ($form_state->isValueEmpty('piwik_cache') && $form['advanced']['piwik_cache']['#default_value']) {
- piwik_clear_js_cache();
- }
-
- // This is for the Newbie's who cannot read a text area description.
- if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state->getValue('piwik_codesnippet_before'))) {
- $form_state->setErrorByName('piwik_codesnippet_before', t('Do not include the <script> tags in the javascript code snippets.'));
- }
- if (preg_match('/(.*)<\/?script(.*)>(.*)/i', $form_state->getValue('piwik_codesnippet_after'))) {
- $form_state->setErrorByName('piwik_codesnippet_after', t('Do not include the <script> tags in the javascript code snippets.'));
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $config = $this->config('piwik.settings');
- $config
- ->set('site_id', $form_state->getValue('piwik_site_id'))
- ->set('url_http', $form_state->getValue('piwik_url_http'))
- ->set('url_https', $form_state->getValue('piwik_url_https'))
- ->set('codesnippet.before', $form_state->getValue('piwik_codesnippet_before'))
- ->set('codesnippet.after', $form_state->getValue('piwik_codesnippet_after'))
- ->set('custom.variable', $form_state->getValue('piwik_custom_var'))
- ->set('domain_mode', $form_state->getValue('piwik_domain_mode'))
- ->set('track.files', $form_state->getValue('piwik_trackfiles'))
- ->set('track.files_extensions', $form_state->getValue('piwik_trackfiles_extensions'))
- ->set('track.colorbox', $form_state->getValue('piwik_trackcolorbox'))
- ->set('track.userid', $form_state->getValue('piwik_trackuserid'))
- ->set('track.mailto', $form_state->getValue('piwik_trackmailto'))
- ->set('track.messages', $form_state->getValue('piwik_trackmessages'))
- ->set('track.site_search', $form_state->getValue('piwik_site_search'))
- ->set('privacy.donottrack', $form_state->getValue('piwik_privacy_donottrack'))
- ->set('cache', $form_state->getValue('piwik_cache'))
- ->set('visibility.request_path_mode', $form_state->getValue('piwik_visibility_request_path_mode'))
- ->set('visibility.request_path_pages', $form_state->getValue('piwik_visibility_request_path_pages'))
- ->set('visibility.user_account_mode', $form_state->getValue('piwik_visibility_user_account_mode'))
- ->set('visibility.user_role_mode', $form_state->getValue('piwik_visibility_user_role_mode'))
- ->set('visibility.user_role_roles', $form_state->getValue('piwik_visibility_user_role_roles'))
- ->save();
-
- if ($form_state->hasValue('piwik_translation_set')) {
- $config->set('translation_set', $form_state->getValue('piwik_translation_set'))->save();
- }
-
- parent::submitForm($form, $form_state);
- }
-
- /**
- * Validate a form element that should have tokens in it.
- *
- * For example:
- * @code
- * $form['my_node_text_element'] = [
- * '#type' => 'textfield',
- * '#title' => $this->t('Some text to token-ize that has a node context.'),
- * '#default_value' => 'The title of this node is [node:title].',
- * '#element_validate' => [[get_class($this), 'tokenElementValidate']],
- * ];
- * @endcode
- */
- public static function tokenElementValidate(&$element, FormStateInterface $form_state) {
- $value = isset($element['#value']) ? $element['#value'] : $element['#default_value'];
-
- if (!Unicode::strlen($value)) {
- // Empty value needs no further validation since the element should depend
- // on using the '#required' FAPI property.
- return $element;
- }
-
- $tokens = \Drupal::token()->scan($value);
- $invalid_tokens = static::getForbiddenTokens($tokens);
- if ($invalid_tokens) {
- $form_state->setError($element, t('The %element-title is using the following forbidden tokens with personal identifying information: @invalid-tokens.', ['%element-title' => $element['#title'], '@invalid-tokens' => implode(', ', $invalid_tokens)]));
- }
-
- return $element;
- }
-
- /**
- * Get an array of all forbidden tokens.
- *
- * @param array $value
- * An array of token values.
- *
- * @return array
- * A unique array of invalid tokens.
- */
- protected static function getForbiddenTokens(array $value) {
- $invalid_tokens = [];
- $value_tokens = is_string($value) ? \Drupal::token()->scan($value) : $value;
-
- foreach ($value_tokens as $tokens) {
- if (array_filter($tokens, 'static::containsForbiddenToken')) {
- $invalid_tokens = array_merge($invalid_tokens, array_values($tokens));
- }
- }
-
- array_unique($invalid_tokens);
- return $invalid_tokens;
- }
-
- /**
- * Validate if string contains forbidden tokens not allowed by privacy rules.
- *
- * @param string $token_string
- * A string with one or more tokens to be validated.
- *
- * @return bool
- * TRUE if blacklisted token has been found, otherwise FALSE.
- */
- protected static function containsForbiddenToken($token_string) {
- // List of strings in tokens with personal identifying information not
- // allowed for privacy reasons. See section 8.1 of the Google Analytics
- // terms of use for more detailed information.
- //
- // This list can never ever be complete. For this reason it tries to use a
- // regex and may kill a few other valid tokens, but it's the only way to
- // protect users as much as possible from admins with illegal ideas.
- //
- // User tokens are not prefixed with colon to catch 'current-user' and
- // 'user'.
- //
- // TODO: If someone have better ideas, share them, please!
- $token_blacklist = [
- ':account-name]',
- ':author]',
- ':author:edit-url]',
- ':author:url]',
- ':author:path]',
- ':current-user]',
- ':current-user:original]',
- ':display-name]',
- ':fid]',
- ':mail]',
- ':name]',
- ':uid]',
- ':one-time-login-url]',
- ':owner]',
- ':owner:cancel-url]',
- ':owner:edit-url]',
- ':owner:url]',
- ':owner:path]',
- 'user:cancel-url]',
- 'user:edit-url]',
- 'user:url]',
- 'user:path]',
- 'user:picture]',
- // addressfield_tokens.module
- ':first-name]',
- ':last-name]',
- ':name-line]',
- ':mc-address]',
- ':thoroughfare]',
- ':premise]',
- // realname.module
- ':name-raw]',
- // token.module
- ':ip-address]',
- ];
-
- return preg_match('/' . implode('|', array_map('preg_quote', $token_blacklist)) . '/i', $token_string);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikCustomVars.php b/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikCustomVars.php
deleted file mode 100644
index ebb575d2b..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikCustomVars.php
+++ /dev/null
@@ -1,27 +0,0 @@
-configuration['module']][$this->configuration['key']])) {
- throw new MigrateSkipRowException();
- }
- return $value[$this->configuration['module']][$this->configuration['key']];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityPages.php b/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityPages.php
deleted file mode 100644
index f4e0ee5ed..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityPages.php
+++ /dev/null
@@ -1,113 +0,0 @@
-moduleHandler = $module_handler;
- $this->migrationPlugin = $migration_plugin;
-
- if (isset($configuration['skip_php'])) {
- $this->skipPHP = $configuration['skip_php'];
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
- $migration_configuration = [
- 'migration' => [
- 'd6_user_role',
- 'd7_user_role',
- ],
- ];
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('module_handler'),
- $container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_configuration, $migration)
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
- list($old_visibility, $pages) = $value;
-
- $request_path_pages = '';
-
- if ($pages) {
- // 2 == BLOCK_VISIBILITY_PHP in Drupal 6 and 7.
- if ($old_visibility == 2) {
- // If the PHP module is present, migrate the visibility code unaltered.
- if ($this->moduleHandler->moduleExists('php')) {
- $request_path_pages = $pages;
- }
- // Skip the row if we're configured to. If not, we don't need to do
- // anything else -- the block will simply have no PHP or request_path
- // visibility configuration.
- elseif ($this->skipPHP) {
- throw new MigrateSkipRowException();
- }
- }
- else {
- $paths = preg_split("(\r\n?|\n)", $pages);
- foreach ($paths as $key => $path) {
- $paths[$key] = $path === '' ? $path : '/' . ltrim($path, '/');
- }
- $request_path_pages = implode("\n", $paths);
- }
- }
-
- return $request_path_pages;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityRoles.php b/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityRoles.php
deleted file mode 100644
index 41afededc..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Plugin/migrate/process/PiwikVisibilityRoles.php
+++ /dev/null
@@ -1,87 +0,0 @@
-moduleHandler = $module_handler;
- $this->migrationPlugin = $migration_plugin;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
- $migration_configuration = [
- 'migration' => [
- 'd6_user_role',
- 'd7_user_role',
- ],
- ];
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('module_handler'),
- $container->get('plugin.manager.migrate.process')->createInstance('migration', $migration_configuration, $migration)
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
- list($roles) = $value;
-
- // Remove role IDs disabled in D6/D7.
- $roles = array_filter($roles);
-
- $user_role_roles = [];
-
- if ($roles) {
- foreach ($roles as $key => $role_id) {
- $roles[$key] = $this->migrationPlugin->transform($role_id, $migrate_executable, $row, $destination_property);
- }
- $user_role_roles = array_combine($roles, $roles);
- }
-
- return $user_role_roles;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikBasicTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikBasicTest.php
deleted file mode 100644
index 331761635..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikBasicTest.php
+++ /dev/null
@@ -1,221 +0,0 @@
-noSnippetUser = $this->drupalCreateUser($permissions);
- $permissions[] = 'add JS snippets for piwik';
- $this->admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->admin_user);
- }
-
- /**
- * Tests if configuration is possible.
- */
- public function testPiwikConfiguration() {
- // Check for setting page's presence.
- $this->drupalGet('admin/config/system/piwik');
- $this->assertRaw(t('Piwik site ID'), '[testPiwikConfiguration]: Settings page displayed.');
-
- // Check for account code validation.
- $edit['piwik_site_id'] = $this->randomMachineName(2);
- $edit['piwik_url_http'] = 'http://www.example.com/piwik/';
- $this->drupalPostForm('admin/config/system/piwik', $edit, 'Save configuration');
- $this->assertRaw(t('A valid Piwik site ID is an integer only.'), '[testPiwikConfiguration]: Invalid Piwik site ID number validated.');
-
- // Verify that invalid URLs throw a form error.
- $edit = [];
- $edit['piwik_site_id'] = 1;
- $edit['piwik_url_http'] = 'http://www.example.com/piwik/';
- $edit['piwik_url_https'] = 'https://www.example.com/piwik/';
- $this->drupalPostForm('admin/config/system/piwik', $edit, t('Save configuration'));
- $this->assertRaw('The validation of "http://www.example.com/piwik/piwik.php" failed with an exception', '[testPiwikConfiguration]: HTTP URL exception shown.');
- $this->assertRaw('The validation of "https://www.example.com/piwik/piwik.php" failed with an exception', '[testPiwikConfiguration]: HTTPS URL exception shown.');
-
- // User should have access to code snippets.
- $this->assertFieldByName('piwik_codesnippet_before');
- $this->assertFieldByName('piwik_codesnippet_after');
- $this->assertNoFieldByXPath("//textarea[@name='piwik_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is enabled.');
- $this->assertNoFieldByXPath("//textarea[@name='piwik_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is enabled.');
-
- // Login as user without JS permissions.
- $this->drupalLogin($this->noSnippetUser);
- $this->drupalGet('admin/config/system/piwik');
-
- // User should *not* have access to snippets, but create fields.
- $this->assertFieldByName('piwik_codesnippet_before');
- $this->assertFieldByName('piwik_codesnippet_after');
- $this->assertFieldByXPath("//textarea[@name='piwik_codesnippet_before' and @disabled='disabled']", NULL, '"Code snippet (before)" is disabled.');
- $this->assertFieldByXPath("//textarea[@name='piwik_codesnippet_after' and @disabled='disabled']", NULL, '"Code snippet (after)" is disabled.');
- }
-
- /**
- * Tests if page visibility works.
- */
- public function testPiwikPageVisibility() {
- $site_id = '1';
- $this->config('piwik.settings')->set('site_id', $site_id)->save();
- $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save();
- $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save();
-
- // Show tracking on "every page except the listed pages".
- $this->config('piwik.settings')->set('visibility.request_path_mode', 0)->save();
- // Disable tracking one "admin*" pages only.
- $this->config('piwik.settings')->set('visibility.request_path_pages', "/admin\n/admin/*")->save();
- // Enable tracking only for authenticated users only.
- $this->config('piwik.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save();
-
- // Check tracking code visibility.
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed for authenticated users.');
-
- // Test whether tracking code is not included on pages to omit.
- $this->drupalGet('admin');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is not displayed on admin page.');
- $this->drupalGet('admin/config/system/piwik');
- // Checking for tracking URI here, as $site_id is displayed in the form.
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is not displayed on admin subpage.');
-
- // Test whether tracking code display is properly flipped.
- $this->config('piwik.settings')->set('visibility.request_path_mode', 1)->save();
- $this->drupalGet('admin');
- $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed on admin page.');
- $this->drupalGet('admin/config/system/piwik');
- // Checking for tracking URI here, as $site_id is displayed in the form.
- $this->assertRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is displayed on admin subpage.');
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is NOT displayed on front page.');
-
- // Test whether tracking code is not display for anonymous.
- $this->drupalLogout();
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikPageVisibility]: Tracking code is NOT displayed for anonymous.');
-
- // Switch back to every page except the listed pages.
- $this->config('piwik.settings')->set('visibility.request_path_mode', 0)->save();
- // Enable tracking code for all user roles.
- $this->config('piwik.settings')->set('visibility.user_role_roles', [])->save();
-
- // Test whether 403 forbidden tracking code is shown if user has no access.
- $this->drupalGet('admin');
- $this->assertRaw('"403/URL = "', '[testPiwikPageVisibility]: 403 Forbidden tracking code shown if user has no access.');
-
- // Test whether 404 not found tracking code is shown on non-existent pages.
- $this->drupalGet($this->randomMachineName(64));
- $this->assertRaw('"404/URL = "', '[testPiwikPageVisibility]: 404 Not Found tracking code shown on non-existent page.');
- }
-
- /**
- * Tests if tracking code is properly added to the page.
- */
- public function testPiwikTrackingCode() {
- $site_id = '2';
- $this->config('piwik.settings')->set('site_id', $site_id)->save();
- $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save();
- $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save();
-
- // Show tracking code on every page except the listed pages.
- $this->config('piwik.settings')->set('visibility.request_path_mode', 0)->save();
- // Enable tracking code for all user roles.
- $this->config('piwik.settings')->set('visibility.user_role_roles', [])->save();
-
- /* Sample JS code as added to page:
-
- */
-
- // Test whether tracking code uses latest JS.
- $this->config('piwik.settings')->set('cache', 0)->save();
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikTrackingCode]: Latest tracking code used.');
-
- // Test if tracking of User ID is enabled.
- $this->config('piwik.settings')->set('track.userid', 1)->save();
- $this->drupalGet('');
- $this->assertRaw('_paq.push(["setUserId", ', '[testPiwikTrackingCode]: Tracking code for User ID is enabled.');
-
- // Test if tracking of User ID is disabled.
- $this->config('piwik.settings')->set('track.userid', 0)->save();
- $this->drupalGet('');
- $this->assertNoRaw('_paq.push(["setUserId", ', '[testPiwikTrackingCode]: Tracking code for User ID is disabled.');
-
- // Test whether single domain tracking is active.
- $this->drupalGet('');
- $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: Single domain tracking is active.');
-
- // Enable "One domain with multiple subdomains".
- $this->config('piwik.settings')->set('domain_mode', 1)->save();
- $this->drupalGet('');
-
- // Test may run on localhost, an ipaddress or real domain name.
- // TODO: Workaround to run tests successfully. This feature cannot tested
- // reliable.
- global $cookie_domain;
- if (count(explode('.', $cookie_domain)) > 2 && !is_numeric(str_replace('.', '', $cookie_domain))) {
- $this->assertRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: One domain with multiple subdomains is active on real host.');
- }
- else {
- // Special cases, Localhost and IP addresses don't show 'setCookieDomain'.
- $this->assertNoRaw('_paq.push(["setCookieDomain"', '[testPiwikTrackingCode]: One domain with multiple subdomains may be active on localhost (test result is not reliable).');
- }
-
- // Test whether the BEFORE and AFTER code is added to the tracker.
- $this->config('piwik.settings')->set('codesnippet.before', '_paq.push(["setLinkTrackingTimer", 250]);')->save();
- $this->config('piwik.settings')->set('codesnippet.after', '_paq.push(["t2.setSiteId", 2]);if(1 == 1 && 2 < 3 && 2 > 1){console.log("Piwik: Custom condition works.");}_gaq.push(["t2.trackPageView"]);')->save();
- $this->drupalGet('');
- $this->assertRaw('setLinkTrackingTimer', '[testPiwikTrackingCode]: Before codesnippet has been found with "setLinkTrackingTimer" set.');
- $this->assertRaw('t2.trackPageView', '[testPiwikTrackingCode]: After codesnippet with "t2" tracker has been found.');
- $this->assertRaw('if(1 == 1 && 2 < 3 && 2 > 1){console.log("Piwik: Custom condition works.");}', '[testPiwikTrackingCode]: JavaScript code is not HTML escaped.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomUrls.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomUrls.php
deleted file mode 100644
index b55890c91..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomUrls.php
+++ /dev/null
@@ -1,59 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Tests if user password page urls are overridden.
- */
- public function testPiwikUserPasswordPage() {
- $base_path = base_path();
- $site_id = '1';
- $this->config('piwik.settings')->set('site_id', $site_id)->save();
- $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save();
- $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save();
-
- $this->drupalGet('user/password', ['query' => ['name' => 'foo']]);
- $this->assertRaw('_paq.push(["setCustomUrl", ' . Json::encode($base_path . 'user/password') . ']);');
-
- $this->drupalGet('user/password', ['query' => ['name' => 'foo@example.com']]);
- $this->assertRaw('_paq.push(["setCustomUrl", ' . Json::encode($base_path . 'user/password') . ']);');
-
- $this->drupalGet('user/password');
- $this->assertNoRaw('_paq.push(["setCustomUrl", "', '[testPiwikCustomUrls]: Custom url not set.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomVariablesTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomVariablesTest.php
deleted file mode 100644
index a06d2bcc8..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikCustomVariablesTest.php
+++ /dev/null
@@ -1,133 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Tests if custom variables are properly added to the page.
- */
- public function testPiwikCustomVariables() {
- $site_id = '3';
- $this->config('piwik.settings')->set('site_id', $site_id)->save();
- $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save();
- $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save();
-
- // Basic test if the feature works.
- $custom_vars = [
- 1 => [
- 'slot' => 1,
- 'name' => 'Foo 1',
- 'value' => 'Bar 1',
- 'scope' => 'visit',
- ],
- 2 => [
- 'slot' => 2,
- 'name' => 'Foo 2',
- 'value' => 'Bar 2',
- 'scope' => 'page',
- ],
- 3 => [
- 'slot' => 3,
- 'name' => 'Foo 3',
- 'value' => 'Bar 3',
- 'scope' => 'page',
- ],
- 4 => [
- 'slot' => 4,
- 'name' => 'Foo 4',
- 'value' => 'Bar 4',
- 'scope' => 'visit',
- ],
- 5 => [
- 'slot' => 5,
- 'name' => 'Foo 5',
- 'value' => 'Bar 5',
- 'scope' => 'visit',
- ],
- ];
- $this->config('piwik.settings')->set('custom.variable', $custom_vars)->save();
- $this->drupalGet('');
-
- foreach ($custom_vars as $slot) {
- $this->assertRaw('_paq.push(["setCustomVariable", ' . Json::encode($slot['slot']) . ', ' . Json::encode($slot['name']) . ', ' . Json::encode($slot['value']) . ', ' . Json::encode($slot['scope']) . ']);', '[testPiwikCustomVariables]: setCustomVariable ' . $slot['slot'] . ' is shown.');
- }
-
- // Test whether tokens are replaced in custom variable names.
- $site_slogan = $this->randomMachineName(16);
- $this->config('system.site')->set('slogan', $site_slogan)->save();
-
- $custom_vars = [
- 1 => [
- 'slot' => 1,
- 'name' => 'Name: [site:slogan]',
- 'value' => 'Value: [site:slogan]',
- 'scope' => 'visit',
- ],
- 2 => [
- 'slot' => 2,
- 'name' => '',
- 'value' => $this->randomMachineName(16),
- 'scope' => 'page',
- ],
- 3 => [
- 'slot' => 3,
- 'name' => $this->randomMachineName(16),
- 'value' => '',
- 'scope' => 'visit',
- ],
- 4 => [
- 'slot' => 4,
- 'name' => '',
- 'value' => '',
- 'scope' => 'page',
- ],
- 5 => [
- 'slot' => 5,
- 'name' => '',
- 'value' => '',
- 'scope' => 'visit',
- ],
- ];
- $this->config('piwik.settings')->set('custom.variable', $custom_vars)->save();
- $this->verbose('
' . print_r($custom_vars, TRUE) . '
');
-
- $this->drupalGet('');
- $this->assertRaw('_paq.push(["setCustomVariable", 1, ' . Json::encode("Name: $site_slogan") . ', ' . Json::encode("Value: $site_slogan") . ', "visit"]', '[testPiwikCustomVariables]: Tokens have been replaced in custom variable.');
- $this->assertNoRaw('_paq.push(["setCustomVariable", 2,', '[testPiwikCustomVariables]: Value with empty name is not shown.');
- $this->assertNoRaw('_paq.push(["setCustomVariable", 3,', '[testPiwikCustomVariables]: Name with empty value is not shown.');
- $this->assertNoRaw('_paq.push(["setCustomVariable", 4,', '[testPiwikCustomVariables]: Empty name and value is not shown.');
- $this->assertNoRaw('_paq.push(["setCustomVariable", 5,', '[testPiwikCustomVariables]: Empty name and value is not shown.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikPhpFilterTest.php.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikPhpFilterTest.php.php
deleted file mode 100644
index 176fa53cb..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikPhpFilterTest.php.php
+++ /dev/null
@@ -1,107 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions_admin_user);
-
- // Administrator who cannot configure tracking visibility with PHP.
- $permissions_delegated_admin_user = [
- 'access administration pages',
- 'administer piwik',
- ];
- $this->delegated_admin_user = $this->drupalCreateUser($permissions_delegated_admin_user);
- }
-
- /**
- * Tests if PHP module integration works.
- */
- public function testPiwikPhpFilter() {
- $site_id = '1';
- $this->drupalLogin($this->admin_user);
-
- $edit = [];
- $edit['piwik_site_id'] = $site_id;
- $edit['piwik_url_http'] = 'http://www.example.com/piwik/';
- $edit['piwik_url_https'] = 'https://www.example.com/piwik/';
- // Skip url check errors in automated tests.
- $edit['piwik_url_skiperror'] = TRUE;
- $edit['piwik_visibility_request_path_mode'] = 2;
- $edit['piwik_visibility_request_path_pages'] = '';
- $this->drupalPostForm('admin/config/system/piwik', $edit, t('Save configuration'));
-
- // Compare saved setting with posted setting.
- $piwik_visibility_request_path_pages = \Drupal::config('piwik.settings')->get('visibility.request_path_pages');
- $this->assertEqual('', $piwik_visibility_request_path_pages, '[testPiwikPhpFilter]: PHP code snippet is intact.');
-
- // Check tracking code visibility.
- $this->config('piwik.settings')->set('visibility.request_path_pages', '')->save();
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is displayed on frontpage page.');
- $this->drupalGet('admin');
- $this->assertRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is displayed on admin page.');
-
- $this->config('piwik.settings')->set('visibility.request_path_pages', '')->save();
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikPhpFilter]: Tracking is not displayed on frontpage page.');
-
- // Test administration form.
- $this->config('piwik.settings')->set('visibility.request_path_pages', '')->save();
- $this->drupalGet('admin/config/system/piwik');
- $this->assertRaw(t('Pages on which this PHP code returns TRUE (experts only)'), '[testPiwikPhpFilter]: Permission to administer PHP for tracking visibility.');
- $this->assertRaw(Html::escape(''), '[testPiwikPhpFilter]: PHP code snippted is displayed.');
-
- // Login the delegated user and check if fields are visible.
- $this->drupalLogin($this->delegated_admin_user);
- $this->drupalGet('admin/config/system/piwik');
- $this->assertNoRaw(t('Pages on which this PHP code returns TRUE (experts only)'), '[testPiwikPhpFilter]: No permission to administer PHP for tracking visibility.');
- $this->assertRaw(Html::escape(''), '[testPiwikPhpFilter]: No permission to view PHP code snippted.');
-
- // Set a different value and verify that this is still the same after the
- // post.
- $this->config('piwik.settings')->set('visibility.request_path_pages', '')->save();
-
- $edit = [];
- $edit['piwik_site_id'] = $site_id;
- $edit['piwik_url_http'] = 'http://www.example.com/piwik/';
- $edit['piwik_url_https'] = 'https://www.example.com/piwik/';
- // Required for testing only.
- $edit['piwik_url_skiperror'] = TRUE;
- $this->drupalPostForm('admin/config/system/piwik', $edit, t('Save configuration'));
-
- // Compare saved setting with posted setting.
- $piwik_visibility_request_path_mode = $this->config('piwik.settings')->get('visibility.request_path_mode');
- $piwik_visibility_request_path_pages = $this->config('piwik.settings')->get('visibility.request_path_pages');
- $this->assertEqual(2, $piwik_visibility_request_path_mode, '[testPiwikPhpFilter]: Pages on which this PHP code returns TRUE is selected.');
- $this->assertEqual('', $piwik_visibility_request_path_pages, '[testPiwikPhpFilter]: PHP code snippet is intact.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikRolesTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikRolesTest.php
deleted file mode 100644
index 2d8831753..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikRolesTest.php
+++ /dev/null
@@ -1,107 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Tests if roles based tracking works.
- */
- public function testPiwikRolesTracking() {
- $site_id = '1';
- $this->config('piwik.settings')->set('site_id', $site_id)->save();
- $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save();
- $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save();
-
- // Test if the default settings are working as expected.
- // Add to the selected roles only.
- $this->config('piwik.settings')->set('visibility.user_role_mode', 0)->save();
- // Enable tracking for all users.
- $this->config('piwik.settings')->set('visibility.user_role_roles', [])->save();
-
- // Check tracking code visibility.
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for anonymous users on frontpage with default settings.');
- $this->drupalGet('admin');
- $this->assertRaw('"403/URL = "', '[testPiwikRoleVisibility]: 403 Forbidden tracking code is displayed for anonymous users in admin section with default settings.');
-
- $this->drupalLogin($this->admin_user);
-
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for authenticated users on frontpage with default settings.');
- $this->drupalGet('admin');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed for authenticated users in admin section with default settings.');
-
- // Test if the non-default settings are working as expected.
- // Enable tracking only for authenticated users.
- $this->config('piwik.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save();
-
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed for authenticated users only on frontpage.');
-
- $this->drupalLogout();
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed for anonymous users on frontpage.');
-
- // Add to every role except the selected ones.
- $this->config('piwik.settings')->set('visibility.user_role_mode', 1)->save();
- // Enable tracking for all users.
- $this->config('piwik.settings')->set('visibility.user_role_roles', [])->save();
-
- // Check tracking code visibility.
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and displayed for anonymous users.');
- $this->drupalGet('admin');
- $this->assertRaw('"403/URL = "', '[testPiwikRoleVisibility]: 403 Forbidden tracking code is shown for anonymous users if every role except the selected ones is selected.');
-
- $this->drupalLogin($this->admin_user);
-
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and displayed on frontpage for authenticated users.');
- $this->drupalGet('admin');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is added to every role and NOT displayed in admin section for authenticated users.');
-
- // Disable tracking for authenticated users.
- $this->config('piwik.settings')->set('visibility.user_role_roles', [AccountInterface::AUTHENTICATED_ROLE => AccountInterface::AUTHENTICATED_ROLE])->save();
-
- $this->drupalGet('');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed on frontpage for excluded authenticated users.');
- $this->drupalGet('admin');
- $this->assertNoRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is NOT displayed in admin section for excluded authenticated users.');
-
- $this->drupalLogout();
- $this->drupalGet('');
- $this->assertRaw('u+"piwik.php"', '[testPiwikRoleVisibility]: Tracking code is displayed on frontpage for included anonymous users.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikSearchTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikSearchTest.php
deleted file mode 100644
index ded686118..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikSearchTest.php
+++ /dev/null
@@ -1,98 +0,0 @@
-drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
-
- $permissions = [
- 'access administration pages',
- 'administer piwik',
- 'search content',
- 'create page content',
- 'edit own page content',
- ];
-
- // User to set up piwik.
- $this->admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->admin_user);
- }
-
- /**
- * Tests if search tracking is properly added to the page.
- */
- public function testPiwikSearchTracking() {
- $site_id = '1';
- $this->config('piwik.settings')->set('site_id', $site_id)->save();
- $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save();
- $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save();
-
- // Check tracking code visibility.
- $this->drupalGet('');
- $this->assertRaw($site_id, '[testPiwikSearch]: Tracking code is displayed for authenticated users.');
-
- $this->drupalGet('search/node');
- $this->assertNoRaw('_paq.push(["trackSiteSearch", ', '[testPiwikSearch]: Search tracker not added to page.');
-
- // Enable site search support.
- $this->config('piwik.settings')->set('track.site_search', 1)->save();
-
- // Search for random string.
- $search = [];
- $search['keys'] = $this->randomMachineName(8);
-
- // Create a node to search for.
- // Create a node.
- $edit = [];
- $edit['title[0][value]'] = 'This is a test title';
- $edit['body[0][value]'] = 'This test content contains ' . $search['keys'] . ' string.';
-
- // Fire a search, it's expected to get 0 results.
- $this->drupalPostForm('search/node', $search, t('Search'));
- $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testPiwikSearch]: Search results tracker is displayed.');
- $this->assertRaw('window.piwik_search_results = 0;', '[testPiwikSearch]: Search yielded no results.');
-
- // Save the node.
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
- $this->assertText(t('@type @title has been created.', ['@type' => 'Basic page', '@title' => $edit['title[0][value]']]), 'Basic page created.');
-
- // Index the node or it cannot found.
- $this->cronRun();
-
- $this->drupalPostForm('search/node', $search, t('Search'));
- $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testPiwikSearch]: Search results tracker is displayed.');
- $this->assertRaw('window.piwik_search_results = 1;', '[testPiwikSearch]: One search result found.');
-
- $this->drupalPostForm('node/add/page', $edit, t('Save'));
- $this->assertText(t('@type @title has been created.', ['@type' => 'Basic page', '@title' => $edit['title[0][value]']]), 'Basic page created.');
-
- // Index the node or it cannot found.
- $this->cronRun();
-
- $this->drupalPostForm('search/node', $search, t('Search'));
- $this->assertRaw('_paq.push(["trackSiteSearch", ', '[testPiwikSearch]: Search results tracker is displayed.');
- $this->assertRaw('window.piwik_search_results = 2;', '[testPiwikSearch]: Two search results found.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikStatusMessagesTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikStatusMessagesTest.php
deleted file mode 100644
index 9e963465a..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikStatusMessagesTest.php
+++ /dev/null
@@ -1,69 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Tests if status messages tracking is properly added to the page.
- */
- public function testPiwikStatusMessages() {
- $site_id = '1';
- $this->config('piwik.settings')->set('site_id', $site_id)->save();
- $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save();
- $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save();
-
- // Enable logging of errors only.
- $this->config('piwik.settings')->set('track.messages', ['error' => 'error'])->save();
-
- $this->drupalPostForm('user/login', [], t('Log in'));
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Username field is required."]);', '[testPiwikStatusMessages]: trackEvent "Username field is required." is shown.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Password field is required."]);', '[testPiwikStatusMessages]: trackEvent "Password field is required." is shown.');
-
- // Testing this drupal_set_message() requires an extra test module.
- $this->drupalGet('piwik-test/drupal-set-message');
- $this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testPiwikStatusMessages]: Example status message is not enabled for tracking.');
- $this->assertNoRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testPiwikStatusMessages]: Example warning message is not enabled for tracking.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testPiwikStatusMessages]: Example error message is shown.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testPiwikStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.');
-
- // Enable logging of status, warnings and errors.
- $this->config('piwik.settings')->set('track.messages', ['status' => 'status', 'warning' => 'warning', 'error' => 'error'])->save();
-
- $this->drupalGet('piwik-test/drupal-set-message');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Status message", "Example status message."]);', '[testPiwikStatusMessages]: Example status message is enabled for tracking.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Warning message", "Example warning message."]);', '[testPiwikStatusMessages]: Example warning message is enabled for tracking.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message."]);', '[testPiwikStatusMessages]: Example error message is shown.');
- $this->assertRaw('_paq.push(["trackEvent", "Messages", "Error message", "Example error message with html tags and link."]);', '[testPiwikStatusMessages]: HTML has been stripped successful from Example error message with html tags and link.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUninstallTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUninstallTest.php
deleted file mode 100644
index d9d878bf2..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUninstallTest.php
+++ /dev/null
@@ -1,78 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->admin_user);
- }
-
- /**
- * Tests if the module cleans up the disk on uninstall.
- */
- public function testPiwikUninstall() {
- $cache_path = 'public://piwik';
- $site_id = '1';
- $this->config('piwik.settings')->set('site_id', $site_id)->save();
- $this->config('piwik.settings')->set('url_http', 'http://www.example.com/piwik/')->save();
- $this->config('piwik.settings')->set('url_https', 'https://www.example.com/piwik/')->save();
-
- // Enable local caching of piwik.js.
- $this->config('piwik.settings')->set('cache', 1)->save();
-
- // Load front page to get the piwik.js downloaded into local cache. But
- // loading the piwik.js is not possible as "url_http" is a test dummy only.
- // Create a dummy file to complete the rest of the tests.
- file_prepare_directory($cache_path, FILE_CREATE_DIRECTORY);
- $data = $this->randomMachineName(128);
- $file_destination = $cache_path . '/piwik.js';
- file_unmanaged_save_data($data, $file_destination);
- file_unmanaged_save_data(gzencode($data, 9, FORCE_GZIP), $file_destination . '.gz', FILE_EXISTS_REPLACE);
-
- // Test if the directory and piwik.js exists.
- $this->assertTrue(file_prepare_directory($cache_path), 'Cache directory "public://piwik" has been found.');
- $this->assertTrue(file_exists($cache_path . '/piwik.js'), 'Cached piwik.js tracking file has been found.');
- $this->assertTrue(file_exists($cache_path . '/piwik.js.gz'), 'Cached piwik.js.gz tracking file has been found.');
-
- // Uninstall the module.
- $edit = [];
- $edit['uninstall[piwik]'] = TRUE;
- $this->drupalPostForm('admin/modules/uninstall', $edit, t('Uninstall'));
- $this->assertNoText(\Drupal::translation()->translate('Configuration deletions'), 'No configuration deletions listed on the module install confirmation page.');
- $this->drupalPostForm(NULL, NULL, t('Uninstall'));
- $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.');
-
- // Test if the directory and all files have been removed.
- $this->assertFalse(file_scan_directory($cache_path, '/.*/'), 'Cached JavaScript files have been removed.');
- $this->assertFalse(file_prepare_directory($cache_path), 'Cache directory "public://piwik" has been removed.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUserFieldsTest.php b/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUserFieldsTest.php
deleted file mode 100644
index 7b79f482a..000000000
--- a/sites/all/modules/contrib/admin/piwik/src/Tests/PiwikUserFieldsTest.php
+++ /dev/null
@@ -1,71 +0,0 @@
-admin_user = $this->drupalCreateUser($permissions);
- $this->drupalLogin($this->admin_user);
- }
-
- /**
- * Tests if "allow users to customize tracking on their account page" works.
- */
- public function testPiwikUserFields() {
- $ua_code = 'UA-123456-1';
- $this->config('piwik.settings')->set('account', $ua_code)->save();
-
- // Check if the pseudo field is shown on account forms.
- $this->drupalGet('admin/config/people/accounts/form-display');
- $this->assertResponse(200);
- $this->assertRaw(t('Piwik settings'), '[testPiwikUserFields]: Piwik settings field exists on Manage form display.');
-
- // No customization allowed.
- $this->config('piwik.settings')->set('visibility.user_account_mode', 0)->save();
- $this->drupalGet('user/' . $this->admin_user->id() . '/edit');
- $this->assertResponse(200);
- $this->assertNoRaw(t('Piwik settings'), '[testPiwikUserFields]: Piwik settings field does not exist on user edit page.');
-
- // Tracking on by default, users with opt-in or out of tracking permission
- // can opt out.
- $this->config('piwik.settings')->set('visibility.user_account_mode', 1)->save();
- $this->drupalGet('user/' . $this->admin_user->id() . '/edit');
- $this->assertResponse(200);
- $this->assertRaw(t('Users are tracked by default, but you are able to opt out.'), '[testPiwikUserFields]: Piwik settings field exists on on user edit page');
-
- // Tracking off by default, users with opt-in or out of tracking permission
- // can opt in.
- $this->config('piwik.settings')->set('visibility.user_account_mode', 2)->save();
- $this->drupalGet('user/' . $this->admin_user->id() . '/edit');
- $this->assertResponse(200);
- $this->assertRaw(t('Users are not tracked by default, but you are able to opt in.'), '[testPiwikUserFields]: Piwik settings field exists on on user edit page.');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.info.yml b/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.info.yml
deleted file mode 100644
index 74c1d837e..000000000
--- a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.info.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-name: 'Piwik test'
-type: module
-description: 'Support module for Piwik testing.'
-package: Testing
-# core: 8.x
-
-# Information added by Drupal.org packaging script on 2018-06-08
-version: '8.x-1.4'
-core: '8.x'
-project: 'piwik'
-datestamp: 1528483684
diff --git a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.routing.yml b/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.routing.yml
deleted file mode 100644
index 08ab3af8b..000000000
--- a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/piwik_test.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-piwik_test.drupal_set_message:
- path: '/piwik-test/drupal-set-message'
- defaults:
- _title: 'Set messages with drupal_set_message()'
- _controller: '\Drupal\piwik_test\Controller\PiwikTestController::drupalSetMessageTest'
- requirements:
- _access: 'TRUE'
diff --git a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/src/Controller/PiwikTestController.php b/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/src/Controller/PiwikTestController.php
deleted file mode 100644
index 5c65b7bd7..000000000
--- a/sites/all/modules/contrib/admin/piwik/tests/modules/piwik_test/src/Controller/PiwikTestController.php
+++ /dev/null
@@ -1,28 +0,0 @@
-message with html tags and link.', 'error');
-
- return [];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/LICENSE.txt b/sites/all/modules/contrib/admin/redirect/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/redirect/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/redirect/README.txt b/sites/all/modules/contrib/admin/redirect/README.txt
deleted file mode 100644
index 5ae8276ab..000000000
--- a/sites/all/modules/contrib/admin/redirect/README.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-CONTENTS OF THIS FILE
----------------------
-
- * Introduction
- * Requirements
- * Installation
- * Configuration
- * Maintainers
-
-
-INTRODUCTION
-------------
-
-The Redirect module provides a unified redirection API (also replaces
-path_redirect and globalredirect).
-
-
- * For a full description of the module visit:
- https://www.drupal.org/project/redirect
-
- * To submit bug reports and feature suggestions, or to track changes visit:
- https://www.drupal.org/project/issues/redirect
-
-
-REQUIREMENTS
-------------
-
-This module requires no modules outside of Drupal core.
-
-
-INSTALLATION
-------------
-
- * Install the Redirect module as you would normally install a contributed
- Drupal module. Visit https://www.drupal.org/node/1897420 for further
- information.
-
-
-CONFIGURATION
--------------
-
- 1. Navigate to Administration > Extend and enable the module.
- 2. Navigate to Administration > Configuration > Search and Metadata > URL
- redirects for configuration.
- 3. Select "Add redirect" and in the "Path" field add the old path.
- 4. In the "To" field, start typing the title of a piece of content to select
- it. You can also enter an internal path such as /node/add or an external
- URL such as http://example.com. Enter to link to the front page.
- 5. Select the Redirect status: 300 Multiple Choices, 301 Moved Permanently,
- 302 Found, 303 See Other, 304 Not Modified, 305 Use Proxy, or 307
- Temporary Redirect. Save.
- 6. Once a redirect has been added, it will be listed in the URL Redirects
- vertical tab group on the content's edit page.
-
-
-MAINTAINERS
------------
-
-Supporting organization for 8.x-1.x port:
-
- * MD Systems - https://www.drupal.org/md-systems
diff --git a/sites/all/modules/contrib/admin/redirect/composer.json b/sites/all/modules/contrib/admin/redirect/composer.json
deleted file mode 100644
index b4f147895..000000000
--- a/sites/all/modules/contrib/admin/redirect/composer.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "name": "drupal/redirect",
- "description": "Allows users to redirect from old URLs to new URLs.",
- "type": "drupal-module",
- "license": "GPL-2.0+",
- "minimum-stability": "dev",
- "require": {
- "drupal/core": "~8"
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/config/install/redirect.settings.yml b/sites/all/modules/contrib/admin/redirect/config/install/redirect.settings.yml
deleted file mode 100644
index 70a96888d..000000000
--- a/sites/all/modules/contrib/admin/redirect/config/install/redirect.settings.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-auto_redirect: true
-default_status_code: 301
-passthrough_querystring: true
-warning: false
-ignore_admin_path: false
-access_check: false
-route_normalizer_enabled: true
diff --git a/sites/all/modules/contrib/admin/redirect/config/install/system.action.redirect_delete_action.yml b/sites/all/modules/contrib/admin/redirect/config/install/system.action.redirect_delete_action.yml
deleted file mode 100644
index 4b23fc81b..000000000
--- a/sites/all/modules/contrib/admin/redirect/config/install/system.action.redirect_delete_action.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-langcode: en
-status: true
-dependencies:
- enforced:
- module:
- - redirect
- module:
- - redirect
-id: redirect_delete_action
-label: 'Delete redirect'
-type: redirect
-plugin: redirect_delete_action
-configuration: { }
diff --git a/sites/all/modules/contrib/admin/redirect/config/install/views.view.redirect.yml b/sites/all/modules/contrib/admin/redirect/config/install/views.view.redirect.yml
deleted file mode 100644
index 6a1c65f55..000000000
--- a/sites/all/modules/contrib/admin/redirect/config/install/views.view.redirect.yml
+++ /dev/null
@@ -1,597 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - link
- - redirect
- - user
-id: redirect
-label: Redirect
-module: views
-description: 'List of redirects'
-tag: ''
-base_table: redirect
-base_field: rid
-core: 8.x
-display:
- default:
- display_plugin: default
- id: default
- display_title: Master
- position: 0
- display_options:
- access:
- type: perm
- options:
- perm: 'administer redirects'
- 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: full
- options:
- items_per_page: 50
- offset: 0
- id: 0
- total_pages: null
- tags:
- previous: '‹ previous'
- next: 'next ›'
- first: '« first'
- last: 'last »'
- 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
- quantity: 9
- style:
- type: table
- options:
- grouping: { }
- row_class: ''
- default_row_class: true
- override: true
- sticky: false
- caption: ''
- summary: ''
- description: ''
- columns:
- redirect_source__path: redirect_source__path
- redirect_redirect__uri: redirect_redirect__uri
- status_code: status_code
- language: language
- created: created
- operations: operations
- info:
- redirect_source__path:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- redirect_redirect__uri:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- status_code:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- language:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- created:
- sortable: true
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- operations:
- sortable: false
- default_sort_order: asc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- default: created
- empty_table: false
- row:
- type: fields
- fields:
- redirect_bulk_form:
- id: redirect_bulk_form
- table: redirect
- field: redirect_bulk_form
- 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
- action_title: 'With selection'
- include_exclude: exclude
- selected_actions: { }
- entity_type: redirect
- plugin_id: redirect_bulk_form
- redirect_source__path:
- id: redirect_source__path
- table: redirect
- field: redirect_source__path
- relationship: none
- group_type: group
- admin_label: ''
- label: From
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- click_sort_column: path
- type: redirect_source
- settings: { }
- group_column: ''
- 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: redirect
- entity_field: redirect_source
- plugin_id: field
- redirect_redirect__uri:
- id: redirect_redirect__uri
- table: redirect
- field: redirect_redirect__uri
- entity_type: redirect
- entity_field: redirect_redirect
- plugin_id: field
- status_code:
- id: status_code
- table: redirect
- field: status_code
- entity_type: redirect
- entity_field: status_code
- plugin_id: field
- language:
- id: language
- table: redirect
- field: language
- entity_type: redirect
- entity_field: language
- plugin_id: field
- created:
- id: created
- table: redirect
- field: created
- relationship: none
- group_type: group
- admin_label: ''
- label: Created
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- date_format: fallback
- custom_date_format: ''
- timezone: ''
- entity_type: redirect
- entity_field: created
- plugin_id: date
- operations:
- id: operations
- table: redirect
- field: operations
- entity_type: redirect
- plugin_id: entity_operations
- filters:
- redirect_source__path:
- id: redirect_source__path
- table: redirect
- field: redirect_source__path
- relationship: none
- group_type: group
- admin_label: ''
- operator: contains
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: redirect_source__path_op
- label: From
- description: ''
- use_operator: false
- operator: redirect_source__path_op
- identifier: redirect_source__path
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- 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: redirect
- entity_field: redirect_source
- plugin_id: string
- redirect_redirect__uri:
- id: redirect_redirect__uri
- table: redirect
- field: redirect_redirect__uri
- relationship: none
- group_type: group
- admin_label: ''
- operator: contains
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: redirect_redirect__uri_op
- label: To
- description: ''
- use_operator: false
- operator: redirect_redirect__uri_op
- identifier: redirect_redirect__uri
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- 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: redirect
- entity_field: redirect_redirect
- plugin_id: string
- status_code:
- id: status_code
- table: redirect
- field: status_code
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value:
- min: ''
- max: ''
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: status_code_op
- label: 'Status code'
- description: ''
- use_operator: false
- operator: status_code_op
- identifier: status_code
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: true
- group_info:
- label: 'Status code'
- description: ''
- identifier: status_code
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items:
- 1:
- title: '300 Multiple Choices'
- operator: '='
- value:
- value: '300'
- min: ''
- max: ''
- 2:
- title: '301 Moved Permanently'
- operator: '='
- value:
- value: '301'
- min: ''
- max: ''
- 3:
- title: '302 Found'
- operator: '='
- value:
- value: '302'
- min: ''
- max: ''
- 4:
- title: '303 See Other'
- operator: '='
- value:
- value: '303'
- min: ''
- max: ''
- 5:
- title: '304 Not Modified'
- operator: '='
- value:
- value: '304'
- min: ''
- max: ''
- 6:
- title: '305 Use Proxy'
- operator: '='
- value:
- value: '305'
- min: ''
- max: ''
- 7:
- title: '307 Temporary Redirect'
- operator: '='
- value:
- value: '307'
- min: ''
- max: ''
- entity_type: redirect
- entity_field: status_code
- plugin_id: numeric
- language:
- id: language
- table: redirect
- field: language
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: language_op
- label: 'Original language'
- description: ''
- use_operator: false
- operator: language_op
- identifier: language
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- 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: redirect
- entity_field: language
- plugin_id: language
- sorts: { }
- title: Redirect
- header: { }
- footer: { }
- empty:
- area_text_custom:
- id: area_text_custom
- table: views
- field: area_text_custom
- relationship: none
- group_type: group
- admin_label: ''
- empty: true
- tokenize: false
- content: 'There is no redirect yet.'
- plugin_id: text_custom
- relationships: { }
- arguments: { }
- display_extenders: { }
- filter_groups:
- operator: AND
- groups:
- 1: AND
- cache_metadata:
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - user.permissions
- cacheable: false
- max-age: 0
- tags: { }
- page_1:
- display_plugin: page
- id: page_1
- display_title: Page
- position: 1
- display_options:
- display_extenders: { }
- path: admin/config/search/redirect
- cache_metadata:
- contexts:
- - 'languages:language_content'
- - 'languages:language_interface'
- - url
- - url.query_args
- - user.permissions
- cacheable: false
- max-age: 0
- tags: { }
diff --git a/sites/all/modules/contrib/admin/redirect/config/optional/language.content_settings.redirect.redirect.yml b/sites/all/modules/contrib/admin/redirect/config/optional/language.content_settings.redirect.redirect.yml
deleted file mode 100644
index e6dfad3fd..000000000
--- a/sites/all/modules/contrib/admin/redirect/config/optional/language.content_settings.redirect.redirect.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - redirect
-id: redirect.redirect
-target_entity_type_id: redirect
-target_bundle: redirect
-default_langcode: und
-language_alterable: true
diff --git a/sites/all/modules/contrib/admin/redirect/config/schema/redirect.schema.yml b/sites/all/modules/contrib/admin/redirect/config/schema/redirect.schema.yml
deleted file mode 100644
index bd9ccd5d6..000000000
--- a/sites/all/modules/contrib/admin/redirect/config/schema/redirect.schema.yml
+++ /dev/null
@@ -1,31 +0,0 @@
-# Schema for the configuration files of the Redirect module.
-
-redirect.settings:
- type: config_entity
- label: 'Redirect settings'
- mapping:
- auto_redirect:
- type: boolean
- label: 'Automatically create redirects when URL aliases are changed.'
- default_status_code:
- type: integer
- label: 'Default redirect status'
- passthrough_querystring:
- type: boolean
- label: 'Retain query string through redirect.'
- warning:
- type: boolean
- label: 'Display a warning message to users when they are redirected.'
- ignore_admin_path:
- type: boolean
- label: 'Allow redirections on admin paths.'
- access_check:
- type: boolean
- label: 'Menu Access Checking'
- route_normalizer_enabled:
- type: boolean
- label: 'Enforce clean and canonical URLs.'
-
-action.configuration.redirect_delete_action:
- type: action_configuration_default
- label: 'Delete redirect configuration'
diff --git a/sites/all/modules/contrib/admin/redirect/config/schema/redirect.views.schema.yml b/sites/all/modules/contrib/admin/redirect/config/schema/redirect.views.schema.yml
deleted file mode 100644
index 59a565ce4..000000000
--- a/sites/all/modules/contrib/admin/redirect/config/schema/redirect.views.schema.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-# Schema for the views plugins of the Redirect module.
-
-views.field.redirect_type:
- type: views.field.redirect
- label: 'Redirect type'
- mapping:
- machine_name:
- type: string
- label: 'Output machine name'
-
-# Schema for the formatter of Redirect Source
-field.formatter.settings.redirect_source:
- type: mapping
- label: 'Redirect Source formatter'
- mapping: { }
-
-views.field.redirect_bulk_form:
- type: views_field_bulk_form
- label: 'Redirect bulk form'
diff --git a/sites/all/modules/contrib/admin/redirect/css/redirect.admin.css b/sites/all/modules/contrib/admin/redirect/css/redirect.admin.css
deleted file mode 100644
index f613931ed..000000000
--- a/sites/all/modules/contrib/admin/redirect/css/redirect.admin.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.redirect-table {
- table-layout: fixed;
-}
-
-.redirect-table__operations {
- width: 30%;
-}
-
-.redirect-table__path {
- width: 70%;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-}
diff --git a/sites/all/modules/contrib/admin/redirect/migrations/d6_path_redirect.yml b/sites/all/modules/contrib/admin/redirect/migrations/d6_path_redirect.yml
deleted file mode 100644
index 1f3ddef96..000000000
--- a/sites/all/modules/contrib/admin/redirect/migrations/d6_path_redirect.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-id: d6_path_redirect
-label: Path Redirect
-migration_tags:
- - Drupal 6
-source:
- plugin: d6_path_redirect
-process:
- rid: rid
- redirect_source: source
- redirect_redirect:
- plugin: d6_path_redirect
- source:
- - redirect
- - query
- language:
- plugin: default_value
- source: language
- default_value: und
- status_code: type
-destination:
- plugin: entity:redirect
\ No newline at end of file
diff --git a/sites/all/modules/contrib/admin/redirect/migrations/d7_path_redirect.yml b/sites/all/modules/contrib/admin/redirect/migrations/d7_path_redirect.yml
deleted file mode 100644
index 3ee9a287d..000000000
--- a/sites/all/modules/contrib/admin/redirect/migrations/d7_path_redirect.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-id: d7_path_redirect
-label: Path Redirect
-migration_tags:
- - Drupal 7
-source:
- plugin: d7_path_redirect
-process:
- rid: rid
- uid: uid
- redirect_source/path: source
- redirect_source/query:
- plugin: d7_redirect_source_query
- source: source_options
- redirect_redirect/uri:
- plugin: d7_path_redirect
- source:
- - redirect
- - redirect_options
- language:
- plugin: default_value
- source: language
- default_value: und
- status_code: status_code
-destination:
- plugin: entity:redirect
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/redirect_404.settings.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/redirect_404.settings.yml
deleted file mode 100644
index 030db9f0a..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/redirect_404.settings.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-row_limit: 10000
-pages: ''
-suppress_404: FALSE
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/views.view.redirect_404.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/views.view.redirect_404.yml
deleted file mode 100644
index 75777dee4..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/install/views.view.redirect_404.yml
+++ /dev/null
@@ -1,523 +0,0 @@
-langcode: en
-status: true
-dependencies:
- module:
- - redirect_404
- - user
-id: redirect_404
-label: 'Redirect 404'
-module: views
-description: ''
-tag: ''
-base_table: redirect_404
-base_field: ''
-core: 8.x
-display:
- default:
- display_plugin: default
- id: default
- display_title: Master
- position: 0
- display_options:
- access:
- type: perm
- options:
- perm: 'administer redirects'
- cache:
- type: none
- 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: true
- 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: table
- options:
- grouping: { }
- row_class: ''
- default_row_class: true
- override: true
- sticky: false
- caption: ''
- summary: ''
- description: ''
- columns:
- path: path
- count: count
- timestamp: timestamp
- info:
- path:
- sortable: true
- default_sort_order: desc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- count:
- sortable: true
- default_sort_order: desc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- timestamp:
- sortable: true
- default_sort_order: desc
- align: ''
- separator: ''
- empty_column: false
- responsive: ''
- default: count
- empty_table: false
- row:
- type: fields
- fields:
- path:
- table: redirect_404
- field: path
- id: path
- entity_type: null
- entity_field: null
- plugin_id: standard
- relationship: none
- group_type: group
- admin_label: ''
- label: Path
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- count:
- id: count
- table: redirect_404
- field: count
- relationship: none
- group_type: group
- admin_label: ''
- label: Count
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- format: unserialized
- key: ''
- plugin_id: serialized
- timestamp:
- id: timestamp
- table: redirect_404
- field: timestamp
- relationship: none
- group_type: group
- admin_label: ''
- label: 'Last accessed'
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- date_format: short
- custom_date_format: ''
- timezone: ''
- plugin_id: date
- langcode:
- id: langcode
- table: redirect_404
- field: langcode
- relationship: none
- group_type: group
- admin_label: ''
- label: Language
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- plugin_id: standard
- redirect_404_operations:
- id: redirect_404_operations
- table: redirect_404
- field: redirect_404_operations
- relationship: none
- group_type: group
- admin_label: ''
- label: Operations
- 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: true
- element_wrapper_type: ''
- element_wrapper_class: ''
- element_default_classes: true
- empty: ''
- hide_empty: false
- empty_zero: false
- hide_alter_empty: true
- plugin_id: redirect_404_operations
- filters:
- path:
- id: path
- table: redirect_404
- field: path
- relationship: none
- group_type: group
- admin_label: ''
- operator: contains
- value: ''
- group: 1
- exposed: true
- expose:
- operator_id: path_op
- label: Path
- description: ''
- use_operator: false
- operator: path_op
- identifier: path
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: string
- langcode:
- id: langcode
- table: redirect_404
- field: langcode
- relationship: none
- group_type: group
- admin_label: ''
- operator: in
- value: { }
- group: 1
- exposed: true
- expose:
- operator_id: langcode_op
- label: Language
- description: ''
- use_operator: false
- operator: langcode_op
- identifier: langcode
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- reduce: false
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: in_operator
- resolved:
- id: resolved
- table: redirect_404
- field: resolved
- relationship: none
- group_type: group
- admin_label: ''
- operator: '='
- value: '0'
- group: 1
- exposed: false
- expose:
- operator_id: ''
- label: Resolved
- description: ''
- use_operator: false
- operator: resolved_op
- identifier: resolved
- required: false
- remember: false
- multiple: false
- remember_roles:
- authenticated: authenticated
- anonymous: '0'
- administrator: '0'
- is_grouped: false
- group_info:
- label: ''
- description: ''
- identifier: ''
- optional: true
- widget: select
- multiple: false
- remember: false
- default_group: All
- default_group_multiple: { }
- group_items: { }
- plugin_id: boolean
- sorts: { }
- title: 'Fix 404 pages'
- header: { }
- footer: { }
- empty:
- area_text_custom:
- id: area_text_custom
- table: views
- field: area_text_custom
- relationship: none
- group_type: group
- admin_label: ''
- empty: true
- tokenize: false
- content: 'There are no 404 errors to fix.'
- plugin_id: text_custom
- relationships: { }
- arguments: { }
- display_extenders: { }
- filter_groups:
- operator: AND
- groups:
- 1: AND
- cache_metadata:
- max-age: 0
- contexts:
- - 'languages:language_interface'
- - url
- - url.query_args
- - user.permissions
- tags: { }
- page_1:
- display_plugin: page
- id: page_1
- display_title: Page
- position: 1
- display_options:
- display_extenders: { }
- path: admin/config/search/redirect/404
- display_description: 'Lists 404 error paths with no redirect assigned yet.'
- enabled: true
- cache_metadata:
- max-age: 0
- contexts:
- - 'languages:language_interface'
- - url
- - url.query_args
- - user.permissions
- tags: { }
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.schema.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.schema.yml
deleted file mode 100644
index 3aaeb9d14..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.schema.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-# Schema for the configuration files of the redirect_404 module.
-
-redirect_404.settings:
- type: config_object
- label: '404 error database logging settings.'
- mapping:
- row_limit:
- type: integer
- label: '404 error database logs to keep.'
- pages:
- type: string
- suppress_404:
- type: boolean
- label: "Whether to log 'page not found' messages to the standard log or not."
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.views.schema.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.views.schema.yml
deleted file mode 100644
index 5798b983e..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/config/schema/redirect_404.views.schema.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-views.field.redirect_404_operations:
- type: views_field
- label: 'Redirect 404 operations'
- mapping:
- text:
- type: label
- label: 'Redirect 404 operations'
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.info.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.info.yml
deleted file mode 100644
index 1fbcea416..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.info.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-name: 'Redirect 404'
-type: module
-description: 'Logs 404 errors and allows users to create redirects for often requested but missing pages.'
-# core: 8.x
-
-dependencies:
- - redirect
- - views
-
-# Information added by Drupal.org packaging script on 2018-10-16
-version: '8.x-1.3'
-core: '8.x'
-project: 'redirect'
-datestamp: 1539682690
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.install b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.install
deleted file mode 100644
index 09190e7cf..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.install
+++ /dev/null
@@ -1,62 +0,0 @@
- 'Stores 404 requests.',
- 'fields' => [
- 'path' => [
- 'description' => 'The path of the request.',
- 'type' => 'varchar',
- 'length' => SqlRedirectNotFoundStorage::MAX_PATH_LENGTH,
- 'not null' => TRUE,
- ],
- 'langcode' => [
- 'description' => 'The language of this request.',
- 'type' => 'varchar_ascii',
- 'length' => 12,
- 'not null' => TRUE,
- 'default' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
- ],
- 'count' => [
- 'description' => 'The number of requests with that path and language.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ],
- 'timestamp' => [
- 'description' => 'The timestamp of the last request with that path and language.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ],
- 'resolved' => [
- 'description' => 'Boolean indicating whether or not this path has a redirect assigned.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'default' => 0,
- ],
- ],
- 'primary key' => ['path', 'langcode'],
- ];
- return $schema;
-}
-
-/**
- * Remove relevancy field from the redirect_404 table.
- */
-function redirect_404_update_8101() {
- \Drupal::database()->schema()->dropField('redirect_404', 'relevancy');
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.action.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.action.yml
deleted file mode 100644
index 24c721adb..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-redirect_404.goto_fix_404:
- route_name: redirect_404.fix_404
- title: 'Fix 404 pages with URL redirects'
- appears_on:
- - 'dblog.page_not_found'
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.menu.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.menu.yml
deleted file mode 100644
index 28622669f..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.menu.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-redirect_404.fix_404:
- title: 'Fix 404 pages'
- parent: redirect.list
- route_name: redirect_404.fix_404
- description: 'Add redirects for 404 pages.'
- menu_name: admin
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.task.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.task.yml
deleted file mode 100644
index 955161a11..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.links.task.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-redirect_404.fix_404:
- route_name: redirect_404.fix_404
- base_route: redirect.list
- title: Fix 404 pages
- weight: 30
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.module b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.module
deleted file mode 100644
index b90d166e1..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.module
+++ /dev/null
@@ -1,96 +0,0 @@
-purgeOldRequests();
-}
-
-/**
- * Implements hook_form_FORM_ID_alter() for system_logging_settings().
- */
-function redirect_404_form_redirect_settings_form_alter(&$form, FormStateInterface $form_state, $form_id) {
- $config = \Drupal::configFactory()->getEditable('redirect_404.settings');
-
- $row_limits = [100, 1000, 10000, 100000, 1000000];
- $form['row_limit'] = [
- '#type' => 'select',
- '#title' => t('404 error database logs to keep'),
- '#default_value' => $config->get('row_limit'),
- '#options' => [0 => t('All')] + array_combine($row_limits, $row_limits),
- '#description' => t('The maximum number of 404 error logs to keep in the database log. Requires a cron maintenance task.', [':cron' => Url::fromRoute('system.status')->toString()])
- ];
-
- $ignored_pages = $config->get('pages');
- // Add a new path to be ignored, if there is an ignore argument in the query.
- if ($path_to_ignore = \Drupal::request()->query->get('ignore')) {
- $ignored_pages .= "\n" . $path_to_ignore;
- }
-
- $form['ignore_pages'] = [
- '#type' => 'textarea',
- '#title' => t('Pages to ignore'),
- '#default_value' => $ignored_pages,
- '#description' => t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. An example path is %user-wildcard for every user page. %front is the front page.", [
- '%user-wildcard' => '/user/*',
- '%front' => '',
- ]),
- ];
-
- $form['suppress_404'] = [
- '#type' => 'checkbox',
- '#title' => t("Suppress 'page not found' log messages"),
- '#default_value' => $config->get('suppress_404'),
- '#description' => t("Prevents logging 'page not found' events. Can be safely enabled when redirect_404 module is used, which stores them separately, nothing else relies on those messages."),
- ];
-
- $form['#submit'][] = 'redirect_404_logging_settings_submit';
-}
-
-/**
- * Form submission handler for system_logging_settings().
- *
- * @see redirect_404_form_redirect_settings_form_alter()
- */
-function redirect_404_logging_settings_submit($form, FormStateInterface $form_state) {
- // Make sure to store the 'pages to ignore' with the leading slash.
- $ignore_pages = explode(PHP_EOL, $form_state->getValue('ignore_pages'));
- $pages = '';
- foreach ($ignore_pages as $page) {
- if (!empty($page)) {
- $pages .= '/' . ltrim($page, '/') . "\n";
- }
- }
-
- \Drupal::configFactory()
- ->getEditable('redirect_404.settings')
- ->set('row_limit', $form_state->getValue('row_limit'))
- ->set('pages', $pages)
- ->set('suppress_404', $form_state->getValue('suppress_404'))
- ->save();
-}
-
-/**
- * Implements hook_ENTITY_TYPE_presave() for redirect entities.
- */
-function redirect_404_redirect_presave(Redirect $redirect) {
- $path = $redirect->getSourcePathWithQuery();
- $langcode = $redirect->get('language')->value;
-
- // Mark a potentially existing log entry for this path as resolved.
- \Drupal::service('redirect.not_found_storage')->resolveLogRequest($path, $langcode);
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.routing.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.routing.yml
deleted file mode 100644
index 15146cba9..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.routing.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-redirect_404.fix_404:
- path: '/admin/config/search/redirect/404'
- defaults:
- _title: 'Fix 404 pages'
- _form: '\Drupal\redirect_404\Form\RedirectFix404Form'
- requirements:
- _permission: 'administer redirects'
-
-redirect_404.ignore_404:
- path: '/admin/config/search/redirect/404/ignore'
- defaults:
- _controller: '\Drupal\redirect_404\Controller\Fix404IgnoreController::ignorePath'
- requirements:
- _permission: 'administer redirect settings'
- _csrf_token: 'TRUE'
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.services.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.services.yml
deleted file mode 100644
index 8221015ab..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.services.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-services:
- redirect.404_subscriber:
- class: Drupal\redirect_404\EventSubscriber\Redirect404Subscriber
- arguments: ['@path.current', '@path.matcher', '@request_stack', '@language_manager', '@redirect.not_found_storage', '@config.factory']
- tags:
- - { name: event_subscriber }
- redirect.not_found_storage:
- class: Drupal\redirect_404\SqlRedirectNotFoundStorage
- arguments: ['@database', '@config.factory']
- tags:
- - { name: backend_overridable }
- logger.redirect_404:
- public: false
- class: \Drupal\redirect_404\Render\Redirect404LogSuppressor
- decorates: logger.factory
- arguments: ['@logger.redirect_404.inner', '@config.factory']
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.views.inc b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.views.inc
deleted file mode 100644
index bc18f93e1..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/redirect_404.views.inc
+++ /dev/null
@@ -1,99 +0,0 @@
- '',
- 'title' => t('Fix 404 pages'),
- 'help' => t('Overview for 404 error paths with no redirect assigned yet.'),
- ];
-
- $data['redirect_404']['path'] = [
- 'title' => t('Path'),
- 'help' => t('The path of the request.'),
- 'field' => [
- 'id' => 'standard',
- ],
- 'filter' => [
- 'id' => 'string',
- ],
- ];
-
- $data['redirect_404']['langcode'] = [
- 'title' => t('Language'),
- 'help' => t('The language of this request.'),
- 'field' => [
- 'id' => 'redirect_404_langcode',
- ],
- 'filter' => [
- 'id' => 'language',
- ],
- ];
-
- $data['redirect_404']['count'] = [
- 'title' => t('Count'),
- 'help' => t('The number of requests with that path and language.'),
- 'field' => [
- 'id' => 'numeric',
- 'click sortable' => TRUE,
- ],
- 'filter' => [
- 'id' => 'numeric',
- ],
- ];
-
- $data['redirect_404']['timestamp'] = [
- 'title' => t('Timestamp'),
- 'help' => t('The timestamp of the last request with that path and language.'),
- 'field' => [
- 'id' => 'date',
- 'click sortable' => TRUE,
- ],
- 'filter' => [
- 'id' => 'date',
- ],
- ];
-
- $data['redirect_404']['resolved'] = [
- 'title' => t('Resolved'),
- 'help' => t('Whether or not this path has a redirect assigned.'),
- 'field' => [
- 'id' => 'boolean',
- ],
- 'filter' => [
- 'id' => 'boolean',
- 'label' => t('Resolved'),
- 'use_equal' => TRUE,
- ],
- ];
-
- $data['redirect_404']['redirect_404_operations'] = [
- 'title' => t('Operations'),
- 'help' => t('Provide operation buttons to handle the 404 path.'),
- 'field' => [
- 'id' => 'redirect_404_operations',
- 'additional fields' => ['path', 'langcode'],
- 'real field' => 'path',
- ],
- ];
-
- return $data;
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Controller/Fix404IgnoreController.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Controller/Fix404IgnoreController.php
deleted file mode 100644
index a00331188..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Controller/Fix404IgnoreController.php
+++ /dev/null
@@ -1,85 +0,0 @@
-configuration = $config_factory;
- $this->redirectStorage = $redirect_storage;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('config.factory'),
- $container->get('redirect.not_found_storage')
- );
- }
-
- /**
- * Adds path into the ignored list.
- *
- * @param \Symfony\Component\HttpFoundation\Request $request
- * The HttpRequest object representing the current request.
- *
- * @return \Symfony\Component\HttpFoundation\RedirectResponse
- */
- public function ignorePath(Request $request) {
- $ignored_paths = $this->config('redirect_404.settings')->get('pages');
- $path = $request->query->get('path');
- $langcode = $request->query->get('langcode');
-
- if (empty($ignored_paths) || !strpos($path, $ignored_paths)) {
- $this->redirectStorage->resolveLogRequest($path, $langcode);
-
- drupal_set_message($this->t('Resolved the path %path in the database. Please check the ignored list and save the settings.', [
- '%path' => $path,
- ]));
- }
-
- $options = [
- 'query' => [
- 'ignore' => $path,
- 'destination' => Url::fromRoute('redirect_404.fix_404')->getInternalPath(),
- ],
- ];
-
- return $this->redirect('redirect.settings', [], $options);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php
deleted file mode 100644
index f7cd1416a..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/EventSubscriber/Redirect404Subscriber.php
+++ /dev/null
@@ -1,129 +0,0 @@
-currentPath = $current_path;
- $this->pathMatcher = $path_matcher;
- $this->requestStack = $request_stack;
- $this->languageManager = $language_manager;
- $this->redirectStorage = $redirect_storage;
- $this->config = $config->get('redirect_404.settings');
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getSubscribedEvents() {
- $events[KernelEvents::EXCEPTION][] = 'onKernelException';
- return $events;
- }
-
- /**
- * Logs an exception of 404 Redirect errors.
- *
- * @param GetResponseForExceptionEvent $event
- * Is given by the event dispatcher.
- */
- public function onKernelException(GetResponseForExceptionEvent $event) {
- // Only log page not found (404) errors.
- if ($event->getException() instanceof NotFoundHttpException) {
- $path = $this->currentPath->getPath();
-
- // Ignore paths specified in the redirect settings.
- if ($pages = mb_strtolower($this->config->get('pages'))) {
- // Do not trim a trailing slash if that is the complete path.
- $path_to_match = $path === '/' ? $path : rtrim($path, '/');
-
- if ($this->pathMatcher->matchPath(mb_strtolower($path_to_match), $pages)) {
- return;
- }
- }
-
- // Allow to store paths with arguments.
- if ($query_string = $this->requestStack->getCurrentRequest()->getQueryString()) {
- $query_string = '?' . $query_string;
- }
- $path .= $query_string;
- $langcode = $this->languageManager->getCurrentLanguage()->getId();
-
- // Write record.
- $this->redirectStorage->logRequest($path, $langcode);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Form/RedirectFix404Form.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Form/RedirectFix404Form.php
deleted file mode 100644
index 7e01d1af5..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Form/RedirectFix404Form.php
+++ /dev/null
@@ -1,193 +0,0 @@
-languageManager = $language_manager;
- $this->redirectStorage = $redirect_storage;
- $this->dateFormatter = $date_formatter;
- $this->entityTypeManager = $entity_type_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('language_manager'),
- $container->get('redirect.not_found_storage'),
- $container->get('date.formatter'),
- $container->get('entity_type.manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'redirect_fix_404_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $destination = $this->getDestinationArray();
-
- $search = $this->getRequest()->get('search');
- $form['#attributes'] = ['class' => ['search-form']];
-
- $form['basic'] = [
- '#type' => 'fieldset',
- '#title' => $this->t('Filter 404s'),
- '#attributes' => ['class' => ['container-inline']],
- ];
- $form['basic']['filter'] = [
- '#type' => 'textfield',
- '#title' => '',
- '#default_value' => $search,
- '#maxlength' => 128,
- '#size' => 25,
- ];
- $form['basic']['submit'] = [
- '#type' => 'submit',
- '#value' => $this->t('Filter'),
- '#action' => 'filter',
- ];
- if ($search) {
- $form['basic']['reset'] = [
- '#type' => 'submit',
- '#value' => $this->t('Reset'),
- '#action' => 'reset',
- ];
- }
-
- $languages = $this->languageManager->getLanguages(LanguageInterface::STATE_ALL);
- $multilingual = $this->languageManager->isMultilingual();
-
- $header = [
- ['data' => $this->t('Path'), 'field' => 'source'],
- ['data' => $this->t('Count'), 'field' => 'count', 'sort' => 'desc'],
- ['data' => $this->t('Last accessed'), 'field' => 'timestamp'],
- ];
- if ($multilingual) {
- $header[] = ['data' => $this->t('Language'), 'field' => 'language'];
- }
- $header[] = ['data' => $this->t('Operations')];
-
- $rows = [];
- $results = $this->redirectStorage->listRequests($header, $search);
- foreach ($results as $result) {
- $path = ltrim($result->path, '/');
-
- $row = [];
- $row['source'] = $path;
- $row['count'] = $result->count;
- $row['timestamp'] = $this->dateFormatter->format($result->timestamp, 'short');
- if ($multilingual) {
- if (isset($languages[$result->langcode])) {
- $row['language'] = $languages[$result->langcode]->getName();
- }
- else {
- $row['language'] = $this->t('Undefined @langcode', ['@langcode' => $result->langcode]);
- }
- }
-
- $operations = [];
- if ($this->entityTypeManager->getAccessControlHandler('redirect')->createAccess()) {
- $operations['add'] = [
- 'title' => $this->t('Add redirect'),
- 'url' => Url::fromRoute('redirect.add', [], ['query' => ['source' => $path, 'language' => $result->langcode] + $destination]),
- ];
- }
- $row['operations'] = [
- 'data' => [
- '#type' => 'operations',
- '#links' => $operations,
- ],
- ];
-
- $rows[] = $row;
- }
-
- $form['redirect_404_table'] = [
- '#theme' => 'table',
- '#header' => $header,
- '#rows' => $rows,
- '#empty' => $this->t('There are no 404 errors to fix.'),
- ];
- $form['redirect_404_pager'] = ['#type' => 'pager'];
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
-
- if ($form_state->getTriggeringElement()['#action'] == 'filter') {
- $form_state->setRedirect('redirect_404.fix_404', [], ['query' => ['search' => trim($form_state->getValue('filter'))]]);
- }
- else {
- $form_state->setRedirect('redirect_404.fix_404');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Language.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Language.php
deleted file mode 100644
index 4fc03d334..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Language.php
+++ /dev/null
@@ -1,63 +0,0 @@
-languageManager = $language_manager;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('language_manager')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function access(AccountInterface $account) {
- return $this->languageManager->isMultilingual();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Redirect404Operations.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Redirect404Operations.php
deleted file mode 100644
index b1c0e6da5..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Plugin/views/field/Redirect404Operations.php
+++ /dev/null
@@ -1,123 +0,0 @@
-entityTypeManager = $entity_type_manager;
- $this->renderer = $renderer;
- $this->currentUser = $current_user;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('entity_type.manager'),
- $container->get('renderer'),
- $container->get('current_user')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function clickSortable() {
- return FALSE;
- }
-
- /**
- * {@inheritdoc}
- */
- public function render(ResultRow $values) {
- $links = [];
-
- $query = [
- 'query' => [
- 'source' => ltrim($this->getValue($values, 'path'), '/'),
- 'language' => $this->getValue($values, 'langcode'),
- 'destination' => $this->view->getPath(),
- ],
- ];
- $links['add'] = [
- 'title' => $this->t('Add redirect'),
- 'url' => Url::fromRoute('redirect.add', [], $query),
- ];
-
- if ($this->currentUser->hasPermission('administer redirect settings')) {
- $links['ignore'] = [
- 'title' => $this->t('Ignore'),
- 'url' => Url::fromRoute('redirect_404.ignore_404', [
- 'path' => $this->getValue($values, 'path'),
- 'langcode' => $this->getValue($values, 'langcode'),
- ]),
- ];
- }
-
- $operations['data'] = [
- '#type' => 'operations',
- '#links' => $links,
- ];
-
- return $this->renderer->render($operations);
- }
-
- /**
- * {@inheritdoc}
- */
- public function access(AccountInterface $account) {
- return $this->entityTypeManager->getAccessControlHandler('redirect')->createAccess();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/RedirectNotFoundStorageInterface.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/RedirectNotFoundStorageInterface.php
deleted file mode 100644
index 27bc56de5..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/RedirectNotFoundStorageInterface.php
+++ /dev/null
@@ -1,53 +0,0 @@
-loggerChannelFactory = $logger_channel_factory;
- $this->configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public function get($channel) {
- if ($channel == 'page not found' && $this->configFactory->get('redirect_404.settings')->get('suppress_404')) {
- // Do not log if a 404 error is detected and the suppress_404 is enabled.
- return new NullLogger();
- }
-
- // Call LoggerChannelFactory to let the default logger workflow proceed.
- return $this->loggerChannelFactory->get($channel);
- }
-
- /**
- * {@inheritdoc}
- */
- public function addLogger(LoggerInterface $logger, $priority = 0) {
- $this->loggerChannelFactory->addLogger($logger, $priority);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/SqlRedirectNotFoundStorage.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/SqlRedirectNotFoundStorage.php
deleted file mode 100644
index 98003ebae..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/SqlRedirectNotFoundStorage.php
+++ /dev/null
@@ -1,162 +0,0 @@
-database = $database;
- $this->configFactory = $config_factory;
- }
-
- /**
- * {@inheritdoc}
- */
- public function logRequest($path, $langcode) {
- if (mb_strlen($path) > static::MAX_PATH_LENGTH) {
- // Don't attempt to log paths that would result in an exception. There is
- // no point in logging truncated paths, as they cannot be used to build a
- // new redirect.
- return;
- }
- // Ignore invalid UTF-8, which can't be logged.
- if (!Unicode::validateUtf8($path)) {
- return;
- }
-
- // If the request is not new, update its count and timestamp.
- $this->database->merge('redirect_404')
- ->key('path', $path)
- ->key('langcode', $langcode)
- ->expression('count', 'count + 1')
- ->fields([
- 'timestamp' => REQUEST_TIME,
- 'count' => 1,
- 'resolved' => 0,
- ])
- ->execute();
- }
-
- /**
- * {@inheritdoc}
- */
- public function resolveLogRequest($path, $langcode) {
- $this->database->update('redirect_404')
- ->fields(['resolved' => 1])
- ->condition('path', $path)
- ->condition('langcode', $langcode)
- ->execute();
- }
-
- /**
- * {@inheritdoc}
- */
- public function purgeOldRequests() {
- $row_limit = $this->configFactory->get('redirect_404.settings')->get('row_limit');
-
- // In admin form 0 used as value for 'All' label.
- if ($row_limit == 0) {
- return;
- }
-
- $query = $this->database->select('redirect_404', 'r404');
- $query->fields('r404', ['timestamp']);
- // On databases known to support log(), use it to calculate a logarithmic
- // scale of the count, to delete records with count of 1-9 first, then
- // 10-99 and so on.
- if ($this->database->driver() == 'mysql' || $this->database->driver() == 'pgsql') {
- $query->addExpression('floor(log(10, count))', 'count_log');
- $query->orderBy('count_log', 'DESC');
- }
- $query->orderBy('timestamp', 'DESC');
- $cutoff = $query
- ->range($row_limit, 1)
- ->execute()
- ->fetchAssoc();
-
- if (!empty($cutoff)) {
- // Delete records having older timestamp and less visits (on a logarithmic
- // scale) than cutoff.
- $delete_query = $this->database->delete('redirect_404');
-
- if ($this->database->driver() == 'mysql' || $this->database->driver() == 'pgsql') {
- // Delete rows with same count_log AND older timestamp than cutoff.
- $and_condition = $delete_query->andConditionGroup()
- ->where('floor(log(10, count)) = :count_log2', [':count_log2' => $cutoff['count_log']])
- ->condition('timestamp', $cutoff['timestamp'], '<=');
-
- // And delete all the rows with count_log less than the cutoff.
- $condition = $delete_query->orConditionGroup()
- ->where('floor(log(10, count)) < :count_log1', [':count_log1' => $cutoff['count_log']])
- ->condition($and_condition);
- $delete_query->condition($condition);
- }
- else {
- $delete_query->condition('timestamp', $cutoff['timestamp'], '<=');
- }
- $delete_query->execute();
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function listRequests(array $header = [], $search = NULL) {
- $query = $this->database
- ->select('redirect_404', 'r404')
- ->extend('Drupal\Core\Database\Query\TableSortExtender')
- ->orderByHeader($header)
- ->extend('Drupal\Core\Database\Query\PagerSelectExtender')
- ->limit(25)
- ->fields('r404');
-
- if ($search) {
- // Replace wildcards with PDO wildcards.
- // @todo Find a way to write a nicer pattern.
- $wildcard = '%' . trim(preg_replace('!\*+!', '%', $this->database->escapeLike($search)), '%') . '%';
- $query->condition('path', $wildcard, 'LIKE');
- }
- $results = $query->condition('resolved', 0, '=')->execute()->fetchAll();
-
- return $results;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUILanguageTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUILanguageTest.php
deleted file mode 100644
index 89a14d2dc..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUILanguageTest.php
+++ /dev/null
@@ -1,203 +0,0 @@
-save();
- $language = ConfigurableLanguage::createFromLangcode('es');
- $language->save();
- $language = ConfigurableLanguage::createFromLangcode('fr');
- $language->save();
- }
-
- /**
- * Tests the fix 404 pages workflow with language and content translation.
- */
- public function testFix404RedirectList() {
- // Visit a non existing page to have the 404 redirect_error entry.
- $this->drupalGet('fr/testing');
-
- $redirect = \Drupal::database()->select('redirect_404')
- ->fields('redirect_404')
- ->condition('path', '/testing')
- ->execute()
- ->fetchAll();
- if (count($redirect) == 0) {
- $this->fail('No record was added');
- }
-
- // Go to the "fix 404" page and check the listing.
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertText('testing');
- $this->assertLanguageInTableBody('French');
- // Check the Language view filter uses the default language filter.
- $this->assertOption('edit-langcode', 'All');
- $this->assertOption('edit-langcode', 'en');
- $this->assertOption('edit-langcode', 'de');
- $this->assertOption('edit-langcode', 'es');
- $this->assertOption('edit-langcode', 'fr');
- $this->assertOption('edit-langcode', LanguageInterface::LANGCODE_NOT_SPECIFIED);
- $this->clickLink(t('Add redirect'));
-
- // Check if we generate correct Add redirect url and if the form is
- // pre-filled.
- $destination = Url::fromRoute('redirect_404.fix_404')->getInternalPath();
- $expected_query = [
- 'destination' => $destination,
- 'language' => 'fr',
- 'source' => 'testing',
- ];
- $parsed_url = UrlHelper::parse($this->getUrl());
- $this->assertEqual(Url::fromRoute('redirect.add')->setAbsolute()->toString(), $parsed_url['path']);
- $this->assertEqual($expected_query, $parsed_url['query']);
- $this->assertFieldByName('redirect_source[0][path]', 'testing');
- $this->assertOptionSelected('edit-language-0-value', 'fr');
- // Save the redirect.
- $edit = ['redirect_redirect[0][uri]' => '/node'];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertUrl('admin/config/search/redirect/404');
- $this->assertText('There are no 404 errors to fix.');
- // Check if the redirect works as expected.
- $this->assertRedirect('fr/testing', 'fr/node', 'HTTP/1.1 301 Moved Permanently');
-
- // Test removing a redirect assignment, visit again the non existing page.
- $this->drupalGet('admin/config/search/redirect');
- $this->assertText('testing');
- $this->assertLanguageInTableBody('French');
- $this->clickLink('Delete', 0);
- $this->drupalPostForm(NULL, [], 'Delete');
- $this->assertUrl('admin/config/search/redirect');
- $this->assertText('There is no redirect yet.');
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertText('There are no 404 errors to fix.');
- // Should be listed again in the 404 overview.
- $this->drupalGet('fr/testing');
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertLanguageInTableBody('French');
- // Check the error path visit count.
- $this->assertFieldByXPath('//table/tbody/tr/td[2]', 2);
- $this->clickLink('Add redirect');
- // Save the redirect with a different langcode.
- $this->assertFieldByName('redirect_source[0][path]', 'testing');
- $this->assertOptionSelected('edit-language-0-value', 'fr');
- $edit['language[0][value]'] = 'es';
- $this->drupalPostForm(NULL, $edit, 'Save');
- $this->assertUrl('admin/config/search/redirect/404');
- // Should still be listed, redirecting to another language does not resolve
- // the path.
- $this->assertLanguageInTableBody('French');
- $this->drupalGet('admin/config/search/redirect');
- $this->assertLanguageInTableBody('Spanish');
- // Check if the redirect works as expected.
- $this->assertRedirect('es/testing', 'es/node', 'HTTP/1.1 301 Moved Permanently');
-
- // Visit multiple non existing pages to test the Redirect 404 View.
- $this->drupalGet('testing1');
- $this->drupalGet('de/testing2');
- $this->drupalGet('de/testing2?test=1');
- $this->drupalGet('de/testing2?test=2');
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertLanguageInTableBody('French');
- $this->assertLanguageInTableBody('English');
- $this->assertLanguageInTableBody('German');
- $this->assertText('testing1');
- $this->assertText('testing2');
- $this->assertText('testing2?test=1');
- $this->assertText('testing2?test=2');
-
- // Test the Language view filter.
- $this->drupalGet('admin/config/search/redirect/404', ['query' => ['langcode' => 'de']]);
- $this->assertText('English');
- $this->assertNoLanguageInTableBody('English');
- $this->assertLanguageInTableBody('German');
- $this->assertNoText('testing1');
- $this->assertText('testing2');
- $this->assertText('testing2?test=1');
- $this->assertText('testing2?test=2');
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertLanguageInTableBody('English');
- $this->assertLanguageInTableBody('German');
- $this->assertText('testing1');
- $this->assertText('testing2');
- $this->assertText('testing2?test=1');
- $this->assertText('testing2?test=2');
- $this->drupalGet('admin/config/search/redirect/404', ['query' => ['langcode' => 'en']]);
- $this->assertLanguageInTableBody('English');
- $this->assertNoLanguageInTableBody('German');
- $this->assertText('testing1');
- $this->assertNoText('testing2');
- $this->assertNoText('testing2?test=1');
- $this->assertNoText('testing2?test=2');
-
- // Assign a redirect to 'testing1'.
- $this->clickLink('Add redirect');
- $expected_query = [
- 'destination' => $destination,
- 'language' => 'en',
- 'source' => 'testing1',
- ];
- $parsed_url = UrlHelper::parse($this->getUrl());
- $this->assertEqual(Url::fromRoute('redirect.add')->setAbsolute()->toString(), $parsed_url['path']);
- $this->assertEqual($expected_query, $parsed_url['query']);
- $this->assertFieldByName('redirect_source[0][path]', 'testing1');
- $this->assertOptionSelected('edit-language-0-value', 'en');
- $edit = ['redirect_redirect[0][uri]' => '/node'];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertUrl('admin/config/search/redirect/404');
- $this->assertNoLanguageInTableBody('English');
- $this->assertLanguageInTableBody('German');
- $this->drupalGet('admin/config/search/redirect');
- $this->assertLanguageInTableBody('Spanish');
- $this->assertLanguageInTableBody('English');
- // Check if the redirect works as expected.
- $this->assertRedirect('/testing1', '/node', 'HTTP/1.1 301 Moved Permanently');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUITest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUITest.php
deleted file mode 100644
index 088cbba47..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Fix404RedirectUITest.php
+++ /dev/null
@@ -1,186 +0,0 @@
-drupalGet('non-existing0');
-
- // Go to the "fix 404" page and check the listing.
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertText('non-existing0');
- $this->clickLink(t('Add redirect'));
-
- // Check if we generate correct Add redirect url and if the form is
- // pre-filled.
- $destination = Url::fromRoute('redirect_404.fix_404')->getInternalPath();
- $expected_query = [
- 'destination' => $destination,
- 'language' => 'en',
- 'source' => 'non-existing0',
- ];
- $parsed_url = UrlHelper::parse($this->getUrl());
- $this->assertEqual(Url::fromRoute('redirect.add')->setAbsolute()->toString(), $parsed_url['path']);
- $this->assertEqual($expected_query, $parsed_url['query']);
- $this->assertFieldByName('redirect_source[0][path]', 'non-existing0');
- // Save the redirect.
- $edit = ['redirect_redirect[0][uri]' => '/node'];
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertUrl('admin/config/search/redirect/404');
- $this->assertText('There are no 404 errors to fix.');
- // Check if the redirect works as expected.
- $this->drupalGet('non-existing0');
- $this->assertUrl('node');
-
- // Test removing a redirect assignment, visit again the non existing page.
- $this->drupalGet('admin/config/search/redirect');
- $this->assertText('non-existing0');
- $this->clickLink('Delete', 0);
- $this->drupalPostForm(NULL, [], 'Delete');
- $this->assertUrl('admin/config/search/redirect');
- $this->assertText('There is no redirect yet.');
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertText('There are no 404 errors to fix.');
- // Should be listed again in the 404 overview.
- $this->drupalGet('non-existing0');
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertText('non-existing0');
-
- // Visit multiple non existing pages to test the Redirect 404 View.
- $this->drupalGet('non-existing0?test=1');
- $this->drupalGet('non-existing0?test=2');
- $this->drupalGet('non-existing1');
- $this->drupalGet('non-existing2');
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertText('non-existing0?test=1');
- $this->assertText('non-existing0?test=2');
- $this->assertText('non-existing0');
- $this->assertText('non-existing1');
- $this->assertText('non-existing2');
-
- // Test the Path view filter.
- $this->drupalGet('admin/config/search/redirect/404', ['query' => ['path' => 'test=']]);
- $this->assertText('non-existing0?test=1');
- $this->assertText('non-existing0?test=2');
- $this->assertNoText('non-existing1');
- $this->assertNoText('non-existing2');
- $this->drupalGet('admin/config/search/redirect/404', ['query' => ['path' => 'existing1']]);
- $this->assertNoText('non-existing0?test=1');
- $this->assertNoText('non-existing0?test=2');
- $this->assertNoText('non-existing0');
- $this->assertText('non-existing1');
- $this->assertNoText('non-existing2');
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertText('non-existing0?test=1');
- $this->assertText('non-existing0?test=2');
- $this->assertText('non-existing0');
- $this->assertText('non-existing1');
- $this->assertText('non-existing2');
- $this->drupalGet('admin/config/search/redirect/404', ['query' => ['path' => 'g2']]);
- $this->assertNoText('non-existing0?test=1');
- $this->assertNoText('non-existing0?test=2');
- $this->assertNoText('non-existing0');
- $this->assertNoText('non-existing1');
- $this->assertText('non-existing2');
-
- // Assign a redirect to 'non-existing2'.
- $this->clickLink('Add redirect');
- $expected_query = [
- 'source' => 'non-existing2',
- 'language' => 'en',
- 'destination' => $destination,
- ];
- $parsed_url = UrlHelper::parse($this->getUrl());
- $this->assertEqual(Url::fromRoute('redirect.add')->setAbsolute()->toString(), $parsed_url['path']);
- $this->assertEqual($expected_query, $parsed_url['query']);
- $this->assertFieldByName('redirect_source[0][path]', 'non-existing2');
- $this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertUrl('admin/config/search/redirect/404');
- $this->assertText('non-existing0?test=1');
- $this->assertText('non-existing0?test=2');
- $this->assertText('non-existing0');
- $this->assertText('non-existing1');
- $this->assertNoText('non-existing2');
- // Check if the redirect works as expected.
- $this->drupalGet('admin/config/search/redirect');
- $this->assertText('non-existing2');
- }
-
- /**
- * Tests the redirect ignore pages.
- */
- public function testIgnorePages() {
- // Create two nodes.
- $node1 = $this->drupalCreateNode(['type' => 'page']);
- $node2 = $this->drupalCreateNode(['type' => 'page']);
-
- // Set some pages to be ignored just for the test.
- $node_to_ignore = '/node/' . $node1->id() . '/test';
- $terms_to_ignore = '/term/*';
- $pages = $node_to_ignore . "\r\n" . $terms_to_ignore;
- \Drupal::configFactory()
- ->getEditable('redirect_404.settings')
- ->set('pages', $pages)
- ->save();
-
- // Visit ignored or non existing pages.
- $this->drupalGet('node/' . $node1->id() . '/test');
- $this->drupalGet('term/foo');
- $this->drupalGet('term/1');
- // Go to the "fix 404" page and check there are no 404 entries.
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertNoText('node/' . $node1->id() . '/test');
- $this->assertNoText('term/foo');
- $this->assertNoText('term/1');
-
- // Visit non existing but 'unignored' page.
- $this->drupalGet('node/' . $node2->id() . '/test');
- // Go to the "fix 404" page and check there is a 404 entry.
- $this->drupalGet('admin/config/search/redirect/404');
- $this->assertText('node/' . $node2->id() . '/test');
-
- // Add this 404 entry to the 'ignore path' list, assert it works properly.
- $path_to_ignore = '/node/' . $node2->id() . '/test';
- $destination = '&destination=admin/config/search/redirect/404';
- $this->clickLink('Ignore');
- $this->assertUrl('admin/config/search/redirect/settings?ignore=' . $path_to_ignore . $destination);
- $this->assertText('Resolved the path ' . $path_to_ignore . ' in the database. Please check the ignored list and save the settings.');
- $xpath = $this->xpath('//*[@id="edit-ignore-pages"]')[0]->asXML();
- $this->assertTrue(strpos($xpath, $node_to_ignore), $node_to_ignore . " in 'Path to ignore' found");
- $this->assertTrue(strpos($xpath, $terms_to_ignore), $terms_to_ignore . " in 'Path to ignore' found");
- $this->assertTrue(strpos($xpath, $path_to_ignore), $path_to_ignore . " in 'Path to ignore' found");
-
- // Save the path with wildcard, but omitting the leading slash.
- $nodes_to_ignore = 'node/*';
- $edit = ['ignore_pages' => $nodes_to_ignore . "\r\n" . $terms_to_ignore];
- $this->drupalPostForm(NULL, $edit, 'Save configuration');
- // Should redirect to 'Fix 404'. Check the 404 entry is not shown anymore.
- $this->assertUrl('admin/config/search/redirect/404');
- $this->assertText('Configuration was saved.');
- $this->assertNoText('node/' . $node2->id() . '/test');
- $this->assertText('There are no 404 errors to fix.');
-
- // Go back to the settings to check the 'Path to ignore' configurations.
- $this->drupalGet('admin/config/search/redirect/settings');
- $xpath = $this->xpath('//*[@id="edit-ignore-pages"]')[0]->asXML();
- // Check that the new page to ignore has been saved with leading slash.
- $this->assertTrue(strpos($xpath, '/' . $nodes_to_ignore), '/' . $nodes_to_ignore . " in 'Path to ignore' found");
- $this->assertTrue(strpos($xpath, $terms_to_ignore), $terms_to_ignore . " in 'Path to ignore' found");
- $this->assertFalse(strpos($xpath, $node_to_ignore), $node_to_ignore . " in 'Path to ignore' found");
- $this->assertFalse(strpos($xpath, $path_to_ignore), $path_to_ignore . " in 'Path to ignore' found");
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404LogSuppressorTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404LogSuppressorTest.php
deleted file mode 100644
index ef021b553..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404LogSuppressorTest.php
+++ /dev/null
@@ -1,80 +0,0 @@
-adminUser = $this->drupalCreateUser([
- 'administer redirect settings',
- 'administer redirects',
- ]);
- $this->webUser = $this->drupalCreateUser([]);
- }
-
- /**
- * Tests the suppress_404 service.
- */
- public function testSuppress404Events() {
- // Cause a page not found and an access denied event.
- $this->drupalGet('page-not-found');
- $this->assertResponse(404);
- $this->drupalLogin($this->webUser);
- $this->drupalGet('admin/reports/dblog');
- $this->assertResponse(403);
-
- // Assert the events are logged in the dblog reports.
- $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'page not found'")->fetchField(), 1);
- $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'access denied'")->fetchField(), 1);
-
- // Login as admin and enable suppress_404 to avoid logging the 404 event.
- $this->drupalLogin($this->adminUser);
- $edit = ['suppress_404' => TRUE];
- $this->drupalPostForm('admin/config/search/redirect/settings', $edit, 'Save configuration');
-
- // Cause again a page not found and an access denied event.
- $this->drupalGet('page-not-found');
- $this->assertResponse(404);
- $this->drupalLogin($this->webUser);
- $this->drupalGet('admin/reports/dblog');
- $this->assertResponse(403);
-
- // Assert only the new access denied event is logged now.
- $this->drupalLogin($this->adminUser);
- $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'page not found'")->fetchField(), 1);
- $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'access denied'")->fetchField(), 2);
-
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404TestBase.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404TestBase.php
deleted file mode 100644
index 2842aeb14..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/src/Tests/Redirect404TestBase.php
+++ /dev/null
@@ -1,144 +0,0 @@
-adminUser = $this->drupalCreateUser($this->adminPermissions);
- $this->drupalLogin($this->adminUser);
-
- $this->drupalCreateContentType(['type' => 'page', 'name' => 'Page']);
- }
-
- /**
- * Passes if the language of the 404 path IS found on the loaded page.
- *
- * Because assertText() checks also in the Language select options, this
- * specific assertion in the redirect 404 table body is needed.
- *
- * @param string $language
- * The language to assert in the redirect 404 table body.
- * @param string $body
- * (optional) The table body xpath where to assert the language. Defaults
- * to '//table/tbody'.
- * @param string $message
- * (optional) A message to display with the assertion. Do not translate
- * messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
- * variables in the message text, not t(). If left blank, a default message
- * will be displayed.
- *
- * @return bool
- * TRUE on pass, FALSE on fail.
- */
- protected function assertLanguageInTableBody($language, $body = '//table/tbody', $message = '') {
- return $this->assertLanguageInTableBodyHelper($language, $body, $message, FALSE);
- }
-
- /**
- * Passes if the language of the 404 path is NOT found on the loaded page.
- *
- * Because assertText() checks also in the Language select options, this
- * specific assertion in the redirect 404 table body is needed.
- *
- * @param string $language
- * The language to assert in the redirect 404 table body.
- * @param string $body
- * (optional) The table body xpath where to assert the language. Defaults
- * to '//table/tbody'.
- * @param string $message
- * (optional) A message to display with the assertion. Do not translate
- * messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
- * variables in the message text, not t(). If left blank, a default message
- * will be displayed.
- *
- * @return bool
- * TRUE on pass, FALSE on fail.
- */
- protected function assertNoLanguageInTableBody($language, $body = '//table/tbody', $message = '') {
- return $this->assertLanguageInTableBodyHelper($language, $body, $message, TRUE);
- }
-
- /**
- * Helper for assertLanguageInTableBody and assertNoLanguageInTableBody.
- *
- * @param array $language
- * The language to assert in the redirect 404 table body.
- * @param string $body
- * (optional) The table body xpath where to assert the language. Defaults
- * to '//table/tbody'.
- * @param string $message
- * (optional) A message to display with the assertion. Do not translate
- * messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed
- * variables in the message text, not t(). If left blank, a default message
- * will be displayed.
- * @param bool $not_exists
- * (optional) TRUE if this language should not exist, FALSE if it should.
- * Defaults to TRUE.
- *
- * @return bool
- * TRUE on pass, FALSE on fail.
- */
- protected function assertLanguageInTableBodyHelper($language, $body = '//table/tbody', $message = '', $not_exists = TRUE) {
- if (!$message) {
- if (!$not_exists) {
- $message = new FormattableMarkup('Language "@language" found in 404 table.', ['@language' => $language]);
- }
- else {
- $message = new FormattableMarkup('Language "@language" not found in 404 table.', ['@language' => $language]);
- }
- }
-
- if ($not_exists) {
- return $this->assertFalse(strpos($this->xpath($body)[0]->asXML(), $language), $message);
- }
- else {
- return $this->assertTrue(strpos($this->xpath($body)[0]->asXML(), $language), $message);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php
deleted file mode 100644
index 6ed6d6774..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Kernel/Fix404RedirectCronJobTest.php
+++ /dev/null
@@ -1,192 +0,0 @@
-installSchema('redirect_404', 'redirect_404');
-
- // Insert some records in the test table with a given count and timestamp.
- $this->insert404Row('/test1', 12, strtotime('now'));
- $this->insert404Row('/test2', 5, strtotime('-1 hour'));
- $this->insert404Row('/test3', 315, strtotime('-1 week'));
- $this->insert404Row('/test4', 300, strtotime('-1 month'));
- $this->insert404Row('/test5', 1557, strtotime('-1 week'));
- $this->insert404Row('/test6', 1, strtotime('-1 day'));
- }
-
- /**
- * Tests adding and deleting rows from redirect_404 table.
- */
- function testRedirect404CronJob() {
- // Set the limit to 3 just for the test.
- \Drupal::configFactory()
- ->getEditable('redirect_404.settings')
- ->set('row_limit', 3)
- ->save();
-
- // Check that there are 6 rows in the redirect_404 table.
- $result = db_query("SELECT COUNT(*) FROM {redirect_404}")->fetchField();
- $this->assertEquals(6, $result);
-
- // Run cron to drop 3 rows from the redirect_404 test table.
- redirect_404_cron();
-
- $result = db_query("SELECT COUNT(*) FROM {redirect_404}")->fetchField();
- $this->assertEquals(3, $result);
-
- // Check there are only 3 rows with more count in the redirect_404 table.
- if (\Drupal::database()->driver() == 'mysql' || \Drupal::database()->driver() == 'pgsql') {
- $this->assertNo404Row('/test1');
- $this->assertNo404Row('/test2');
- $this->assert404Row('/test3');
- $this->assert404Row('/test4');
- $this->assert404Row('/test5');
- $this->assertNo404Row('/test6');
- }
- else {
- // In SQLite is the opposite: the 3 rows kept are the newest ones.
- $this->assert404Row('/test1');
- $this->assert404Row('/test2');
- $this->assertNo404Row('/test3');
- $this->assertNo404Row('/test4');
- $this->assertNo404Row('/test5');
- $this->assert404Row('/test6');
- }
- }
-
- /**
- * Tests adding rows and deleting one row from redirect_404 table.
- */
- function testRedirect404CronJobKeepAllButOne() {
- // Set the limit to 5 just for the test.
- \Drupal::configFactory()
- ->getEditable('redirect_404.settings')
- ->set('row_limit', 5)
- ->save();
-
- // Check that there are 6 rows in the redirect_404 table.
- $result = db_query("SELECT COUNT(*) FROM {redirect_404}")->fetchField();
- $this->assertEquals(6, $result);
-
- // Run cron to drop just 1 row from the redirect_404 test table.
- redirect_404_cron();
-
- $result = db_query("SELECT COUNT(*) FROM {redirect_404}")->fetchField();
- $this->assertEquals(5, $result);
-
- // Check only the row with least count has been removed from the table.
- if (\Drupal::database()->driver() == 'mysql' || \Drupal::database()->driver() == 'pgsql') {
- $this->assert404Row('/test1');
- $this->assert404Row('/test2');
- $this->assert404Row('/test3');
- $this->assert404Row('/test4');
- $this->assert404Row('/test5');
- $this->assertNo404Row('/test6');
- }
- else {
- // In SQlite, only the oldest row is deleted.
- $this->assert404Row('/test1');
- $this->assert404Row('/test2');
- $this->assert404Row('/test3');
- $this->assertNo404Row('/test4');
- $this->assert404Row('/test5');
- $this->assert404Row('/test6');
- }
- }
-
- /**
- * Inserts a 404 request log in the redirect_404 test table.
- *
- * @param string $path
- * The path of the request.
- * @param int $count
- * (optional) The visits count of the request.
- * @param int $timestamp
- * (optional) The timestamp of the last visited request.
- * @param string $langcode
- * (optional) The langcode of the request.
- */
- protected function insert404Row($path, $count = 1, $timestamp = 0, $langcode = 'en') {
- db_insert('redirect_404')
- ->fields([
- 'path' => $path,
- 'langcode' => $langcode,
- 'count' => $count,
- 'timestamp' => $timestamp,
- 'resolved' => 0,
- ])
- ->execute();
- }
-
- /**
- * Passes if the row with the given parameters is in the redirect_404 table.
- *
- * @param string $path
- * The path of the request.
- * @param string $langcode
- * (optional) The langcode of the request.
- */
- protected function assert404Row($path, $langcode = 'en') {
- $this->assert404RowHelper($path, $langcode, FALSE);
- }
-
- /**
- * Passes if the row with the given parameters is NOT in the redirect_404 table.
- *
- * @param string $path
- * The path of the request.
- * @param string $langcode
- * (optional) The langcode of the request.
- */
- protected function assertNo404Row($path, $langcode = 'en') {
- $this->assert404RowHelper($path, $langcode, TRUE);
- }
-
- /**
- * Passes if the row with the given parameters is in the redirect_404 table.
- *
- * @param string $path
- * The path of the request.
- * @param string $langcode
- * (optional) The langcode of the request.
- * @param bool $not_exists
- * (optional) TRUE if this 404 row should not exist in the redirect_404
- * table, FALSE if it should. Defaults to TRUE.
- */
- protected function assert404RowHelper($path, $langcode = 'en', $not_exists = TRUE) {
- $result = db_select('redirect_404', 'r404')
- ->fields('r404', ['path'])
- ->condition('path', $path)
- ->condition('langcode', $langcode)
- ->condition('resolved', 0)
- ->execute()
- ->fetchField();
-
- if ($not_exists) {
- $this->assertNotEquals($path, $result);
- }
- else {
- $this->assertEquals($path, $result);
- }
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Unit/SqlRedirectNotFoundStorageTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Unit/SqlRedirectNotFoundStorageTest.php
deleted file mode 100644
index 42e0224e5..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_404/tests/src/Unit/SqlRedirectNotFoundStorageTest.php
+++ /dev/null
@@ -1,78 +0,0 @@
-database = $this->getMockBuilder(Connection::class)
- ->disableOriginalConstructor()
- ->getMock();
- }
-
- /**
- * Tests that long paths aren't stored in the database.
- */
- public function testLongPath() {
- $this->database->expects($this->never())
- ->method('merge');
- $storage = new SqlRedirectNotFoundStorage($this->database, $this->getConfigFactoryStub());
- $storage->logRequest($this->randomMachineName(SqlRedirectNotFoundStorage::MAX_PATH_LENGTH + 1), LanguageInterface::LANGCODE_DEFAULT);
- }
-
- /**
- * Tests that invalid UTF-8 paths are not stored in the database.
- */
- public function testInvalidUtf8Path() {
- $this->database->expects($this->never())
- ->method('merge');
- $storage = new SqlRedirectNotFoundStorage($this->database, $this->getConfigFactoryStub());
- $storage->logRequest("Caf\xc3", LanguageInterface::LANGCODE_DEFAULT);
- }
-
- /**
- * Tests that all logs are kept if row limit config is "All".
- */
- public function testPurgeOldRequests() {
- $this->configFactory = $this->getConfigFactoryStub(
- [
- 'redirect_404.settings' => [
- 'row_limit' => 0,
- ],
- ]
- );
- $storage = new SqlRedirectNotFoundStorage($this->database, $this->configFactory);
- $storage->purgeOldRequests();
- $this->database->expects($this->never())
- ->method('select');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/install/redirect_domain.domains.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/install/redirect_domain.domains.yml
deleted file mode 100644
index 05c0310cc..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/install/redirect_domain.domains.yml
+++ /dev/null
@@ -1 +0,0 @@
-domain_redirects: { }
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/schema/redirect_domain.schema.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/schema/redirect_domain.schema.yml
deleted file mode 100644
index 5e29a4c57..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/config/schema/redirect_domain.schema.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-redirect_domain.domains:
- type: config_object
- label: 'Redirect domains'
- mapping:
- domain_redirects:
- type: sequence
- label: 'Domain redirects'
- sequence:
- type: sequence
- sequence:
- type: mapping
- mapping:
- sub_path:
- type: string
- label: 'Sub path'
- destination:
- type: string
- label: 'Destination'
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.info.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.info.yml
deleted file mode 100644
index aeb66d453..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: 'Redirect Domain'
-type: module
-description: 'Allows users to redirect between domains.'
-# core: 8.x
-
-dependencies:
- - redirect
-
-# Information added by Drupal.org packaging script on 2018-10-16
-version: '8.x-1.3'
-core: '8.x'
-project: 'redirect'
-datestamp: 1539682690
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.links.task.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.links.task.yml
deleted file mode 100644
index 1dcee94c0..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.links.task.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-redirect_domain.domain_list:
- title: 'Domain redirects'
- base_route: redirect.list
- route_name: redirect_domain.domain_list
- weight: 60
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.module b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.module
deleted file mode 100644
index f60b329bf..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.module
+++ /dev/null
@@ -1,33 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('The Redirect domain module allows users to redirect between domains.') . '
';
- $output .= '
' . t('Uses') . '
';
- $output .= '
' . t('Manage domain redirects') . '
';
- $output .= '
' . t('The domain redirect is accessed through Domain Redirects. The user can add the domain redirects through the domain redirect table which consists of the domain from which it needs to be redirected, the sub path and the complete url destination to which it needs to be redirected. The module also supports the usage of a wildcard redirecting, thus many requests can be handled with one instance of domain redirect.', [':domainlist' => Url::fromRoute('redirect_domain.domain_list')->toString()]) . '
' . t('The domain redirect table consists of the domain from which it needs to be redirected, the sub path and the complete url destination to which it needs to be redirected.') . '
';
- return $output;
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.routing.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.routing.yml
deleted file mode 100644
index ad38a0716..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.routing.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-redirect_domain.domain_list:
- path: '/admin/config/search/redirect/domain'
- defaults:
- _title: 'Domain redirects'
- _form: '\Drupal\redirect_domain\Form\RedirectDomainForm'
- requirements:
- _permission: 'administer redirects'
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.services.yml b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.services.yml
deleted file mode 100644
index 94503c617..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/redirect_domain.services.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-services:
- redirect_domain.request_subscriber:
- class: Drupal\redirect_domain\EventSubscriber\DomainRedirectRequestSubscriber
- arguments: ['@config.factory', '@redirect.checker', '@path.matcher']
- tags:
- - { name: event_subscriber }
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php
deleted file mode 100644
index bc949b81f..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/EventSubscriber/DomainRedirectRequestSubscriber.php
+++ /dev/null
@@ -1,133 +0,0 @@
-domainConfig = $config_factory->get('redirect_domain.domains');
- $this->redirectConfig = $config_factory->get('redirect.settings');
- $this->redirectChecker = $redirect_checker;
- $this->pathMatcher = $path_matcher;
- }
-
- /**
- * Handles the domain redirect if any found.
- *
- * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
- * The event to process.
- */
- public function onKernelRequestCheckDomainRedirect(GetResponseEvent $event) {
- $request = clone $event->getRequest();
-
- if (!$this->redirectChecker->canRedirect($request)) {
- return;
- }
-
- // Redirect between domains configuration.
- $domains = $this->domainConfig->get('domain_redirects');
- if (!empty($domains)) {
- $host = $request->getHost();
- $path = $request->getPathInfo();
- $protocol = $request->getScheme() . '://';
- $destination = NULL;
-
- // Checks if there is a redirect domain in the configuration.
- if (isset($domains[str_replace('.', ':', $host)])) {
- foreach ($domains[str_replace('.', ':', $host)] as $item) {
- if ($this->pathMatcher->matchPath($path, $item['sub_path'])) {
- $destination = $item['destination'];
- break;
- }
- }
- if ($destination) {
- // Use the default status code from Redirect.
- $response = new TrustedRedirectResponse(
- $protocol . $destination,
- $this->redirectConfig->get('default_status_code')
- );
- $event->setResponse($response);
- return;
- }
- }
- }
- }
-
- /**
- * Prior to set the response it check if we can redirect.
- *
- * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
- * The event object.
- * @param \Drupal\Core\Url $url
- * The Url where we want to redirect.
- */
- protected function setResponse(GetResponseEvent $event, Url $url) {
- $request = $event->getRequest();
-
- parse_str($request->getQueryString(), $query);
- $url->setOption('query', $query);
- $url->setAbsolute(TRUE);
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getSubscribedEvents() {
- // This needs to run before RouterListener::onKernelRequest(), which has
- // a priority of 32 and
- // RedirectRequestSubscriber::onKernelRequestCheckRedirect(), which has
- // a priority of 33. Otherwise, that aborts the request if no matching
- // route is found.
- $events[KernelEvents::REQUEST][] = ['onKernelRequestCheckDomainRedirect', 34];
- return $events;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Form/RedirectDomainForm.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Form/RedirectDomainForm.php
deleted file mode 100644
index 1bf5b9a87..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Form/RedirectDomainForm.php
+++ /dev/null
@@ -1,165 +0,0 @@
-has('maximum_domains')) {
- $form_state->set('maximum_domains', 1);
- }
-
- $form['redirects'] = [
- '#type' => 'table',
- '#tree' => TRUE,
- '#header' => [
- $this->t('From domain'),
- $this->t('Sub path'),
- $this->t('Destination')
- ],
- '#prefix' => '
',
- '#suffix' => '
',
- ];
-
- $rows = [];
- // Obtain domain redirects from configuration.
- if ($domain_redirects = $this->config('redirect_domain.domains')->get('domain_redirects')) {
- foreach ($domain_redirects as $key => $value) {
- foreach ($value as $item) {
- $form['redirects'][] = [
- 'from' => [
- '#type' => 'textfield',
- '#value' => str_replace(':','.',$key),
- ],
- 'sub_path' => [
- '#type' => 'textfield',
- '#value' => $item['sub_path'],
- ],
- 'destination' => [
- '#type' => 'textfield',
- '#value' => $item['destination'],
- ],
- ];
- }
- }
- }
-
- // Fields for the new domain redirects.
- for ($i = 0; $i < $form_state->get('maximum_domains'); $i++) {
- $form['redirects'][] = [
- 'from' => [
- '#type' => 'textfield',
- ],
- 'sub_path' => [
- '#type' => 'textfield',
- '#value' => '/',
- ],
- 'destination' => [
- '#type' => 'textfield',
- ],
- ];
- }
-
- $form['add'] = [
- '#type' => 'submit',
- '#value' => $this->t('Add another'),
- '#submit' => ['::addAnotherSubmit'],
- '#ajax' => [
- 'callback' => '::ajaxAddAnother',
- 'wrapper' => 'redirect-domain-wrapper',
- ],
- ];
- $form['submit'] = [
- '#type' => 'submit',
- '#button_type' => 'primary',
- '#value' => $this->t('Save'),
- ];
- return $form;
- }
-
- /**
- * Ajax callback for adding another domain redirect.
- *
- * @param array $form
- * The form structure.
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * The form state.
- *
- * @return array
- * The new domain redirect form part.
- */
- public function ajaxAddAnother(array $form, FormStateInterface $form_state) {
- return $form['redirects'];
- }
-
- /**
- * Submit callback for adding a new domain field.
- */
- public function addAnotherSubmit(array $form, FormStateInterface $form_state) {
- $form_state->set('maximum_domains', $form_state->get('maximum_domains') + 1);
- $form_state->setRebuild(TRUE);
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- parent::validateForm($form, $form_state);
- if ($redirects = $form_state->getValue('redirects')) {
- foreach ($redirects as $redirect) {
- if (strpos($redirect['from'], '://') !== FALSE) {
- $form_state->setErrorByName('redirects', $this->t('No protocol should be included in the redirect domain.'));
- }
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $domain_redirects = [];
- $domain_config = $this->config('redirect_domain.domains');
-
- if ($redirects = $form_state->getValue('redirects')) {
- foreach ($redirects as $redirect) {
- if (!empty($redirect['from']) && !empty($redirect['destination'])) {
- // Replace '.' with ':' for an eligible key.
- $redirect['from'] = str_replace('.', ':', $redirect['from']);
- $domain_redirects[$redirect['from']][] = [
- 'sub_path' => '/' . ltrim($redirect['sub_path'], '/'),
- 'destination' => $redirect['destination']
- ];
- }
- }
- }
- $domain_config->set('domain_redirects', $domain_redirects);
- $domain_config->save();
- drupal_set_message($this->t('The domain redirects have been saved.'));
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Tests/RedirectDomainUITest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Tests/RedirectDomainUITest.php
deleted file mode 100644
index d50791f37..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/src/Tests/RedirectDomainUITest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-drupalCreateUser([
- 'administer site configuration',
- 'access administration pages',
- 'administer redirects'
- ]);
- $this->drupalLogin($user);
- $this->drupalGet('/admin/config/search/redirect/domain');
-
- // Assert that there are 2 domain redirect fields.
- $this->assertFieldByName('redirects[0][from]');
- $this->assertFieldByName('redirects[0][sub_path]');
- $this->assertFieldByName('redirects[0][destination]');
-
- // Add another field for new domain redirect.
- $this->drupalPostAjaxForm(NULL, [], ['op' => t('Add another')]);
-
- // Add two new domain redirects.
- $edit = [
- 'redirects[0][from]' => 'foo.example.org',
- 'redirects[0][sub_path]' => '//sub-path',
- 'redirects[0][destination]' => 'www.example.org/foo',
- 'redirects[1][from]' => 'bar.example.org',
- 'redirects[1][sub_path]' => '',
- 'redirects[1][destination]' => 'www.example.org/bar',
- ];
- $this->drupalPostForm(NULL, $edit, t('Save'));
-
- // Check the new domain redirects.
- $this->assertFieldByName('redirects[0][from]', 'foo.example.org');
- $this->assertFieldByName('redirects[0][destination]', 'www.example.org/foo');
- $this->assertFieldByName('redirects[1][from]', 'bar.example.org');
- $this->assertFieldByName('redirects[1][destination]', 'www.example.org/bar');
-
- // Ensure that the sub paths are correct.
- $this->assertFieldByName('redirects[0][sub_path]', '/sub-path');
- $this->assertFieldByName('redirects[1][sub_path]', '/');
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php b/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php
deleted file mode 100644
index 89453ab9d..000000000
--- a/sites/all/modules/contrib/admin/redirect/modules/redirect_domain/tests/src/Unit/DomainRedirectRequestSubscriberTest.php
+++ /dev/null
@@ -1,144 +0,0 @@
- [
- 'domain_redirects' => [
- 'foo:com' => [
- [
- 'sub_path' => '/fixedredirect',
- 'destination' => 'bar.com/fixedredirect',
- ],
- [
- 'sub_path' => '/*',
- 'destination' => 'bar.com/example',
- ],
- ],
- 'example:com' => [
- [
- 'sub_path' => '/foo/*/bar',
- 'destination' => 'example.com/bar/foo',
- ],
- ],
- 'simpleexample:com' => [
- [
- 'sub_path' => '/redirect',
- 'destination' => 'redirected.com/redirect',
- ],
- ],
- ],
- ],
- 'redirect.settings' => [
- 'default_status_code' => 301,
- ],
- 'system.site' => [
- 'page.front' => '/',
- ],
- ];
-
- // Create a mock redirect checker.
- $checker = $this->getMockBuilder(RedirectChecker::class)
- ->disableOriginalConstructor()
- ->getMock();
- $checker->expects($this->any())
- ->method('canRedirect')
- ->will($this->returnValue(TRUE));
-
- // Set up the configuration for the requested domain.
- $config_factory = $this->getConfigFactoryStub($data);
-
- // Create a mock path matcher.
- $route_match = $this->getMock(RouteMatchInterface::class);
- $path_matcher = new PathMatcher($config_factory, $route_match);
-
- $subscriber = new DomainRedirectRequestSubscriber(
- $config_factory,
- $checker,
- $path_matcher
- );
-
- // Make a request to the urls from the data provider and get the response.
- $event = $this->getGetResponseEventStub($request_url, http_build_query([]));
-
- // Run the main redirect method.
- $subscriber->onKernelRequestCheckDomainRedirect($event);
-
- // Assert the expected response from the data provider.
- if ($response_url) {
- $this->assertTrue($event->getResponse() instanceof RedirectResponse);
- $response = $event->getResponse();
- // Make sure that the response is properly redirected.
- $this->assertEquals($response_url, $response->getTargetUrl());
- $this->assertEquals(
- $config_factory->get('redirect.settings')->get('default_status_code'),
- $response->getStatusCode()
- );
- }
- else {
- $this->assertNull($event->getResponse());
- }
- }
-
- /**
- * Gets response event object.
- *
- * @param $path_info
- * The path info.
- * @param $query_string
- * The query string in the url.
- *
- * @return GetResponseEvent
- * The response for the request.
- */
- protected function getGetResponseEventStub($path_info, $query_string) {
- $request = Request::create($path_info . '?' . $query_string, 'GET', [], [], [], ['SCRIPT_NAME' => 'index.php']);
-
- $http_kernel = $this->getMockBuilder(HttpKernelInterface::class)
- ->getMock();
- return new GetResponseEvent($http_kernel, $request, 'test');
- }
-
- /**
- * Data provider for the domain redirects.
- *
- * @return array
- * An array of requests and expected responses for the redirect domains.
- */
- public function providerDomains() {
- $datasets = [];
- $datasets[] = ['http://foo.com/example', 'http://bar.com/example'];
- $datasets[] = ['http://example.com/foo/test/bar', 'http://example.com/bar/foo'];
- $datasets[] = ['http://simpleexample.com/redirect', 'http://redirected.com/redirect'];
- $datasets[] = ['http://nonexisting.com', NULL];
- $datasets[] = ['http://simpleexample.com/wrongpath', NULL];
- $datasets[] = ['http://foo.com/fixedredirect', 'http://bar.com/fixedredirect'];
- return $datasets;
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.api.php b/sites/all/modules/contrib/admin/redirect/redirect.api.php
deleted file mode 100644
index 9ec1bdff7..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.api.php
+++ /dev/null
@@ -1,142 +0,0 @@
- $redirect) {
- if ($redirect->source !== $source) {
- // If the redirects to do not exactly match $source (e.g. case
- // insensitive matches), then remove them from the results.
- unset($redirects[$rid]);
- }
- }
-}
-
-/**
- * Act on a redirect object about to be shown on the add/edit form.
- *
- * This hook is invoked from redirect_create().
- *
- * @param $redirect
- * The redirect that is about to be shown on the add/edit form.
- *
- * @ingroup redirect_api_hooks
- */
-function hook_redirect_prepare($redirect) {
-
-}
-
-/**
- * Act on a redirect being redirected.
- *
- * This hook is invoked from redirect_redirect() before the redirect callback
- * is invoked.
- *
- * @param $redirect
- * The redirect that is being used for the redirect.
- *
- * @see redirect_redirect()
- * @see drupal_page_is_cacheable()
- * @ingroup redirect_api_hooks
- */
-function hook_redirect_alter($redirect) {
-}
-
-/**
- * @} End of "addtogroup hooks".
- */
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.drush.inc b/sites/all/modules/contrib/admin/redirect/redirect.drush.inc
deleted file mode 100644
index ffe98ce05..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.drush.inc
+++ /dev/null
@@ -1,72 +0,0 @@
- 'Create redirects.',
- 'drupal dependencies' => array('devel_generate'),
- 'arguments' => array(
- 'count' => 'Number of redirects to generate.',
- ),
- 'options' => array(
- 'delete' => 'Delete all redirects before generating new ones.',
- ),
- );
-
- return $items;
-}
-
-/**
- * Command callback. Generate a number of redirects.
- */
-function drush_redirect_generate_redirects($count = NULL) {
- if (drush_generate_is_number($count) == FALSE) {
- return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', t('Invalid number of redirects.'));
- }
- module_load_include('inc', 'redirect', 'redirect.generate');
- drush_generate_include_devel();
- redirect_run_unprogressive_batch('redirect_generate_redirects_batch_info', $count, drush_get_option('delete'));
-}
-
-/**
- * Perform an unprogressive batch process for CLI.
- */
-function redirect_run_unprogressive_batch() {
- $batch = batch_get();
- if (!empty($batch)) {
- // If there is already something in the batch, don't run.
- return FALSE;
- }
-
- $args = func_get_args();
- $batch_callback = array_shift($args);
-
- if (!lock_acquire($batch_callback)) {
- return FALSE;
- }
-
- // Attempt to increase the execution time.
- drupal_set_time_limit(240);
-
- // Build the batch array.
- $batch = call_user_func_array($batch_callback, $args);
- batch_set($batch);
-
- // We need to manually set the progressive variable again.
- // @todo Remove when http://drupal.org/node/638712 is fixed.
- $batch =& batch_get();
- $batch['progressive'] = FALSE;
-
- // Run the batch process.
- batch_process();
-
- lock_release($batch_callback);
- return TRUE;
-}
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.generate.inc b/sites/all/modules/contrib/admin/redirect/redirect.generate.inc
deleted file mode 100644
index 6120ae19b..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.generate.inc
+++ /dev/null
@@ -1,194 +0,0 @@
- 'textfield',
- '#title' => t('How many URL redirects would you like to generate?'),
- '#default_value' => 50,
- '#size' => 4,
- );
- $form['delete'] = array(
- '#type' => 'checkbox',
- '#title' => t('Delete all URL redirects before generating new URL redirects.'),
- '#default_value' => FALSE,
- );
- $form['submit'] = array(
- '#type' => 'submit',
- '#value' => t('Generate'),
- );
-
- return $form;
-}
-
-function redirect_generate_form_submit(&$form, &$form_state) {
- // Run the batch.
- $batch = redirect_generate_redirects_batch_info($form_state['values']['count'], $form_state['values']['delete']);
- batch_set($batch);
-}
-
-function redirect_generate_redirects_batch_info($count, $delete = FALSE) {
- if ($delete) {
- $operations[] = array('redirect_generate_batch_delete', array());
- }
-
- $operations[] = array('redirect_generate_batch_generate', array($count));
-
- return array(
- 'operations' => $operations,
- 'finished' => 'redirect_generate_batch_finished',
- 'file' => drupal_get_path('module', 'redirect') . '/redirect.generate.inc',
- );
-}
-
-function redirect_generate_batch_delete(array &$context) {
- if (empty($context['sandbox'])) {
- $context['sandbox'] = array();
- $context['sandbox']['progress'] = 0;
- $context['sandbox']['current_rid'] = 0;
- $context['sandbox']['max'] = db_query('SELECT COUNT(DISTINCT rid) FROM {redirect}')->fetchField();
- }
-
- $limit = 20;
- $rids = db_query_range("SELECT rid FROM {redirect} WHERE rid > :rid ORDER BY rid", 0, $limit, array(':rid' => $context['sandbox']['current_rid']))->fetchCol();
- foreach (redirect_repository()->loadMultiple($rids) as $redirect) {
- $redirect->delete();
- }
-
- // Update our progress information.
- $context['sandbox']['progress'] += count($rids);
- $context['sandbox']['current_rid'] = end($rids);
- $context['message'] = t('Deleted URL redirect @rid.', array('@rid' => end($rids)));
-
- // Inform the batch engine that we are not finished,
- // and provide an estimation of the completion level we reached.
- if ($context['sandbox']['progress'] != $context['sandbox']['max']) {
- $context['finished'] = ($context['sandbox']['progress'] >= $context['sandbox']['max']);
- }
-}
-
-function redirect_generate_batch_generate($num, array &$context) {
- if (empty($context['sandbox'])) {
- $context['sandbox'] = array();
- $context['sandbox']['progress'] = 0;
- $context['sandbox']['max'] = $num;
- $query = \Drupal::database()->select('node', 'n');
- $query->addField('n', 'nid');
- $query->condition('n.status', NODE_PUBLISHED);
- $query->addTag('node_access');
- $context['sandbox']['nids'] = $query->execute()->fetchAllKeyed(0, 0);
- }
-
- module_load_include('inc', 'devel_generate');
-
- $limit = 20;
- $types = array_keys(redirect_status_code_options());
- $languages = \Drupal::moduleHandler()->moduleExists('locale') ? array_keys(\Drupal::languageManager()->getLanguages()) : array();
-
- for ($i = 0; $i < min($limit, $context['sandbox']['max'] - $context['sandbox']['progress']); $i++) {
- $rand = mt_rand(0, 100);
-
- $redirect = Redirect::create();
-
- $source = _redirect_generate_url();
- $source_options = array();
- $redirect_options = array();
-
- if ($context['sandbox']['nids'] && $rand >= 40) {
- $redirect_target = 'node/' . array_rand($context['sandbox']['nids']);
- }
- else {
- $redirect_target = _redirect_generate_url(TRUE);
- if ($rand <= 20) {
- $redirect_options['query'] = _redirect_generate_querystring();
- }
- if ($rand <= 5) {
- $redirect_options['fragment'] = DevelGenerateBase::generateWord(mt_rand(4, 8));
- }
- }
-
- if ($rand <= 20) {
- $redirect->setStatusCode($types[array_rand($types)]);
- }
-
- if ($languages && $rand <= 20) {
- $redirect->setLanguage($languages[array_rand($languages)]);
- }
-
- $query = array();
- if ($rand <= 30) {
- $query = _redirect_generate_querystring();
- }
-
- $redirect->setSource($source, $query);
- $redirect->setRedirect($redirect_target);
-
- $redirect->save();
-
- if (mt_rand(0, 1)) {
- $query = \Drupal::database();
- $query->update('redirect')
- ->fields(array(
- 'count' => mt_rand(1, 500),
- 'access' => mt_rand(REQUEST_TIME - 31536000, REQUEST_TIME),
- ))
- ->condition('rid', $redirect->id())
- ->execute();
- }
-
- $context['results'][] = $redirect->id();
- }
-
- // Update our progress information.
- $context['sandbox']['progress'] += $limit;
- //$context['message'] = t('Deleted URL redirect @rid.', array('@rid' => end($rids)));
-
- // Inform the batch engine that we are not finished,
- // and provide an estimation of the completion level we reached.
- if ($context['sandbox']['progress'] != $context['sandbox']['max']) {
- $context['finished'] = ($context['sandbox']['progress'] >= $context['sandbox']['max']);
- }
-}
-
-function redirect_generate_batch_finished($success, $results, $operations) {
- if ($success) {
- drupal_set_message(\Drupal::translation()->formatPlural(count($results), 'One URL redirect created.', '@count URL redirects created.'));
- }
- else {
- // An error occurred.
- // $operations contains the operations that remained unprocessed.
- $error_operation = reset($operations);
- drupal_set_message(t('An error occurred while processing @operation with arguments : @args', array('@operation' => $error_operation[0], '@args' => print_r($error_operation[0], TRUE))));
- }
-}
-
-function _redirect_generate_url($external = FALSE, $max_levels = 2) {
- $url = array();
- if ($external) {
- $tlds = array('com', 'net', 'org');
- $url[] = 'http://www.example.'. $tlds[array_rand($tlds)];
- }
- $max_levels = mt_rand($external ? 0 : 1, $max_levels);
- for ($i = 1; $i <= $max_levels; $i++) {
- $url[] = DevelGenerateBase::generateWord(mt_rand(6 / $i, 8));
- }
- return implode('/', $url);
-}
-
-function _redirect_generate_querystring() {
- $query = array(DevelGenerateBase::generateWord(mt_rand(1, 3)) => DevelGenerateBase::generateWord(mt_rand(2, 4)));
- return $query;
-}
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.info.yml b/sites/all/modules/contrib/admin/redirect/redirect.info.yml
deleted file mode 100644
index a1e6eb15d..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.info.yml
+++ /dev/null
@@ -1,15 +0,0 @@
-name: Redirect
-type: module
-description: Allows users to redirect from old URLs to new URLs.
-# core: 8.x
-configure: redirect.settings
-
-dependencies:
- - drupal:link
- - drupal:views
-
-# Information added by Drupal.org packaging script on 2018-10-16
-version: '8.x-1.3'
-core: '8.x'
-project: 'redirect'
-datestamp: 1539682690
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.install b/sites/all/modules/contrib/admin/redirect/redirect.install
deleted file mode 100644
index 31a8ee693..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.install
+++ /dev/null
@@ -1,224 +0,0 @@
-fetchField();
- }
-
- $result = \Drupal::database()->select('redirect', 'r')
- ->fields('r', ['rid', 'redirect_source__path', 'redirect_source__query', 'language', 'hash'])
- ->condition('rid', $sandbox['current_rid'], '>')
- ->range(0, 100)
- ->orderBy('rid', 'ASC')
- ->execute();
-
- foreach ($result as $row) {
- $query = !empty($row->redirect_source__query) ? unserialize($row->redirect_source__query): [];
- $new_hash = Redirect::generateHash($row->redirect_source__path, (array) $query, $row->language);
- if ($row->hash != $new_hash) {
- // Do a direct query to speed things up.
- $query = \Drupal::database();
- $query->update('redirect')
- ->fields(['hash' => $new_hash])
- ->condition('rid', $row->rid)
- ->execute();
- }
- $sandbox['progress']++;
- $sandbox['current_rid'] = $row->rid;
- }
- // Reset caches.
- $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']);
-}
-
-
-/**
- * Update the {redirect} table.
- */
-function redirect_update_8101() {
- // Get the current schema, change the length.
- $key_value_store_schema = \Drupal::keyValue('entity.storage_schema.sql');
- $schema = $key_value_store_schema->get('redirect.field_schema_data.hash');
- $schema['redirect']['fields']['hash']['length'] = 64;
-
- // Set the max_length of the hash column to 64 characters.
- Database::getConnection()
- ->schema()
- ->changeField('redirect', 'hash', 'hash', $schema['redirect']['fields']['hash']);
-
- // Update the last installed field definition and field schema.
- /** @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface $key_value_store */
- \Drupal::entityManager()->clearCachedFieldDefinitions();
- $key_value_store_definition = \Drupal::keyValue('entity.definitions.installed');
- $storage_definitions = $key_value_store_definition->get('redirect.field_storage_definitions');
- $storage_definitions['hash'] = $storage_definition = \Drupal::entityManager()
- ->getFieldStorageDefinitions('redirect')['hash'];
- $key_value_store_definition->set('redirect.field_storage_definitions', $storage_definitions);
-
- // Update the stored schema.
- $key_value_store_schema->set('redirect.field_schema_data.hash', $schema);
-}
-
-/**
- * Update settings based on existing settings and Globalredirect settings.
- */
-function redirect_update_8102() {
- // Load default configuration.
- $redirect_settings = \Drupal::config('redirect.settings');
- $globalredirect_settings = \Drupal::config('globalredirect.settings');
- $config_factory = \Drupal::configFactory();
- $redirect = $config_factory->getEditable('redirect.settings');
- $nonclean_to_clean = $redirect_settings->get('global_clean');
- $admin_path = $redirect_settings->get('global_admin_paths');
- $frontpage_redirect = $redirect_settings->get('global_home');
- $deslash = $redirect_settings->get('global_deslash');
-
- $message = NULL;
-
- // If Globalredirect configuration exists, use those settings.
- if ((!$globalredirect_settings->isNew())) {
- $access_check = $globalredirect_settings->get('access_check');
- $normalize_aliases = $globalredirect_settings->get('normalize_aliases');
- $content_location_header = $globalredirect_settings->get('content_location_header');
- $term_path_handler = $globalredirect_settings->get('term_path_handler');
- $deslash = $globalredirect_settings->get('deslash');
- $frontpage_redirect = $globalredirect_settings->get('frontpage_redirect');
- $nonclean_to_clean = $globalredirect_settings->get('nonclean_to_clean');
-
- $redirect->set('access_check', $access_check);
- $redirect->set('normalize_aliases', $normalize_aliases);
- $redirect->set('content_location_header', $content_location_header);
- $redirect->set('term_path_handler', $term_path_handler);
-
- $message = 'The Globalredirect module functionality has been merged into redirect, it should be uninstalled now.';
- }
- else {
- $redirect->set('access_check', FALSE);
- $redirect->set('normalize_aliases', TRUE);
- $redirect->set('content_location_header', FALSE);
- $redirect->set('term_path_handler', TRUE);
- }
-
- // Update new redirect settings names.
- $redirect->set('nonclean_to_clean', $nonclean_to_clean);
- $redirect->set('admin_path', $admin_path);
- $redirect->set('frontpage_redirect', $frontpage_redirect);
- $redirect->set('deslash', $deslash);
-
- // Remove old names of redirect settings.
- $redirect->clear('global_clean');
- $redirect->clear('global_admin_paths');
- $redirect->clear('global_home');
- $redirect->clear('global_deslash');
-
- $redirect->save();
-
- return $message;
-}
-
-/**
- * Creates the new default redirect view.
- */
-function redirect_update_8103() {
- $message = NULL;
-
- // Only create if the redirect view doesn't exist and views is enabled.
- if (!View::load('redirect') && \Drupal::moduleHandler()->moduleExists('views')) {
- $config_path = drupal_get_path('module', 'redirect') . '/config/install/views.view.redirect.yml';
- $data = Yaml::parse($config_path);
- \Drupal::configFactory()->getEditable('views.view.redirect')->setData($data)->save(TRUE);
- $message = 'The new redirect view has been created.';
- }
- else {
- $message = 'Not creating a redirect view since it already exists.';
- }
- return $message;
-}
-
-/**
- * Save the bulk delete action to config.
- */
-function redirect_update_8104() {
- if (!Action::load('redirect_delete_action')) {
- $entity_type_manager = \Drupal::entityTypeManager();
- $module_handler = \Drupal::moduleHandler();
-
- // Save the bulk delete action to config.
- $config_install_path = $module_handler->getModule('redirect')->getPath() . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;
- $storage = new FileStorage($config_install_path);
- $entity_type_manager
- ->getStorage('action')
- ->create($storage->read('system.action.redirect_delete_action'))
- ->trustData()
- ->save();
- }
-}
-
-/**
- * Ensure to use the redirect_404 submodule.
- */
-function redirect_update_8105() {
- \Drupal::service('module_installer')->install(['redirect_404']);
-}
-
-/**
- * Removes unnecessary settings from storage.
- */
-function redirect_update_8106() {
- $config = \Drupal::configFactory()->getEditable('redirect.settings');
- $config->set('route_normalizer_enabled', $config->get('normalize_aliases'));
- $config->clear('term_path_handler');
- $config->clear('normalize_aliases');
- $config->clear('deslash');
- $config->clear('frontpage_redirect');
- $config->clear('nonclean_to_clean');
- $config->save();
-}
-
-/**
- * Update permissions.
- *
- * When splitting the permission for settings from the permission to view
- * the list of redirects, maintain the current permissions for sites which
- * already have this module installed.
- */
-function redirect_update_8107() {
- if ($roles = Role::loadMultiple()) {
- foreach ($roles as $role) {
- if ($role->hasPermission('administer redirects')) {
- $role->grantPermission('administer redirect settings');
- $role->save();
- }
- }
- }
-}
-
-/**
- * Removes unnecessary settings.
- */
-function redirect_update_8108() {
- $config = \Drupal::configFactory()->getEditable('redirect.settings');
- $config->clear('canonical');
- $config->clear('content_location_header');
- $config->save();
-}
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.libraries.yml b/sites/all/modules/contrib/admin/redirect/redirect.libraries.yml
deleted file mode 100644
index 987487264..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.libraries.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-drupal.redirect.admin:
- version: VERSION
- css:
- component:
- css/redirect.admin.css: {}
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.links.action.yml b/sites/all/modules/contrib/admin/redirect/redirect.links.action.yml
deleted file mode 100644
index 3952ca594..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-redirect.add:
- route_name: redirect.add
- title: 'Add redirect'
- appears_on:
- - 'redirect.list'
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.links.menu.yml b/sites/all/modules/contrib/admin/redirect/redirect.links.menu.yml
deleted file mode 100644
index b034d47fd..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.links.menu.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-redirect.list:
- title: 'URL redirects'
- parent: system.admin_config_search
- description: 'Redirect users from one URL to another.'
- route_name: redirect.list
- menu_name: admin
-
-redirect.add:
- title: 'Add redirect'
- parent: redirect.list
- route_name: redirect.add
- menu_name: admin
-
-redirect.settings:
- title: 'Settings'
- parent: redirect.list
- route_name: redirect.settings
- description: 'Configure behavior for URL redirects.'
- menu_name: admin
-
-#redirect.devel_generate:
-# title: 'Generate redirects'
-# parent: dblog.page_not_found
-# route_name: redirect.devel_generate
-# description: 'Generate a given number of redirects. Optionally delete current redirects.'
-# menu_name: admin
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.links.task.yml b/sites/all/modules/contrib/admin/redirect/redirect.links.task.yml
deleted file mode 100644
index 4216cbc30..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.links.task.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-redirect.list:
- route_name: redirect.list
- base_route: redirect.list
- title: URL Redirects
-
-redirect.settings:
- route_name: redirect.settings
- base_route: redirect.list
- title: Settings
- weight: 50
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.module b/sites/all/modules/contrib/admin/redirect/redirect.module
deleted file mode 100644
index bf4d4f902..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.module
+++ /dev/null
@@ -1,504 +0,0 @@
- 'redirect'));
-}
-
-/**
- * Implements hook_help().
- */
-function redirect_help($route_name, RouteMatchInterface $route_match) {
- $output = '';
- switch ($route_name) {
- case 'help.page.redirect':
- $output = '
' . t('About') . '
';
- $output .= '
' . t('The Redirect module allows users to redirect from old URLs to new URLs. For more information, see the online documentation for Redirect.', [':online' => 'https://www.drupal.org/documentation/modules/path-redirect']) . '
';
- $output .= '
';
- $output .= '
' . t('Uses') . '
';
- $output .= '
' . t('Redirect is accessed from three tabs that help you manage URL Redirects.', [':list' => Url::fromRoute('redirect.list')->toString()]) . '
';
- $output .= '
' . t('Manage URL Redirects') . '
';
- $output .= '
' . t('The "URL Redirects" page is used to setup and manage URL Redirects. New redirects are created here using the Add redirect button which presents a form to simplify the creation of redirects . The URL redirects page provides a list of all redirects on the site and allows you to edit them.', [':redirect' => Url::fromRoute('redirect.list')->toString(), ':add_form' => Url::fromRoute('redirect.add')->toString()]) . '
';
- if (\Drupal::moduleHandler()->moduleExists('redirect_404')) {
- $output .= '
' . t('Fix 404 pages') . '
';
- $output .= '
' . t('"Fix 404 pages" lists all paths that have resulted in 404 errors and do not yet have any redirects assigned to them. This 404 (or Not Found) error message is an HTTP standard response code indicating that the client was able to communicate with a given server, but the server could not find what was requested.', [':fix_404' => Url::fromRoute('redirect_404.fix_404')->toString()]) . '
' . t('404 (or Not Found) error message is an HTTP standard response code indicating that the client was able to communicate with a given server, but the server could not find what was requested. Please install the Redirect 404 submodule to be able to log all paths that have resulted in 404 errors.', [':extend' => Url::fromRoute('system.modules_list')->toString()]) . '
';
- }
- $output .= '
' . t('Configure Global Redirects') . '
';
- $output .= '
' . t('The "Settings" page presents you with a number of means to adjust redirect settings.', [':settings' => Url::fromRoute('redirect.settings')->toString()]) . '
';
- $output .= '
';
- return $output;
- break;
- }
-}
-
-/**
- * Implements hook_entity_delete().
- *
- * Will delete redirects based on the entity URL.
- */
-function redirect_entity_delete(EntityInterface $entity) {
- try {
- if ($entity->getEntityType()->hasLinkTemplate('canonical') && $entity->toUrl('canonical')->isRouted()) {
- redirect_delete_by_path('internal:/' . $entity->toUrl('canonical')->getInternalPath());
- redirect_delete_by_path('entity:' . $entity->getEntityTypeId() . '/' . $entity->id());
- }
- }
- catch (RouteNotFoundException $e) {
- // This can happen if a module incorrectly defines a link template, ignore
- // such errors.
- }
-}
-
-/**
- * Implements hook_path_update().
- *
- * Will create redirect from the old path alias to the new one.
- */
-function redirect_path_update(array $path) {
- if (!\Drupal::config('redirect.settings')->get('auto_redirect')) {
- return;
- }
- $original_path = $path['original'];
-
- // Delete all redirects having the same source as this alias.
- redirect_delete_by_path($path['alias'], $path['langcode'], FALSE);
- if ($original_path['alias'] != $path['alias']) {
- if (!redirect_repository()->findMatchingRedirect($original_path['alias'], array(), $original_path['langcode'])) {
- $redirect = Redirect::create();
- $redirect->setSource($original_path['alias']);
- $redirect->setRedirect($path['source']);
- $redirect->setLanguage($original_path['langcode']);
- $redirect->setStatusCode(\Drupal::config('redirect.settings')->get('default_status_code'));
- $redirect->save();
- }
- }
-}
-
-/**
- * Implements hook_path_insert().
- */
-function redirect_path_insert(array $path) {
- // Delete all redirects having the same source as this alias.
- redirect_delete_by_path($path['alias'], $path['langcode'], FALSE);
-}
-
-/**
- * Implements hook_path_delete().
- */
-function redirect_path_delete($path) {
- if (!\Drupal::config('redirect.settings')->get('auto_redirect')) {
- return;
- }
- elseif (isset($path['redirect']) && !$path['redirect']) {
- return;
- }
- elseif (empty($path)) {
- // @todo Remove this condition and allow $path to use an array type hint
- // when http://drupal.org/node/1025904 is fixed.
- return;
- }
-
- // Redirect from a deleted alias to the system path.
- //if (!redirect_load_by_source($path['alias'], $path['language'])) {
- // $redirect = new stdClass();
- // redirect_create($redirect);
- // $redirect->source = $path['alias'];
- // $redirect->redirect = $path['source'];
- // $redirect->language = $path['language'];
- // redirect_save($redirect);
- //}
-}
-
-/**
- * Implements hook_page_build().
- *
- * Adds an action on 404 pages to create a redirect.
- *
- * @todo hook_page_build() can no longer be used for this. Find a different way.
- */
-function redirect_page_build(&$page) {
- if (redirect_is_current_page_404() && \Drupal::currentUser()->hasPermission('administer redirects')) {
- if (!isset($page['content']['system_main']['actions'])) {
- $page['content']['system_main']['actions'] = array(
- '#theme' => 'links',
- '#links' => array(),
- '#attributes' => array('class' => array('action-links')),
- '#weight' => -100,
- );
- }
- // We cannot simply use current_path() because if a 404 path is set, then
- // that value overrides whatever is in $_GET['q']. The
- // drupal_deliver_html_page() function thankfully puts the original current
- // path into $_GET['destination'].
- $destination = drupal_get_destination();
- $page['content']['system_main']['actions']['#links']['add_redirect'] = array(
- 'title' => t('Add URL redirect from this page to another location'),
- 'href' => 'admin/config/search/redirect/add',
- 'query' => array('source' => $destination['destination']) + drupal_get_destination(),
- );
- }
-}
-
-/**
- * Gets the redirect repository service.
- *
- * @return \Drupal\redirect\RedirectRepository
- * The repository service.
- */
-function redirect_repository() {
- return \Drupal::service('redirect.repository');
-}
-
-/**
- * Delete any redirects associated with a path or any of its sub-paths.
- *
- * Given a source like 'node/1' this function will delete any redirects that
- * have that specific source or any sources that match 'node/1/%'.
- *
- * @param string $path
- * An string with an internal Drupal path.
- * @param string $langcode
- * (optional) If specified, limits deletion to redirects for the given
- * language. Defaults to all languages.
- * @param bool $match_subpaths_and_redirect
- * (optional) Whether redirects with a destination to the given path and
- * sub-paths should also be deleted.
- *
- * @ingroup redirect_api
- */
-function redirect_delete_by_path($path, $langcode = NULL, $match_subpaths_and_redirect = TRUE) {
- $path = ltrim($path, '/');
- $database = \Drupal::database();
- $query = $database->select('redirect');
- $query->addField('redirect', 'rid');
- $query_or = db_or();
- $query_or->condition('redirect_source__path', $database->escapeLike($path), 'LIKE');
- if ($match_subpaths_and_redirect) {
- $query_or->condition('redirect_source__path', $database->escapeLike($path . '/') . '%', 'LIKE');
- $query_or->condition('redirect_redirect__uri', $database->escapeLike($path), 'LIKE');
- $query_or->condition('redirect_redirect__uri', $database->escapeLike($path . '/') . '%', 'LIKE');
- }
-
- if ($langcode) {
- $query->condition('language', $langcode);
- }
-
- $query->condition($query_or);
- $rids = $query->execute()->fetchCol();
-
- if ($rids) {
- foreach (redirect_repository()->loadMultiple($rids) as $redirect) {
- $redirect->delete();
- }
- }
-}
-
-/**
- * Sort an array recusively.
- *
- * @param $array
- * The array to sort, by reference.
- * @param $callback
- * The sorting callback to use (e.g. 'sort', 'ksort', 'asort').
- *
- * @return
- * TRUE on success or FALSE on failure.
- */
-function redirect_sort_recursive(&$array, $callback = 'sort') {
- $result = $callback($array);
- foreach ($array as $key => $value) {
- if (is_array($value)) {
- $result &= redirect_sort_recursive($array[$key], $callback);
- }
- }
- return $result;
-}
-
-/**
- * Build the URL of a redirect for display purposes only.
- */
-function redirect_url($path, array $options = array(), $clean_url = NULL) {
- // @todo - deal with removal of clean_url config. See
- // https://drupal.org/node/1659580
- if (!isset($clean_url)) {
- //$clean_url = variable_get('clean_url', 0);
- }
-
- if ($path == '') {
- $path = '';
- }
-
- if (!isset($options['alter']) || !empty($options['alter'])) {
- \Drupal::moduleHandler()->alter('redirect_url', $path, $options);
- }
-
- // The base_url might be rewritten from the language rewrite in domain mode.
- if (!isset($options['base_url'])) {
- // @todo - is this correct? See https://drupal.org/node/1798832.
- if (isset($options['https']) && Settings::get('mixed_mode_sessions', FALSE)) {
- if ($options['https'] === TRUE) {
- $options['base_url'] = $GLOBALS['base_secure_url'];
- $options['absolute'] = TRUE;
- }
- elseif ($options['https'] === FALSE) {
- $options['base_url'] = $GLOBALS['base_insecure_url'];
- $options['absolute'] = TRUE;
- }
- }
- else {
- $options['base_url'] = $GLOBALS['base_url'];
- }
- }
-
- if (empty($options['absolute']) || url_is_external($path)) {
- $url = $path;
- }
- else {
- $url = $options['base_url'] . base_path() . $path;
- }
-
- if (isset($options['query'])) {
- $url .= $clean_url ? '?' : '&';
- $url .= UrlHelper::buildQuery($options['query']);
- }
- if (isset($options['fragment'])) {
- $url .= '#' . $options['fragment'];
- }
-
- return $url;
-}
-
-function redirect_status_code_options($code = NULL) {
- $codes = array(
- 300 => t('300 Multiple Choices'),
- 301 => t('301 Moved Permanently'),
- 302 => t('302 Found'),
- 303 => t('303 See Other'),
- 304 => t('304 Not Modified'),
- 305 => t('305 Use Proxy'),
- 307 => t('307 Temporary Redirect'),
- );
- return isset($codes[$code]) ? $codes[$code] : $codes;
-}
-
-/**
- * Returns if the current page request is a page not found (404 status error).
- *
- * Why the fuck do we have to do this? Why is there not an easier way???
- *
- * @return
- * TRUE if the current page is a 404, or FALSE otherwise.
- */
-function redirect_is_current_page_404() {
- return drupal_get_http_header('Status') == '404 Not Found';
-}
-
-/**
- * uasort callback; Compare redirects based on language neutrality and rids.
- */
-function _redirect_uasort($a, $b) {
- $a_weight = isset($a->weight) ? $a->weight : 0;
- $b_weight = isset($b->weight) ? $b->weight : 0;
- if ($a_weight != $b_weight) {
- // First sort by weight (case sensitivity).
- return $a_weight > $b_weight;
- }
- elseif ($a->language != $b->language) {
- // Then sort by language specific over language neutral.
- return $a->language == Language::LANGCODE_NOT_SPECIFIED;
- }
- elseif (!empty($a->source_options['query']) != !empty($b->source_options['query'])) {
- // Then sort by redirects that do not have query strings over ones that do.
- return empty($a->source_options['query']);
- }
- else {
- // Lastly sort by the highest redirect ID.
- return $a->rid < $b->rid;
- }
-}
-
-/**
- * Implements hook_form_FORM_ID_alter() on behalf of locale.module.
- */
-function locale_form_redirect_edit_form_alter(array &$form, FormStateInterface $form_state) {
- $form['language'] = array(
- '#type' => 'select',
- '#title' => t('Language'),
- '#options' => array(Language::LANGCODE_NOT_SPECIFIED => t('All languages')) + \Drupal::languageManager()->getLanguages(),
- '#default_value' => $form['language']['#value'],
- '#description' => t('A redirect set for a specific language will always be used when requesting this page in that language, and takes precedence over redirects set for All languages.'),
- );
-}
-
-/**
- * Fetch an array of redirect bulk operations.
- *
- * @see hook_redirect_operations()
- * @see hook_redirect_operations_alter()
- */
-function redirect_get_redirect_operations() {
- $operations = &drupal_static(__FUNCTION__);
-
- if (!isset($operations)) {
- $operations = \Drupal::moduleHandler()->invokeAll('redirect_operations');
- \Drupal::moduleHandler()->alter('redirect_operations', $operations);
- }
-
- return $operations;
-}
-
-/**
- * Implements hook_redirect_operations().
- */
-function redirect_redirect_operations() {
- $operations['delete'] = array(
- 'action' => t('Delete'),
- 'action_past' => t('Deleted'),
- 'callback' => 'redirect_delete_multiple',
- 'confirm' => TRUE,
- );
- return $operations;
-}
-
-/**
- * Ajax callback for the redirect link widget.
- */
-function redirect_source_link_get_status_messages(array $form, FormStateInterface $form_state) {
- return $form['redirect_source']['widget'][0]['status_box'];
-}
-
-/**
- * Implements hook_entity_extra_field_info().
- */
-function redirect_entity_extra_field_info() {
- $extra = [];
-
- if (\Drupal::service('module_handler')->moduleExists('node')) {
- $node_types = \Drupal::entityTypeManager()
- ->getStorage('node_type')
- ->loadMultiple();
-
- foreach ($node_types as $node_type) {
- $extra['node'][$node_type->id()]['form']['url_redirects'] = [
- 'label' => t('URL redirects'),
- 'description' => t('Redirect module form elements'),
- 'weight' => 50,
- ];
- }
- }
-
- return $extra;
-}
-
-/**
- * Implements hook_form_node_form_alter().
- */
-function redirect_form_node_form_alter(&$form, FormStateInterface $form_state, $form_id) {
- /** @var \Drupal\node\NodeInterface $node */
- $node = $form_state->getFormObject()->getEntity();
- if (!$node->isNew() && \Drupal::currentUser()->hasPermission('administer redirects')) {
-
- $nid = $node->id();
-
- // Find redirects to this node.
- $redirects = \Drupal::service('redirect.repository')
- ->findByDestinationUri(["internal:/node/$nid", "entity:node/$nid"]);
-
- // Assemble the rows for the table.
- $rows = [];
- /** @var \Drupal\Core\Entity\EntityListBuilder $list_builder */
- $list_builder = \Drupal::service('entity.manager')->getListBuilder('redirect');
- /** @var \Drupal\redirect\Entity\Redirect[] $redirects */
- foreach ($redirects as $redirect) {
- $row = [];
- $path = $redirect->getSourcePathWithQuery();
- $row['path'] = [
- 'class' => ['redirect-table__path'],
- 'data' => ['#plain_text' => $path],
- 'title' => $path,
- ];
- $row['operations'] = [
- 'data' => [
- '#type' => 'operations',
- '#links' => $list_builder->getOperations($redirect),
- ],
- ];
- $rows[] = $row;
- }
-
- // Add the list to the vertical tabs section of the form.
- $header = [
- ['class' => ['redirect-table__path'], 'data' => t('From')],
- ['class' => ['redirect-table__operations'], 'data' => t('Operations')],
- ];
- $form['url_redirects'] = [
- '#type' => 'details',
- '#title' => t('URL redirects'),
- '#group' => 'advanced',
- '#open' => FALSE,
- 'table' => [
- '#type' => 'table',
- '#header' => $header,
- '#rows' => $rows,
- '#empty' => t('No URL redirects available.'),
- '#attributes' => ['class' => ['redirect-table']],
- ],
- '#attached' => [
- 'library' => [
- 'redirect/drupal.redirect.admin',
- ],
- ],
- ];
-
- if (!empty($rows)) {
- $form['url_redirects']['warning'] = [
- '#markup' => t('Note: links open in the current window.'),
- '#prefix' => '
',
- '#suffix' => '
',
- ];
- }
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.permissions.yml b/sites/all/modules/contrib/admin/redirect/redirect.permissions.yml
deleted file mode 100644
index 8596ee1ca..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.permissions.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-administer redirects:
- title: 'Administer individual URL redirections'
-administer redirect settings:
- title: 'Administer global URL redirection settings'
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.routing.yml b/sites/all/modules/contrib/admin/redirect/redirect.routing.yml
deleted file mode 100644
index 4195cbb59..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.routing.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-redirect.list:
- path: '/admin/config/search/redirect'
- defaults:
- _entity_list: 'redirect'
- _title: 'URL redirects'
- requirements:
- _permission: 'administer redirects'
-
-entity.redirect.canonical:
- path: '/admin/config/search/redirect/edit/{redirect}'
- defaults:
- _entity_form: 'redirect.edit'
- _title: 'Edit URL redirect'
- requirements:
- _entity_access: 'redirect.update'
-
-redirect.add:
- path: '/admin/config/search/redirect/add'
- defaults:
- _entity_form: 'redirect.default'
- _title: 'Add URL redirect'
- requirements:
- _entity_create_access: 'redirect'
-
-entity.redirect.edit_form:
- path: '/admin/config/search/redirect/edit/{redirect}'
- defaults:
- _entity_form: 'redirect.edit'
- _title: 'Edit URL redirect'
- requirements:
- _entity_access: 'redirect.update'
-
-entity.redirect.delete_form:
- path: '/admin/config/search/redirect/delete/{redirect}'
- defaults:
- _entity_form: 'redirect.delete'
- _title: 'Delete URL redirect'
- requirements:
- _entity_access: 'redirect.delete'
-
-entity.redirect.multiple_delete_confirm:
- path: '/admin/config/search/redirect/delete'
- defaults:
- _form: '\Drupal\redirect\Form\RedirectDeleteMultipleForm'
- requirements:
- _permission: 'administer redirects'
-
-redirect.settings:
- path: '/admin/config/search/redirect/settings'
- defaults:
- _form: '\Drupal\redirect\Form\RedirectSettingsForm'
- _title: 'Settings'
- requirements:
- _permission: 'administer redirect settings'
-
-#redirect.devel_generate:
-# requirements:
-# _module_dependencies: 'devel'
diff --git a/sites/all/modules/contrib/admin/redirect/redirect.services.yml b/sites/all/modules/contrib/admin/redirect/redirect.services.yml
deleted file mode 100644
index 743bd9392..000000000
--- a/sites/all/modules/contrib/admin/redirect/redirect.services.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-parameters:
- route_normalizer_enabled: true
-services:
- redirect.repository:
- class: Drupal\redirect\RedirectRepository
- arguments: ['@entity.manager', '@database', '@config.factory']
- tags:
- - { name: backend_overridable }
- redirect.checker:
- class: Drupal\redirect\RedirectChecker
- arguments: ['@config.factory', '@state', '@access_manager', '@current_user', '@router.route_provider']
- redirect.request_subscriber:
- class: Drupal\redirect\EventSubscriber\RedirectRequestSubscriber
- arguments: ['@redirect.repository', '@language_manager', '@config.factory', '@path.alias_manager', '@module_handler', '@entity.manager', '@redirect.checker', '@router.request_context', '@path_processor_manager']
- tags:
- - { name: event_subscriber }
- redirect.settings_cache_tag:
- class: Drupal\redirect\EventSubscriber\RedirectSettingsCacheTag
- arguments: ['@cache_tags.invalidator']
- tags:
- - { name: event_subscriber }
- redirect.route_normalizer_request_subscriber:
- class: Drupal\redirect\EventSubscriber\RouteNormalizerRequestSubscriber
- arguments: ['@url_generator', '@path.matcher', '@config.factory', '@redirect.checker']
- tags:
- - { name: event_subscriber }
- redirect.route_subscriber:
- class: Drupal\redirect\Routing\RouteSubscriber
- tags:
- - { name: event_subscriber }
diff --git a/sites/all/modules/contrib/admin/redirect/src/Entity/Redirect.php b/sites/all/modules/contrib/admin/redirect/src/Entity/Redirect.php
deleted file mode 100644
index cb5d4c56d..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Entity/Redirect.php
+++ /dev/null
@@ -1,347 +0,0 @@
- mb_strtolower($source_path),
- 'language' => $language,
- );
-
- if (!empty($source_query)) {
- $hash['source_query'] = $source_query;
- }
- redirect_sort_recursive($hash, 'ksort');
- return Crypt::hashBase64(serialize($hash));
- }
-
- /**
- * {@inheritdoc}
- */
- public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
- $values += array(
- 'type' => 'redirect',
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function preSave(EntityStorageInterface $storage_controller) {
- // Get the language code directly from the field as language() might not
- // be up to date if the language was just changed.
- $this->set('hash', Redirect::generateHash($this->redirect_source->path, (array) $this->redirect_source->query, $this->get('language')->value));
- }
-
- /**
- * Sets the redirect language.
- *
- * @param string $language
- * Language code.
- */
- public function setLanguage($language) {
- $this->set('language', $language);
- }
-
- /**
- * Sets the redirect status code.
- *
- * @param int $status_code
- * The redirect status code.
- */
- public function setStatusCode($status_code) {
- $this->set('status_code', $status_code);
- }
-
- /**
- * Gets the redirect status code.
- *
- * @return int
- * The redirect status code.
- */
- public function getStatusCode() {
- return $this->get('status_code')->value;
- }
-
- /**
- * Sets the redirect created datetime.
- *
- * @param int $datetime
- * The redirect created datetime.
- */
- public function setCreated($datetime) {
- $this->set('created', $datetime);
- }
-
- /**
- * Gets the redirect created datetime.
- *
- * @return int
- * The redirect created datetime.
- */
- public function getCreated() {
- return $this->get('created')->value;
- }
-
- /**
- * Sets the source URL data.
- *
- * @param string $path
- * The base url of the source.
- * @param array $query
- * Query arguments.
- */
- public function setSource($path, array $query = array()) {
- $this->redirect_source->set(0, ['path' => ltrim($path, '/'), 'query' => $query]);
- }
-
- /**
- * Gets the source URL data.
- *
- * @return array
- */
- public function getSource() {
- return $this->get('redirect_source')->get(0)->getValue();
- }
-
- /**
- * Gets the source base URL.
- *
- * @return string
- */
- public function getSourceUrl() {
- return $this->get('redirect_source')->get(0)->getUrl()->toString();
- }
-
- /**
- * Gets the source URL path with its query.
- *
- * @return string
- * The source URL path, eventually with its query.
- */
- public function getSourcePathWithQuery() {
- $path = '/' . $this->get('redirect_source')->path;
- if ($this->get('redirect_source')->query) {
- $path .= '?' . UrlHelper::buildQuery($this->get('redirect_source')->query);
- }
- return $path;
- }
-
- /**
- * Gets the redirect URL data.
- *
- * @return array
- * The redirect URL data.
- */
- public function getRedirect() {
- return $this->get('redirect_redirect')->get(0)->getValue();
- }
-
- /**
- * Sets the redirect destination URL data.
- *
- * @param string $url
- * The base url of the redirect destination.
- * @param array $query
- * Query arguments.
- * @param array $options
- * The source url options.
- */
- public function setRedirect($url, array $query = array(), array $options = array()) {
- $uri = $url . ($query ? '?' . UrlHelper::buildQuery($query) : '');
- $external = UrlHelper::isValid($url, TRUE);
- $uri = ($external ? $url : 'internal:/' . ltrim($uri, '/'));
- $this->redirect_redirect->set(0, ['uri' => $uri, 'options' => $options]);
- }
-
- /**
- * Gets the redirect URL.
- *
- * @return \Drupal\Core\Url
- * The redirect URL.
- */
- public function getRedirectUrl() {
- return $this->get('redirect_redirect')->get(0)->getUrl();
- }
-
- /**
- * Gets the redirect URL options.
- *
- * @return array
- * The redirect URL options.
- */
- public function getRedirectOptions() {
- return $this->get('redirect_redirect')->options;
- }
-
- /**
- * Gets a specific redirect URL option.
- *
- * @param string $key
- * Option key.
- * @param mixed $default
- * Default value used in case option does not exist.
- *
- * @return mixed
- * The option value.
- */
- public function getRedirectOption($key, $default = NULL) {
- $options = $this->getRedirectOptions();
- return isset($options[$key]) ? $options[$key] : $default;
- }
-
- /**
- * Gets the current redirect entity hash.
- *
- * @return string
- * The hash.
- */
- public function getHash() {
- return $this->get('hash')->value;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
- $fields['rid'] = BaseFieldDefinition::create('integer')
- ->setLabel(t('Redirect ID'))
- ->setDescription(t('The redirect ID.'))
- ->setReadOnly(TRUE);
-
- $fields['uuid'] = BaseFieldDefinition::create('uuid')
- ->setLabel(t('UUID'))
- ->setDescription(t('The record UUID.'))
- ->setReadOnly(TRUE);
-
- $fields['hash'] = BaseFieldDefinition::create('string')
- ->setLabel(t('Hash'))
- ->setSetting('max_length', 64)
- ->setDescription(t('The redirect hash.'));
-
- $fields['type'] = BaseFieldDefinition::create('string')
- ->setLabel(t('Type'))
- ->setDescription(t('The redirect type.'));
-
- $fields['uid'] = BaseFieldDefinition::create('entity_reference')
- ->setLabel(t('User ID'))
- ->setDescription(t('The user ID of the node author.'))
- ->setDefaultValueCallback('\Drupal\redirect\Entity\Redirect::getCurrentUserId')
- ->setSettings(array(
- 'target_type' => 'user',
- ));
-
- $fields['redirect_source'] = BaseFieldDefinition::create('redirect_source')
- ->setLabel(t('From'))
- ->setDescription(t("Enter an internal Drupal path or path alias to redirect (e.g. %example1 or %example2). Fragment anchors (e.g. %anchor) are not allowed.", array('%example1' => 'node/123', '%example2' => 'taxonomy/term/123', '%anchor' => '#anchor')))
- ->setRequired(TRUE)
- ->setTranslatable(FALSE)
- ->setDisplayOptions('form', array(
- 'type' => 'redirect_link',
- 'weight' => -5,
- ))
- ->setDisplayConfigurable('form', TRUE);
-
- $fields['redirect_redirect'] = BaseFieldDefinition::create('link')
- ->setLabel(t('To'))
- ->setRequired(TRUE)
- ->setTranslatable(FALSE)
- ->setSettings(array(
- 'link_type' => LinkItemInterface::LINK_GENERIC,
- 'title' => DRUPAL_DISABLED
- ))
- ->setDisplayOptions('form', array(
- 'type' => 'link',
- 'weight' => -4,
- ))
- ->setDisplayConfigurable('form', TRUE);
-
- $fields['language'] = BaseFieldDefinition::create('language')
- ->setLabel(t('Language'))
- ->setDescription(t('The redirect language.'))
- ->setDisplayOptions('form', array(
- 'type' => 'language_select',
- 'weight' => 2,
- ));
-
- $fields['status_code'] = BaseFieldDefinition::create('integer')
- ->setLabel(t('Status code'))
- ->setDescription(t('The redirect status code.'))
- ->setDefaultValue(0);
-
- $fields['created'] = BaseFieldDefinition::create('created')
- ->setLabel(t('Created'))
- ->setDescription(t('The date when the redirect was created.'));
- return $fields;
- }
-
- /**
- * Default value callback for 'uid' base field definition.
- *
- * @see ::baseFieldDefinitions()
- *
- * @return array
- * An array of default values.
- */
- public static function getCurrentUserId() {
- return array(\Drupal::currentUser()->id());
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectRequestSubscriber.php b/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectRequestSubscriber.php
deleted file mode 100644
index 87095deff..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectRequestSubscriber.php
+++ /dev/null
@@ -1,211 +0,0 @@
-redirectRepository = $redirect_repository;
- $this->languageManager = $language_manager;
- $this->config = $config->get('redirect.settings');
- $this->aliasManager = $alias_manager;
- $this->moduleHandler = $module_handler;
- $this->entityManager = $entity_manager;
- $this->checker = $checker;
- $this->context = $context;
- $this->pathProcessor = $path_processor;
- }
-
- /**
- * Handles the redirect if any found.
- *
- * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
- * The event to process.
- */
- public function onKernelRequestCheckRedirect(GetResponseEvent $event) {
- // Get a clone of the request. During inbound processing the request
- // can be altered. Allowing this here can lead to unexpected behavior.
- // For example the path_processor.files inbound processor provided by
- // the system module alters both the path and the request; only the
- // changes to the request will be propagated, while the change to the
- // path will be lost.
- $request = clone $event->getRequest();
-
- if (!$this->checker->canRedirect($request)) {
- return;
- }
-
- // Get URL info and process it to be used for hash generation.
- parse_str($request->getQueryString(), $request_query);
-
- if (strpos($request->getPathInfo(), '/system/files/') === 0 && !$request->query->has('file')) {
- // Private files paths are split by the inbound path processor and the
- // relative file path is moved to the 'file' query string parameter. This
- // is because the route system does not allow an arbitrary amount of
- // parameters. We preserve the path as is returned by the request object.
- // @see \Drupal\system\PathProcessor\PathProcessorFiles::processInbound()
- $path = $request->getPathInfo();
- }
- else {
- // Do the inbound processing so that for example language prefixes are
- // removed.
- $path = $this->pathProcessor->processInbound($request->getPathInfo(), $request);
- }
- $path = trim($path, '/');
-
- $this->context->fromRequest($request);
-
- try {
- $redirect = $this->redirectRepository->findMatchingRedirect($path, $request_query, $this->languageManager->getCurrentLanguage()->getId());
- }
- catch (RedirectLoopException $e) {
- \Drupal::logger('redirect')->warning($e->getMessage());
- $response = new Response();
- $response->setStatusCode(503);
- $response->setContent('Service unavailable');
- $event->setResponse($response);
- return;
- }
-
- if (!empty($redirect)) {
-
- // Handle internal path.
- $url = $redirect->getRedirectUrl();
- if ($this->config->get('passthrough_querystring')) {
- $url->setOption('query', (array) $url->getOption('query') + $request_query);
- }
- $headers = [
- 'X-Redirect-ID' => $redirect->id(),
- ];
- $response = new TrustedRedirectResponse($url->setAbsolute()->toString(), $redirect->getStatusCode(), $headers);
- $response->addCacheableDependency($redirect);
- $event->setResponse($response);
- }
- }
-
- /**
- * Prior to set the response it check if we can redirect.
- *
- * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
- * The event object.
- * @param \Drupal\Core\Url $url
- * The Url where we want to redirect.
- */
- protected function setResponse(GetResponseEvent $event, Url $url) {
- $request = $event->getRequest();
- $this->context->fromRequest($request);
-
- parse_str($request->getQueryString(), $query);
- $url->setOption('query', $query);
- $url->setAbsolute(TRUE);
-
- // We can only check access for routed URLs.
- if (!$url->isRouted() || $this->checker->canRedirect($request, $url->getRouteName())) {
- // Add the 'rendered' cache tag, so that we can invalidate all responses
- // when settings are changed.
- $response = new TrustedRedirectResponse($url->toString(), 301);
- $response->addCacheableDependency(CacheableMetadata::createFromRenderArray([])->addCacheTags(['rendered']));
- $event->setResponse($response);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getSubscribedEvents() {
- // This needs to run before RouterListener::onKernelRequest(), which has
- // a priority of 32. Otherwise, that aborts the request if no matching
- // route is found.
- $events[KernelEvents::REQUEST][] = array('onKernelRequestCheckRedirect', 33);
- return $events;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectSettingsCacheTag.php b/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectSettingsCacheTag.php
deleted file mode 100644
index 7dfb063b3..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RedirectSettingsCacheTag.php
+++ /dev/null
@@ -1,54 +0,0 @@
-cacheTagsInvalidator = $cache_tags_invalidator;
- }
-
- /**
- * Invalidate the 'rendered' cache tag whenever the settings are modified.
- *
- * @param \Drupal\Core\Config\ConfigCrudEvent $event
- * The Event to process.
- */
- public function onSave(ConfigCrudEvent $event) {
- // Changing the Redirect settings means that any cached page might
- // result in a different response, so we need to invalidate them all.
- if ($event->getConfig()->getName() === 'redirect.settings') {
- $this->cacheTagsInvalidator->invalidateTags(['rendered']);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public static function getSubscribedEvents() {
- $events[ConfigEvents::SAVE][] = ['onSave'];
- return $events;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php b/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php
deleted file mode 100644
index 800e022a5..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/EventSubscriber/RouteNormalizerRequestSubscriber.php
+++ /dev/null
@@ -1,143 +0,0 @@
-urlGenerator = $url_generator;
- $this->pathMatcher = $path_matcher;
- $this->redirectChecker = $redirect_checker;
- $this->config = $config->get('redirect.settings');
- }
-
- /**
- * Performs a redirect if the URL changes in routing.
- *
- * The redirect happens if a URL constructed from the current route is
- * different from the requested one. Examples:
- * - Language negotiation system detected a language to use, and that language
- * has a path prefix: perform a redirect to the language prefixed URL.
- * - A route that's set as the front page is requested: redirect to the front
- * page.
- * - Requested path has an alias: redirect to alias.
- *
- * @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
- * The Event to process.
- */
- public function onKernelRequestRedirect(GetResponseEvent $event) {
-
- if (!$this->config->get('route_normalizer_enabled') || !$event->isMasterRequest()) {
- return;
- }
-
- $request = $event->getRequest();
- if ($request->attributes->get('_disable_route_normalizer')) {
- return;
- }
-
- if ($this->redirectChecker->canRedirect($request)) {
- // The "" placeholder can be used for all routes except the front
- // page because it's not a real route.
- $route_name = $this->pathMatcher->isFrontPage() ? '' : '';
-
- // Don't pass in the query here using $request->query->all()
- // since that can potentially modify the query parameters.
- $options = ['absolute' => TRUE];
- $redirect_uri = $this->urlGenerator->generateFromRoute($route_name, [], $options);
-
- // Strip off query parameters added by the route such as a CSRF token.
- if (strpos($redirect_uri, '?') !== FALSE) {
- $redirect_uri = strtok($redirect_uri, '?');
- }
-
- // Append back the request query string from $_SERVER.
- $query_string = $request->server->get('QUERY_STRING');
- if ($query_string) {
- $redirect_uri .= '?' . $query_string;
- }
-
- // Remove /index.php from redirect uri the hard way.
- if (!RequestHelper::isCleanUrl($request)) {
- // This needs to be fixed differently.
- $redirect_uri = str_replace('/index.php', '', $redirect_uri);
- }
-
- $original_uri = $request->getSchemeAndHttpHost() . $request->getRequestUri();
- $original_uri = urldecode($original_uri);
- $redirect_uri = urldecode($redirect_uri);
- if ($redirect_uri != $original_uri) {
- $response = new TrustedRedirectResponse($redirect_uri, $this->config->get('default_status_code'));
- $response->headers->set('X-Drupal-Route-Normalizer', 1);
- $event->setResponse($response);
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- static function getSubscribedEvents() {
- $events[KernelEvents::REQUEST][] = array('onKernelRequestRedirect', 30);
- return $events;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Exception/RedirectLoopException.php b/sites/all/modules/contrib/admin/redirect/src/Exception/RedirectLoopException.php
deleted file mode 100644
index f2793f3e8..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Exception/RedirectLoopException.php
+++ /dev/null
@@ -1,24 +0,0 @@
- $path, '%rid' => $rid]));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteForm.php b/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteForm.php
deleted file mode 100644
index eeee993d9..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteForm.php
+++ /dev/null
@@ -1,41 +0,0 @@
-t('Are you sure you want to delete the URL redirect from %source to %redirect?', array('%source' => $this->entity->getSourceUrl(), '%redirect' => $this->entity->getRedirectUrl()->toString()));
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('redirect.list');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Delete');
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->entity->delete();
- drupal_set_message($this->t('The redirect %redirect has been deleted.', array('%redirect' => $this->entity->getRedirectUrl()->toString())));
- $form_state->setRedirect('redirect.list');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteMultipleForm.php b/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteMultipleForm.php
deleted file mode 100644
index 79c79467c..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectDeleteMultipleForm.php
+++ /dev/null
@@ -1,140 +0,0 @@
-privateTempStoreFactory = $temp_store_factory;
- $this->redirectStorage = $entity_type_manager->getStorage('redirect');
- $this->currentUser = $account;
- $this->setStringTranslation($string_translation);
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('user.private_tempstore'),
- $container->get('entity_type.manager'),
- $container->get('current_user'),
- $container->get('string_translation')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'redirect_multiple_delete_confirm';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getQuestion() {
- return $this->formatPlural(count($this->redirects), 'Are you sure you want to delete this redirect?', 'Are you sure you want to delete these redirects?');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCancelUrl() {
- return new Url('redirect.list');
- }
-
- /**
- * {@inheritdoc}
- */
- public function getConfirmText() {
- return $this->t('Delete');
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
- $this->redirects = $this->privateTempStoreFactory->get('redirect_multiple_delete_confirm')->get($this->currentUser->id());
- if (empty($this->redirects)) {
- return new RedirectResponse($this->getCancelUrl()->setAbsolute()->toString());
- }
-
- $form['redirects'] = [
- '#theme' => 'item_list',
- '#items' => array_map(function ($redirect) {
- return $redirect->label();
- }, $this->redirects),
- ];
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
-
- if ($form_state->getValue('confirm') && !empty($this->redirects)) {
- $this->redirectStorage->delete($this->redirects);
- $this->privateTempStoreFactory->get('redirect_multiple_delete_confirm')->delete($this->currentUser->id());
- $count = count($this->redirects);
- $this->logger('redirect')->notice('Deleted @count redirects.', ['@count' => $count]);
- drupal_set_message($this->stringTranslation->formatPlural($count, 'Deleted 1 redirect.', 'Deleted @count redirects.'));
- }
- $form_state->setRedirect('redirect.list');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectForm.php b/sites/all/modules/contrib/admin/redirect/src/Form/RedirectForm.php
deleted file mode 100644
index 702e99158..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectForm.php
+++ /dev/null
@@ -1,152 +0,0 @@
-entity;
-
- if ($redirect->isNew()) {
-
- // To pass in the query set parameters into GET as follows:
- // source_query[key1]=value1&source_query[key2]=value2
- $source_query = array();
- if ($this->getRequest()->get('source_query')) {
- $source_query = $this->getRequest()->get('source_query');
- }
-
- $redirect_options = array();
- $redirect_query = array();
- if ($this->getRequest()->get('redirect_options')) {
- $redirect_options = $this->getRequest()->get('redirect_options');
- if (isset($redirect_options['query'])) {
- $redirect_query = $redirect_options['query'];
- unset($redirect_options['query']);
- }
- }
-
- $source_url = urldecode($this->getRequest()->get('source'));
- if (!empty($source_url)) {
- $redirect->setSource($source_url, $source_query);
- }
-
- $redirect_url = urldecode($this->getRequest()->get('redirect'));
- if (!empty($redirect_url)) {
- try {
- $redirect->setRedirect($redirect_url, $redirect_query, $redirect_options);
- }
- catch (MatchingRouteNotFoundException $e) {
- drupal_set_message($this->t('Invalid redirect URL %url provided.', array('%url' => $redirect_url)), 'warning');
- }
- }
-
- $redirect->setLanguage($this->getRequest()->get('language') ? $this->getRequest()->get('language') : Language::LANGCODE_NOT_SPECIFIED);
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function form(array $form, FormStateInterface $form_state) {
- $form = parent::form($form, $form_state);
- /** @var \Drupal\redirect\Entity\Redirect $redirect */
- $redirect = $this->entity;
-
- // Only add the configured languages and a single key for all languages.
- if (isset($form['language']['widget'][0]['value'])) {
- foreach (\Drupal::languageManager()->getLanguages(LanguageInterface::STATE_CONFIGURABLE) as $langcode => $language) {
- $form['language']['widget'][0]['value']['#options'][$langcode] = $language->getName();
- }
- $form['language']['widget'][0]['value']['#options'][LanguageInterface::LANGCODE_NOT_SPECIFIED] = $this->t('- All languages -');
- }
-
- $default_code = $redirect->getStatusCode() ? $redirect->getStatusCode() : \Drupal::config('redirect.settings')->get('default_status_code');
-
- $form['status_code'] = array(
- '#type' => 'select',
- '#title' => $this->t('Redirect status'),
- '#description' => $this->t('You can find more information about HTTP redirect status codes at @status-codes.', array('@status-codes' => 'http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection')),
- '#default_value' => $default_code,
- '#options' => redirect_status_code_options(),
- );
-
- return $form;
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- parent::validateForm($form, $form_state);
- $source = $form_state->getValue(array('redirect_source', 0));
- $redirect = $form_state->getValue(array('redirect_redirect', 0));
-
- if ($source['path'] == '') {
- $form_state->setErrorByName('redirect_source', $this->t('It is not allowed to create a redirect from the front page.'));
- }
- if (strpos($source['path'], '#') !== FALSE) {
- $form_state->setErrorByName('redirect_source', $this->t('The anchor fragments are not allowed.'));
- }
- if (strpos($source['path'], '/') === 0) {
- $form_state->setErrorByName('redirect_source', $this->t('The url to redirect from should not start with a forward slash (/).'));
- }
-
- try {
- $source_url = Url::fromUri('internal:/' . $source['path']);
- $redirect_url = Url::fromUri($redirect['uri']);
-
- // It is relevant to do this comparison only in case the source path has
- // a valid route. Otherwise the validation will fail on the redirect path
- // being an invalid route.
- if ($source_url->toString() == $redirect_url->toString()) {
- $form_state->setErrorByName('redirect_redirect', $this->t('You are attempting to redirect the page to itself. This will result in an infinite loop.'));
- }
- }
- catch (\InvalidArgumentException $e) {
- // Do nothing, we want to only compare the resulting URLs.
- }
-
- $parsed_url = UrlHelper::parse(trim($source['path']));
- $path = isset($parsed_url['path']) ? $parsed_url['path'] : NULL;
- $query = isset($parsed_url['query']) ? $parsed_url['query'] : NULL;
- $hash = Redirect::generateHash($path, $query, $form_state->getValue('language')[0]['value']);
-
- // Search for duplicate.
- $redirects = \Drupal::entityManager()
- ->getStorage('redirect')
- ->loadByProperties(array('hash' => $hash));
-
- if (!empty($redirects)) {
- $redirect = array_shift($redirects);
- if ($this->entity->isNew() || $redirect->id() != $this->entity->id()) {
- $form_state->setErrorByName('redirect_source', $this->t('The source path %source is already being redirected. Do you want to edit the existing redirect?',
- array(
- '%source' => $source['path'],
- '@edit-page' => $redirect->url('edit-form'))));
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $form, FormStateInterface $form_state) {
- $this->entity->save();
- drupal_set_message($this->t('The redirect has been saved.'));
- $form_state->setRedirect('redirect.list');
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectSettingsForm.php b/sites/all/modules/contrib/admin/redirect/src/Form/RedirectSettingsForm.php
deleted file mode 100644
index 029973dcc..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Form/RedirectSettingsForm.php
+++ /dev/null
@@ -1,93 +0,0 @@
-config('redirect.settings');
- $form['redirect_auto_redirect'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Automatically create redirects when URL aliases are changed.'),
- '#default_value' => $config->get('auto_redirect'),
- '#disabled' => !\Drupal::moduleHandler()->moduleExists('path'),
- );
- $form['redirect_passthrough_querystring'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Retain query string through redirect.'),
- '#default_value' => $config->get('passthrough_querystring'),
- '#description' => $this->t('For example, given a redirect from %source to %redirect, if a user visits %sourcequery they would be redirected to %redirectquery. The query strings in the redirection will always take precedence over the current query string.', array('%source' => 'source-path', '%redirect' => 'node?a=apples', '%sourcequery' => 'source-path?a=alligators&b=bananas', '%redirectquery' => 'node?a=apples&b=bananas')),
- );
- $form['redirect_warning'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Display a warning message to users when they are redirected.'),
- '#default_value' => $config->get('warning'),
- '#access' => FALSE,
- );
- $form['redirect_default_status_code'] = array(
- '#type' => 'select',
- '#title' => $this->t('Default redirect status'),
- '#description' => $this->t('You can find more information about HTTP redirect status codes at @status-codes.', array('@status-codes' => 'http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection')),
- '#options' => redirect_status_code_options(),
- '#default_value' => $config->get('default_status_code'),
- );
- $form['globals'] = array(
- '#type' => 'fieldset',
- '#title' => $this->t('Global redirects'),
- '#description' => $this->t('(formerly Global Redirect features)'),
- );
- $form['globals']['redirect_route_normalizer_enabled'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Enforce clean and canonical URLs.'),
- '#description' => $this->t('Enabling this will automatically redirect to the canonical URL of any page. That includes redirecting to an alias if existing, removing trailing slashes, ensure the language prefix is set and similar clean-up.'),
- '#default_value' => $config->get('route_normalizer_enabled'),
- );
- $form['globals']['redirect_ignore_admin_path'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Ignore redirections on admin paths.'),
- '#default_value' => $config->get('ignore_admin_path'),
- );
- $form['globals']['redirect_access_check'] = array(
- '#type' => 'checkbox',
- '#title' => $this->t('Check access to the redirected page'),
- '#description' => $this->t('This helps to stop redirection on protected pages and avoids giving away secret URL\'s. By default this feature is disabled to avoid any unexpected behavior'),
- '#default_value' => $config->get('access_check'),
- );
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $config = $this->config('redirect.settings');
- foreach ($form_state->getValues() as $key => $value) {
- if (strpos($key, 'redirect_') !== FALSE) {
- $config->set(str_replace('redirect_', '', $key), $value);
- }
- }
- $config->save();
- drupal_set_message($this->t('Configuration was saved.'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Action/DeleteRedirect.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Action/DeleteRedirect.php
deleted file mode 100644
index 8b7f57972..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Action/DeleteRedirect.php
+++ /dev/null
@@ -1,92 +0,0 @@
-currentUser = $current_user;
- $this->privateTempStore = $temp_store_factory->get('redirect_multiple_delete_confirm');
-
- parent::__construct($configuration, $plugin_id, $plugin_definition);
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('user.private_tempstore'),
- $container->get('current_user')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function executeMultiple(array $entities) {
- $this->privateTempStore->set($this->currentUser->id(), $entities);
- }
-
- /**
- * {@inheritdoc}
- */
- public function execute($object = NULL) {
- $this->executeMultiple([$object]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE) {
- return $object->access('delete', $account, $return_as_object);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldFormatter/RedirectSourceFormatter.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldFormatter/RedirectSourceFormatter.php
deleted file mode 100644
index 7ef400de2..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldFormatter/RedirectSourceFormatter.php
+++ /dev/null
@@ -1,36 +0,0 @@
- $item) {
- $elements[$delta] = array(
- '#markup' => urldecode($item->getUrl()->toString()),
- );
- }
-
- return $elements;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldType/RedirectSourceItem.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldType/RedirectSourceItem.php
deleted file mode 100644
index 53a0efc66..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldType/RedirectSourceItem.php
+++ /dev/null
@@ -1,112 +0,0 @@
-setLabel(t('Path'));
-
- $properties['query'] = MapDataDefinition::create()
- ->setLabel(t('Query'));
-
- return $properties;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function schema(FieldStorageDefinitionInterface $field_definition) {
- return array(
- 'columns' => array(
- 'path' => array(
- 'description' => 'The source path',
- 'type' => 'varchar',
- 'length' => 2048,
- ),
- 'query' => array(
- 'description' => 'Serialized array of path queries',
- 'type' => 'blob',
- 'size' => 'big',
- 'serialize' => TRUE,
- ),
- ),
- 'indexes' => array(
- 'path' => array(array('path', 50)),
- ),
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
- // Set random length for the path.
- $domain_length = mt_rand(7, 15);
- $random = new Random();
-
- $values['path'] = 'http://www.' . $random->word($domain_length);
-
- return $values;
- }
-
- /**
- * {@inheritdoc}
- */
- public function isEmpty() {
- return $this->path === NULL || $this->path === '';
- }
-
- /**
- * {@inheritdoc}
- */
- public static function mainPropertyName() {
- return 'path';
- }
-
- /**
- * {@inheritdoc}
- */
- public function setValue($values, $notify = TRUE) {
- // Unserialize the values.
- // @todo The storage controller should take care of this, see
- // SqlContentEntityStorage::loadFieldItems, see
- // https://www.drupal.org/node/2414835
- if (isset($values['query']) && is_string($values['query'])) {
- $values['query'] = unserialize($values['query']);
- }
- parent::setValue($values, $notify);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getUrl() {
- return Url::fromUri('base:' . $this->path, ['query' => $this->query]);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldWidget/RedirectSourceWidget.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldWidget/RedirectSourceWidget.php
deleted file mode 100644
index 0a4341116..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Field/FieldWidget/RedirectSourceWidget.php
+++ /dev/null
@@ -1,117 +0,0 @@
-path;
- if ($items[$delta]->query) {
- $default_url_value .= '?' . http_build_query($items[$delta]->query);
- }
- $element['path'] = array(
- '#type' => 'textfield',
- '#title' => $this->t('Path'),
- '#placeholder' => $this->getSetting('placeholder_url'),
- '#default_value' => $default_url_value,
- '#maxlength' => 2048,
- '#required' => $element['#required'],
- '#field_prefix' => Url::fromRoute('', array(), array('absolute' => TRUE))->toString(),
- '#attributes' => array('data-disable-refocus' => 'true'),
- );
-
- // If creating new URL add checks.
- if ($items->getEntity()->isNew()) {
- $element['status_box'] = array(
- '#prefix' => '
',
- '#suffix' => '
',
- );
-
- $source_path = $form_state->getValue(array('redirect_source', 0, 'path'));
- if ($source_path) {
- $source_path = trim($source_path);
-
- // Warning about creating a redirect from a valid path.
- // @todo - Hmm... exception driven logic. Find a better way how to
- // determine if we have a valid path.
- try {
- \Drupal::service('router')->match('/' . $form_state->getValue(array('redirect_source', 0, 'path')));
- $element['status_box'][]['#markup'] = '
' . $this->t('The source path %path is likely a valid path. It is preferred to create URL aliases for existing paths rather than redirects.',
- array('%path' => $source_path, '@url-alias' => Url::fromRoute('path.admin_add')->toString())) . '
' . $this->t('The base source path %source is already being redirected. Do you want to edit the existing redirect?', array('%source' => $source_path, '@edit-page' => $redirect->url('edit-form'))) . '
';
- }
- }
- }
-
- $element['path']['#ajax'] = array(
- 'callback' => 'redirect_source_link_get_status_messages',
- 'wrapper' => 'redirect-link-status',
- );
- }
-
- return $element;
- }
-
- /**
- * {@inheritdoc}
- */
- public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
- $values = parent::massageFormValues($values, $form, $form_state);
- // It is likely that the url provided for this field is not existing and
- // so the logic in the parent method did not set any defaults. Just run
- // through all url values and add defaults.
- foreach ($values as &$value) {
- if (!empty($value['path'])) {
- // In case we have query process the url.
- if (strpos($value['path'], '?') !== FALSE) {
- $url = UrlHelper::parse($value['path']);
- $value['path'] = $url['path'];
- $value['query'] = $url['query'];
- }
- }
- }
- return $values;
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/Validation/Constraint/SourceLinkTypeConstraint.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/Validation/Constraint/SourceLinkTypeConstraint.php
deleted file mode 100644
index 5d354a07d..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Plugin/Validation/Constraint/SourceLinkTypeConstraint.php
+++ /dev/null
@@ -1,92 +0,0 @@
-context = $context;
- }
-
- /**
- * {@inheritdoc}
- */
- public function validatedBy() {
- return get_class($this);
- }
-
- /**
- * {@inheritdoc}
- */
- public function validate($value, Constraint $constraint) {
- if (isset($value)) {
- $url_is_valid = TRUE;
- /** @var $link_item \Drupal\link\LinkItemInterface */
- $link_item = $value;
- $link_type = $link_item->getFieldDefinition()->getSetting('link_type');
- $url_string = $link_item->url;
- // Validate the url property.
- if ($url_string !== '') {
- try {
- // @todo This shouldn't be needed, but massageFormValues() may not
- // run.
- $parsed_url = UrlHelper::parse($url_string);
-
- if (!empty($parsed_url['path'])) {
- $url = Url::fromUri('internal:' . $parsed_url['path']);
-
- if ($url->isExternal() && !UrlHelper::isValid($url_string, TRUE)) {
- $url_is_valid = FALSE;
- }
- elseif ($url->isExternal() && !($link_type & LinkItemInterface::LINK_EXTERNAL)) {
- $url_is_valid = FALSE;
- }
- }
- }
- catch (NotFoundHttpException $e) {
- $url_is_valid = FALSE;
- }
- catch (ResourceNotFoundException $e) {
- // User is creating a redirect from non existing path. This is not an
- // error state.
- $url_is_valid = TRUE;
- }
- catch (ParamNotConvertedException $e) {
- $url_is_valid = FALSE;
- }
- }
- if (!$url_is_valid) {
- $this->context->addViolation($this->message, array('%url' => $url_string));
- }
- }
- }
-}
-
diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/PathRedirect.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/PathRedirect.php
deleted file mode 100644
index ecff15446..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/process/PathRedirect.php
+++ /dev/null
@@ -1,42 +0,0 @@
-select('path_redirect', 'p')
- ->fields('p', array(
- 'rid',
- 'source',
- 'redirect',
- 'query',
- 'fragment',
- 'language',
- 'type',
- 'last_used',
- ));
-
- return $query;
- }
-
- /**
- * {@inheritdoc}
- */
- public function fields() {
- $fields = array(
- 'rid' => $this->t('Redirect ID'),
- 'source' => $this->t('Source'),
- 'redirect' => $this->t('Redirect'),
- 'query' => $this->t('Query'),
- 'fragment' => $this->t('Fragment'),
- 'language' => $this->t('Language'),
- 'type' => $this->t('Type'),
- 'last_used' => $this->t('Last Used'),
- );
- return $fields;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getIds() {
- $ids['rid']['type'] = 'integer';
- return $ids;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/source/d7/PathRedirect.php b/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/source/d7/PathRedirect.php
deleted file mode 100644
index c9ec720d6..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Plugin/migrate/source/d7/PathRedirect.php
+++ /dev/null
@@ -1,81 +0,0 @@
-select('redirect', 'p')->fields('p');
-
- return $query;
- }
-
- /**
- * {@inheritdoc}
- */
- public function prepareRow(Row $row) {
- static $default_status_code;
- if (!isset($default_status_code)) {
- $default_status_code = unserialize($this->getDatabase()
- ->select('variable', 'v')
- ->fields('v', ['value'])
- ->condition('name', 'redirect_default_status_code')
- ->execute()
- ->fetchField());
- }
- $current_status_code = $row->getSourceProperty('status_code');
- $status_code = $current_status_code != 0 ? $current_status_code : $default_status_code;
- $row->setSourceProperty('status_code', $status_code);
- return parent::prepareRow($row);
- }
-
- /**
- * {@inheritdoc}
- */
- public function fields() {
- $fields = [
- 'rid' => $this->t('Redirect ID'),
- 'hash' => $this->t('Hash'),
- 'type' => $this->t('Type'),
- 'uid' => $this->t('UID'),
- 'source' => $this->t('Source'),
- 'source_options' => $this->t('Source Options'),
- 'redirect' => $this->t('Redirect'),
- 'redirect_options' => $this->t('Redirect Options'),
- 'language' => $this->t('Language'),
- 'status_code' => $this->t('Status Code'),
- 'count' => $this->t('Count'),
- 'access' => $this->t('Access'),
- ];
- return $fields;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getIds() {
- $ids['rid']['type'] = 'integer';
- return $ids;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/RedirectChecker.php b/sites/all/modules/contrib/admin/redirect/src/RedirectChecker.php
deleted file mode 100644
index 02da7ad2e..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/RedirectChecker.php
+++ /dev/null
@@ -1,98 +0,0 @@
-config = $config->get('redirect.settings');
- $this->accessManager = $access_manager;
- $this->state = $state;
- $this->account = $account;
- $this->routeProvider = $route_provider;
- }
-
- /**
- * Determines if redirect may be performed.
- *
- * @param Request $request
- * The current request object.
- * @param string $route_name
- * The current route name.
- *
- * @return bool
- * TRUE if redirect may be performed.
- */
- public function canRedirect(Request $request, $route_name = NULL) {
- $can_redirect = TRUE;
- if (isset($route_name)) {
- $route = $this->routeProvider->getRouteByName($route_name);
- if ($this->config->get('access_check')) {
- // Do not redirect if is a protected page.
- $can_redirect = $this->accessManager->checkNamedRoute($route_name, [], $this->account);
- }
- }
- else {
- $route = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT);
- }
-
- if (!preg_match('/index\.php$/', $request->getScriptName())) {
- // Do not redirect if the root script is not /index.php.
- $can_redirect = FALSE;
- }
- elseif (!($request->isMethod('GET') || $request->isMethod('HEAD'))) {
- // Do not redirect if this is other than GET request.
- $can_redirect = FALSE;
- }
- elseif ($this->state->get('system.maintenance_mode') || defined('MAINTENANCE_MODE')) {
- // Do not redirect in offline or maintenance mode.
- $can_redirect = FALSE;
- }
- elseif ($request->query->has('destination')) {
- $can_redirect = FALSE;
- }
- elseif ($this->config->get('ignore_admin_path') && isset($route)) {
- // Do not redirect on admin paths.
- $can_redirect &= !(bool) $route->getOption('_admin_route');
- }
-
- return $can_redirect;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/RedirectRepository.php b/sites/all/modules/contrib/admin/redirect/src/RedirectRepository.php
deleted file mode 100644
index 236c927f6..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/RedirectRepository.php
+++ /dev/null
@@ -1,180 +0,0 @@
-manager = $manager;
- $this->connection = $connection;
- $this->config = $config_factory->get('redirect.settings');
- }
-
- /**
- * Gets a redirect for given path, query and language.
- *
- * @param string $source_path
- * The redirect source path.
- * @param array $query
- * The redirect source path query.
- * @param $language
- * The language for which is the redirect.
- *
- * @return \Drupal\redirect\Entity\Redirect
- * The matched redirect entity.
- *
- * @throws \Drupal\redirect\Exception\RedirectLoopException
- */
- public function findMatchingRedirect($source_path, array $query = [], $language = Language::LANGCODE_NOT_SPECIFIED) {
- $source_path = ltrim($source_path, '/');
- $hashes = [Redirect::generateHash($source_path, $query, $language)];
- if ($language != Language::LANGCODE_NOT_SPECIFIED) {
- $hashes[] = Redirect::generateHash($source_path, $query, Language::LANGCODE_NOT_SPECIFIED);
- }
-
- // Add a hash without the query string if using passthrough querystrings.
- if (!empty($query) && $this->config->get('passthrough_querystring')) {
- $hashes[] = Redirect::generateHash($source_path, [], $language);
- if ($language != Language::LANGCODE_NOT_SPECIFIED) {
- $hashes[] = Redirect::generateHash($source_path, [], Language::LANGCODE_NOT_SPECIFIED);
- }
- }
-
- // Load redirects by hash. A direct query is used to improve performance.
- $rid = $this->connection->query('SELECT rid FROM {redirect} WHERE hash IN (:hashes[]) ORDER BY LENGTH(redirect_source__query) DESC', [':hashes[]' => $hashes])->fetchField();
-
- if (!empty($rid)) {
- // Check if this is a loop.
- if (in_array($rid, $this->foundRedirects)) {
- throw new RedirectLoopException('/' . $source_path, $rid);
- }
- $this->foundRedirects[] = $rid;
-
- $redirect = $this->load($rid);
-
- // Find chained redirects.
- if ($recursive = $this->findByRedirect($redirect, $language)) {
- // Reset found redirects.
- $this->foundRedirects = [];
- return $recursive;
- }
-
- return $redirect;
- }
-
- return NULL;
- }
-
- /**
- * Helper function to find recursive redirects.
- *
- * @param \Drupal\redirect\Entity\Redirect
- * The redirect object.
- * @param string $language
- * The language to use.
- */
- protected function findByRedirect(Redirect $redirect, $language) {
- $uri = $redirect->getRedirectUrl();
- $base_url = \Drupal::request()->getBaseUrl();
- $generated_url = $uri->toString(TRUE);
- $path = ltrim(substr($generated_url->getGeneratedUrl(), strlen($base_url)), '/');
- $query = $uri->getOption('query') ?: [];
- $return_value = $this->findMatchingRedirect($path, $query, $language);
- return $return_value ? $return_value->addCacheableDependency($generated_url) : $return_value;
- }
-
- /**
- * Finds redirects based on the source path.
- *
- * @param string $source_path
- * The redirect source path (without the query).
- *
- * @return \Drupal\redirect\Entity\Redirect[]
- * Array of redirect entities.
- */
- public function findBySourcePath($source_path) {
- $ids = $this->manager->getStorage('redirect')->getQuery()
- ->condition('redirect_source.path', $source_path, 'LIKE')
- ->execute();
- return $this->manager->getStorage('redirect')->loadMultiple($ids);
- }
-
- /**
- * Finds redirects based on the destination URI.
- *
- * @param string[] $destination_uri
- * List of destination URIs, for example ['internal:/node/123'].
- *
- * @return \Drupal\redirect\Entity\Redirect[]
- * Array of redirect entities.
- */
- public function findByDestinationUri(array $destination_uri) {
- $storage = $this->manager->getStorage('redirect');
- $ids = $storage->getQuery()
- ->condition('redirect_redirect.uri', $destination_uri, 'IN')
- ->execute();
- return $storage->loadMultiple($ids);
- }
-
- /**
- * Load redirect entity by id.
- *
- * @param int $redirect_id
- * The redirect id.
- *
- * @return \Drupal\redirect\Entity\Redirect
- */
- public function load($redirect_id) {
- return $this->manager->getStorage('redirect')->load($redirect_id);
- }
-
- /**
- * Loads multiple redirect entities.
- *
- * @param array $redirect_ids
- * Redirect ids to load.
- *
- * @return \Drupal\redirect\Entity\Redirect[]
- * List of redirect entities.
- */
- public function loadMultiple(array $redirect_ids = NULL) {
- return $this->manager->getStorage('redirect')->loadMultiple($redirect_ids);
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/RedirectStorageSchema.php b/sites/all/modules/contrib/admin/redirect/src/RedirectStorageSchema.php
deleted file mode 100644
index e034362f1..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/RedirectStorageSchema.php
+++ /dev/null
@@ -1,31 +0,0 @@
- ['hash'],
- ];
- $schema['redirect']['indexes'] += [
- // Limit length to 191.
- 'source_language' => [['redirect_source__path', 191], 'language'],
- ];
-
- return $schema;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/RedirectViewsData.php b/sites/all/modules/contrib/admin/redirect/src/RedirectViewsData.php
deleted file mode 100644
index 7e33ea51f..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/RedirectViewsData.php
+++ /dev/null
@@ -1,25 +0,0 @@
-get('image.style_public')) {
- $route->setDefault('_disable_route_normalizer', TRUE);
- }
- if ($route = $collection->get('image.style_private')) {
- $route->setDefault('_disable_route_normalizer', TRUE);
- }
- if ($route = $collection->get('system.files')) {
- $route->setDefault('_disable_route_normalizer', TRUE);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Tests/AssertRedirectTrait.php b/sites/all/modules/contrib/admin/redirect/src/Tests/AssertRedirectTrait.php
deleted file mode 100644
index ae9368886..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Tests/AssertRedirectTrait.php
+++ /dev/null
@@ -1,53 +0,0 @@
-drupalHead($path);
- $headers = $this->drupalGetHeaders(TRUE);
-
- $ending_url = isset($headers[0]['location']) ? $headers[0]['location'] : NULL;
- $message = SafeMarkup::format('Testing redirect from %from to %to. Ending url: %url', [
- '%from' => $path,
- '%to' => $expected_ending_url,
- '%url' => $ending_url,
- ]);
-
- if ($expected_ending_url == '') {
- $expected_ending_url = Url::fromUri('base:')->setAbsolute()->toString();
- }
- elseif (!empty($expected_ending_url)) {
- // Check for absolute/external urls.
- if (!parse_url($expected_ending_url, PHP_URL_SCHEME)) {
- $expected_ending_url = Url::fromUri('base:' . $expected_ending_url)->setAbsolute()->toString();
- }
- }
- else {
- $expected_ending_url = NULL;
- }
-
- $this->assertEqual($expected_ending_url, $ending_url, $message);
-
- $this->assertEqual($headers[0][':status'], $expected_ending_status);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Tests/GlobalRedirectTest.php b/sites/all/modules/contrib/admin/redirect/src/Tests/GlobalRedirectTest.php
deleted file mode 100644
index 75e1f9987..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Tests/GlobalRedirectTest.php
+++ /dev/null
@@ -1,296 +0,0 @@
-config = $this->config('redirect.settings');
-
- $this->drupalCreateContentType(['type' => 'page', 'name' => 'Page']);
- $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
-
- // Create a users for testing the access.
- $this->normalUser = $this->drupalCreateUser([
- 'access content',
- 'create page content',
- 'create url aliases',
- 'access administration pages',
- ]);
- $this->adminUser = $this->drupalCreateUser([
- 'administer site configuration',
- 'access administration pages',
- 'administer languages',
- 'administer content types',
- 'administer content translation',
- 'create page content',
- 'edit own page content',
- 'create content translations',
- ]);
-
- // Save the node.
- $this->node = $this->drupalCreateNode([
- 'type' => 'page',
- 'title' => 'Test Page Node',
- 'path' => ['alias' => '/test-node'],
- 'language' => Language::LANGCODE_NOT_SPECIFIED,
- ]);
-
- // Create an alias for the create story path - this is used in the
- // "redirect with permissions testing" test.
- \Drupal::service('path.alias_storage')->save('/admin/config/system/site-information', '/site-info');
-
- // Create a taxonomy term for the forum.
- $term = entity_create('taxonomy_term', [
- 'name' => 'Test Forum Term',
- 'vid' => 'forums',
- 'langcode' => Language::LANGCODE_NOT_SPECIFIED,
- ]);
- $term->save();
- $this->forumTerm = $term;
-
- // Create another taxonomy vocabulary with a term.
- $vocab = entity_create('taxonomy_vocabulary', [
- 'name' => 'test vocab',
- 'vid' => 'test-vocab',
- 'langcode' => Language::LANGCODE_NOT_SPECIFIED,
- ]);
- $vocab->save();
- $term = entity_create('taxonomy_term', [
- 'name' => 'Test Term',
- 'vid' => $vocab->id(),
- 'langcode' => Language::LANGCODE_NOT_SPECIFIED,
- 'path' => ['alias' => '/test-term'],
- ]);
- $term->save();
-
- $this->term = $term;
- }
-
- /**
- * Will test the redirects.
- */
- public function testRedirects() {
-
- // First test that the good stuff can be switched off.
- $this->config->set('route_normalizer_enabled', FALSE)->save();
- $this->assertRedirect('index.php/node/' . $this->node->id(), NULL, 'HTTP/1.1 200 OK');
- $this->assertRedirect('index.php/test-node', NULL, 'HTTP/1.1 200 OK');
- $this->assertRedirect('test-node/', NULL, 'HTTP/1.1 200 OK');
- $this->assertRedirect('Test-node/', NULL, 'HTTP/1.1 200 OK');
-
- $this->config->set('route_normalizer_enabled', TRUE)->save();
-
- // Test alias normalization.
- $this->assertRedirect('node/' . $this->node->id(), 'test-node');
- $this->assertRedirect('Test-node', 'test-node');
-
- // Test redirects for non-clean urls.
- $this->assertRedirect('index.php/node/' . $this->node->id(), 'test-node');
- $this->assertRedirect('index.php/test-node', 'test-node');
-
- // Test deslashing.
- $this->assertRedirect('test-node/', 'test-node');
-
- // Test front page redirects.
- $this->config('system.site')->set('page.front', '/node')->save();
- $this->assertRedirect('node', '');
-
- // Test front page redirects with an alias.
- \Drupal::service('path.alias_storage')->save('/node', '/node-alias');
- $this->assertRedirect('node-alias', '');
-
- // Test post request.
- $this->drupalPost('Test-node', 'application/json', array());
- // Does not do a redirect, stays in the same path.
- $this->assertEqual(basename($this->getUrl()), 'Test-node');
-
- // Test the access checking.
- $this->config->set('access_check', TRUE)->save();
- $this->assertRedirect('admin/config/system/site-information', NULL, 'HTTP/1.1 403 Forbidden');
-
- $this->config->set('access_check', FALSE)->save();
- // @todo - here it seems that the access check runs prior to our redirecting
- // check why so and enable the test.
- //$this->assertRedirect('admin/config/system/site-information', 'site-info');
-
- // Test original query string is preserved with alias normalization.
- $this->assertRedirect('Test-node?&foo&.bar=baz', 'test-node?&foo&.bar=baz');
-
- // Test alias normalization with trailing ?.
- $this->assertRedirect('test-node?', 'test-node');
- $this->assertRedirect('Test-node?', 'test-node');
-
- // Test alias normalization still works without trailing ?.
- $this->assertRedirect('test-node', NULL, 'HTTP/1.1 200 OK');
- $this->assertRedirect('Test-node', 'test-node');
-
- // Login as user with admin privileges.
- $this->drupalLogin($this->adminUser);
-
- // Test ignoring admin paths.
- $this->config->set('ignore_admin_path', FALSE)->save();
- $this->assertRedirect('admin/config/system/site-information', 'site-info');
-
- // Test alias normalization again with ignore_admin_path false.
- $this->assertRedirect('Test-node', 'test-node');
-
- $this->config->set('ignore_admin_path', TRUE)->save();
- $this->assertRedirect('admin/config/system/site-information', NULL, 'HTTP/1.1 200 OK');
-
- // Test alias normalization again with ignore_admin_path true.
- $this->assertRedirect('Test-node', 'test-node');
- }
-
- /**
- * Test that redirects work properly with content_translation enabled.
- */
- public function testLanguageRedirects() {
- $this->drupalLogin($this->adminUser);
-
- // Add a new language.
- ConfigurableLanguage::createFromLangcode('es')
- ->save();
-
- // Enable URL language detection and selection.
- $edit = ['language_interface[enabled][language-url]' => '1'];
- $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
-
- // Set page content type to use multilingual support.
- $edit = [
- 'language_configuration[language_alterable]' => TRUE,
- 'language_configuration[content_translation]' => TRUE,
- ];
- $this->drupalPostForm('admin/structure/types/manage/page', $edit, t('Save content type'));
- $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Page')), 'Basic page content type has been updated.');
-
- $spanish_node = $this->drupalCreateNode([
- 'type' => 'page',
- 'title' => 'Spanish Test Page Node',
- 'path' => ['alias' => '/spanish-test-node'],
- 'langcode' => 'es',
- ]);
-
- // Test multilingual redirect.
- $this->assertRedirect('es/node/' . $spanish_node->id(), 'es/spanish-test-node');
- }
-
- /**
- * Asserts the redirect from $path to the $expected_ending_url.
- *
- * @param string $path
- * The request path.
- * @param $expected_ending_url
- * The path where we expect it to redirect. If NULL value provided, no
- * redirect is expected.
- * @param string $expected_ending_status
- * The status we expect to get with the first request.
- */
- public function assertRedirect($path, $expected_ending_url, $expected_ending_status = 'HTTP/1.1 301 Moved Permanently') {
- $this->drupalHead($GLOBALS['base_url'] . '/' . $path);
- $headers = $this->drupalGetHeaders(TRUE);
-
- $ending_url = isset($headers[0]['location']) ? $headers[0]['location'] : NULL;
- $message = SafeMarkup::format('Testing redirect from %from to %to. Ending url: %url', array(
- '%from' => $path,
- '%to' => $expected_ending_url,
- '%url' => $ending_url,
- ));
-
-
- if ($expected_ending_url == '') {
- $expected_ending_url = $GLOBALS['base_url'] . '/';
- }
- elseif (!empty($expected_ending_url)) {
- $expected_ending_url = $GLOBALS['base_url'] . '/' . $expected_ending_url;
- }
- else {
- $expected_ending_url = NULL;
- }
-
- $this->assertEqual($expected_ending_url, $ending_url);
-
- $this->assertEqual($headers[0][':status'], $expected_ending_status);
- }
-
- /**
- * @inheritdoc}
- */
- protected function drupalHead($path, array $options = [], array $headers = []) {
- // Always just use getAbsolutePath() so that generating the link does not
- // alter special requests.
- $url = $this->getAbsoluteUrl($path);
- $out = $this->curlExec([CURLOPT_NOBODY => TRUE, CURLOPT_URL => $url, CURLOPT_HTTPHEADER => $headers]);
- // Ensure that any changes to variables in the other thread are picked up.
- $this->refreshVariables();
-
- if ($this->dumpHeaders) {
- $this->verbose('GET request to: ' . $path .
- 'Ending URL: ' . $this->getUrl() .
- 'Headers:
');
- }
-
- return $out;
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUILanguageTest.php b/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUILanguageTest.php
deleted file mode 100644
index 6d9a72791..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUILanguageTest.php
+++ /dev/null
@@ -1,125 +0,0 @@
-save();
- $language = ConfigurableLanguage::createFromLangcode('es');
- $language->save();
- }
-
- /**
- * Test multilingual scenarios.
- */
- public function testLanguageSpecificRedirects() {
- $this->drupalLogin($this->adminUser);
-
- $this->drupalGet('admin/config/search/redirect/add');
- $this->assertOption('edit-language-0-value', 'en');
- $this->assertOption('edit-language-0-value', 'de');
- $this->assertOption('edit-language-0-value', 'es');
- $this->assertOption('edit-language-0-value', 'und');
- $this->assertNoOption('edit-language-0-value', 'zxx');
- $this->assertOptionByText('edit-language-0-value', 'English');
- $this->assertOptionByText('edit-language-0-value', 'German');
- $this->assertOptionByText('edit-language-0-value', 'Spanish');
- $this->assertOptionByText('edit-language-0-value', '- All languages -');
-
- // Add a redirect for english.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'langpath',
- 'redirect_redirect[0][uri]' => '/user',
- 'language[0][value]' => 'en',
- ), t('Save'));
-
- // Add a redirect for germany.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'langpath',
- 'redirect_redirect[0][uri]' => '',
- 'language[0][value]' => 'de',
- ), t('Save'));
-
- // Check redirect for english.
- $this->assertRedirect('langpath', '/user', 'HTTP/1.1 301 Moved Permanently');
-
- // Check redirect for germany.
- $this->assertRedirect('de/langpath', '/de', 'HTTP/1.1 301 Moved Permanently');
-
- // Check no redirect for spanish.
- $this->assertRedirect('es/langpath', NULL, 'HTTP/1.1 404 Not Found');
- }
-
- /**
- * Test non-language specific redirect.
- */
- public function testUndefinedLangugageRedirects() {
- $this->drupalLogin($this->adminUser);
-
- // Add a redirect for english.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'langpath',
- 'redirect_redirect[0][uri]' => '/user',
- 'language[0][value]' => 'und',
- ), t('Save'));
-
- // Check redirect for english.
- $this->assertRedirect('langpath', '/user', 'HTTP/1.1 301 Moved Permanently');
-
- // Check redirect for spanish.
- $this->assertRedirect('es/langpath', '/es/user', 'HTTP/1.1 301 Moved Permanently');
- }
-
- /**
- * Test editing the redirect language.
- */
- public function testEditRedirectLanguage() {
- $this->drupalLogin($this->adminUser);
-
- // Add a redirect for english.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'langpath',
- 'redirect_redirect[0][uri]' => '/user',
- 'language[0][value]' => 'en',
- ), t('Save'));
-
- // Check redirect for english.
- $this->assertRedirect('langpath', '/user', 'HTTP/1.1 301 Moved Permanently');
-
- // Check that redirect for Germany is not working.
- $this->assertRedirect('de/langpath', NULL, 'HTTP/1.1 404 Not Found');
-
- // Edit the redirect and change the language.
- $this->drupalGet('admin/config/search/redirect');
- $this->clickLink('Edit');
- $this->drupalPostForm(NULL, ['language[0][value]' => 'de'], t('Save'));
-
- // Check redirect for english is NOT working now.
- $this->assertRedirect('langpath', NULL, 'HTTP/1.1 404 Not Found');
-
- // Check that redirect for Germany is now working.
- $this->assertRedirect('de/langpath', '/de/user', 'HTTP/1.1 301 Moved Permanently');
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUITest.php b/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUITest.php
deleted file mode 100644
index 67b066614..000000000
--- a/sites/all/modules/contrib/admin/redirect/src/Tests/RedirectUITest.php
+++ /dev/null
@@ -1,436 +0,0 @@
-drupalCreateContentType(array('type' => 'article', 'name' => 'Article'));
- $this->adminUser = $this->drupalCreateUser(array(
- 'administer redirects',
- 'administer redirect settings',
- 'access content',
- 'bypass node access',
- 'create url aliases',
- 'administer taxonomy',
- 'administer url aliases',
- ));
-
- $this->repository = \Drupal::service('redirect.repository');
-
- $this->storage = $this->container->get('entity.manager')->getStorage('redirect');
- }
-
- /**
- * Test the redirect UI.
- */
- public function testRedirectUI() {
- $this->drupalLogin($this->adminUser);
-
- // Test populating the redirect form with predefined values.
- $this->drupalGet('admin/config/search/redirect/add', array('query' => array(
- 'source' => 'non-existing',
- 'source_query' => array('key' => 'val', 'key1' => 'val1'),
- 'redirect' => 'node',
- 'redirect_options' => array('query' => array('key' => 'val', 'key1' => 'val1')),
- )));
- $this->assertFieldByName('redirect_source[0][path]', 'non-existing?key=val&key1=val1');
- $this->assertFieldByName('redirect_redirect[0][uri]', '/node?key=val&key1=val1');
-
- // Test creating a new redirect via UI.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'non-existing',
- 'redirect_redirect[0][uri]' => '/node',
- ), t('Save'));
-
- // Try to find the redirect we just created.
- $redirect = $this->repository->findMatchingRedirect('non-existing');
- $this->assertEqual($redirect->getSourceUrl(), Url::fromUri('base:non-existing')->toString());
- $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:node')->toString());
-
- // After adding the redirect we should end up in the list. Check if the
- // redirect is listed.
- $this->assertUrl('admin/config/search/redirect');
- $this->assertText('non-existing');
- $this->assertLink(Url::fromUri('base:node')->toString());
- $this->assertText(t('Not specified'));
-
- // Test the edit form and update action.
- $this->clickLink(t('Edit'));
- $this->assertFieldByName('redirect_source[0][path]', 'non-existing');
- $this->assertFieldByName('redirect_redirect[0][uri]', '/node');
- $this->assertFieldByName('status_code', $redirect->getStatusCode());
-
- // Append a query string to see if we handle query data properly.
- $this->drupalPostForm(NULL, array(
- 'redirect_source[0][path]' => 'non-existing?key=value',
- ), t('Save'));
-
- // Check the location after update and check if the value has been updated
- // in the list.
- $this->assertUrl('admin/config/search/redirect');
- $this->assertText('non-existing?key=value');
-
- // The path field should not contain the query string and therefore we
- // should be able to load the redirect using only the url part without
- // query.
- $this->storage->resetCache();
- $redirects = $this->repository->findBySourcePath('non-existing');
- $redirect = array_shift($redirects);
- $this->assertEqual($redirect->getSourceUrl(), Url::fromUri('base:non-existing', ['query' => ['key' => 'value']])->toString());
-
- // Test the source url hints.
- // The hint about an existing base path.
- $this->drupalPostAjaxForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'non-existing?key=value',
- ), 'redirect_source[0][path]');
- $this->assertRaw(t('The base source path %source is already being redirected. Do you want to edit the existing redirect?',
- array('%source' => 'non-existing?key=value', '@edit-page' => $redirect->url('edit-form'))));
-
- // The hint about a valid path.
- $this->drupalPostAjaxForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'node',
- ), 'redirect_source[0][path]');
- $this->assertRaw(t('The source path %path is likely a valid path. It is preferred to create URL aliases for existing paths rather than redirects.',
- array('%path' => 'node', '@url-alias' => Url::fromRoute('path.admin_add')->toString())));
-
- // Test validation.
- // Duplicate redirect.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'non-existing?key=value',
- 'redirect_redirect[0][uri]' => '/node',
- ), t('Save'));
- $this->assertRaw(t('The source path %source is already being redirected. Do you want to edit the existing redirect?',
- array('%source' => 'non-existing?key=value', '@edit-page' => $redirect->url('edit-form'))));
-
- // Redirecting to itself.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'node',
- 'redirect_redirect[0][uri]' => '/node',
- ), t('Save'));
- $this->assertRaw(t('You are attempting to redirect the page to itself. This will result in an infinite loop.'));
-
- // Redirecting the front page.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => '',
- 'redirect_redirect[0][uri]' => '/node',
- ), t('Save'));
- $this->assertRaw(t('It is not allowed to create a redirect from the front page.'));
-
- // Redirecting a url with fragment.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'page-to-redirect#content',
- 'redirect_redirect[0][uri]' => '/node',
- ), t('Save'));
- $this->assertRaw(t('The anchor fragments are not allowed.'));
-
- // Adding path that starts with /
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => '/page-to-redirect',
- 'redirect_redirect[0][uri]' => '/node',
- ), t('Save'));
- $this->assertRaw(t('The url to redirect from should not start with a forward slash (/).'));
-
- // Test filters.
- // Add a new redirect.
- $this->drupalPostForm('admin/config/search/redirect/add', array(
- 'redirect_source[0][path]' => 'test27',
- 'redirect_redirect[0][uri]' => '/node',
- ), t('Save'));
-
- // Filter with non existing value.
- $this->drupalGet('admin/config/search/redirect', array(
- 'query' => array(
- 'status_code' => '3',
- ),
- ));
-
- $rows = $this->xpath('//tbody/tr');
- // Check if the list has no rows.
- $this->assertTrue(count($rows) == 0);
-
- // Filter with existing values.
- $this->drupalGet('admin/config/search/redirect', array(
- 'query' => array(
- 'redirect_source__path' => 'test',
- 'status_code' => '2',
- ),
- ));
-
- $rows = $this->xpath('//tbody/tr');
- // Check if the list has 1 row.
- $this->assertTrue(count($rows) == 1);
-
- $this->drupalGet('admin/config/search/redirect', array(
- 'query' => array(
- 'redirect_redirect__uri' => 'nod',
- ),
- ));
-
- $rows = $this->xpath('//tbody/tr');
- // Check if the list has 2 rows.
- $this->assertTrue(count($rows) == 2);
-
- // Test the plural form of the bulk delete action.
- $this->drupalGet('admin/config/search/redirect');
- $edit = [
- 'redirect_bulk_form[0]' => TRUE,
- 'redirect_bulk_form[1]' => TRUE,
- ];
- $this->drupalPostForm(NULL, $edit, t('Apply to selected items'));
- $this->assertText('Are you sure you want to delete these redirects?');
- $this->clickLink('Cancel');
-
- // Test the delete action.
- $this->clickLink(t('Delete'));
- $this->assertRaw(t('Are you sure you want to delete the URL redirect from %source to %redirect?',
- array('%source' => Url::fromUri('base:non-existing', ['query' => ['key' => 'value']])->toString(), '%redirect' => Url::fromUri('base:node')->toString())));
- $this->drupalPostForm(NULL, array(), t('Delete'));
- $this->assertUrl('admin/config/search/redirect');
-
- // Test the bulk delete action.
- $this->drupalPostForm(NULL, ['redirect_bulk_form[0]' => TRUE], t('Apply to selected items'));
- $this->assertText('Are you sure you want to delete this redirect?');
- $this->assertText('test27');
- $this->drupalPostForm(NULL, [], t('Delete'));
-
- $this->assertText(t('There is no redirect yet.'));
- }
-
- /**
- * Tests redirects being automatically created upon path alias change.
- */
- public function testAutomaticRedirects() {
- $this->drupalLogin($this->adminUser);
-
- // Create a node and update its path alias which should result in a redirect
- // being automatically created from the old alias to the new one.
- $node = $this->drupalCreateNode(array(
- 'type' => 'article',
- 'langcode' => Language::LANGCODE_NOT_SPECIFIED,
- 'path' => array('alias' => '/node_test_alias'),
- ));
- $this->drupalGet('node/' . $node->id() . '/edit');
- $this->assertText(t('No URL redirects available.'));
- $this->drupalPostForm('node/' . $node->id() . '/edit', array('path[0][alias]' => '/node_test_alias_updated'), t('Save'));
-
- $redirect = $this->repository->findMatchingRedirect('node_test_alias', array(), Language::LANGCODE_NOT_SPECIFIED);
- $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:node_test_alias_updated')->toString());
- // Test if the automatically created redirect works.
- $this->assertRedirect('node_test_alias', 'node_test_alias_updated');
-
- // Test that changing the path back deletes the first redirect, creates
- // a new one and does not result in a loop.
- $this->drupalPostForm('node/' . $node->id() . '/edit', array('path[0][alias]' => '/node_test_alias'), t('Save'));
- $redirect = $this->repository->findMatchingRedirect('node_test_alias', array(), Language::LANGCODE_NOT_SPECIFIED);
- $this->assertTrue(empty($redirect));
-
- \Drupal::service('path.alias_manager')->cacheClear();
- $redirect = $this->repository->findMatchingRedirect('node_test_alias_updated', array(), Language::LANGCODE_NOT_SPECIFIED);
-
- $this->drupalGet('node/' . $node->id() . '/edit');
- $this->assertText($redirect->getSourcePathWithQuery());
- $this->assertLinkByHref(Url::fromRoute('entity.redirect.edit_form', ['redirect' => $redirect->id()])->toString());
- $this->assertLinkByHref(Url::fromRoute('entity.redirect.delete_form', ['redirect' => $redirect->id()])->toString());
-
- $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:node_test_alias')->toString());
- // Test if the automatically created redirect works.
- $this->assertRedirect('node_test_alias_updated', 'node_test_alias');
-
- // Test that the redirect will be deleted upon node deletion.
- $this->drupalPostForm('node/' . $node->id() . '/delete', array(), t('Delete'));
- $redirect = $this->repository->findMatchingRedirect('node_test_alias_updated', array(), Language::LANGCODE_NOT_SPECIFIED);
- $this->assertTrue(empty($redirect));
-
- // Create a term and update its path alias and check if we have a redirect
- // from the previous path alias to the new one.
- $term = $this->createTerm($this->createVocabulary());
- $this->drupalPostForm('taxonomy/term/' . $term->id() . '/edit', array('path[0][alias]' => '/term_test_alias_updated'), t('Save'));
- $redirect = $this->repository->findMatchingRedirect('term_test_alias');
- $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:term_test_alias_updated')->toString());
- // Test if the automatically created redirect works.
- $this->assertRedirect('term_test_alias', 'term_test_alias_updated');
-
- // Test the path alias update via the admin path form.
- $this->drupalPostForm('admin/config/search/path/add', array(
- 'source' => '/node',
- 'alias' => '/aaa_path_alias',
- ), t('Save'));
- // Note that here we rely on fact that we land on the path alias list page
- // and the default sort is by the alias, which implies that the first edit
- // link leads to the edit page of the aaa_path_alias.
- $this->clickLink(t('Edit'));
- $this->drupalPostForm(NULL, array('alias' => '/aaa_path_alias_updated'), t('Save'));
- $redirect = $this->repository->findMatchingRedirect('aaa_path_alias', array(), 'en');
- $this->assertEqual($redirect->getRedirectUrl()->toString(), Url::fromUri('base:aaa_path_alias_updated')->toString());
- // Test if the automatically created redirect works.
- $this->assertRedirect('aaa_path_alias', 'aaa_path_alias_updated');
-
- // Test the automatically created redirect shows up in the form correctly.
- $this->drupalGet('admin/config/search/redirect/edit/' . $redirect->id());
- $this->assertFieldByName('redirect_source[0][path]', 'aaa_path_alias');
- $this->assertFieldByName('redirect_redirect[0][uri]', '/node');
- }
-
- /**
- * Test the redirect loop protection and logging.
- */
- function testRedirectLoop() {
- // Redirect loop redirection only works when page caching is disabled.
- \Drupal::service('module_installer')->uninstall(['page_cache']);
-
- /** @var \Drupal\redirect\Entity\Redirect $redirect1 */
- $redirect1 = $this->storage->create();
- $redirect1->setSource('node');
- $redirect1->setRedirect('admin');
- $redirect1->setStatusCode(301);
- $redirect1->save();
-
- /** @var \Drupal\redirect\Entity\Redirect $redirect2 */
- $redirect2 = $this->storage->create();
- $redirect2->setSource('admin');
- $redirect2->setRedirect('node');
- $redirect2->setStatusCode(301);
- $redirect2->save();
-
- $this->maximumRedirects = 10;
- $this->drupalGet('node');
- $this->assertText('Service unavailable');
- $this->assertResponse(503);
-
- $log = db_select('watchdog')->fields('watchdog')->condition('type', 'redirect')->execute()->fetchAll();
- if (count($log) == 0) {
- $this->fail('Redirect loop has not been logged');
- }
- else {
- $log = reset($log);
- $this->assertEqual($log->severity, RfcLogLevel::WARNING);
- $this->assertEqual(SafeMarkup::format($log->message, unserialize($log->variables)),
- SafeMarkup::format('Redirect loop identified at %path for redirect %id', array('%path' => '/node', '%id' => $redirect1->id())));
- }
- }
-
- /**
- * Returns a new vocabulary with random properties.
- */
- function createVocabulary() {
- // Create a vocabulary.
- $vocabulary = entity_create('taxonomy_vocabulary', array(
- 'name' => $this->randomMachineName(),
- 'description' => $this->randomMachineName(),
- 'vid' => mb_strtolower($this->randomMachineName()),
- 'langcode' => Language::LANGCODE_NOT_SPECIFIED,
- 'weight' => mt_rand(0, 10),
- ));
- $vocabulary->save();
- return $vocabulary;
- }
-
- /**
- * Returns a new term with random properties in vocabulary $vid.
- */
- function createTerm($vocabulary) {
- $filter_formats = filter_formats();
- $format = array_pop($filter_formats);
- $term = entity_create('taxonomy_term', array(
- 'name' => $this->randomMachineName(),
- 'description' => array(
- 'value' => $this->randomMachineName(),
- // Use the first available text format.
- 'format' => $format->id(),
- ),
- 'vid' => $vocabulary->id(),
- 'langcode' => Language::LANGCODE_NOT_SPECIFIED,
- 'path' => array('alias' => '/term_test_alias'),
- ));
- $term->save();
- return $term;
- }
-
- /**
- * Test cache tags.
- *
- * @todo Not sure this belongs in a UI test, but a full web test is needed.
- */
- public function testCacheTags() {
- /** @var \Drupal\redirect\Entity\Redirect $redirect1 */
- $redirect1 = $this->storage->create();
- $redirect1->setSource('test-redirect');
- $redirect1->setRedirect('node');
- $redirect1->setStatusCode(301);
- $redirect1->save();
-
- $this->assertRedirect('test-redirect', 'node');
- $headers = $this->drupalGetHeaders(TRUE);
- // Note, self::assertCacheTag() cannot be used here since it only looks at
- // the final set of headers.
- $expected = 'http_response ' . implode(' ', $redirect1->getCacheTags());
- $this->assertEqual($expected, $headers[0]['x-drupal-cache-tags'], 'Redirect cache tags properly set.');
-
- // First request should be a cache MISS.
- $this->assertEqual($headers[0]['x-drupal-cache'], 'MISS', 'First request to the redirect was not cached.');
-
- // Second request should be cached.
- $this->assertRedirect('test-redirect', 'node');
- $headers = $this->drupalGetHeaders(TRUE);
- $this->assertEqual($headers[0]['x-drupal-cache'], 'HIT', 'The second request to the redirect was cached.');
-
- // Ensure that the redirect has been cleared from cache when deleted.
- $redirect1->delete();
- $this->drupalGet('test-redirect');
- $this->assertResponse(404, 'Deleted redirect properly clears the internal page cache.');
- }
-
- /**
- * Test external destinations.
- */
- public function testExternal() {
- $redirect = $this->storage->create();
- $redirect->setSource('a-path');
- // @todo Redirect::setRedirect() assumes that all redirects are internal.
- $redirect->redirect_redirect->set(0, ['uri' => 'https://www.example.org']);
- $redirect->setStatusCode(301);
- $redirect->save();
- $this->assertRedirect('a-path', 'https://www.example.org');
- $this->drupalLogin($this->adminUser);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal6.php b/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal6.php
deleted file mode 100644
index e6f9c4758..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal6.php
+++ /dev/null
@@ -1,186 +0,0 @@
-schema()->createTable('path_redirect', array(
- 'fields' => array(
- 'rid' => array(
- 'type' => 'serial',
- 'not null' => TRUE,
- 'size' => 'normal',
- ),
- 'source' => array(
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
- 'redirect' => array(
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
- 'query' => array(
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => FALSE,
- ),
- 'fragment' => array(
- 'type' => 'varchar',
- 'length' => 50,
- 'not null' => FALSE,
- ),
- 'language' => array(
- 'type' => 'varchar',
- 'length' => 12,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'type' => array(
- 'type' => 'int',
- 'size' => 'small',
- 'not null' => TRUE,
- ),
- 'last_used' => array(
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- 'default' => 0,
- ),
- ),
- 'primary key' => array('rid'),
- 'unique keys' => array('source_language' => array('source', 'language')),
- 'mysql_character_set' => 'utf8',
-));
-
-
-$connection->insert('path_redirect')
- ->fields(array(
- 'rid',
- 'source',
- 'redirect',
- 'query',
- 'fragment',
- 'language',
- 'type',
- 'last_used',
- ))
- ->values(array(
- 'rid' => 5,
- 'source' => 'test/source/url',
- 'redirect' => 'test/redirect/url',
- 'query' => NULL,
- 'fragment' => NULL,
- 'language' => '',
- 'type' => 301,
- 'last_used' => 1449497138,
- ))
- ->values(array(
- 'rid' => 7,
- 'source' => 'test/source/url2',
- 'redirect' => 'http://test/external/redirect/url',
- 'query' => 'foo=bar&biz=buz',
- 'fragment' => NULL,
- 'language' => 'en',
- 'type' => 302,
- 'last_used' => 1449497139,
- ))
- ->execute();
-
-$connection->schema()->createTable('system', array(
- 'fields' => array(
- 'filename' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '255',
- 'default' => '',
- ),
- 'name' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '255',
- 'default' => '',
- ),
- 'type' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '255',
- 'default' => '',
- ),
- 'owner' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '255',
- 'default' => '',
- ),
- 'status' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '0',
- ),
- 'throttle' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '0',
- ),
- 'bootstrap' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '0',
- ),
- 'schema_version' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '-1',
- ),
- 'weight' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '0',
- ),
- 'info' => array(
- 'type' => 'text',
- 'not null' => FALSE,
- 'size' => 'normal',
- ),
- ),
- 'primary key' => array(
- 'filename',
- ),
- 'mysql_character_set' => 'utf8',
-));
-
-$connection->insert('system')
- ->fields(array(
- 'filename',
- 'name',
- 'type',
- 'owner',
- 'status',
- 'bootstrap',
- 'schema_version',
- 'weight',
- 'info',
- ))
- ->values(array(
- 'filename' => 'modules/contrib/path_redirect/path_redirect.module',
- 'name' => 'path_redirect',
- 'type' => 'module',
- 'owner' => '',
- 'status' => '1',
- 'bootstrap' => '0',
- 'schema_version' => '7000',
- 'weight' => '0',
- 'info' => 'a:10:{s:4:"name";s:13:"Path Redirect";s:11:"description";s:51:"Allows users to redirect from old URLs to new URLs.";s:7:"package";s:5:"Other";s:7:"version";s:3:"6.0";s:4:"core";s:3:"6.x";s:7:"project";s:13:"path_redirect";s:9:"datestamp";s:10:"1347989995";s:12:"dependencies";a:0:{}s:10:"dependents";a:0:{}s:3:"php";s:5:"4.3.5";}',
- ))
- ->execute();
diff --git a/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal7.php b/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal7.php
deleted file mode 100644
index 205107617..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/fixtures/drupal7.php
+++ /dev/null
@@ -1,240 +0,0 @@
-schema()->createTable('redirect', array(
- 'fields' => array(
- 'rid' => array(
- 'type' => 'serial',
- 'not null' => TRUE,
- 'size' => 'normal',
- ),
- 'hash' => array(
- 'type' => 'varchar',
- 'length' => 64,
- 'not null' => TRUE,
- ),
- 'type' => array(
- 'type' => 'varchar',
- 'length' => 64,
- 'not null' => TRUE,
- ),
- 'uid' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- ),
- 'source' => array(
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
- 'source_options' => array(
- 'type' => 'text',
- 'not null' => TRUE,
- ),
- 'redirect' => array(
- 'type' => 'varchar',
- 'length' => 255,
- 'not null' => TRUE,
- ),
- 'redirect_options' => array(
- 'type' => 'text',
- 'not null' => TRUE,
- ),
- 'language' => array(
- 'type' => 'varchar',
- 'length' => 12,
- 'not null' => TRUE,
- 'default' => '',
- ),
- 'status_code' => array(
- 'type' => 'int',
- 'size' => 'small',
- 'not null' => TRUE,
- ),
- 'count' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- ),
- 'access' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- ),
- ),
- 'primary key' => array('rid'),
- 'unique keys' => array(
- 'source_language' => array('source', 'language'),
- 'expires' => array('type', 'access')
- ),
- 'mysql_character_set' => 'utf8',
-));
-
-
-$connection->insert('redirect')
- ->fields(array(
- 'rid',
- 'hash',
- 'type',
- 'uid',
- 'source',
- 'source_options',
- 'redirect',
- 'redirect_options',
- 'language',
- 'status_code',
- 'count',
- 'access',
- ))
- ->values(array(
- 'rid' => 5,
- 'hash' => 'MwmDbnA65ag646gtEdLqmAqTbF0qQerse63RkQmJK_Y',
- 'type' => 'redirect',
- 'uid' => 5,
- 'source' => 'test/source/url',
- 'source_options' => '',
- 'redirect' => 'test/redirect/url',
- 'redirect_options' => '',
- 'language' => 'und',
- 'status_code' => 301,
- 'count' => 2518,
- 'access' => 1449497138,
- ))
- ->values(array(
- 'rid' => 7,
- 'hash' => 'GvD5bBB71W8qBvp9I9hHmbSoqZfTvUz0mIkEWjlP8M4',
- 'type' => 'redirect',
- 'uid' => 6,
- 'source' => 'test/source/url2',
- 'source_options' => '',
- 'redirect' => 'http://test/external/redirect/url',
- 'redirect_options' => 'a:2:{s:5:"query";a:2:{s:3:"foo";s:3:"bar";s:3:"biz";s:3:"buz";}s:8:"fragment";s:10:"fragment-1";}',
- 'language' => 'und',
- 'status_code' => 0,
- 'count' => 419,
- 'access' => 1449497139,
- ))
- ->execute();
-
-$connection->schema()->createTable('variable', array(
- 'fields' => array(
- 'name' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '128',
- 'default' => '',
- ),
- 'value' => array(
- 'type' => 'blob',
- 'not null' => TRUE,
- 'size' => 'normal',
- ),
- ),
- 'primary key' => array(
- 'name',
- ),
- 'mysql_character_set' => 'utf8',
-));
-
-$connection->insert('variable')
-->fields(array(
- 'name',
- 'value',
-))
-->values(array(
- 'name' => 'redirect_default_status_code',
- 'value' => 's:3:"307";',
-))
-->execute();
-
-$connection->schema()->createTable('system', array(
- 'fields' => array(
- 'filename' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '255',
- 'default' => '',
- ),
- 'name' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '255',
- 'default' => '',
- ),
- 'type' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '12',
- 'default' => '',
- ),
- 'owner' => array(
- 'type' => 'varchar',
- 'not null' => TRUE,
- 'length' => '255',
- 'default' => '',
- ),
- 'status' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '0',
- ),
- 'bootstrap' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '0',
- ),
- 'schema_version' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '-1',
- ),
- 'weight' => array(
- 'type' => 'int',
- 'not null' => TRUE,
- 'size' => 'normal',
- 'default' => '0',
- ),
- 'info' => array(
- 'type' => 'blob',
- 'not null' => FALSE,
- 'size' => 'normal',
- ),
- ),
- 'primary key' => array(
- 'filename',
- ),
- 'mysql_character_set' => 'utf8',
-));
-
-$connection->insert('system')
-->fields(array(
- 'filename',
- 'name',
- 'type',
- 'owner',
- 'status',
- 'bootstrap',
- 'schema_version',
- 'weight',
- 'info',
-))
-->values(array(
- 'filename' => 'modules/contrib/redirect/redirect.module',
- 'name' => 'redirect',
- 'type' => 'module',
- 'owner' => '',
- 'status' => '1',
- 'bootstrap' => '0',
- 'schema_version' => '7000',
- 'weight' => '0',
- 'info' => 'a:13:{s:4:"name";s:8:"Redirect";s:11:"description";s:51:"Allows users to redirect from old URLs to new URLs.";s:4:"core";s:3:"7.x";s:5:"files";a:11:{i:0;s:15:"redirect.module";i:1;s:18:"redirect.admin.inc";i:2;s:16:"redirect.install";i:3;s:13:"redirect.test";i:4;s:24:"views/redirect.views.inc";i:5;s:47:"views/redirect_handler_filter_redirect_type.inc";i:6;s:48:"views/redirect_handler_field_redirect_source.inc";i:7;s:50:"views/redirect_handler_field_redirect_redirect.inc";i:8;s:52:"views/redirect_handler_field_redirect_operations.inc";i:9;s:51:"views/redirect_handler_field_redirect_link_edit.inc";i:10;s:53:"views/redirect_handler_field_redirect_link_delete.inc";}s:9:"configure";s:37:"admin/config/search/redirect/settings";s:7:"version";s:11:"7.x-1.0-rc1";s:7:"project";s:8:"redirect";s:9:"datestamp";s:10:"1347989995";s:5:"mtime";i:1347989995;s:12:"dependencies";a:0:{}s:7:"package";s:5:"Other";s:3:"php";s:5:"5.2.4";s:9:"bootstrap";i:0;}',
-))
-->execute();
diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d6/PathRedirectTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d6/PathRedirectTest.php
deleted file mode 100644
index 9383adcd1..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d6/PathRedirectTest.php
+++ /dev/null
@@ -1,50 +0,0 @@
-installSchema('system', array('router'));
- $this->installEntitySchema('redirect');
- $this->loadFixture( __DIR__ . '/../../../../../tests/fixtures/drupal6.php');
-
- $this->executeMigrations(['d6_path_redirect']);
- }
-
- /**
- * Tests the Drupal 6 path redirect to Drupal 8 migration.
- */
- public function testPathRedirect() {
-
- /** @var Redirect $redirect */
- $redirect = Redirect::load(5);
- $this->assertSame($this->getMigration('d6_path_redirect')
- ->getIdMap()
- ->lookupDestinationID(array(5)), array($redirect->id()));
- $this->assertSame("/test/source/url", $redirect->getSourceUrl());
- $this->assertSame("base:test/redirect/url", $redirect->getRedirectUrl()->toUriString());
-
- $redirect = Redirect::load(7);
- $this->assertSame("/test/source/url2", $redirect->getSourceUrl());
- $this->assertSame("http://test/external/redirect/url?foo=bar&biz=buz", $redirect->getRedirectUrl()->toUriString());
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d7/PathRedirectTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d7/PathRedirectTest.php
deleted file mode 100644
index 469e5ccd5..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/Migrate/d7/PathRedirectTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-installEntitySchema('redirect');
- $this->loadFixture(__DIR__ . '/../../../../fixtures/drupal7.php');
-
- $this->executeMigration('d7_path_redirect');
- }
-
- /**
- * Asserts various aspects of a redirect entity.
- *
- * @param int $id
- * The entity ID in the form ENTITY_TYPE.BUNDLE.FIELD_NAME.
- * @param string $source_url
- * The expected source url.
- * @param string $redirect_url
- * The expected redirect url.
- * @param string $status_code
- * The expected status code.
- */
- protected function assertEntity($id, $source_url, $redirect_url, $status_code) {
- /** @var Redirect $redirect */
- $redirect = Redirect::load($id);
- $this->assertSame($this->getMigration('d7_path_redirect')
- ->getIdMap()
- ->lookupDestinationID([$id]), [$redirect->id()]);
- $this->assertSame($source_url, $redirect->getSourceUrl());
- $this->assertSame($redirect_url, $redirect->getRedirectUrl()
- ->toUriString());
- $this->assertSame($status_code, $redirect->getStatusCode());
- }
-
- /**
- * Tests the Drupal 7 path redirect to Drupal 8 migration.
- */
- public function testPathRedirect() {
- $this->assertEntity(5, '/test/source/url', 'base:test/redirect/url', '301');
- $this->assertEntity(7, '/test/source/url2', 'http://test/external/redirect/url?foo=bar&biz=buz#fragment-1', '307');
- }
-}
diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/RedirectAPITest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/RedirectAPITest.php
deleted file mode 100644
index 6d982f7c1..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/src/Kernel/RedirectAPITest.php
+++ /dev/null
@@ -1,305 +0,0 @@
-installEntitySchema('redirect');
- $this->installEntitySchema('user');
- $this->installSchema('system', ['router']);
- $this->installConfig(array('redirect'));
-
- $language = ConfigurableLanguage::createFromLangcode('de');
- $language->save();
-
- $this->controller = $this->container->get('entity.manager')->getStorage('redirect');
- }
-
- /**
- * Test redirect entity logic.
- */
- public function testRedirectEntity() {
- // Create a redirect and test if hash has been generated correctly.
- /** @var \Drupal\redirect\Entity\Redirect $redirect */
- $redirect = $this->controller->create();
- $redirect->setSource('some-url', array('key' => 'val'));
- $redirect->setRedirect('node');
-
- $redirect->save();
- $this->assertEquals(Redirect::generateHash('some-url', array('key' => 'val'), Language::LANGCODE_NOT_SPECIFIED), $redirect->getHash());
- // Update the redirect source query and check if hash has been updated as
- // expected.
- $redirect->setSource('some-url', array('key1' => 'val1'));
- $redirect->save();
- $this->assertEqual(Redirect::generateHash('some-url', array('key1' => 'val1'), Language::LANGCODE_NOT_SPECIFIED), $redirect->getHash());
- // Update the redirect source path and check if hash has been updated as
- // expected.
- $redirect->setSource('another-url', array('key1' => 'val1'));
- $redirect->save();
- $this->assertEqual(Redirect::generateHash('another-url', array('key1' => 'val1'), Language::LANGCODE_NOT_SPECIFIED), $redirect->getHash());
- // Update the redirect language and check if hash has been updated as
- // expected.
- $redirect->setLanguage('de');
- $redirect->save();
- $this->assertEqual(Redirect::generateHash('another-url', array('key1' => 'val1'), 'de'), $redirect->getHash());
- // Create a few more redirects to test the select.
- for ($i = 0; $i < 5; $i++) {
- $redirect = $this->controller->create();
- $redirect->setSource($this->randomMachineName());
- $redirect->save();
- }
- /** @var \Drupal\redirect\RedirectRepository $repository */
- $repository = \Drupal::service('redirect.repository');
- $redirect = $repository->findMatchingRedirect('another-url', array('key1' => 'val1'), 'de');
- if (!empty($redirect)) {
- $this->assertEqual($redirect->getSourceUrl(), '/another-url?key1=val1');
- }
- else {
- $this->fail(t('Failed to find matching redirect.'));
- }
-
- // Load the redirect based on url.
- $redirects = $repository->findBySourcePath('another-url');
- $redirect = array_shift($redirects);
- if (!empty($redirect)) {
- $this->assertEqual($redirect->getSourceUrl(), '/another-url?key1=val1');
- }
- else {
- $this->fail(t('Failed to find redirect by source path.'));
- }
-
- // Test passthrough_querystring.
- $redirect = $this->controller->create();
- $redirect->setSource('a-different-url');
- $redirect->setRedirect('node');
- $redirect->save();
- $redirect = $repository->findMatchingRedirect('a-different-url', ['key1' => 'val1'], 'de');
- if (!empty($redirect)) {
- $this->assertEqual($redirect->getSourceUrl(), '/a-different-url');
- }
- else {
- $this->fail('Failed to find redirect by source path with query string.');
- }
-
- // Add another redirect to the same path, with a query. This should always
- // be found before the source without a query set.
- /** @var \Drupal\redirect\Entity\Redirect $new_redirect */
- $new_redirect = $this->controller->create();
- $new_redirect->setSource('a-different-url', ['foo' => 'bar']);
- $new_redirect->setRedirect('node');
- $new_redirect->save();
- $found = $repository->findMatchingRedirect('a-different-url', ['foo' => 'bar'], 'de');
- if (!empty($found)) {
- $this->assertEqual($found->getSourceUrl(), '/a-different-url?foo=bar');
- }
- else {
- $this->fail('Failed to find a redirect by source path with query string.');
- }
-
- // Add a redirect to an external URL.
- $external_redirect = $this->controller->create();
- $external_redirect->setSource('google');
- $external_redirect->setRedirect('https://google.com');
- $external_redirect->save();
- $found = $repository->findMatchingRedirect('google');
- if (!empty($found)) {
- $this->assertEqual($found->getRedirectUrl()->toString(), 'https://google.com');
- }
- else {
- $this->fail('Failed to find a redirect for google.');
- }
-
- // Hashes should be case-insensitive since the source paths are.
- /** @var \Drupal\redirect\Entity\Redirect $redirect */
- $redirect = $this->controller->create();
- $redirect->setSource('Case-Sensitive-Path');
- $redirect->setRedirect('node');
- $redirect->save();
- $found = $repository->findBySourcePath('case-sensitive-path');
- if (!empty($found)) {
- $found = reset($found);
- $this->assertEqual($found->getSourceUrl(), '/Case-Sensitive-Path');
- }
- else {
- $this->fail('findBySourcePath is case sensitive');
- }
- $found = $repository->findMatchingRedirect('case-sensitive-path');
- if (!empty($found)) {
- $this->assertEqual($found->getSourceUrl(), '/Case-Sensitive-Path');
- }
- else {
- $this->fail('findMatchingRedirect is case sensitive.');
- }
- }
-
- /**
- * Test slash is removed from source path in findMatchingRedirect.
- */
- public function testDuplicateRedirectEntry() {
- $redirect = $this->controller->create();
- $redirect->setSource('/foo/foo', []);
- $redirect->setRedirect('foo');
- $redirect->save();
-
- $redirect_repository = \Drupal::service('redirect.repository');
- $matched_redirect = $redirect_repository->findMatchingRedirect('/foo/foo', [], 'en-AU');
- $this->assertNotNull($matched_redirect);
-
- $null_redirect = $redirect_repository->findMatchingRedirect('/foo/foo-bar', [], 'en-AU');
- $this->assertNull($null_redirect);
- }
-
- /**
- * Test redirect_sort_recursive().
- */
- public function testSortRecursive() {
- $test_cases = array(
- array(
- 'input' => array('b' => 'aa', 'c' => array('c2' => 'aa', 'c1' => 'aa'), 'a' => 'aa'),
- 'expected' => array('a' => 'aa', 'b' => 'aa', 'c' => array('c1' => 'aa', 'c2' => 'aa')),
- 'callback' => 'ksort',
- ),
- );
- foreach ($test_cases as $index => $test_case) {
- $output = $test_case['input'];
- redirect_sort_recursive($output, $test_case['callback']);
- $this->assertIdentical($output, $test_case['expected']);
- }
- }
-
- /**
- * Test loop detection.
- */
- public function testLoopDetection() {
- // Add a chained redirect that isn't a loop.
- /** @var \Drupal\redirect\Entity\Redirect $one */
- $one = $this->controller->create();
- $one->setSource('my-path');
- $one->setRedirect('node');
- $one->save();
- /** @var \Drupal\redirect\Entity\Redirect $two */
- $two = $this->controller->create();
- $two->setSource('second-path');
- $two->setRedirect('my-path');
- $two->save();
- /** @var \Drupal\redirect\Entity\Redirect $three */
- $three = $this->controller->create();
- $three->setSource('third-path');
- $three->setRedirect('second-path');
- $three->save();
-
- /** @var \Drupal\redirect\RedirectRepository $repository */
- $repository = \Drupal::service('redirect.repository');
- $found = $repository->findMatchingRedirect('third-path');
- if (!empty($found)) {
- $this->assertEqual($found->getRedirectUrl()->toString(), '/node', 'Chained redirects properly resolved in findMatchingRedirect.');
- }
- else {
- $this->fail('Failed to resolve a chained redirect.');
- }
-
- // Create a loop.
- $one->setRedirect('third-path');
- $one->save();
- try {
- $repository->findMatchingRedirect('third-path');
- $this->fail('Failed to detect a redirect loop.');
- }
- catch (RedirectLoopException $e) {
- $this->pass('Properly detected a redirect loop.');
- }
- }
-
- /**
- * Test redirect_parse_url().
- */
- public function testParseURL() {
- //$test_cases = array(
- // array(
- // 'input' => array('b' => 'aa', 'c' => array('c2' => 'aa', 'c1' => 'aa'), 'a' => 'aa'),
- // 'expected' => array('a' => 'aa', 'b' => 'aa', 'c' => array('c1' => 'aa', 'c2' => 'aa')),
- // ),
- //);
- //foreach ($test_cases as $index => $test_case) {
- // $output = redirect_parse_url($test_case['input']);
- // $this->assertIdentical($output, $test_case['expected']);
- //}
- }
-
- /**
- * Test multilingual redirects.
- */
- public function testMultilanguageCases() {
- // Add a redirect for english.
- /** @var \Drupal\redirect\Entity\Redirect $en_redirect */
- $en_redirect = $this->controller->create();
- $en_redirect->setSource('langpath');
- $en_redirect->setRedirect('/about');
- $en_redirect->setLanguage('en');
- $en_redirect->save();
-
- // Add a redirect for germany.
- /** @var \Drupal\redirect\Entity\Redirect $en_redirect */
- $en_redirect = $this->controller->create();
- $en_redirect->setSource('langpath');
- $en_redirect->setRedirect('node');
- $en_redirect->setLanguage('de');
- $en_redirect->save();
-
- // Check redirect for english.
- /** @var \Drupal\redirect\RedirectRepository $repository */
- $repository = \Drupal::service('redirect.repository');
-
- $found = $repository->findBySourcePath('langpath');
- if (!empty($found)) {
- $this->assertEqual($found[1]->getRedirectUrl()->toString(), '/about', 'Multilingual redirect resolved properly.');
- $this->assertEqual($found[1]->get('language')[0]->value, 'en', 'Multilingual redirect resolved properly.');
- }
- else {
- $this->fail('Failed to resolve the multilingual redirect.');
- }
-
- // Check redirect for germany.
- \Drupal::configFactory()->getEditable('system.site')->set('default_langcode', 'de')->save();
- /** @var \Drupal\redirect\RedirectRepository $repository */
- $repository = \Drupal::service('redirect.repository');
- $found = $repository->findBySourcePath('langpath');
- if (!empty($found)) {
- $this->assertEqual($found[2]->getRedirectUrl()->toString(), '/node', 'Multilingual redirect resolved properly.');
- $this->assertEqual($found[2]->get('language')[0]->value, 'de', 'Multilingual redirect resolved properly.');
- }
- else {
- $this->fail('Failed to resolve the multilingual redirect.');
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/Migrate/d7/PathRedirectTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Unit/Migrate/d7/PathRedirectTest.php
deleted file mode 100644
index 8a5c593e6..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/Migrate/d7/PathRedirectTest.php
+++ /dev/null
@@ -1,54 +0,0 @@
- 'test',
- 'source' => [
- 'plugin' => 'd7_path_redirect',
- ],
- ];
-
- protected $expectedResults = [
- [
- 'rid' => 5,
- 'hash' => 'MwmDbnA65ag646gtEdLqmAqTbF0qQerse63RkQmJK_Y',
- 'type' => 'redirect',
- 'uid' => 5,
- 'source' => 'test/source/url',
- 'source_options' => '',
- 'redirect' => 'test/redirect/url',
- 'redirect_options' => '',
- 'language' => 'und',
- 'status_code' => 301,
- 'count' => 2518,
- 'access' => 1449497138,
- ],
- ];
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- $this->databaseContents['variable'] = [
- [
- 'name' => 'redirect_default_status_code',
- 'value' => 's:3:"307";',
- ]
- ];
- $this->databaseContents['redirect'] = $this->expectedResults;
- parent::setUp();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectCheckerTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectCheckerTest.php
deleted file mode 100644
index 35f823323..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectCheckerTest.php
+++ /dev/null
@@ -1,155 +0,0 @@
- array('ignore_admin_path' => FALSE, 'access_check' => TRUE));
-
- $state = $this->getMockBuilder('Drupal\Core\State\StateInterface')
- ->getMock();
- $state->expects($this->any())
- ->method('get')
- ->with('system.maintenance_mode')
- ->will($this->returnValue(FALSE));
- $access = $this->getMockBuilder('Drupal\Core\Access\AccessManager')
- ->disableOriginalConstructor()
- ->getMock();
- $account = $this->getMockBuilder('Drupal\Core\Session\AccountInterface')
- ->getMock();
- $route_provider = $this->getMockBuilder('Drupal\Core\Routing\RouteProviderInterface')
- ->getMock();
-
- $route = new Route('/example');
- $route_provider->expects($this->any())
- ->method('getRouteByName')
- ->willReturn($route);
-
- $access->expects($this->any())
- ->method('checkNamedRoute')
- ->willReturnMap([
- ['denied_route', [], $account, FALSE, FALSE],
- ['allowed_route', [], $account, FALSE, TRUE],
- ]);
-
- $checker = new RedirectChecker($this->getConfigFactoryStub($config), $state, $access, $account, $route_provider);
-
- // All fine - we can redirect.
- $request = $this->getRequestStub('index.php', 'GET');
- $this->assertTrue($checker->canRedirect($request), 'Can redirect');
-
- // The script name is not index.php.
- $request = $this->getRequestStub('statistics.php', 'GET');
- $this->assertFalse($checker->canRedirect($request), 'Cannot redirect script name not index.php');
-
- // The request method is not GET.
- $request = $this->getRequestStub('index.php', 'POST');
- $this->assertFalse($checker->canRedirect($request), 'Cannot redirect other than GET method');
-
-
- // Route access check, deny access.
- $request = $this->getRequestStub('index.php', 'GET');
- $this->assertFalse($checker->canRedirect($request, 'denied_route'), 'Can not redirect');
-
- // Route access check, allow access.
- $request = $this->getRequestStub('index.php', 'GET');
- $this->assertTrue($checker->canRedirect($request, 'allowed_route'), 'Can redirect');
-
- // Check destination parameter.
- $request = $this->getRequestStub('index.php', 'GET', [], ['destination' => 'paradise']);
- $this->assertFalse($checker->canRedirect($request), 'Cannot redirect');
-
- // Maintenance mode is on.
- $state = $this->getMockBuilder('Drupal\Core\State\StateInterface')
- ->getMock();
- $state->expects($this->any())
- ->method('get')
- ->with('system.maintenance_mode')
- ->will($this->returnValue(TRUE));
-
- $checker = new RedirectChecker($this->getConfigFactoryStub($config), $state, $access, $account, $route_provider);
-
- $request = $this->getRequestStub('index.php', 'GET');
- $this->assertFalse($checker->canRedirect($request), 'Cannot redirect if maintenance mode is on');
-
- // We are at a admin path.
- $state = $this->getMockBuilder('Drupal\Core\State\StateInterface')
- ->getMock();
- $state->expects($this->any())
- ->method('get')
- ->with('system.maintenance_mode')
- ->will($this->returnValue(FALSE));
-
-// $checker = new RedirectChecker($this->getConfigFactoryStub($config), $state);
-//
-// $route = $this->getMockBuilder('Symfony\Component\Routing\Route')
-// ->disableOriginalConstructor()
-// ->getMock();
-// $route->expects($this->any())
-// ->method('getOption')
-// ->with('_admin_route')
-// ->will($this->returnValue('system.admin_config_search'));
-//
-// $request = $this->getRequestStub('index.php', 'GET',
-// array(RouteObjectInterface::ROUTE_OBJECT => $route));
-// $this->assertFalse($checker->canRedirect($request), 'Cannot redirect if we are requesting a admin path');
-//
-// // We are at admin path with ignore_admin_path set to TRUE.
-// $config['redirect.settings']['ignore_admin_path'] = TRUE;
-// $checker = new RedirectChecker($this->getConfigFactoryStub($config), $state);
-//
-// $request = $this->getRequestStub('index.php', 'GET',
-// array(RouteObjectInterface::ROUTE_OBJECT => $route));
-// $this->assertTrue($checker->canRedirect($request), 'Can redirect a admin with ignore_admin_path set to TRUE');
- }
-
- /**
- * Gets request mock object.
- *
- * @param string $script_name
- * The result of the getScriptName() method.
- * @param string $method
- * The request method.
- * @param array $attributes
- * Attributes to be passed into request->attributes.
- * @param array $query
- * Query paramter to be passed into request->query.
- *
- * @return PHPUnit_Framework_MockObject_MockObject
- * Mocked request object.
- */
- protected function getRequestStub($script_name, $method, array $attributes = [], array $query = []) {
- $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')
- ->disableOriginalConstructor()
- ->getMock();
- $request->expects($this->any())
- ->method('getScriptName')
- ->will($this->returnValue($script_name));
- $request->expects($this->any())
- ->method('isMethod')
- ->with($this->anything())
- ->will($this->returnValue($method == 'GET'));
- $request->query = new ParameterBag($query);
- $request->attributes = new ParameterBag($attributes);
-
- return $request;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectRequestSubscriberTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectRequestSubscriberTest.php
deleted file mode 100644
index e664e95ba..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RedirectRequestSubscriberTest.php
+++ /dev/null
@@ -1,301 +0,0 @@
-getMockBuilder('Drupal\Core\Url')
- ->disableOriginalConstructor()
- ->getMock();
-
- $url->expects($this->once())
- ->method('setAbsolute')
- ->with(TRUE)
- ->willReturn($url);
-
- $url->expects($this->once())
- ->method('getOption')
- ->with('query')
- ->willReturn($redirect_query);
-
- $url->expects($this->once())
- ->method('setOption')
- ->with('query', $final_query);
-
- $url->expects($this->once())
- ->method('toString')
- ->willReturn($redirect_uri);
-
- $redirect = $this->getRedirectStub($url);
- $event = $this->callOnKernelRequestCheckRedirect($redirect, $request_uri, $request_query, TRUE);
-
- $this->assertTrue($event->getResponse() instanceof RedirectResponse);
- $response = $event->getResponse();
- $this->assertEquals('/test-path', $response->getTargetUrl());
- $this->assertEquals(301, $response->getStatusCode());
- $this->assertEquals(1, $response->headers->get('X-Redirect-ID'));
- }
-
- /**
- * @covers ::onKernelRequestCheckRedirect
- * @dataProvider getRedirectData
- */
- public function testRedirectLogicWithoutQueryRetaining($request_uri, $request_query, $redirect_uri) {
-
- $url = $this->getMockBuilder('Drupal\Core\Url')
- ->disableOriginalConstructor()
- ->getMock();
-
- $url->expects($this->once())
- ->method('setAbsolute')
- ->with(TRUE)
- ->willReturn($url);
-
- // No query retaining, so getOption should not be called.
- $url->expects($this->never())
- ->method('getOption');
- $url->expects($this->never())
- ->method('setOption');
-
- $url->expects($this->once())
- ->method('toString')
- ->willReturn($redirect_uri);
-
- $redirect = $this->getRedirectStub($url);
- $event = $this->callOnKernelRequestCheckRedirect($redirect, $request_uri, $request_query, FALSE);
-
- $this->assertTrue($event->getResponse() instanceof RedirectResponse);
- $response = $event->getResponse();
- $this->assertEquals($redirect_uri, $response->getTargetUrl());
- $this->assertEquals(301, $response->getStatusCode());
- $this->assertEquals(1, $response->headers->get('X-Redirect-ID'));
- }
-
- /**
- * Data provider for both tests.
- */
- public function getRedirectData() {
- return [
- ['non-existing', ['key' => 'val'], '/test-path', ['dummy' => 'value']],
- ['non-existing/', ['key' => 'val'], '/test-path', ['dummy' => 'value']],
- ['system/files/file.txt', [], '/test-path', []],
- ];
- }
-
- /**
- * Instantiates the subscriber and runs onKernelRequestCheckRedirect()
- *
- * @param $redirect
- * The redirect entity.
- * @param $request_uri
- * The URI of the request.
- * @param array $request_query
- * The query that is supposed to come via request.
- * @param bool $retain_query
- * Flag if to retain the query through the redirect.
- *
- * @return \Symfony\Component\HttpKernel\Event\GetResponseEvent
- * THe response event.
- */
- protected function callOnKernelRequestCheckRedirect($redirect, $request_uri, $request_query, $retain_query) {
-
- $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query));
- $request = $event->getRequest();
-
- $checker = $this->getMockBuilder('Drupal\redirect\RedirectChecker')
- ->disableOriginalConstructor()
- ->getMock();
- $checker->expects($this->any())
- ->method('canRedirect')
- ->will($this->returnValue(TRUE));
-
- $context = $this->getMock('Symfony\Component\Routing\RequestContext');
-
- $inbound_path_processor = $this->getMockBuilder('Drupal\Core\PathProcessor\InboundPathProcessorInterface')
- ->disableOriginalConstructor()
- ->getMock();
- $inbound_path_processor->expects($this->any())
- ->method('processInbound')
- ->with($request->getPathInfo(), $request)
- ->willReturnCallback(function ($path, Request $request) {
- if (strpos($path, '/system/files/') === 0 && !$request->query->has('file')) {
- // Private files paths are split by the inbound path processor and the
- // relative file path is moved to the 'file' query string parameter.
- // This is because the route system does not allow an arbitrary amount
- // of parameters.
- // @see \Drupal\system\PathProcessor\PathProcessorFiles::processInbound()
- $path = '/system/files';
- }
- return $path;
- });
-
- $alias_manager = $this->getMockBuilder('Drupal\Core\Path\AliasManager')
- ->disableOriginalConstructor()
- ->getMock();
- $module_handler = $this->getMockBuilder('Drupal\Core\Extension\ModuleHandlerInterface')
- ->getMock();
- $entity_manager = $this->getMockBuilder('Drupal\Core\Entity\EntityManagerInterface')
- ->getMock();
-
- $subscriber = new RedirectRequestSubscriber(
- $this->getRedirectRepositoryStub('findMatchingRedirect', $redirect),
- $this->getLanguageManagerStub(),
- $this->getConfigFactoryStub(array('redirect.settings' => array('passthrough_querystring' => $retain_query))),
- $alias_manager,
- $module_handler,
- $entity_manager,
- $checker,
- $context,
- $inbound_path_processor
- );
-
- // Run the main redirect method.
- $subscriber->onKernelRequestCheckRedirect($event);
- return $event;
- }
-
- /**
- * Gets the redirect repository mock object.
- *
- * @param $method
- * Method to mock - either load() or findMatchingRedirect().
- * @param $redirect
- * The redirect object to be returned.
- *
- * @return PHPUnit_Framework_MockObject_MockObject
- * The redirect repository.
- */
- protected function getRedirectRepositoryStub($method, $redirect) {
- $repository = $this->getMockBuilder('Drupal\redirect\RedirectRepository')
- ->disableOriginalConstructor()
- ->getMock();
-
- if ($method === 'findMatchingRedirect') {
- $repository->expects($this->any())
- ->method($method)
- ->willReturnCallback(function ($source_path) use ($redirect) {
- // No redirect with source path 'system/files' exists. The stored
- // redirect has 'system/files/file.txt' as source path.
- return $source_path === 'system/files' ? NULL : $redirect;
- });
- }
- else {
- $repository->expects($this->any())
- ->method($method)
- ->will($this->returnValue($redirect));
- }
-
- return $repository;
- }
-
- /**
- * Gets the redirect mock object.
- *
- * @param $url
- * Url to be returned from getRedirectUrl
- * @param int $status_code
- * The redirect status code.
- *
- * @return PHPUnit_Framework_MockObject_MockObject
- * The mocked redirect object.
- */
- protected function getRedirectStub($url, $status_code = 301) {
- $redirect = $this->getMockBuilder('Drupal\redirect\Entity\Redirect')
- ->disableOriginalConstructor()
- ->getMock();
- $redirect->expects($this->once())
- ->method('getRedirectUrl')
- ->will($this->returnValue($url));
- $redirect->expects($this->any())
- ->method('getStatusCode')
- ->will($this->returnValue($status_code));
- $redirect->expects($this->any())
- ->method('id')
- ->willReturn(1);
- $redirect->expects($this->once())
- ->method('getCacheTags')
- ->willReturn(['redirect:1']);
-
- return $redirect;
- }
-
- /**
- * Gets post response event.
- *
- * @param array $headers
- * Headers to be set into the response.
- *
- * @return \Symfony\Component\HttpKernel\Event\PostResponseEvent
- * The post response event object.
- */
- protected function getPostResponseEvent($headers = array()) {
- $http_kernel = $this->getMockBuilder('\Symfony\Component\HttpKernel\HttpKernelInterface')
- ->getMock();
- $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')
- ->disableOriginalConstructor()
- ->getMock();
-
- $response = new Response('', 301, $headers);
-
- return new PostResponseEvent($http_kernel, $request, $response);
- }
-
- /**
- * Gets response event object.
- *
- * @param $path_info
- * @param $query_string
- *
- * @return GetResponseEvent
- */
- protected function getGetResponseEventStub($path_info, $query_string) {
- $request = Request::create($path_info . '?' . $query_string, 'GET', [], [], [], ['SCRIPT_NAME' => 'index.php']);
-
- $http_kernel = $this->getMockBuilder('\Symfony\Component\HttpKernel\HttpKernelInterface')
- ->getMock();
- return new GetResponseEvent($http_kernel, $request, 'test');
- }
-
- /**
- * Gets the language manager mock object.
- *
- * @return \Drupal\language\ConfigurableLanguageManagerInterface|PHPUnit_Framework_MockObject_MockObject
- */
- protected function getLanguageManagerStub() {
- $language_manager = $this->getMockBuilder('Drupal\language\ConfigurableLanguageManagerInterface')
- ->getMock();
- $language_manager->expects($this->any())
- ->method('getCurrentLanguage')
- ->will($this->returnValue(new Language(array('id' => 'en'))));
-
- return $language_manager;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php b/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php
deleted file mode 100644
index 87d3c3135..000000000
--- a/sites/all/modules/contrib/admin/redirect/tests/src/Unit/RouteNormalizerRequestSubscriberTest.php
+++ /dev/null
@@ -1,225 +0,0 @@
-getMock('\Drupal\Core\PageCache\ResponsePolicy\KillSwitch');
- $kill_switch->expects($this->any())
- ->method('trigger')
- ->withAnyParameters()
- ->will($this->returnValue(NULL));
- $container = new ContainerBuilder();
- $container->set('page_cache_kill_switch', $kill_switch);
- \Drupal::setContainer($container);
- }
-
- /**
- * @covers ::onKernelRequestRedirect
- */
- public function testSkipIfFlagNotEnabled() {
- $request_uri = 'https://example.com/route-to-normalize';
- $request_query = [];
-
- $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query));
- // We set 'route_normalizer_enabled' config to FALSE and expect to leave onKernelRequestRedirect at the beginning,
- // i.e. $this->redirectChecker->canRedirect($request) should never be called.
- $subscriber = $this->getSubscriber($request_uri, FALSE, FALSE);
- $subscriber->onKernelRequestRedirect($event);
- }
-
- /**
- * @covers ::onKernelRequestRedirect
- */
- public function testSkipIfSubRequest() {
- $request_uri = 'https://example.com/route-to-normalize';
- $request_query = [];
-
- $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query), HttpKernelInterface::SUB_REQUEST);
- // We are using SUB_REQUEST as the request type and expect to leave onKernelRequestRedirect at the beginning,
- // i.e. $this->redirectChecker->canRedirect($request) should never be called.
- $subscriber = $this->getSubscriber($request_uri, TRUE, FALSE);
- $subscriber->onKernelRequestRedirect($event);
- }
-
- /**
- * @covers ::onKernelRequestRedirect
- */
- public function testSkipIfRequestAttribute() {
- $request_uri = 'https://example.com/route-to-normalize';
- $request_query = [];
-
- $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query), HttpKernelInterface::MASTER_REQUEST, TRUE);
- // We set '_disable_route_normalizer' as a request attribute and expect to leave onKernelRequestRedirect at the beginning,
- // i.e. $this->redirectChecker->canRedirect($request) should never be called.
- $subscriber = $this->getSubscriber($request_uri, TRUE, FALSE);
- $subscriber->onKernelRequestRedirect($event);
- }
-
- /**
- * @covers ::onKernelRequestRedirect
- * @dataProvider getTestUrls
- */
- public function testOnKernelRequestRedirect($request_uri, $request_query, $expected, $expect_normalization) {
- $event = $this->getGetResponseEventStub($request_uri, http_build_query($request_query));
- $subscriber = $this->getSubscriber($request_uri);
- $subscriber->onKernelRequestRedirect($event);
-
- if ($expect_normalization) {
- $response = $event->getResponse();
- $this->assertEquals($expected, $response->getTargetUrl());
- }
- }
-
- /**
- * Data provider for testOnKernelRequestRedirect().
- */
- public function getTestUrls() {
- return [
- ['https://example.com/route-to-normalize', [], 'https://example.com/route-to-normalize', FALSE],
- ['https://example.com/route-to-normalize', ['key' => 'value'], 'https://example.com/route-to-normalize?key=value', FALSE],
- ['https://example.com/index.php/', ['q' => 'node/1'], 'https://example.com/?q=node/1', TRUE],
- ];
- }
-
- /**
- * Create a RouteNormalizerRequestSubscriber object.
- *
- * @param string $request_uri
- * The return value for the generateFromRoute method.
- * @param bool $enabled
- * Flag indicating if the normalizer shoud be enabled.
- * @param bool $call_expected
- * If true, canRedirect() and other methods should be called once.
- *
- * @return \Drupal\redirect\EventSubscriber\RouteNormalizerRequestSubscriber
- */
- protected function getSubscriber($request_uri, $enabled = TRUE, $call_expected = TRUE) {
- return new RouteNormalizerRequestSubscriber(
- $this->getUrlGeneratorStub($request_uri, $call_expected),
- $this->getPathMatcherStub($call_expected),
- $this->getConfigFactoryStub([
- 'redirect.settings' => [
- 'route_normalizer_enabled' => $enabled,
- 'default_status_code' => 301,
- ],
- ]),
- $this->getRedirectCheckerStub($call_expected)
- );
- }
-
- /**
- * Gets the UrlGenerator mock object.
- *
- * @param string $request_uri
- * The return value for the generateFromRoute method.
- * @param bool $call_expected
- * If true, we expect generateFromRoute() to be called once.
- *
- * @return \Drupal\Core\Routing\UrlGeneratorInterface|PHPUnit_Framework_MockObject_MockObject
- */
- protected function getUrlGeneratorStub($request_uri, $call_expected = TRUE) {
- $url_generator = $this->getMockBuilder('\Drupal\Core\Routing\UrlGeneratorInterface')
- ->getMock();
-
- $options = ['absolute' => TRUE];
-
- $expectation = $call_expected ? $this->once() : $this->never();
-
- $url_generator->expects($expectation)
- ->method('generateFromRoute')
- ->with('', [], $options)
- ->willReturn($request_uri);
- return $url_generator;
- }
-
- /**
- * Gets the PathMatcher mock object.
- *
- * @param bool $call_expected
- * If true, we expect isFrontPage() to be called once.
- *
- * @return \Drupal\Core\Path\PathMatcherInterface|PHPUnit_Framework_MockObject_MockObject
- */
- protected function getPathMatcherStub($call_expected = TRUE) {
- $path_matcher = $this->getMockBuilder('\Drupal\Core\Path\PathMatcherInterface')
- ->getMock();
-
- $expectation = $call_expected ? $this->once() : $this->never();
-
- $path_matcher->expects($expectation)
- ->method('isFrontPage')
- ->withAnyParameters()
- ->willReturn(FALSE);
- return $path_matcher;
- }
-
- /**
- * Gets the RedirectChecker mock object.
- *
- * @param bool $call_expected
- * If true, we expect canRedirect() to be called once.
- *
- * @return \Drupal\redirect\RedirectChecker|PHPUnit_Framework_MockObject_MockObject
- */
- protected function getRedirectCheckerStub($call_expected = TRUE) {
- $redirect_checker = $this->getMockBuilder('\Drupal\redirect\RedirectChecker')
- ->disableOriginalConstructor()
- ->getMock();
-
- $expectation = $call_expected ? $this->once() : $this->never();
-
- $redirect_checker->expects($expectation)
- ->method('canRedirect')
- ->withAnyParameters()
- ->willReturn(TRUE);
- return $redirect_checker;
- }
-
- /**
- * Returns a GET response event object.
- *
- * @param string $path_info
- * The path of the request.
- * @param array $query_string
- * The query string of the request.
- * @param int $request_type
- * The request type of the request.
- * @param bool $set_request_attribute
- * If true, the request attribute '_disable_route_normalizer' will be set.
- *
- * @return \Symfony\Component\HttpKernel\Event\GetResponseEvent
- */
- protected function getGetResponseEventStub($path_info, $query_string, $request_type = HttpKernelInterface::MASTER_REQUEST, $set_request_attribute = FALSE) {
- $request = Request::create($path_info . '?' . $query_string, 'GET', [], [], [], ['SCRIPT_NAME' => 'index.php', 'SCRIPT_FILENAME' => 'index.php']);
-
- if ($set_request_attribute === TRUE) {
- $request->attributes->add(['_disable_route_normalizer' => TRUE]);
- }
-
- $http_kernel = $this->getMockBuilder('\Symfony\Component\HttpKernel\HttpKernelInterface')
- ->getMock();
- return new GetResponseEvent($http_kernel, $request, $request_type);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/LICENSE.txt b/sites/all/modules/contrib/admin/simple_sitemap/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/README.md b/sites/all/modules/contrib/admin/simple_sitemap/README.md
deleted file mode 100644
index 5d10a8644..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/README.md
+++ /dev/null
@@ -1,249 +0,0 @@
-## CONTENTS OF THIS FILE ##
-
- * Introduction
- * Installation
- * Configuration
- * Usage
- * Extending the module
- * How Can You Contribute?
- * Maintainers
-
-## INTRODUCTION ##
-
-Author and maintainer: Pawel Ginalski (gbyte.co)
- * Drupal: https://www.drupal.org/u/gbyte.co
- * Personal: https://gbyte.co/
-
-The module generates multilingual XML sitemaps which adhere to Google's new
-hreflang standard. Out of the box the sitemaps index most of Drupal's
-content entity types including:
-
- * nodes
- * taxonomy terms
- * menu links
- * users
- * ...
-
-Contributed entity types like commerce products or media entities can be indexed
-as well. On top of that custom links can be added to the sitemap.
-
-To learn about XML sitemaps, see https://en.wikipedia.org/wiki/Sitemaps.
-
-The module also provides an API allowing to create any type of sitemap (not
-necessary an XML one) holding links to a local or remote source.
-
-## INSTALLATION ##
-
-See https://www.drupal.org/documentation/install/modules-themes/modules-8
-for instructions on how to install or update Drupal modules.
-
-## CONFIGURATION ##
-
-### PERMISSIONS ###
-
-The module permission 'administer sitemap settings' can be configured under
-/admin/people/permissions.
-
-### ENTITIES ###
-
-Initially only the home page is indexed in the sitemap. To include content into
-the sitemap, visit /admin/config/search/simplesitemap/entities to enable support
-for entity types of your choosing. Entity types which feature bundles can then
-be configured on a per-bundle basis, e.g.
-
- * /admin/structure/types/manage/[content type] for nodes
- * /admin/structure/taxonomy/manage/[taxonomy vocabulary] for taxonomy terms
- * /admin/structure/menu/manage/[menu] for menu items
- * ...
-
-When including an entity type or bundle into the sitemap, the priority setting
-can be set which will set the 'priority' parameter for all entities of that
-type. Same goes for the 'changefreq' setting. All Images referenced by the
-entities can be indexed as well. See https://en.wikipedia.org/wiki/Sitemaps to
-learn more about these parameters.
-
-Inclusion settings of bundles can be overridden on a per-entity
-basis. Just head over to a bundle instance edit form (e.g. node/1/edit) to
-override its sitemap settings.
-
-If you wish for the sitemap to reflect the new configuration instantly, check
-'Regenerate sitemaps after clicking save'. This setting only appears if a change
-in the settings has been detected.
-
-As the sitemap is accessible to anonymous users, bear in mind that only links
-will be included which are accessible to anonymous users. There are no access
-checks for links added through the module's hooks (see below).
-
-### CUSTOM LINKS ###
-
-To include custom links into the sitemap, visit
-/admin/config/search/simplesitemap/custom.
-
-### SETTINGS ###
-
-The settings page can be found under admin/config/search/simplesitemap.
-Here the module can be configured and the sitemaps can be manually regenerated.
-
-#### VARIANTS ####
-
-It is possible to have several sitemap instances of different sitemap types with
-specific links accessible under certain URLs. These sitemap variants can be
-configured under admin/config/search/simplesitemap/variants.
-
-## USAGE ##
-
-The sitemaps are accessible to the whole world under [variant name]/sitemap.xml.
-In addition to that, the default sitemap is accessible under /sitemap.xml.
-
-If the cron generation is turned on, the sitemaps will be regenerated according
-to the 'Sitemap generation interval' setting.
-
-A manual generation is possible on admin/config/search/simplesitemap. This is
-also the place that shows the overall and variant specific generation status.
-
-The sitemap can be also generated via drush: Use the command
-'drush simple-sitemap:generate' ('ssg'), or 'drush simple-sitemap:rebuild-queue'
-('ssr').
-
-Generation of hundreds of thousands of links can take time. Each variant gets
-published as soon as all of its links have been generated. The previous version
-of the sitemap variant is accessible during the generation process.
-
-## EXTENDING THE MODULE ##
-
-### API ###
-
-There are API methods for altering stored inclusion settings, status queries and
-programmatic sitemap generation. These include:
-
- * getSetting
- * saveSetting
- * setVariants
- * getSitemap
- * removeSitemap
- * generateSitemap
- * rebuildQueue
- * enableEntityType
- * disableEntityType
- * setBundleSettings
- * getBundleSettings
- * removeBundleSettings
- * supplementDefaultSettings
- * setEntityInstanceSettings
- * getEntityInstanceSettings
- * removeEntityInstanceSettings
- * bundleIsIndexed
- * entityTypeIsEnabled
- * addCustomLink
- * getCustomLinks
- * removeCustomLinks
- * getSitemapManager
- * getSitemapVariants
- * addSitemapVariant
- * removeSitemapVariants
- * getQueueWorker
- * deleteQueue
- * rebuildQueue
- * getInitialElementCount
- * getQueuedElementCount
- * getStashedResultCount
- * getProcessedElementCount
- * generationInProgress
-
-
-These service methods can be chained like so:
-
-```php
-$generator = \Drupal::service('simple_sitemap.generator');
-
-$generator
- ->getSitemapManager()
- ->addSitemapVariant('test');
-
-$generator
- ->saveSetting('remove_duplicates', TRUE)
- ->enableEntityType('node')
- ->setVariants(['default', 'test'])
- ->setBundleSettings('node', 'page', ['index' => TRUE, 'priority' = 0.5])
- ->removeCustomLinks()
- ->addCustomLink('/some/view/page', ['priority' = 0.5])
- ->generateSitemap();
-```
-
-See https://gbyte.co/projects/simple-xml-sitemap and code documentation in
-Drupal\simple_sitemap\Simplesitemap for further details.
-
-### API HOOKS ###
-
-It is possible to hook into link generation by implementing
-`hook_simple_sitemap_links_alter(&$links){}` in a custom module and altering the
-link array shortly before it is transformed to XML.
-
-Adding arbitrary links is possible through the use of
-`hook_simple_sitemap_arbitrary_links_alter(&$arbitrary_links){}`. There are no
-checks performed on these links (i.e. if they are internal/valid/accessible)
-and parameters like priority/lastmod/changefreq have to be added manually.
-
-Altering sitemap attributes and sitemap index attributes is possible through the
-use of `hook_simple_sitemap_attributes_alter(&$attributes){}` and
-`hook_simple_sitemap_index_attributes_alter(&$index_attributes){}`.
-
-Altering URL generators is possible through
-the use of `hook_simple_sitemap_url_generators_alter(&$generators){}`.
-
-Altering sitemap generators is possible through
-the use of `hook_simple_sitemap_sitemap_generators_alter(&$generators){}`.
-
-Altering sitemap types is possible through
-the use of `hook_simple_sitemap_sitemap_types_alter(&$generators){}`.
-
-### WRITING PLUGINS ###
-
-There are three types of plugins that allow to create any type of sitemap. See
-the generator plugins included in this module and check the API docs
-(https://www.drupal.org/docs/8/api/plugin-api/plugin-api-overview) to learn how
-to implement plugins.
-
-#### SITEMAP TYPE PLUGINS ####
-
-This plugin defines a sitemap type. A sitemap type consists of a sitemap
-generator and several URL generators. This plugin is very simple, as it
-only requires some class annotation to define which sitemap/URL plugins to use.
-
-#### SITEMAP GENERATOR PLUGINS ####
-
-This plugin defines how a sitemap type is supposed to look. It handles all
-aspects of the sitemap except its links/URLs.
-
-#### URL GENERATOR PLUGINS ####
-
-This plugin defines a way of generating URLs for one or more sitemap types.
-
-Note:
-Overwriting the default EntityUrlGenerator for a single entity type is possible
-through the flag "overrides_entity_type" = "[entity_type_to_be_overwritten]" in
-the settings array of the new generator plugin's annotation. See how the
-EntityUrlGenerator is overwritten by the EntityMenuLinkContentUrlGenerator to
-facilitate a different logic for menu links.
-
-See https://gbyte.co/projects/simple-xml-sitemap for further details.
-
-## HOW CAN YOU CONTRIBUTE? ##
-
- * Report any bugs, feature or support requests in the issue tracker; if
- possible help out by submitting patches.
- http://drupal.org/project/issues/simple_sitemap
-
- * Do you know a non-English language? Help translating the module.
- https://localize.drupal.org/translate/projects/simple_sitemap
-
- * If you would like to say thanks and support the development of this module, a
- donation will be much appreciated.
- https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5AFYRSBLGSC3W
-
- * Feel free to contact me for paid support: https://gbyte.co/contact
-
-## MAINTAINERS ##
-
-Current maintainers:
- * Pawel Ginalski (gbyte.co) - https://www.drupal.org/u/gbyte.co
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/composer.json b/sites/all/modules/contrib/admin/simple_sitemap/composer.json
deleted file mode 100644
index f8c19b934..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/composer.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "name": "drupal/simple_sitemap",
- "description": "Creates a standard conform hreflang XML sitemap of the site content and provides a framework for developing other sitemap types.",
- "type": "drupal-module",
- "homepage": "https://drupal.org/project/simple_sitemap",
- "authors": [
- {
- "name": "Pawel Ginalski (gbyte.co)",
- "email": "contact@gbyte.co",
- "homepage": "https://www.drupal.org/u/gbyte.co",
- "role": "Maintainer"
- }
- ],
- "support": {
- "issues": "https://drupal.org/project/issues/simple_sitemap",
- "irc": "irc://irc.freenode.org/drupal-contribute",
- "source": "https://cgit.drupalcode.org/simple_sitemap"
- },
- "license": "GPL-2.0+",
- "minimum-stability": "dev",
- "require": {
- "ext-xmlwriter": "*"
- },
- "extra": {
- "drush": {
- "services": {
- "drush.services.yml": "^9"
- }
- }
- }
-}
-
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.custom_links.default.yml b/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.custom_links.default.yml
deleted file mode 100644
index b74e96a0f..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.custom_links.default.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-links:
- -
- path: '/'
- priority: '1.0'
- changefreq: 'daily'
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.settings.yml b/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.settings.yml
deleted file mode 100644
index 1d4c8e0bb..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.settings.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-max_links: 2000
-cron_generate: true
-cron_generate_interval: 0
-generate_duration: 10000
-remove_duplicates: true
-skip_untranslated: true
-base_url: ''
-default_variant: 'default'
-custom_links_include_images: false
-excluded_languages: []
-enabled_entity_types:
- - 'node'
- - 'taxonomy_term'
- - 'menu_link_content'
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.variants.default_hreflang.yml b/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.variants.default_hreflang.yml
deleted file mode 100644
index fd7847d28..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/config/install/simple_sitemap.variants.default_hreflang.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-variants:
- default:
- label: 'Default'
- weight: 0
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/config/schema/simple_sitemap.schema.yml b/sites/all/modules/contrib/admin/simple_sitemap/config/schema/simple_sitemap.schema.yml
deleted file mode 100644
index 9fd771245..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/config/schema/simple_sitemap.schema.yml
+++ /dev/null
@@ -1,94 +0,0 @@
-simple_sitemap.settings:
- type: config_object
- mapping:
- max_links:
- label: 'Max links'
- type: integer
- cron_generate:
- label: 'Cron generation'
- type: boolean
- cron_generate_interval:
- label: 'Cron generation interval'
- type: integer
- generate_duration:
- label: 'Generation duration'
- type: integer
- remove_duplicates:
- label: 'Remove duplicates'
- type: boolean
- skip_untranslated:
- label: 'Skip untranslated'
- type: boolean
- base_url:
- label: 'Base URL'
- type: string
- default_variant:
- label: 'Default variant'
- type: string
- custom_links_include_images:
- label: 'Include images of custom links'
- type: boolean
- excluded_languages:
- label: 'Excluded languages'
- type: sequence
- sequence:
- type: string
- enabled_entity_types:
- label: 'Enabled entity types'
- type: sequence
- sequence:
- type: string
-
-simple_sitemap.bundle_settings.*.*.*:
- label: 'Entity bundle settings'
- type: config_object
- mapping:
- index:
- label: 'Index'
- type: boolean
- priority:
- label: 'Priority'
- type: string
- changefreq:
- label: 'Change frequency'
- type: string
- include_images:
- label: 'Include images'
- type: boolean
-
-simple_sitemap.custom_links.*:
- label: 'Custom links'
- type: config_object
- mapping:
- links:
- label: 'Custom links'
- type: sequence
- sequence:
- type: mapping
- mapping:
- path:
- label: 'Path'
- type: string
- priority:
- label: 'Priority'
- type: string
- changefreq:
- label: 'Change frequency'
- type: string
-
-simple_sitemap.variants.*:
- label: 'Sitemap variants'
- type: config_object
- mapping:
- variants:
- label: 'Sitemap variants'
- type: sequence
- sequence:
- type: mapping
- mapping:
- label:
- label: 'Variant label'
- type: string
- weight:
- label: 'Weight'
- type: integer
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/drush.services.yml b/sites/all/modules/contrib/admin/simple_sitemap/drush.services.yml
deleted file mode 100644
index d2c7a6946..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/drush.services.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-services:
- simple_sitemap.commands:
- class: \Drupal\simple_sitemap\Commands\SimplesitemapCommands
- arguments:
- - '@simple_sitemap.generator'
- tags:
- - { name: drush.command }
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.fieldsetSummaries.js b/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.fieldsetSummaries.js
deleted file mode 100644
index 1963294aa..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.fieldsetSummaries.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @file
- * Attaches simple_sitemap behaviors to the entity form.
- */
-(function($) {
-
- "use strict";
-
- Drupal.behaviors.simple_sitemapFieldsetSummaries = {
- attach: function(context) {
- $(context).find('#edit-simple-sitemap').drupalSetSummary(function(context) {
- var vals = [];
- if ($(context).find('#edit-simple-sitemap-index-content-1').is(':checked')) {
- vals.push(Drupal.t('Included in sitemap'));
- vals.push(Drupal.t('Variant') + ': ' + $('#edit-simple-sitemap-variant option:selected', context).text());
- vals.push(Drupal.t('Priority') + ': ' + $('#edit-simple-sitemap-priority option:selected', context).text());
- vals.push(Drupal.t('Change frequency') + ': ' + $('#edit-simple-sitemap-changefreq option:selected', context).text());
- vals.push(Drupal.t('Include images') + ': ' + $('#edit-simple-sitemap-include-images option:selected', context).text());
- }
- else {
- vals.push(Drupal.t('Excluded from sitemap'));
- }
- return vals.join(' ');
- });
- }
- };
-})(jQuery);
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.form.js b/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.form.js
deleted file mode 100644
index d4f24fa4b..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.form.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * @file
- * Attaches simple_sitemap behaviors to the entity form.
- */
-(function($) {
-
- "use strict";
-
- Drupal.behaviors.simple_sitemapForm = {
- attach: function(context) {
-
- // On load: Hide the 'Regenerate sitemap' field to only display it if settings have changed.
- $('.form-item-simple-sitemap-regenerate-now').hide();
-
- // Show 'Regenerate sitemap' field if settings have changed.
- $("#edit-simple-sitemap-index-content"
- + ", #edit-simple-sitemap-variant"
- + ", #edit-simple-sitemap-priority"
- + ", #edit-simple-sitemap-changefreq"
- + ", #edit-simple-sitemap-include-images"
- ).change(function() {
- $('.form-item-simple-sitemap-regenerate-now').show();
- });
- }
- };
-})(jQuery);
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.sitemapEntities.js b/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.sitemapEntities.js
deleted file mode 100644
index abfe5fb1f..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/js/simple_sitemap.sitemapEntities.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * @file
- * Attaches simple_sitemap behaviors to the sitemap entities form.
- */
-(function($) {
-
- "use strict";
-
- Drupal.behaviors.simple_sitemapSitemapEntities = {
- attach: function(context, settings) {
- var allEntities = settings.simple_sitemap.all_entities;
- var atomicEntities = settings.simple_sitemap.atomic_entities;
-
- // Hide the 'Regenerate sitemap' field to only display it if settings have changed.
- $('.form-item-simple-sitemap-regenerate-now').hide();
-
- $.each(allEntities, function(index, value) {
-
- // On load: hide all warning messages.
- $('#warning-' + value).hide();
-
- // On change: Show or hide warning message dependent on 'enabled' checkbox.
- var enabledId = '#edit-' + value + '-enabled';
- $(enabledId).change(function() {
- if ($(enabledId).is(':checked')) {
- $('#warning-' + value).hide();
- $('#indexed-bundles-' + value).show();
- }
- else {
- $('#warning-' + value).show();
- $('#indexed-bundles-' + value).hide();
- }
-
- // Show 'Regenerate sitemap' field if 'enabled' setting has changed.
- $('.form-item-simple-sitemap-regenerate-now').show();
- });
- });
-
- // todo
- // Show 'Regenerate sitemap' field if settings have changed.
- // $.each(atomicEntities, function(index, value) {
- // var variant = '.form-item-' + value + '-simple-sitemap-variant';
- // var priorityId = '.form-item-' + value + '-simple-sitemap-priority';
- // var changefreqId = '.form-item-' + value + '-simple-sitemap-changefreq';
- // var includeImagesId = '.form-item-' + value + '-simple-sitemap-include-images';
- //
- // $(variant, priorityId, changefreqId, includeImagesId).change(function() {
- // $('.form-item-simple-sitemap-regenerate-now').show();
- // });
- // });
- }
- };
-})(jQuery);
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.api.php b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.api.php
deleted file mode 100644
index 55936bf83..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.api.php
+++ /dev/null
@@ -1,142 +0,0 @@
- $link) {
- if ($link['path'] === 'node/1') {
-
- // Remove 'loc' URL if it points to a german site.
- if ($link['langcode'] === 'de') {
- unset($links[$key]);
- }
-
- // If this 'loc' URL points to a non-german site, make sure to remove
- // its german alternate URL.
- else {
- if ($link['alternate_urls']['de']) {
- unset($links[$key]['alternate_urls']['de']);
- }
- }
- }
- }
-}
-
-/**
- * Add arbitrary links to the sitemap.
- *
- * @param array &$arbitrary_links
- * @param string|null $sitemap_variant
- */
-function hook_simple_sitemap_arbitrary_links_alter(array &$arbitrary_links, $sitemap_variant) {
-
- // Add an arbitrary link to all sitemap variants.
- $arbitrary_links[] = [
- 'url' => 'http://some-arbitrary-link/',
- 'priority' => '0.5',
-
- // An ISO8601 formatted date.
- 'lastmod' => '2012-10-12T17:40:30+02:00',
-
- 'changefreq' => 'weekly',
- 'images' => [
- ['path' => 'http://path-to-image.png']
- ],
-
- // Add alternate URLs for every language of a multilingual site.
- // Not necessary for monolingual sites.
- 'alternate_urls' => [
- 'en' => 'http://this-is-your-life.net/de/tyler',
- 'de' => 'http://this-is-your-life.net/en/tyler',
- ]
- ];
-
- // Add an arbitrary link to the 'fight_club' sitemap variant only.
- switch ($sitemap_variant) {
- case 'fight_club':
- $arbitrary_links[] = [
- 'url' => 'http://this-is-your-life.net/tyler',
- ];
- break;
- }
-}
-
-/**
- * Alters the sitemap attributes shortly before XML document generation.
- * Attributes can be added, changed and removed.
- *
- * @param array &$attributes
- * @param string|null $sitemap_variant
- */
-function hook_simple_sitemap_attributes_alter(array &$attributes, $sitemap_variant) {
-
- // Remove the xhtml attribute e.g. if no xhtml sitemap elements are present.
- unset($attributes['xmlns:xhtml']);
-}
-
-/**
- * Alters attributes of the sitemap index shortly before XML document generation.
- * Attributes can be added, changed and removed.
- *
- * @param array &$index_attributes
- * @param string|null $sitemap_variant
- */
-function hook_simple_sitemap_index_attributes_alter(array &$index_attributes, $sitemap_variant) {
-
- // Add some attribute to the sitemap index.
- $index_attributes['name'] = 'value';
-}
-
-/**
- * Alter properties of and remove URL generator plugins.
- *
- * @param array $url_generators
- */
-function hook_simple_sitemap_url_generators_alter(array &$url_generators) {
-
- // Remove the entity generator.
- unset($url_generators['entity']);
-}
-
-/**
- * Alter properties of and remove sitemap generator plugins.
- *
- * @param array $sitemap_generators
- */
-function hook_simple_sitemap_sitemap_generators_alter(array &$sitemap_generators) {
-
- // Remove the default generator.
- unset($sitemap_generators['default']);
-}
-
-/**
- * Alter properties of and remove sitemap type plugins.
- *
- * @param array $sitemap_types
- */
-function hook_simple_sitemap_sitemap_types_alter(array &$sitemap_types) {
-
-}
-
-/**
- * @} End of "addtogroup hooks".
- */
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.drush.inc b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.drush.inc
deleted file mode 100644
index 72a6d3bf5..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.drush.inc
+++ /dev/null
@@ -1,45 +0,0 @@
- 'Regenerate the XML sitemaps according to the module settings.',
- 'callback' => 'drush_simple_sitemap_generate',
- 'drupal dependencies' => ['simple_sitemap'],
- 'aliases' => ['ssg'],
- ];
-
- $items['simple-sitemap-rebuild-queue'] = [
- 'description' => 'Rebuild the sitemap queue for all sitemap variants.',
- 'callback' => 'drush_simple_sitemap_rebuild_queue',
- 'drupal dependencies' => ['simple_sitemap'],
- 'aliases' => ['ssr'],
- ];
-
- return $items;
-}
-
-/**
- * Callback function for hook_drush_command().
- *
- * Regenerate the XML sitemaps according to the module settings.
- */
-function drush_simple_sitemap_generate() {
- \Drupal::service('simple_sitemap.generator')->generateSitemap('drush');
-}
-
-/**
- * Callback function for hook_drush_command().
- *
- * Rebuild the sitemap queue for all sitemap variants.
- */
-function drush_simple_sitemap_rebuild_queue() {
- \Drupal::service('simple_sitemap.generator')->rebuildQueue();
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.info.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.info.yml
deleted file mode 100644
index 262e0bcfb..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.info.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: 'Simple XML Sitemap'
-type: module
-description: 'Creates a standard conform hreflang XML sitemap of the site content and provides a framework for developing other sitemap types.'
-configure: simple_sitemap.settings
-package: SEO
-# core: 8.x
-
-# Information added by Drupal.org packaging script on 2018-12-07
-version: '8.x-3.0'
-core: '8.x'
-project: 'simple_sitemap'
-datestamp: 1544174900
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.install b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.install
deleted file mode 100644
index 33e1c1393..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.install
+++ /dev/null
@@ -1,678 +0,0 @@
- t('Simple XML sitemap PHP extensions'),
- 'value' => t('Missing PHP xmlwriter extension'),
- 'description' => t('In order to be able to generate sitemaps, the Simple XML sitemap module requires the xmlwriter PHP extension to be enabled.'),
- 'severity' => REQUIREMENT_ERROR,
- ];
- }
-
- switch ($phase) {
-
- case 'runtime':
-
- // todo Implement for 3.x
-// /** @var \Drupal\simple_sitemap\Simplesitemap $generator */
-// $generator = \Drupal::service('simple_sitemap.generator');
-// $generated_ago = $generator->getGeneratedAgo();
-// $cron_generation = $generator->getSetting('cron_generate');
-//
-// if (!$generated_ago) {
-// $value = t('Not available');
-// $description = t($cron_generation
-// ? 'Run cron, or generate the sitemap manually.'
-// : 'Generation on cron run is disabled. Generate the sitemap manually.', [
-// '@generate' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap'
-// ]
-// );
-// $severity = REQUIREMENT_WARNING;
-// }
-// else {
-// $value = t('XML sitemaps are available');
-// $description = t('The last generation finished @ago ago.'
-// . ' ' . ($cron_generation
-// ? 'Run cron, or regenerate the sitemaps manually.'
-// : 'Generation on cron run is disabled. Regenerate the sitemaps manually.'), [
-// '@ago' => $generated_ago,
-// '@generate' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap'
-// ]
-// );
-// $severity = REQUIREMENT_INFO;
-// }
-//
-// $requirements['simple_sitemap_generated'] = [
-// 'title' => 'Simple XML sitemap',
-// 'value' => $value,
-// 'description' => $description,
-// 'severity' => $severity,
-// ];
- break;
- }
- return $requirements;
-}
-
-/**
- * Implements hook_uninstall().
- */
-function simple_sitemap_uninstall() {
- \Drupal::service('state')->deleteMultiple([
- 'simple_sitemap.last_cron_generate',
- 'simple_sitemap.queue_items_initial_amount',
- 'simple_sitemap.queue_stashed_results',
- ]);
-
- \Drupal::service('queue')
- ->get('simple_sitemap_elements')
- ->deleteQueue();
-}
-
-/**
- * Implements hook_schema().
- */
-function simple_sitemap_schema() {
- $schema['simple_sitemap'] = [
- 'description' => 'Holds XML sitemaps as strings for quick retrieval.',
- 'fields' => [
- 'id' => [
- 'description' => 'Sitemap chunk unique identifier.',
- 'type' => 'int',
- 'size' => 'small',
- 'not null' => TRUE,
- 'unsigned' => TRUE,
- ],
- 'type' => [
- 'description' => 'Type of sitemap this chunk belongs to.',
- 'type' => 'varchar',
- 'length' => 50,
- 'not null' => TRUE,
- 'default' => '',
- ],
- 'delta' => [
- 'description' => 'Delta of the chunk within the type scope.',
- 'type' => 'int',
- 'size' => 'small',
- 'not null' => TRUE,
- 'unsigned' => TRUE,
- ],
- 'sitemap_string' => [
- 'description' => 'XML sitemap chunk string.',
- 'type' => 'text',
- 'size' => 'big',
- 'not null' => TRUE,
- ],
- 'sitemap_created' => [
- 'description' => 'Timestamp of sitemap chunk generation.',
- 'type' => 'int',
- 'not null' => TRUE,
- 'unsigned' => TRUE,
- 'default' => 0,
- ],
- 'status' => [
- 'description' => "Flag indicating the publishing status of the chunk.",
- 'type' => 'int',
- 'size' => 'tiny',
- 'not null' => TRUE,
- 'unsigned' => TRUE,
- 'default' => 0,
- ],
- ],
- 'primary key' => ['id'],
- ];
-
- $schema['simple_sitemap_entity_overrides'] = [
- 'description' => 'Holds sitemap settings overridden by entities.',
- 'fields' => [
- 'id' => [
- 'description' => 'Override unique identifier.',
- 'type' => 'serial',
- 'not null' => TRUE,
- 'unsigned' => TRUE,
- ],
- 'type' => [
- 'description' => 'Type of sitemap this override belongs to.',
- 'type' => 'varchar',
- 'length' => 50,
- 'not null' => TRUE,
- ],
- 'entity_type' => [
- 'description' => 'Entity type of the overriding entity.',
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- ],
- 'entity_id' => [
- 'description' => 'ID of the overriding entity.',
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- ],
- 'inclusion_settings' => [
- 'description' => 'Setting for the overriding entity.',
- 'type' => 'blob',
- ],
- ],
- 'primary key' => ['id'],
- ];
- return $schema;
-}
-
-function _simple_sitemap_update_8216_get_default_variant() {
- $config_factory = \Drupal::service('config.factory');
- $default_variant = $config_factory->get('simple_sitemap.settings')->get('default_variant');
- if (empty($default_variant)) {
- $default_variant = 'default';
- $config_factory->getEditable('simple_sitemap.settings')
- ->set('default_variant', $default_variant)
- ->save();
- }
-
- /** @var \Drupal\simple_sitemap\SimplesitemapManager $manager */
- $manager = \Drupal::service('simple_sitemap.manager');
- $variants = $manager->getSitemapVariants();
- if (!isset($variants[$default_variant])) {
- $manager->addSitemapVariant($default_variant);
- }
-
- return $default_variant;
-}
-
-/**
- * Changing the data structure of the module's configuration.
- */
-function simple_sitemap_update_8201() {
- $entity_types = \Drupal::config('simple_sitemap.settings')->get('entity_types');
- $entity_types = is_array($entity_types) ? $entity_types : [];
- $naming_changes = [
- 'node_type' => 'node',
- 'taxonomy_vocabulary' => 'taxonomy_term',
- 'menu' => 'menu_link_content',
- 'commerce_product_type' => 'commerce_product',
- 'media_bundle' => 'media',
- ];
- foreach ($entity_types as $entity_type_name => $settings) {
- if (isset($naming_changes[$entity_type_name])) {
- $entity_types[$naming_changes[$entity_type_name]] = $entity_types[$entity_type_name];
- unset($entity_types[$entity_type_name]);
- }
- }
- \Drupal::service('config.factory')->getEditable('simple_sitemap.settings')
- ->set('entity_types', $entity_types)->save();
-}
-
-/**
- * Moving entity overrides from configuration to database table.
- */
-function simple_sitemap_update_8202() {
- $database = \Drupal::database();
-
- // Create database table.
- if (!$database->schema()->tableExists('simple_sitemap_entity_overrides')) {
- $database->schema()->createTable('simple_sitemap_entity_overrides', [
- 'description' => 'Holds sitemap settings overridden by entities.',
- 'fields' => [
- 'id' => [
- 'description' => 'Override unique identifier.',
- 'type' => 'serial',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ],
- 'entity_type' => [
- 'description' => 'Entity type of the overriding entity.',
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- ],
- 'entity_id' => [
- 'description' => 'ID of the overriding entity.',
- 'type' => 'int',
- 'unsigned' => TRUE,
- 'not null' => TRUE,
- ],
- 'inclusion_settings' => [
- 'description' => 'Setting for the overriding entity.',
- 'type' => 'blob',
- ],
- ],
- 'primary key' => ['id'],
- ]);
- }
-
- // Populate database table with config values.
- $entity_types = \Drupal::config('simple_sitemap.settings')->get('entity_types');
- $entity_types = is_array($entity_types) ? $entity_types : [];
-
- foreach ($entity_types as $entity_type_name => &$entity_type) {
- if (is_array($entity_type)) {
- foreach ($entity_type as $bundle_name => &$bundle) {
- if (isset($bundle['entities'])) {
- foreach ($bundle['entities'] as $entity_id => $entity_settings) {
- $database->insert('simple_sitemap_entity_overrides')
- ->fields([
- 'entity_type' => $entity_type_name,
- 'entity_id' => $entity_id,
- 'inclusion_settings' => serialize($entity_settings),
- ])
- ->execute();
- }
- // Remove entity overrides from configuration.
- unset($bundle['entities']);
- }
- }
- }
- }
-
- \Drupal::service('config.factory')->getEditable('simple_sitemap.settings')
- ->set('entity_types', $entity_types)->save();
-}
-
-/**
- * Splitting simple_sitemap.settings configuration into simple_sitemap.settings,
- * simple_sitemap.entity_types and simple_sitemap.custom.
- */
-function simple_sitemap_update_8203() {
- $old_config = $config = \Drupal::config('simple_sitemap.settings');
- foreach (['entity_types', 'custom'] as $config_name) {
- if (!$config = $old_config->get($config_name)) {
- continue;
- }
- \Drupal::service('config.factory')->getEditable("simple_sitemap.$config_name")
- ->setData($config)->save();
- }
- $settings = $old_config->get('settings');
- \Drupal::service('config.factory')->getEditable("simple_sitemap.settings")
- ->setData($settings)->save();
-}
-
-/**
- * Removing entity type settings for entity types which do not have the canonical
- * link template.
- */
-function simple_sitemap_update_8204() {
- $sitemap_entity_types = \Drupal::service('entity_type.manager')->getDefinitions();
- $entity_types = \Drupal::config('simple_sitemap.entity_types')->get();
- unset($entity_types['_core']);
- foreach ($entity_types as $entity_type_id => $entity_type) {
- if (!isset($sitemap_entity_types[$entity_type_id])
- || !$sitemap_entity_types[$entity_type_id]->hasLinkTemplate('canonical')) {
-
- // Delete entity overrides.
- \Drupal::database()->delete('simple_sitemap_entity_overrides')
- ->condition('entity_type', $entity_type_id)
- ->execute();
-
- // Delete entity type settings.
- unset($entity_types[$entity_type_id]);
- }
- }
- \Drupal::service('config.factory')->getEditable("simple_sitemap.entity_types")
- ->setData($entity_types)->save();
-}
-
-/**
- * Splitting simple_sitemap.entity_types into individual configuration objects
- * for each bundle.
- */
-function simple_sitemap_update_8205() {
- $entity_types = \Drupal::config('simple_sitemap.entity_types')->get();
- unset($entity_types['_core']);
- $enabled_entity_types = [];
- foreach ($entity_types as $entity_type_id => $bundles) {
- $enabled_entity_types[] = $entity_type_id;
- foreach ($bundles as $bundle_name => $bundle_settings) {
- \Drupal::service('config.factory')
- ->getEditable("simple_sitemap.bundle_settings.$entity_type_id.$bundle_name")
- ->setData($bundle_settings)->save();
- }
- }
-
- // Add enabled entity type settings.
- \Drupal::service('config.factory')
- ->getEditable('simple_sitemap.settings')
- ->set('enabled_entity_types', $enabled_entity_types)
- ->save();
-
- // Remove old configuration object.
- \Drupal::service('config.factory')
- ->getEditable('simple_sitemap.entity_types')
- ->delete();
-}
-
-/**
- * Placing custom links in a subkey of simple_sitemap.custom configuration.
- */
-function simple_sitemap_update_8206() {
- $custom_links = \Drupal::config('simple_sitemap.custom')->get();
- foreach ($custom_links as $i => $custom_link) {
- if (!isset($custom_link['path'])) {
- unset($custom_links[$i]);
- }
- }
- \Drupal::service('config.factory')->getEditable('simple_sitemap.custom')
- ->setData(['links' => $custom_links])->save();
-}
-
-/**
- * Updating entity_id field of simple_sitemap_entity_overrides table to varchar(32).
- */
-function simple_sitemap_update_8207() {
- \Drupal::database()->schema()->changeField(
- 'simple_sitemap_entity_overrides',
- 'entity_id',
- 'entity_id', [
- 'description' => 'ID of the overriding entity.',
- 'type' => 'varchar',
- 'length' => 32,
- 'not null' => TRUE,
- ]
- );
-}
-
-/**
- * Adding changefreq setting to all existing bundle and entity instance settings.
- */
-function simple_sitemap_update_8208() {
-
- // Update existing bundle settings.
- $config_factory = \Drupal::service('config.factory');
- $entity_types = $config_factory->listAll('simple_sitemap.bundle_settings.');
-
- foreach ($entity_types as $entity_type) {
- $config = $config_factory->get($entity_type)->get();
- if (!isset($config['changefreq'])) {
- $config_factory->getEditable($entity_type)
- ->setData($config + ['changefreq' => ''])
- ->save();
- }
- }
-
- // Update existing entity override data.
- $results = \Drupal::database()->select('simple_sitemap_entity_overrides', 'o')
- ->fields('o', ['id', 'inclusion_settings'])
- ->execute()->fetchAll(\PDO::FETCH_OBJ);
-
- foreach ($results as $row) {
- $settings = unserialize($row->inclusion_settings);
- if (!isset($settings['changefreq'])) {
- \Drupal::database()->update('simple_sitemap_entity_overrides')
- ->fields(['inclusion_settings' => serialize($settings + ['changefreq' => '']),])
- ->condition('id', $row->id)
- ->execute();
- }
- }
-
- return t('You may now want to configure the new changefreq setting for the XML sitemap entities and custom links.');
-}
-
-/**
- * Adding image inclusion setting to all existing bundle and entity instance settings.
- */
-function simple_sitemap_update_8209() {
-
- // Update existing bundle settings.
- $config_factory = \Drupal::service('config.factory');
- $all_bundle_settings = $config_factory->listAll('simple_sitemap.bundle_settings.');
-
- foreach ($all_bundle_settings as $bundle_settings) {
- $config = $config_factory->get($bundle_settings)->get();
- if (!isset($config['include_images'])) {
- $config_factory->getEditable($bundle_settings)
- ->setData($config + ['include_images' => 0])
- ->save();
- }
- }
-
- // Update existing entity override data.
- $results = \Drupal::database()->select('simple_sitemap_entity_overrides', 'o')
- ->fields('o', ['id', 'inclusion_settings'])
- ->execute()->fetchAll(\PDO::FETCH_OBJ);
-
- foreach ($results as $row) {
- $settings = unserialize($row->inclusion_settings);
- if (!isset($settings['include_images'])) {
- \Drupal::database()->update('simple_sitemap_entity_overrides')
- ->fields(['inclusion_settings' => serialize($settings + ['include_images' => 0]),])
- ->condition('id', $row->id)
- ->execute();
- }
- }
-
- return t('You may now want to configure your XML sitemap entities to include images.');
-}
-
-/**
- * Adding 'type' and 'delta' fields to simple_sitemap table.
- */
-function simple_sitemap_update_8210() {
-
- $database = \Drupal::database();
- $database->truncate('simple_sitemap')->execute();
-
- if (!$database->schema()->fieldExists('simple_sitemap', 'type')) {
- $database->schema()->addField(
- 'simple_sitemap',
- 'type', [
- 'description' => 'Type of sitemap this chunk belongs to.',
- 'type' => 'varchar',
- 'length' => 50,
- 'not null' => TRUE,
- 'default' => '',
- ]
- );
- }
- if (!$database->schema()->fieldExists('simple_sitemap', 'delta')) {
- $database->schema()->addField(
- 'simple_sitemap',
- 'delta', [
- 'description' => 'Delta of the chunk within the type scope.',
- 'type' => 'int',
- 'size' => 'small',
- 'not null' => TRUE,
- 'unsigned' => TRUE,
- ]
- );
- }
-}
-
-/**
- * Adding simple_sitemap.variants and simple_sitemap.types to configuration.
- */
-function simple_sitemap_update_8211() {
- $config_factory = \Drupal::service('config.factory');
-
- // Add simple_sitemap.types.
- $config_factory
- ->getEditable('simple_sitemap.types.default_hreflang')
- ->setData([
- 'label' => 'Default hreflang',
- 'description' => 'The default hreflang sitemap type.',
- 'sitemap_generator' => 'default',
- 'url_generators' => [
- 'custom',
- 'entity',
- 'entity_menu_link_content',
- 'arbitrary',
- ],
- ])->save();
-
- // Add simple_sitemap.variants.
- $config_factory
- ->getEditable('simple_sitemap.variants')
- ->set('variants', [
- 'default' => [
- 'label' => 'Default',
- 'type' => 'default_hreflang',
- ]
- ])->save();
-}
-
-/**
- * Changing storage data type of 'index' and 'include_images' from integer to boolean.
- */
-function simple_sitemap_update_8212() {
-
- // Update existing bundle settings.
- $config_factory = \Drupal::service('config.factory');
- $all_bundle_settings = $config_factory->listAll('simple_sitemap.bundle_settings.');
-
- foreach ($all_bundle_settings as $bundle_settings) {
- $config = $config_factory->get($bundle_settings)->get();
-
- $config['include_images'] = isset($config['include_images'])
- ? (bool) $config['include_images']
- : FALSE;
-
- $config['index'] = isset($config['index'])
- ? (bool) $config['index']
- : FALSE;
-
- $config_factory->getEditable($bundle_settings)->setData($config)->save();
- }
-
- // Update existing entity override data.
- $results = \Drupal::database()->select('simple_sitemap_entity_overrides', 'o')
- ->fields('o', ['id', 'inclusion_settings'])
- ->execute()->fetchAll(\PDO::FETCH_OBJ);
-
- foreach ($results as $row) {
- $settings = unserialize($row->inclusion_settings);
-
- if (isset($settings['index'])) {
- $settings['index'] = (bool) $settings['index'];
- }
-
- if (isset($settings['include_images'])) {
- $settings['include_images'] = (bool) $settings['include_images'];
- }
-
- \Drupal::database()->update('simple_sitemap_entity_overrides')
- ->fields(['inclusion_settings' => serialize($settings)])
- ->condition('id', $row->id)
- ->execute();
- }
-}
-
-/**
- * Altering the configuration storage of variants.
- */
-function simple_sitemap_update_8213() {
- $config_factory = \Drupal::service('config.factory');
- $new_variants = [];
- foreach ($config_factory->get('simple_sitemap.variants')->get('variants') as $variant_name => $variant_definition) {
- $new_variants[$variant_definition['type']][$variant_name] = ['label' => $variant_definition['label']];
- }
-
- // Create new configuration objects.
- foreach ($new_variants as $type => $variants) {
- $config_factory
- ->getEditable('simple_sitemap.variants.' . $type)
- ->set('variants', $variants)
- ->save();
- }
-
- // Remove old configuration object.
- $config_factory->getEditable('simple_sitemap.variants')->delete();
-}
-
-/**
- * Removing sitemap types from configuration as they are to be stored as plugins in code.
- */
-function simple_sitemap_update_8214() {
- $config_factory = \Drupal::service('config.factory');
- $sitemap_types = $config_factory->listAll('simple_sitemap.types.');
-
- // Remove sitemap type configuration objects.
- foreach ($sitemap_types as $type) {
- $config_factory->getEditable($type)->delete();
- }
-}
-
-/**
- * Adding 'status' field to simple_sitemap table and weight to variants.
- */
-function simple_sitemap_update_8215() {
- $database = \Drupal::database();
- $database->truncate('simple_sitemap')->execute();
-
- if (!$database->schema()->fieldExists('simple_sitemap', 'status')) {
- $database->schema()->addField(
- 'simple_sitemap',
- 'status', [
- 'description' => "Flag indicating the publishing status of the chunk.",
- 'type' => 'int',
- 'size' => 'tiny',
- 'not null' => TRUE,
- 'unsigned' => TRUE,
- 'default' => 0,
- ]
- );
- }
-
- $config_factory = \Drupal::service('config.factory');
- foreach ($config_factory->listAll('simple_sitemap.variants.') as $type) {
- $type = $config_factory->getEditable($type);
- $variants = $type->get('variants');
- foreach($variants as $i => $variant) {
- $variants[$i]['weight'] = 0;
- }
- $type->set('variants', $variants)->save();
- }
-}
-
-/**
- * Adding per-variant bundle and entity override configuration.
- */
-function simple_sitemap_update_8216() {
- $config_factory = \Drupal::service('config.factory');
- foreach ($config_factory->listAll('simple_sitemap.bundle_settings.') as $bundle_config_name) {
- $config = $config_factory->getEditable($bundle_config_name);
- $config_name_parts = explode('.', $bundle_config_name);
- $config_factory->getEditable($config_name_parts[0] . '.' . $config_name_parts[1]
- . '.' . _simple_sitemap_update_8216_get_default_variant() . '.' . $config_name_parts[2] . '.' . $config_name_parts[3])
- ->setData($config->get())->save();
-
- $config->delete();
- }
-
- $database = \Drupal::database();
- if (!$database->schema()->fieldExists('simple_sitemap_entity_overrides', 'type')) {
- $database->schema()->addField(
- 'simple_sitemap_entity_overrides',
- 'type', [
- 'description' => 'Type of sitemap this override belongs to.',
- 'type' => 'varchar',
- 'length' => 50,
- 'not null' => TRUE,
- 'initial' => 'default',
- ]
- );
- }
-}
-
-/**
- * Adding per-variant custom link configuration.
- */
-function simple_sitemap_update_8217() {
- $config_factory = \Drupal::service('config.factory');
- $old_config = $config_factory->getEditable('simple_sitemap.custom');
- $config_factory->getEditable('simple_sitemap.custom_links.' . _simple_sitemap_update_8216_get_default_variant())
- ->setData($old_config->get())->save();
- $old_config->delete();
-
- return t('The XML sitemaps need to be regenerated.');
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.libraries.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.libraries.yml
deleted file mode 100644
index 72b955aeb..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.libraries.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-fieldsetSummaries:
- version: VERSION
- js:
- js/simple_sitemap.fieldsetSummaries.js: {}
- dependencies:
- - core/jquery
-form:
- version: VERSION
- js:
- js/simple_sitemap.form.js: {}
- dependencies:
- - core/jquery
-sitemapEntities:
- version: VERSION
- js:
- js/simple_sitemap.sitemapEntities.js: {}
- dependencies:
- - core/jquery
- - core/drupalSettings
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.menu.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.menu.yml
deleted file mode 100644
index 02ea6faf7..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.menu.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-simple_sitemap.settings:
- title: 'Simple XML sitemap'
- description: 'Configure and generate the XML sitemap, add custom links to it.'
- parent: system.admin_config_search
- route_name: simple_sitemap.settings
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.task.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.task.yml
deleted file mode 100644
index c0e163e9a..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.links.task.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-simple_sitemap.settings:
- route_name: simple_sitemap.settings
- title: 'Settings'
- base_route: simple_sitemap.settings
- weight: -1
-
-simple_sitemap.settings_entities:
- route_name: simple_sitemap.settings_entities
- title: 'Sitemap entities'
- base_route: simple_sitemap.settings
- weight: 0
-
-simple_sitemap.variants:
- route_name: simple_sitemap.settings_variants
- title: 'Sitemap variants'
- base_route: simple_sitemap.settings
- weight: 1
-
-simple_sitemap.settings_custom:
- route_name: simple_sitemap.settings_custom
- title: 'Custom links'
- base_route: simple_sitemap.settings
- weight: 2
-
-
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.module b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.module
deleted file mode 100644
index 504f8352d..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.module
+++ /dev/null
@@ -1,236 +0,0 @@
-processForm($form_state)) {
- return;
- }
-
- $form['simple_sitemap'] = [
- '#type' => 'details',
- '#group' => isset($form['additional_settings']) ? 'additional_settings' : 'advanced',
- '#title' => t('Simple XML sitemap'),
- '#description' => $f->getEntityCategory() === 'instance' ? t('Settings for this entity can be overridden here.') : '',
- '#weight' => 10,
- ];
-
- // Attach some js magic to forms.
- if ($f->getEntityCategory() !== 'instance') {
- $form['#attached']['library'][] = 'simple_sitemap/form';
- }
-
- // Only attach fieldset summary js to 'additional settings' vertical tabs.
- if (isset($form['additional_settings'])) {
- $form['#attached']['library'][] = 'simple_sitemap/fieldsetSummaries';
- }
-
- $f->displayEntitySettings($form['simple_sitemap'])
- // todo: do not show setting when creating new bundle.
- ->displayRegenerateNow($form['simple_sitemap']);
-
- // Add submission handler.
- if (isset($form['actions']['submit']['#submit'])) {
- foreach (array_keys($form['actions']) as $action) {
- if ($action !== 'preview'
- && isset($form['actions'][$action]['#type'])
- && $form['actions'][$action]['#type'] === 'submit') {
- $form['actions'][$action]['#submit'][] = 'simple_sitemap_entity_form_submit';
- }
- }
- }
- // Fix for account page rendering other submit handlers not usable.
- else {
- $form['#submit'][] = 'simple_sitemap_entity_form_submit';
- }
-}
-
-/**
- * Form submission handler called in hook_form_alter.
- *
- * @param $form
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- */
-function simple_sitemap_entity_form_submit($form, FormStateInterface &$form_state) {
-
- /** @var Drupal\simple_sitemap\Form\FormHelper $f */
- $f = \Drupal::service('simple_sitemap.form_helper');
- if (!$f->processForm($form_state)) {
- return;
- }
-
- $values = $form_state->getValues();
-
- // Fix for values appearing in a sub array on a commerce product entity.
- $values = isset($values['simple_sitemap']) ? $values['simple_sitemap'] : $values;
-
- // Only make changes in DB if sitemap settings actually changed.
- if ($f->valuesChanged($form, $values)) {
-
- /** @var \Drupal\simple_sitemap\Simplesitemap $generator */
- $generator = \Drupal::service('simple_sitemap.generator');
-
- $settings = [
- 'index' => (bool) $values['simple_sitemap_index_content'],
- 'priority' => $values['simple_sitemap_priority'],
- 'changefreq' => $values['simple_sitemap_changefreq'],
- 'include_images' => (bool) $values['simple_sitemap_include_images'],
- ];
-
- // Deleting bundle settings for old bundle.
- // See SimplesitemapEntitiesForm::submitForm().
- // todo: This will not be necessary if "multiple variants pro bundle" is implemented.
- if (isset($form['simple_sitemap']['simple_sitemap_variant']['#default_value'])) {
- $old_variant = $form['simple_sitemap']['simple_sitemap_variant']['#default_value'];
- if ($old_variant !== $values['simple_sitemap_variant']) {
- $generator->setVariants($old_variant)->removeBundleSettings($f->getEntityTypeId(), $f->getBundleName());
- }
- }
-
- switch ($f->getEntityCategory()) {
-
- case 'bundle':
- $generator->setVariants($values['simple_sitemap_variant'])
- ->setBundleSettings($f->getEntityTypeId(),
- !empty($f->getBundleName()) ? $f->getBundleName() : $f->getFormEntityId(),
- $settings
- );
- break;
-
- case 'instance':
- $generator->setVariants($values['simple_sitemap_variant'])
- ->setEntityInstanceSettings($f->getEntityTypeId(),
- !empty($f->getInstanceId()) ? $f->getInstanceId() : $f->getFormEntityId(),
- $settings
- );
- break;
- }
-
- // Regenerate sitemaps according to user setting.
- if ($values['simple_sitemap_regenerate_now']) {
- $generator->rebuildQueue()->generateSitemap();
- }
- }
-}
-
-/**
- * Implements hook_cron().
- */
-function simple_sitemap_cron() {
-
- /** @var \Drupal\simple_sitemap\Simplesitemap $generator */
- $generator = \Drupal::service('simple_sitemap.generator');
-
- if ($generator->getSetting('cron_generate')) {
- $interval = (int) $generator->getSetting('cron_generate_interval', 0) * 60 * 60;
- $request_time = \Drupal::service('datetime.time')->getRequestTime();
- $generation_in_progress = $generator->getQueueWorker()->generationInProgress();
- $state = \Drupal::state();
-
- if ($interval === 0
- || $generation_in_progress
- || (($state->get('simple_sitemap.last_cron_generate', 0) + $interval) <= $request_time)) {
-
- if (!$generation_in_progress) {
- $state->set('simple_sitemap.last_cron_generate', $request_time);
- }
-
- $generator->generateSitemap('cron');
- }
- }
-}
-
-/**
- * Implements hook_ENTITY_TYPE_delete().
- *
- * When a language is removed from the system remove it also from settings.
- */
-function simple_sitemap_configurable_language_delete(ConfigurableLanguageInterface $language) {
-
- /** @var \Drupal\simple_sitemap\Simplesitemap $generator */
- $generator = \Drupal::service('simple_sitemap.generator');
-
- $excluded_languages = $generator->getSetting('excluded_languages');
- if (isset($excluded_languages[$language->id()])) {
- unset($excluded_languages[$language->id()]);
- $generator->saveSetting('excluded_languages', $excluded_languages);
- }
-}
-
-/**
- * Implements hook_entity_delete().
- *
- * Removes settings of the removed entity.
- *
- * @param \Drupal\Core\Entity\EntityInterface $entity
- */
-function simple_sitemap_entity_delete(EntityInterface $entity) {
-
- /** @var \Drupal\simple_sitemap\Simplesitemap $generator */
- $generator = \Drupal::service('simple_sitemap.generator');
- $generator->setVariants(TRUE)->removeEntityInstanceSettings(
- $entity->getEntityTypeId(), $entity->id()
- );
-}
-
-/**
- * Implements hook_entity_bundle_delete().
- *
- * Removes settings of the removed bundle.
- *
- * @param string $entity_type_id
- * @param string $bundle
- */
-function simple_sitemap_entity_bundle_delete($entity_type_id, $bundle) {
-
- /** @var \Drupal\simple_sitemap\Simplesitemap $generator */
- $generator = \Drupal::service('simple_sitemap.generator');
- $generator->setVariants(TRUE)->removeBundleSettings($entity_type_id, $bundle);
-}
-
-/**
- * Implements hook_menu_delete().
- *
- * Removes settings for the removed menu.
- *
- * @param \Drupal\system\MenuInterface $menu
- */
-function simple_sitemap_menu_delete(MenuInterface $menu) {
-
- /** @var \Drupal\simple_sitemap\Simplesitemap $generator */
- $generator = \Drupal::service('simple_sitemap.generator');
- $generator->setVariants(TRUE)->removeBundleSettings('menu_link_content', $menu->id());
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.permissions.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.permissions.yml
deleted file mode 100644
index 035e3ce21..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.permissions.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-administer sitemap settings:
- title: 'Administer sitemap settings'
- description: 'Administer Simple XML sitemap settings, alter inclusion settings of content and generate the sitemap on demand.'
- restrict access: false
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.routing.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.routing.yml
deleted file mode 100644
index eaa9fbd26..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.routing.yml
+++ /dev/null
@@ -1,51 +0,0 @@
-simple_sitemap.sitemap_default:
- path: '/sitemap.xml'
- defaults:
- _controller: '\Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap'
- _disable_route_normalizer: 'TRUE'
- requirements:
- _access: 'TRUE'
-
-# The actual path to a variant is '/{variant}/sitemap.xml'. Because Drupal 8
-# cannot handle a parameter as first route argument,
-# Drupal\simple_sitemap\PathProcessor\PathProcessorSitemapVariant::processInbound()
-# is being used to catch the request and redirect to the following route.
-simple_sitemap.sitemap_variant:
- path: '/sitemaps/{variant}/sitemap.xml'
- defaults:
- _controller: '\Drupal\simple_sitemap\Controller\SimplesitemapController::getSitemap'
- _disable_route_normalizer: 'TRUE'
- requirements:
- _access: 'TRUE'
-
-simple_sitemap.settings:
- path: '/admin/config/search/simplesitemap'
- defaults:
- _form: '\Drupal\simple_sitemap\Form\SimplesitemapSettingsForm'
- _title: 'Simple XML Sitemap Settings'
- requirements:
- _permission: 'administer sitemap settings'
-
-simple_sitemap.settings_entities:
- path: '/admin/config/search/simplesitemap/entities'
- defaults:
- _form: '\Drupal\simple_sitemap\Form\SimplesitemapEntitiesForm'
- _title: 'Simple XML Sitemap Settings'
- requirements:
- _permission: 'administer sitemap settings'
-
-simple_sitemap.settings_custom:
- path: '/admin/config/search/simplesitemap/custom'
- defaults:
- _form: '\Drupal\simple_sitemap\Form\SimplesitemapCustomLinksForm'
- _title: 'Simple XML Sitemap Settings'
- requirements:
- _permission: 'administer sitemap settings'
-
-simple_sitemap.settings_variants:
- path: '/admin/config/search/simplesitemap/variants'
- defaults:
- _form: '\Drupal\simple_sitemap\Form\SimplesitemapVariantsForm'
- _title: 'Simple XML Sitemap Settings'
- requirements:
- _permission: 'administer sitemap settings'
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.services.yml b/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.services.yml
deleted file mode 100644
index 3a784281d..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/simple_sitemap.services.yml
+++ /dev/null
@@ -1,100 +0,0 @@
-services:
- simple_sitemap.generator:
- class: Drupal\simple_sitemap\Simplesitemap
- public: true
- arguments:
- - '@simple_sitemap.entity_helper'
- - '@simple_sitemap.settings'
- - '@simple_sitemap.manager'
- - '@config.factory'
- - '@database'
- - '@entity_type.manager'
- - '@entity_type.bundle.info'
- - '@path.validator'
- - '@date.formatter'
- - '@datetime.time'
- - '@simple_sitemap.queue_worker'
-
- simple_sitemap.manager:
- class: Drupal\simple_sitemap\SimplesitemapManager
- public: true
- arguments:
- - '@config.factory'
- - '@database'
- - '@plugin.manager.simple_sitemap.sitemap_type'
- - '@plugin.manager.simple_sitemap.url_generator'
- - '@plugin.manager.simple_sitemap.sitemap_generator'
- - '@simple_sitemap.settings'
-
- simple_sitemap.settings:
- class: Drupal\simple_sitemap\SimplesitemapSettings
- public: false
- arguments:
- - '@config.factory'
-
- simple_sitemap.queue_worker:
- class: Drupal\simple_sitemap\Queue\QueueWorker
- public: true
- arguments:
- - '@simple_sitemap.settings'
- - '@simple_sitemap.manager'
- - '@state'
- - '@simple_sitemap.queue'
- - '@simple_sitemap.logger'
-
- simple_sitemap.queue:
- class: Drupal\simple_sitemap\Queue\SimplesitemapQueue
- public: false
- arguments:
- - 'simple_sitemap_elements'
- - '@database'
-
- simple_sitemap.sitemap_writer:
- class: Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapWriter
- public: true
-
- simple_sitemap.entity_helper:
- class: Drupal\simple_sitemap\EntityHelper
- public: true
- arguments:
- - '@entity_type.manager'
- - '@database'
-
- simple_sitemap.form_helper:
- class: Drupal\simple_sitemap\Form\FormHelper
- public: true
- arguments:
- - '@simple_sitemap.generator'
- - '@simple_sitemap.entity_helper'
- - '@current_user'
-
- simple_sitemap.logger:
- class: Drupal\simple_sitemap\Logger
- public: true
- arguments:
- - '@logger.channel.simple_sitemap'
- - '@messenger'
- - '@current_user'
-
- simple_sitemap.path_processor_variant:
- class: Drupal\simple_sitemap\PathProcessor\PathProcessorSitemapVariant
- tags:
- - { name: path_processor_inbound, priority: 300 }
-
- logger.channel.simple_sitemap:
- parent: logger.channel_base
- public: false
- arguments:
- - simple_sitemap
-
- plugin.manager.simple_sitemap.url_generator:
- class: Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorManager
- parent: default_plugin_manager
-
- plugin.manager.simple_sitemap.sitemap_generator:
- class: Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapGeneratorManager
- parent: default_plugin_manager
-
- plugin.manager.simple_sitemap.sitemap_type:
- class: Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapType\SitemapTypeManager
- parent: default_plugin_manager
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/SitemapGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/SitemapGenerator.php
deleted file mode 100644
index 1b71536f4..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Annotation/SitemapGenerator.php
+++ /dev/null
@@ -1,50 +0,0 @@
-generator = $generator;
- }
-
- /**
- * Regenerate the XML sitemaps according to the module settings.
- *
- * @command simple-sitemap:generate
- *
- * @usage drush simple-sitemap:generate
- * Regenerate the XML sitemaps according to the module settings.
- *
- * @validate-module-enabled simple_sitemap
- *
- * @aliases ssg, simple-sitemap-generate
- */
- public function generate() {
- $this->generator->generateSitemap('drush');
- }
-
- /**
- * Rebuild the sitemap queue for all sitemap variants.
- *
- * @command simple-sitemap:rebuild-queue
- *
- * @usage drush simple-sitemap:rebuild-queue
- * Rebuild the sitemap queue for all sitemap variants.
- *
- * @validate-module-enabled simple_sitemap
- *
- * @aliases ssr, simple-sitemap-rebuild-queue
- */
- public function rebuildQueue() {
- $this->generator->rebuildQueue();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Controller/SimplesitemapController.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Controller/SimplesitemapController.php
deleted file mode 100644
index b8c637e85..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Controller/SimplesitemapController.php
+++ /dev/null
@@ -1,70 +0,0 @@
-generator = $generator;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('simple_sitemap.generator')
- );
- }
-
- /**
- * Returns the whole sitemap variant, its requested chunk,
- * or its sitemap index file.
- * Caches the response in case of expected output, prevents caching otherwise.
- *
- * @param string $variant
- * Optional name of sitemap variant.
- * @see \hook_simple_sitemap_variants_alter()
- * @see SimplesitemapManager::getSitemapVariants()
- *
- * @param \Symfony\Component\HttpFoundation\Request $request
- * The request object.
- *
- * @throws NotFoundHttpException
- *
- * @return object
- * Returns an XML response.
- */
- public function getSitemap(Request $request, $variant = NULL) {
- $output = $this->generator->setVariants($variant)->getSitemap($request->query->getInt('page'));
- if (!$output) {
- throw new NotFoundHttpException();
- }
-
- return new Response($output, Response::HTTP_OK, [
- 'content-type' => 'application/xml',
- 'X-Robots-Tag' => 'noindex', // Tell search engines not to index the sitemap itself.
- ]);
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/EntityHelper.php b/sites/all/modules/contrib/admin/simple_sitemap/src/EntityHelper.php
deleted file mode 100644
index d49bdb9bd..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/EntityHelper.php
+++ /dev/null
@@ -1,164 +0,0 @@
-entityTypeManager = $entityTypeManager;
- $this->db = $database;
- }
-
- /**
- * Gets an entity's bundle name.
- *
- * @param \Drupal\Core\Entity\EntityInterface $entity
- * @return string
- */
- public function getEntityInstanceBundleName(EntityInterface $entity) {
- return $entity->getEntityTypeId() === 'menu_link_content'
- // Menu fix.
- ? $entity->getMenuName() : $entity->bundle();
- }
-
- /**
- * Gets the entity type id for a bundle.
- *
- * @param \Drupal\Core\Entity\EntityInterface $entity
- * @return null|string
- */
- public function getBundleEntityTypeId(EntityInterface $entity) {
- return $entity->getEntityTypeId() === 'menu'
- // Menu fix.
- ? 'menu_link_content' : $entity->getEntityType()->getBundleOf();
- }
-
- /**
- * Returns objects of entity types that can be indexed.
- *
- * @return array
- * Objects of entity types that can be indexed by the sitemap.
- */
- public function getSupportedEntityTypes() {
-
- /** @var \Drupal\Core\Entity\ContentEntityTypeInterface[] $entity_types */
- $entity_types = $this->entityTypeManager->getDefinitions();
- foreach ($entity_types as $entity_type_id => $entity_type) {
- if (!$entity_type instanceof ContentEntityTypeInterface
- || !method_exists($entity_type, 'getBundleEntityType')
- || !$entity_type->hasLinkTemplate('canonical')) {
- unset($entity_types[$entity_type_id]);
- }
- }
- return $entity_types;
- }
-
- /**
- * Checks whether an entity type does not provide bundles.
- *
- * @param string $entity_type_id
- * @return bool
- */
- public function entityTypeIsAtomic($entity_type_id) {
-
- // Menu fix.
- if ($entity_type_id === 'menu_link_content') {
- return FALSE;
- }
-
- $entity_types = $this->entityTypeManager->getDefinitions();
-
- if (!isset($entity_types[$entity_type_id])) {
- // todo: Throw exception.
- }
-
- return empty($entity_types[$entity_type_id]->getBundleEntityType()) ? TRUE : FALSE;
- }
-
- /**
- * @param \Drupal\Core\Url $url_object
- * @return \Drupal\Core\Entity\EntityInterface|null
- * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
- * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
- */
- public function getEntityFromUrlObject(Url $url_object) {
- return $url_object->isRouted()
- && !empty($route_parameters = $url_object->getRouteParameters())
- && $this->entityTypeManager->getDefinition($entity_type_id = key($route_parameters), FALSE)
- ? $this->entityTypeManager->getStorage($entity_type_id)
- ->load($route_parameters[$entity_type_id])
- : NULL;
- }
-
- /**
- * @param string $entity_type_id
- * @param string|null $bundle_name
- * @return array|int
- * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
- * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
- */
- public function getEntityInstanceIds($entity_type_id, $bundle_name = NULL) {
- $sitemap_entity_types = $this->getSupportedEntityTypes();
- if (!isset($sitemap_entity_types[$entity_type_id])) {
- return [];
- }
-
- $entity_query = $this->entityTypeManager->getStorage($entity_type_id)->getQuery();
- if (!$this->entityTypeIsAtomic($entity_type_id) && NULL !== $bundle_name) {
- $keys = $sitemap_entity_types[$entity_type_id]->getKeys();
-
- // Menu fix.
- $keys['bundle'] = $entity_type_id === 'menu_link_content' ? 'menu_name' : $keys['bundle'];
-
- $entity_query->condition($keys['bundle'], $bundle_name);
- }
-
- return $entity_query->execute();
- }
-
- /**
- * @param string $entity_type_name
- * @param string $entity_id
- * @return array
- */
- public function getEntityImageUrls($entity_type_name, $entity_id) {
- $query = $this->db->select('file_managed', 'fm');
- $query->fields('fm', ['uri']);
- $query->join('file_usage', 'fu', 'fu.fid = fm.fid');
- $query->condition('fm.filemime', 'image/%', 'LIKE');
- $query->condition('fu.type', $entity_type_name);
- $query->condition('fu.id', $entity_id);
-
- foreach ($query->execute() as $row) {
- $imageUris[] = file_create_url($row->uri);
- }
-
- return !empty($imageUris) ? $imageUris : [];
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/FormHelper.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/FormHelper.php
deleted file mode 100644
index d11b7f810..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/FormHelper.php
+++ /dev/null
@@ -1,539 +0,0 @@
-generator = $generator;
- $this->entityHelper = $entityHelper;
- $this->currentUser = $current_user;
- }
-
- /**
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * @return bool
- */
- public function processForm(FormStateInterface $form_state) {
- $this->formState = $form_state;
- $this->cleanUpFormInfo();
- $this->getEntityDataFromFormEntity();
- $this->negotiateVariant();
- return $this->supports();
- }
-
- /**
- * @param string $entity_category
- * @return $this
- */
- public function setEntityCategory($entity_category) {
- $this->entityCategory = $entity_category;
- return $this;
- }
-
- /**
- * @return null|string
- */
- public function getEntityCategory() {
- return $this->entityCategory;
- }
-
- /**
- * @param string $entity_type_id
- * @return $this
- */
- public function setEntityTypeId($entity_type_id) {
- $this->entityTypeId = $entity_type_id;
- return $this;
- }
-
- /**
- * @return string
- */
- public function getEntityTypeId() {
- return $this->entityTypeId;
- }
-
- /**
- * @param string $bundle_name
- * @return $this
- */
- public function setBundleName($bundle_name) {
- $this->bundleName = $bundle_name;
- return $this;
- }
-
- /**
- * @return string
- */
- public function getBundleName() {
- return $this->bundleName;
- }
-
- /**
- * @param string $instance_id
- * @return $this
- */
- public function setInstanceId($instance_id) {
- $this->instanceId = $instance_id;
- return $this;
- }
-
- /**
- * @return string
- */
- public function getInstanceId() {
- return $this->instanceId;
- }
-
- /**
- * @return bool
- */
- protected function supports() {
-
- // Do not alter the form if user lacks certain permissions.
- if (!$this->currentUser->hasPermission('administer sitemap settings')) {
- return FALSE;
- }
-
- // Do not alter the form if it is irrelevant to sitemap generation.
- elseif (empty($this->getEntityCategory())) {
- return FALSE;
- }
-
- // Do not alter the form if entity is not enabled in sitemap settings.
- elseif (!$this->generator->entityTypeIsEnabled($this->getEntityTypeId())) {
- return FALSE;
- }
-
- // Do not alter the form, if sitemap is disabled for the entity type of this
- // entity instance.
- elseif ($this->getEntityCategory() === 'instance') {
- if (NULL === $this->variant || !$this->generator
- ->setVariants($this->variant)
- ->bundleIsIndexed($this->getEntityTypeId(), $this->getBundleName())) {
- return FALSE;
- }
- }
-
- return TRUE;
- }
-
- /**
- * @param array $form_fragment
- */
- public function displayRegenerateNow(&$form_fragment) {
- $form_fragment['simple_sitemap_regenerate_now'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Regenerate sitemap after hitting Save'),
- '#description' => $this->t('This setting will regenerate all sitemaps including the above changes.'),
- '#default_value' => FALSE,
- ];
- if ($this->generator->getSetting('cron_generate')) {
- $form_fragment['simple_sitemap_regenerate_now']['#description'] .= '' . $this->t('Otherwise the sitemap will be regenerated during a future cron run.');
- }
- }
-
- protected function negotiateVariant() {
- $all_bundle_settings = $this->generator->setVariants(TRUE)
- ->getBundleSettings($this->getEntityTypeId(), $this->getBundleName(), FALSE, TRUE);
- $this->bundleSettings = NULL !== ($variant = key($all_bundle_settings))
- ? $all_bundle_settings[$variant]
- : [];
- $this->variant = $variant;
- }
-
- /**
- * @param array $form_fragment
- * @param bool $multiple
- * @return $this
- */
- public function displayEntitySettings(&$form_fragment, $multiple = FALSE) {
- $prefix = $multiple ? $this->getEntityTypeId() . '_' : '';
-
- $settings = $this->getEntityCategory() === 'instance' && NULL !== $this->variant && NULL !== $this->getInstanceId()
- ? $this->generator->setVariants($this->variant)->getEntityInstanceSettings($this->getEntityTypeId(), $this->getInstanceId())
- : $this->bundleSettings;
- Simplesitemap::supplementDefaultSettings('entity', $settings);
-
- $bundle_name = !empty($this->getBundleName()) ? $this->getBundleName() : $this->t('undefined');
-
- // Index
- if (!$multiple) {
- $form_fragment[$prefix . 'simple_sitemap_index_content'] = [
- '#type' => 'radios',
- '#default_value' => (int) $settings['index'],
- '#options' => [
- 0 => $this->getEntityCategory() === 'instance'
- ? $this->t('Do not index this @bundle entity', ['@bundle' => $bundle_name])
- : $this->t('Do not index entities of this type'),
- 1 => $this->getEntityCategory() === 'instance'
- ? $this->t('Index this @bundle entity', ['@bundle' => $bundle_name])
- : $this->t('Index entities of this type'),
- ],
- ];
-
- if ($this->getEntityCategory() === 'instance' && isset($this->bundleSettings['index'])) {
- $form_fragment[$prefix . 'simple_sitemap_index_content']['#options'][(int) $this->bundleSettings['index']] .= ' (' . $this->t('default') . ')';
- }
- }
-
- // Variant
- $form_fragment[$prefix . 'simple_sitemap_variant'] = [
- '#type' => 'select',
- '#title' => $this->t('Sitemap variant'),
- '#description' => $this->t('The sitemap variant entities of this type are to be indexed in.'),
- '#options' => array_map(
- function($variant) { return $this->t($variant['label']); },
- $this->generator->getSitemapManager()->getSitemapVariants(NULL, FALSE)
- ),
- '#default_value' => $this->variant,
- '#states' => [
- 'visible' => !$multiple
- ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]]
- : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]],
- 'required' => !$multiple // todo Should implement server side validation on top of this.
- ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]]
- : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]],
- ],
- '#disabled' => $this->getEntityCategory() === 'instance'
- ];
-
- // Priority
- $form_fragment[$prefix . 'simple_sitemap_priority'] = [
- '#type' => 'select',
- '#title' => $this->t('Priority'),
- '#description' => $this->getEntityCategory() === 'instance'
- ? $this->t('The priority this @bundle entity will have in the eyes of search engine bots.', ['@bundle' => $bundle_name])
- : $this->t('The priority entities of this type will have in the eyes of search engine bots.'),
- '#default_value' => $settings['priority'],
- '#options' => $this->getPrioritySelectValues(),
- '#states' => [
- 'visible' => !$multiple
- ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]]
- : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]],
- ],
- ];
-
- if ($this->getEntityCategory() === 'instance' && isset($this->bundleSettings['priority'])) {
- $form_fragment[$prefix . 'simple_sitemap_priority']['#options'][$this->formatPriority($this->bundleSettings['priority'])] .= ' (' . $this->t('default') . ')';
- }
-
- // Changefreq
- $form_fragment[$prefix . 'simple_sitemap_changefreq'] = [
- '#type' => 'select',
- '#title' => $this->t('Change frequency'),
- '#description' => $this->getEntityCategory() === 'instance'
- ? $this->t('The frequency with which this @bundle entity changes. Search engine bots may take this as an indication of how often to index it.', ['@bundle' => $bundle_name])
- : $this->t('The frequency with which entities of this type change. Search engine bots may take this as an indication of how often to index them.'),
- '#default_value' => $settings['changefreq'],
- '#options' => $this->getChangefreqSelectValues(),
- '#states' => [
- 'visible' => !$multiple
- ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]]
- : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]],
- ],
- ];
-
- if ($this->getEntityCategory() === 'instance' && isset($this->bundleSettings['changefreq'])) {
- $form_fragment[$prefix . 'simple_sitemap_changefreq']['#options'][$this->bundleSettings['changefreq']] .= ' (' . $this->t('default') . ')';
- }
-
- // Images
- $form_fragment[$prefix . 'simple_sitemap_include_images'] = [
- '#type' => 'select',
- '#title' => $this->t('Include images'),
- '#description' => $this->getEntityCategory() === 'instance'
- ? $this->t('Determines if images referenced by this @bundle entity should be included in the sitemap.', ['@bundle' => $bundle_name])
- : $this->t('Determines if images referenced by entities of this type should be included in the sitemap.'),
- '#default_value' => (int) $settings['include_images'],
- '#options' => [0 => $this->t('No'), 1 => $this->t('Yes')],
- '#states' => [
- 'visible' => !$multiple
- ? [':input[name="' . $prefix . 'simple_sitemap_index_content"]' => ['value' => 1]]
- : [':input[name="' . $prefix . 'enabled"]' => ['checked' => TRUE]],
- ],
- ];
-
- if ($this->getEntityCategory() === 'instance' && isset($this->bundleSettings['include_images'])) {
- $form_fragment[$prefix . 'simple_sitemap_include_images']['#options'][(int) $this->bundleSettings['include_images']] .= ' (' . $this->t('default') . ')';
- }
-
- return $this;
- }
-
- /**
- * Checks if this particular form is a bundle form, or a bundle instance form
- * and gathers sitemap settings from the database.
- *
- * @return bool
- * TRUE if this is a bundle or bundle instance form, FALSE otherwise.
- */
- protected function getEntityDataFromFormEntity() {
- if (!$form_entity = $this->getFormEntity()) {
- return FALSE;
- }
-
- $entity_type_id = $form_entity->getEntityTypeId();
- $sitemap_entity_types = $this->entityHelper->getSupportedEntityTypes();
- if (isset($sitemap_entity_types[$entity_type_id])) {
- $this->setEntityCategory('instance');
- }
- else {
- /** @var \Drupal\Core\Entity\EntityType $sitemap_entity_type */
- foreach ($sitemap_entity_types as $sitemap_entity_type) {
- if ($sitemap_entity_type->getBundleEntityType() === $entity_type_id) {
- $this->setEntityCategory('bundle');
- break;
- }
- }
- }
-
- // Menu fix.
- $this->setEntityCategory(NULL === $this->getEntityCategory() && $entity_type_id === 'menu' ? 'bundle' : $this->getEntityCategory());
-
- switch ($this->getEntityCategory()) {
- case 'bundle':
- $this->setEntityTypeId($this->entityHelper->getBundleEntityTypeId($form_entity));
- $this->setBundleName($form_entity->id());
- $this->setInstanceId(NULL);
- break;
-
- case 'instance':
- $this->setEntityTypeId($entity_type_id);
- $this->setBundleName($this->entityHelper->getEntityInstanceBundleName($form_entity));
- // New menu link's id is '' instead of NULL, hence checking for empty.
- $this->setInstanceId(!empty($form_entity->id()) ? $form_entity->id() : NULL);
- break;
-
- default:
- return FALSE;
- }
- return TRUE;
- }
-
- /**
- * Gets the object entity of the form if available.
- *
- * @return \Drupal\Core\Entity\Entity|false
- * Entity or FALSE if non-existent or if form operation is
- * 'delete'.
- */
- protected function getFormEntity() {
- $form_object = $this->formState->getFormObject();
- if (NULL !== $form_object
- && method_exists($form_object, 'getOperation')
- && method_exists($form_object, 'getEntity')
- && in_array($form_object->getOperation(), self::$allowedFormOperations)) {
- return $form_object->getEntity();
- }
- return FALSE;
- }
-
- /**
- * Removes gathered form information from service object.
- *
- * Needed because this service may contain form info from the previous
- * operation when revived from the container.
- */
- protected function cleanUpFormInfo() {
- $this->entityCategory = NULL;
- $this->entityTypeId = NULL;
- $this->bundleName = NULL;
- $this->instanceId = NULL;
- $this->variant = NULL;
- $this->bundleSettings = NULL;
- }
-
- /**
- * Gets new entity Id after entity creation.
- * To be used in an entity form submit.
- *
- * @return int
- * Entity ID.
- */
- public function getFormEntityId() {
- return $this->formState->getFormObject()->getEntity()->id();
- }
-
- /**
- * Checks if simple_sitemap values have been changed after submitting the form.
- * To be used in an entity form submit.
- *
- * @param $form
- * @param array $values
- *
- * @return bool
- * TRUE if simple_sitemap form values have been altered by the user.
- */
- public function valuesChanged($form, array $values) {
- foreach (self::$valuesToCheck as $field_name) {
- if (!isset($form['simple_sitemap'][$field_name]['#default_value'])
- || (isset($values[$field_name]) && $values[$field_name] != $form['simple_sitemap'][$field_name]['#default_value'])) {
- return TRUE;
- }
- }
- return FALSE;
- }
-
- /**
- * Gets the values needed to display the priority dropdown setting.
- *
- * @return array
- * Select options.
- */
- public function getPrioritySelectValues() {
- $options = [];
- foreach (range(0, self::PRIORITY_HIGHEST) as $value) {
- $value = $this->formatPriority($value / self::PRIORITY_DIVIDER);
- $options[$value] = $value;
- }
- return $options;
- }
-
- /**
- * Gets the values needed to display the changefreq dropdown setting.
- *
- * @return array
- * Select options.
- */
- public function getChangefreqSelectValues() {
- $options = ['' => $this->t('- Not specified -')];
- foreach (self::$changefreqValues as $setting) {
- $options[$setting] = $this->t($setting);
- }
- return $options;
- }
-
- /**
- * @return array
- */
- public static function getChangefreqOptions() {
- return self::$changefreqValues;
- }
-
- /**
- * @param string $priority
- * @return string
- */
- public function formatPriority($priority) {
- return number_format((float) $priority, 1, '.', '');
- }
-
- /**
- * @param string|int $priority
- * @return bool
- */
- public static function isValidPriority($priority) {
- return is_numeric($priority) && $priority >= 0 && $priority <= 1;
- }
-
- /**
- * @param string $changefreq
- * @return bool
- */
- public static function isValidChangefreq($changefreq) {
- return in_array($changefreq, self::$changefreqValues);
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapCustomLinksForm.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapCustomLinksForm.php
deleted file mode 100644
index 1b2e40938..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapCustomLinksForm.php
+++ /dev/null
@@ -1,227 +0,0 @@
-pathValidator = $path_validator;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('simple_sitemap.generator'),
- $container->get('simple_sitemap.form_helper'),
- $container->get('path.validator')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'simple_sitemap_custom_links_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
-
- $form['simple_sitemap_custom'] = [
- '#title' => $this->t('Custom links'),
- '#type' => 'fieldset',
- '#markup' => '
' . $this->t('Add custom internal drupal paths to the XML sitemap.') . '
',
- '#prefix' => $this->getDonationText(),
- ];
-
- $form['simple_sitemap_custom']['custom_links'] = [
- '#type' => 'textarea',
- '#title' => $this->t('Relative Drupal paths'),
- '#default_value' => $this->customLinksToString($this->generator->setVariants(TRUE)->getCustomLinks(NULL, FALSE)),
- '#description' => $this->t("Please specify drupal internal (relative) paths, one per line. Do not forget to prepend the paths with a '/'. Optionally link priority (0.0 - 1.0) can be added by appending it after a space. Optionally link change frequency (always / hourly / daily / weekly / monthly / yearly / never) can be added by appending it after a space.
Examples: / 1.0 daily -> home page with the highest priority and daily change frequency /contact -> contact page with the default priority and no change frequency information"),
- ];
-
- $form['simple_sitemap_custom']['variants'] = [
- '#type' => 'select',
- '#multiple' => TRUE,
- '#title' => $this->t('Sitemap variants'),
- '#description' => $this->t('The sitemap variants to include the above links in. Variants can be configured here.', ['@url' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap/variants']),
- '#options' => array_map(
- function($variant) { return $this->t($variant['label']); },
- $this->generator->getSitemapManager()->getSitemapVariants(NULL, FALSE)
- ),
- '#default_value' => array_keys(array_filter(
- $this->generator->setVariants(TRUE)->getCustomLinks(NULL, FALSE, TRUE),
- function($e) { return !empty($e);})
- ),
- ];
-
- $form['simple_sitemap_custom']['include_images'] = [
- '#type' => 'select',
- '#title' => $this->t('Include images'),
- '#description' => $this->t('If a custom link points to an entity, include its referenced images in the sitemap.'),
- '#default_value' => $this->generator->getSetting('custom_links_include_images', FALSE),
- '#options' => [0 => $this->t('No'), 1 => $this->t('Yes')],
- ];
-
- $this->formHelper->displayRegenerateNow($form['simple_sitemap_custom']);
-
- return parent::buildForm($form, $form_state);
- }
-
- protected function negotiateVariant() {
-
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- if (!empty($form_state->getValue('custom_links')) && empty($form_state->getValue('variants'))) {
- $form_state->setErrorByName('variants', $this->t('Custom links must be assigned to at least one sitemap variant.'));
- }
-
- foreach ($this->stringToCustomLinks($form_state->getValue('custom_links')) as $i => $link_config) {
- $placeholders = [
- '@line' => ++$i,
- '@path' => $link_config['path'],
- '@priority' => isset($link_config['priority']) ? $link_config['priority'] : '',
- '@changefreq' => isset($link_config['changefreq']) ? $link_config['changefreq'] : '',
- '@changefreq_options' => implode(', ', FormHelper::getChangefreqOptions()),
- ];
-
- // Checking if internal path exists.
- if (!(bool) $this->pathValidator->getUrlIfValidWithoutAccessCheck($link_config['path'])
- // Path validator does not see a double slash as an error. Catching this to prevent breaking path generation.
- || strpos($link_config['path'], '//') !== FALSE) {
- $form_state->setErrorByName('', $this->t('Line @line: The path @path does not exist.', $placeholders));
- }
-
- // Making sure the paths start with a slash.
- if ($link_config['path'][0] !== '/') {
- $form_state->setErrorByName('', $this->t("Line @line: The path @path needs to start with a '/'.", $placeholders));
- }
-
- // Making sure the priority is formatted correctly.
- if (isset($link_config['priority']) && !FormHelper::isValidPriority($link_config['priority'])) {
- $form_state->setErrorByName('', $this->t('Line @line: The priority setting @priority for path @path is incorrect. Set the priority from 0.0 to 1.0.', $placeholders));
- }
-
- // Making sure changefreq is formatted correctly.
- if (isset($link_config['changefreq']) && !FormHelper::isValidChangefreq($link_config['changefreq'])) {
- $form_state->setErrorByName('', $this->t('Line @line: The changefreq setting @changefreq for path @path is incorrect. The following are the correct values: @changefreq_options.', $placeholders));
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $this->generator->setVariants(TRUE)->removeCustomLinks();
- if (!empty($variants = $form_state->getValue('variants')) && !empty($links = $form_state->getValue('custom_links'))) {
- $this->generator->setVariants(array_values($variants));
- foreach ($this->stringToCustomLinks($links) as $link_config) {
- $this->generator->addCustomLink($link_config['path'], $link_config);
- }
- }
-
- $this->generator->saveSetting('custom_links_include_images', (bool) $form_state->getValue('include_images'));
- parent::submitForm($form, $form_state);
-
- // Regenerate sitemaps according to user setting.
- if ($form_state->getValue('simple_sitemap_regenerate_now')) {
- $this->generator->rebuildQueue()->generateSitemap();
- }
- }
-
- /**
- * @param $custom_links_string
- * @return array
- */
- protected function stringToCustomLinks($custom_links_string) {
-
- // Unify newline characters and explode into array.
- $custom_links_string_lines = explode("\n", str_replace("\r\n", "\n", $custom_links_string));
-
- // Remove empty values and whitespaces from array.
- $custom_links_string_lines = array_filter(array_map('trim', $custom_links_string_lines));
-
- $custom_links = [];
- foreach ($custom_links_string_lines as $i => &$line) {
- $link_settings = explode(' ', $line);
- $custom_links[$i]['path'] = $link_settings[0];
-
- // If two arguments are provided for a link, assume the first to be
- // priority, the second to be changefreq.
- if (!empty($link_settings[1]) && !empty($link_settings[2])) {
- $custom_links[$i]['priority'] = $link_settings[1];
- $custom_links[$i]['changefreq'] = $link_settings[2];
- }
- else {
- // If one argument is provided for a link, guess if it is priority or
- // changefreq.
- if (!empty($link_settings[1])) {
- if (is_numeric($link_settings[1])) {
- $custom_links[$i]['priority'] = $link_settings[1];
- }
- else {
- $custom_links[$i]['changefreq'] = $link_settings[1];
- }
- }
- }
- }
- return $custom_links;
- }
-
- /**
- * @param array $links
- * @return string
- */
- protected function customLinksToString(array $links) {
- $setting_string = '';
- foreach ($links as $custom_link) {
- $setting_string .= $custom_link['path'];
- $setting_string .= isset($custom_link['priority'])
- ? ' ' . $this->formHelper->formatPriority($custom_link['priority'])
- : '';
- $setting_string .= isset($custom_link['changefreq'])
- ? ' ' . $custom_link['changefreq']
- : '';
- $setting_string .= "\r\n";
- }
- return $setting_string;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapEntitiesForm.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapEntitiesForm.php
deleted file mode 100644
index 190503c34..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapEntitiesForm.php
+++ /dev/null
@@ -1,192 +0,0 @@
-entityHelper = $entity_helper;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('simple_sitemap.generator'),
- $container->get('simple_sitemap.form_helper'),
- $container->get('simple_sitemap.entity_helper')
- );
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFormId() {
- return 'simple_sitemap_entities_form';
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildForm(array $form, FormStateInterface $form_state) {
-
- $form['simple_sitemap_entities']['#prefix'] = $this->getDonationText();
-
- $form['simple_sitemap_entities']['entities'] = [
- '#title' => $this->t('Sitemap entities'),
- '#type' => 'fieldset',
- '#markup' => '
' . $this->t('Simple XML sitemap settings will be added only to entity forms of entity types enabled here. For all entity types featuring bundles (e.g. node) sitemap settings have to be set on their bundle pages (e.g. page).') . '
',
- ];
-
- $form['#attached']['library'][] = 'simple_sitemap/sitemapEntities';
- $form['#attached']['drupalSettings']['simple_sitemap'] = ['all_entities' => [], 'atomic_entities' => []];
-
- $entity_type_labels = [];
- foreach ($this->entityHelper->getSupportedEntityTypes() as $entity_type_id => $entity_type) {
- $entity_type_labels[$entity_type_id] = $entity_type->getLabel() ? : $entity_type_id;
- }
- asort($entity_type_labels);
-
- $this->formHelper->processForm($form_state);
-
- $bundle_settings = $this->generator->getBundleSettings();
-
- foreach ($entity_type_labels as $entity_type_id => $entity_type_label) {
-;
- $enabled_entity_type = $this->generator->entityTypeIsEnabled($entity_type_id);
- $atomic_entity_type = $this->entityHelper->entityTypeIsAtomic($entity_type_id);
- $css_entity_type_id = str_replace('_', '-', $entity_type_id);
-
- $form['simple_sitemap_entities']['entities'][$entity_type_id] = [
- '#type' => 'details',
- '#title' => $entity_type_label,
- '#open' => $enabled_entity_type,
- ];
-
- $form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_enabled'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Enable @entity_type_label (@entity_type_id) support', ['@entity_type_label' => strtolower($entity_type_label), '@entity_type_id' => $entity_type_id]),
- '#description' => $atomic_entity_type
- ? $this->t('Sitemap settings for the entity type @entity_type_label can be set below and overridden on its entity pages.', ['@entity_type_label' => strtolower($entity_type_label)])
- : $this->t('Sitemap settings for the entity type @entity_type_label can be set on its bundle pages and overridden on its entity pages.', ['@entity_type_label' => strtolower($entity_type_label)]),
- '#default_value' => $enabled_entity_type,
- ];
-
- if ($form['simple_sitemap_entities']['entities'][$entity_type_id][$entity_type_id . '_enabled']['#default_value']) {
-
- $bundle_info = '';
- $indexed_bundles = isset($bundle_settings[$entity_type_id])
- ? implode(array_keys(array_filter($bundle_settings[$entity_type_id], function ($val) {return $val['index'];})), ', ')
- : '';
-
- if (!$atomic_entity_type) {
- $bundle_info .= '
'
- . (!empty($indexed_bundles)
- ? $this->t("@entity_type_label bundles set to be indexed:", ['@entity_type_label' => ucfirst(strtolower($entity_type_label))]) . ' ' . '' . $indexed_bundles . ''
- : $this->t('No @entity_type_label bundles are set to be indexed yet.', ['@entity_type_label' => strtolower($entity_type_label)]))
- . '
'
- . ($atomic_entity_type
- ? $this->t("Warning: This entity type's sitemap settings including per-entity overrides will be deleted after hitting Save.")
- : $this->t("Warning: The sitemap settings for @bundles and any per-entity overrides will be deleted after hitting Save.",
- ['@bundles' => $indexed_bundles]))
- . '
' . $this->t('If you would like to say thanks and support the development of this module, a donation will be much appreciated.', ['@url' => 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5AFYRSBLGSC3W']) . '
' : '',
- ];
- $form['simple_sitemap_settings']['status']['types'][$type_name]['table'] = [
- '#type' => 'table',
- '#header' => [$this->t('Variant'), $this->t('Status'), /*$this->t('Actions')*/],
- '#attributes' => ['class' => ['form-item', 'clearfix']],
- ];
- foreach ($variants as $variant_name => $variant_definition) {
- $row = [];
- $row['name']['data']['#markup'] = '' . $variant_definition['label'] . '';
- if (!isset($sitemap_statuses[$variant_name])) {
- $row['status'] = $this->t('pending');
- }
- else {
- $url = $GLOBALS['base_url'] . '/' . $variant_name . '/sitemap.xml';
- switch ($sitemap_statuses[$variant_name]) {
- case 0:
- $row['status'] = $this->t('generating');
- break;
- case 1:
- $row['status']['data']['#markup'] = $this->t('published', ['@url' => $url]);
- break;
- case 2:
- $row['status'] = $this->t('published, regenerating', ['@url' => $url]);
- break;
- }
- }
-
-// $row['actions'] = '';
- $form['simple_sitemap_settings']['status']['types'][$type_name]['table']['#rows'][$variant_name] = $row;
- unset($sitemap_statuses[$variant_name]);
- }
- }
- }
- if (empty($form['simple_sitemap_settings']['status']['types'])) {
- $form['simple_sitemap_settings']['status']['types']['#markup'] = $this->t('No variants have been defined');
- }
-
-/* if (!empty($sitemap_statuses)) {
- $form['simple_sitemap_settings']['status']['types']['&orphans'] = [
- '#type' => 'details',
- '#title' => $this->t('Orphans'),
- '#open' => TRUE,
- ];
-
- $form['simple_sitemap_settings']['status']['types']['&orphans']['table'] = [
- '#type' => 'table',
- '#header' => [$this->t('Variant'), $this->t('Status'), $this->t('Actions')],
- ];
- foreach ($sitemap_statuses as $orphan_name => $orphan_info) {
- $form['simple_sitemap_settings']['status']['types']['&orphans']['table']['#rows'][$orphan_name] = [
- 'name' => $orphan_name,
- 'status' => $this->t('orphaned'),
- 'actions' => '',
- ];
- }
- }*/
-
- $form['simple_sitemap_settings']['settings'] = [
- '#type' => 'fieldset',
- '#title' => $this->t('Settings'),
- ];
-
- $form['simple_sitemap_settings']['settings']['cron_generate'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Regenerate the sitemaps during cron runs'),
- '#description' => $this->t('Uncheck this if you intend to only regenerate the sitemaps manually or via drush.'),
- '#default_value' => $this->generator->getSetting('cron_generate', TRUE),
- ];
-
- $form['simple_sitemap_settings']['settings']['cron_generate_interval'] = [
- '#type' => 'select',
- '#title' => $this->t('Sitemap generation interval'),
- '#description' => $this->t('The sitemap will be generated according to this interval.'),
- '#default_value' => $this->generator->getSetting('cron_generate_interval', 0),
- '#options' => [
- 0 => $this->t('On every cron run'),
- 1 => $this->t('Once an hour'),
- 3 => $this->t('Once every @hours hours', ['@hours' => 3]),
- 6 => $this->t('Once every @hours hours', ['@hours' => 6]),
- 12 => $this->t('Once every @hours hours', ['@hours' => 12]),
- 24 => $this->t('Once a day'),
- 48 => $this->t('Once every @days days', ['@days' => 48/24]),
- 72 => $this->t('Once every @days days', ['@days' => 72/24]),
- 96 => $this->t('Once every @days days', ['@days' => 96/24]),
- 120 => $this->t('Once every @days days', ['@days' => 120/24]),
- 144 => $this->t('Once every @days days', ['@days' => 144/24]),
- 168 => $this->t('Once a week'),
- ],
- '#states' => [
- 'visible' => [
- ':input[name="cron_generate"]' => ['checked' => TRUE],
- ],
- ],
- ];
-
- $form['simple_sitemap_settings']['settings']['languages'] = [
- '#type' => 'details',
- '#title' => $this->t('Language settings'),
- '#open' => FALSE,
- ];
-
- $language_options = [];
- foreach ($this->languageManager->getLanguages() as $language) {
- if (!$language->isDefault()) {
- $language_options[$language->getId()] = $language->getName();
- }
- }
-
- $form['simple_sitemap_settings']['settings']['languages']['skip_untranslated'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Skip non-existent translations'),
- '#description' => $this->t('If checked, entity links are generated exclusively for languages the entity has been translated to as long as the language is not excluded below. Otherwise entity links are generated for every language installed on the site apart from languages excluded below. Bear in mind that non-entity paths like homepage will always be generated for every non-excluded language.'),
- '#default_value' => $this->generator->getSetting('skip_untranslated', FALSE),
- ];
-
- $form['simple_sitemap_settings']['settings']['languages']['excluded_languages'] = [
- '#title' => $this->t('Exclude languages'),
- '#type' => 'checkboxes',
- '#options' => $language_options,
- '#description' => !empty($language_options)
- ? $this->t('There will be no links generated for languages checked here.')
- : $this->t('There are no languages other than the default language available.', ['@url' => $GLOBALS['base_url'] . '/admin/config/regional/language']),
- '#default_value' => $this->generator->getSetting('excluded_languages', []),
- ];
-
- $form['simple_sitemap_settings']['advanced'] = [
- '#type' => 'details',
- '#title' => $this->t('Advanced settings'),
- '#open' => TRUE,
- ];
-
- $variants = $this->generator->getSitemapManager()->getSitemapVariants(NULL, FALSE);
- $default_variant = $this->generator->getSetting('default_variant');
- $form['simple_sitemap_settings']['advanced']['default_variant'] = [
- '#type' => 'select',
- '#title' => $this->t('Default sitemap variant'),
- '#description' => $this->t('This sitemap variant will be available under /sitemap.xml in addition to its default path /variant-name/sitemap.xml. Variants can be configured here.', ['@url' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap/variants']),
- '#default_value' => isset($variants[$default_variant]) ? $default_variant : '',
- '#options' => ['' => $this->t('- None -')] + array_map(function($variant) { return $this->t($variant['label']); }, $variants),
- ];
-
- $form['simple_sitemap_settings']['advanced']['base_url'] = [
- '#type' => 'textfield',
- '#title' => $this->t('Default base URL'),
- '#default_value' => $this->generator->getSetting('base_url', ''),
- '#size' => 30,
- '#description' => $this->t('On some hosting providers it is impossible to pass parameters to cron to tell Drupal which URL to bootstrap with. In this case the base URL of sitemap links can be overridden here. Example: @url', ['@url' => $GLOBALS['base_url']]),
- ];
-
- $form['simple_sitemap_settings']['advanced']['remove_duplicates'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Exclude duplicate links'),
- '#description' => $this->t('Prevent per-sitemap variant duplicate links. Uncheck this to significantly speed up the sitemap generation process on a huge site (more than 20 000 indexed entities).'),
- '#default_value' => $this->generator->getSetting('remove_duplicates', TRUE),
- ];
-
- $form['simple_sitemap_settings']['advanced']['max_links'] = [
- '#type' => 'number',
- '#title' => $this->t('Maximum links in a sitemap'),
- '#min' => 1,
- '#description' => $this->t('The maximum number of links one sitemap can hold. If more links are generated than set here, a sitemap index will be created and the links split into several sub-sitemaps. 50 000 links is the maximum Google will parse per sitemap, but an equally important consideration is generation performance: Splitting sitemaps into chunks greatly increases it. If left blank, all links will be shown on a single sitemap.'),
- '#default_value' => $this->generator->getSetting('max_links'),
- ];
-
- $form['simple_sitemap_settings']['advanced']['generate_duration'] = [
- '#type' => 'number',
- '#title' => $this->t('Sitemap generation max duration'),
- '#min' => 1,
- '#description' => $this->t('The maximum duration in seconds the generation task can run during a single cron run or during one batch process iteration. The higher the number, the quicker the generation process, but higher the risk of PHP timeout errors.'),
- '#default_value' => $this->generator->getSetting('generate_duration', 10000) / 1000,
- '#required' => TRUE,
- ];
-
- $this->formHelper->displayRegenerateNow($form['simple_sitemap_settings']);
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * @return array
- * Array of sitemap statuses keyed by variant name.
- * Status values:
- * 0: Instance is unpublished
- * 1: Instance is published
- * 2: Instance is published but is being regenerated
- */
- protected function fetchSitemapInstanceStatuses() {
- $results = $this->db
- ->query('SELECT type, status FROM {simple_sitemap} GROUP BY type, status')
- ->fetchAll();
-
- $instances = [];
- foreach ($results as $i => $result) {
- $instances[$result->type] = isset($instances[$result->type])
- ? $result->status + 1
- : (int) $result->status;
- }
-
- return $instances;
- }
-
- /**
- * {@inheritdoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- $base_url = $form_state->getValue('base_url');
- $form_state->setValue('base_url', rtrim($base_url, '/'));
- if ($base_url !== '' && !UrlHelper::isValid($base_url, TRUE)) {
- $form_state->setErrorByName('base_url', t('The base URL is invalid.'));
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- foreach (['max_links',
- 'cron_generate',
- 'cron_generate_interval',
- 'remove_duplicates',
- 'skip_untranslated',
- 'base_url',
- 'default_variant'] as $setting_name) {
- $this->generator->saveSetting($setting_name, $form_state->getValue($setting_name));
- }
- $this->generator->saveSetting('excluded_languages', array_filter($form_state->getValue('excluded_languages')));
- $this->generator->saveSetting('generate_duration', $form_state->getValue('generate_duration') * 1000);
-
- parent::submitForm($form, $form_state);
-
- // Regenerate sitemaps according to user setting.
- if ($form_state->getValue('simple_sitemap_regenerate_now')) {
- $this->generator->rebuildQueue()->generateSitemap();
- }
- }
-
- /**
- * @param array $form
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function generateSitemap(array &$form, FormStateInterface $form_state) {
- $this->generator->generateSitemap();
- }
-
- /**
- * @param array $form
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function generateSitemapBackend (array &$form, FormStateInterface $form_state) {
- $this->generator->generateSitemap('backend');
- }
-
-
- /**
- * @param array $form
- * @param \Drupal\Core\Form\FormStateInterface $form_state
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function rebuildQueue(array &$form, FormStateInterface $form_state) {
- $this->generator->rebuildQueue();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapVariantsForm.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapVariantsForm.php
deleted file mode 100644
index d1e1ac533..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Form/SimplesitemapVariantsForm.php
+++ /dev/null
@@ -1,147 +0,0 @@
- $this->t('Sitemap variants'),
- '#type' => 'fieldset',
- '#markup' => '
' . $this->t('Define sitemap variants. A sitemap variant is a sitemap instance of a certain type (specific sitemap generator and URL generators) accessible under a certain URL. Each variant can have its own entity bundle settings (to be defined on bundle edit pages).') . '
',
- '#prefix' => $this->getDonationText(),
- ];
-
- $form['simple_sitemap_variants']['variants'] = [
- '#type' => 'textarea',
- '#title' => $this->t('Variants'),
- '#default_value' => $this->variantsToString($this->generator->getSitemapManager()->getSitemapVariants(NULL, TRUE)),
- '#description' => $this->t("Please specify sitemap variants, one per line. Caution: Removing variants here will delete their bundle settings, custom links and corresponding sitemap instances.
A variant definition consists of the variant name (used as the variant's path), the sitemap type it belongs to (optional) and the variant label (optional). These three values have to be separated by the | pipe | symbol.
Examples: default | default_hreflang | Default -> variant of the default_hreflang sitemap type and Default as label; accessible under /default/sitemap.xml test -> variant of the @default_sitemap_type sitemap type and test as label; accessible under /test/sitemap.xml
Available sitemap types:", ['@default_sitemap_type' => SimplesitemapManager::DEFAULT_SITEMAP_TYPE]),
- ];
-
- foreach ($this->generator->getSitemapManager()->getSitemapTypes() as $sitemap_type => $definition) {
- $form['simple_sitemap_variants']['variants']['#description'] .= ' ' . '' . $sitemap_type . '' . (!empty($definition['description']) ? (': ' . $definition['description']) : '');
- }
-
- $this->formHelper->displayRegenerateNow($form['simple_sitemap_custom']);
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- *
- * @todo Show multiple errors at once.
- * @todo Allow numeric variant names, but bear in mind that they are stored as integer array keys due to how php arrays work.
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {
- $line = 0;
- $sitemap_types = $this->generator->getSitemapManager()->getSitemapTypes();
- foreach ($this->stringToVariants($form_state->getValue('variants')) as $variant_name => $variant_definition) {
- $placeholders = [
- '@line' => ++$line,
- '@name' => $variant_name,
- '@type' => isset($variant_definition['type']) ? $variant_definition['type'] : '',
- '@label' => isset($variant_definition['label']) ? $variant_definition['label'] : '',
- ];
-
- if (trim($variant_name) === '') {
- $form_state->setErrorByName('', $this->t("Line @line: The variant name cannot be empty.", $placeholders));
- }
-
- if (!preg_match('/^[\w-_]+$/', $variant_name)) {
- $form_state->setErrorByName('', $this->t("Line @line: The variant name @name can only include alphanumeric characters, dashes and underscores.", $placeholders));
- }
-
- if (is_numeric($variant_name)) {
- $form_state->setErrorByName('', $this->t("Line @line: The variant name cannot be numeric.", $placeholders));
- }
-
- if (!isset($sitemap_types[$variant_definition['type']])) {
- $form_state->setErrorByName('', $this->t("Line @line: The variant @name is of a sitemap type @type that does not exist.", $placeholders));
- }
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $manager = $this->generator->getSitemapManager();
- $new_variants = $this->stringToVariants($form_state->getValue('variants'));
- $remove_variants = array_values(array_diff(
- array_keys($manager->getSitemapVariants(NULL, FALSE)),
- array_keys($new_variants)
- ));
- $manager->removeSitemapVariants($remove_variants);
- $weight = 0;
- foreach ($new_variants as $variant_name => $variant_definition) {
- $manager->addSitemapVariant($variant_name, $variant_definition + ['weight' => $weight]);
- $weight++;
- }
-
- parent::submitForm($form, $form_state);
-
- // Regenerate sitemaps according to user setting.
- if ($form_state->getValue('simple_sitemap_regenerate_now')) {
- $this->generator->setVariants(TRUE)
- ->rebuildQueue()
- ->generateSitemap();
- }
- }
-
- /**
- * @param $variant_string
- * @return array
- */
- protected function stringToVariants($variant_string) {
-
- // Unify newline characters and explode into array.
- $variants_string_lines = explode("\n", str_replace("\r\n", "\n", $variant_string));
-
- // Remove empty values and whitespaces from array.
- $variants_string_lines = array_filter(array_map('trim', $variants_string_lines));
-
- $variants = [];
- foreach ($variants_string_lines as $i => &$line) {
- $variant_settings = explode('|', $line);
- $name = strtolower(trim($variant_settings[0]));
- $variants[$name]['type'] = !empty($variant_settings[1]) ? trim($variant_settings[1]) : SimplesitemapManager::DEFAULT_SITEMAP_TYPE;
- $variants[$name]['label'] = !empty($variant_settings[2]) ? trim($variant_settings[2]) : $name;
- }
- return $variants;
- }
-
- /**
- * @param array $variants
- * @return string
- */
- protected function variantsToString(array $variants) {
- $variants_string = '';
- foreach ($variants as $variant_name => $variant_definition) {
- $variants_string .= $variant_name
- . ' | ' . $variant_definition['type']
- . ' | ' . $variant_definition['label']
- . "\r\n";
- }
- return $variants_string;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Logger.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Logger.php
deleted file mode 100644
index 42c6daa9f..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Logger.php
+++ /dev/null
@@ -1,100 +0,0 @@
-logger = $logger;
- $this->messenger = $messenger;
- $this->currentUser = $current_user;
- }
-
- /**
- * @param $message
- * @param array $substitutions
- * @return $this
- */
- public function m($message, $substitutions = []) {
- $this->message = $message;
- $this->substitutions = $substitutions;
- return $this;
- }
-
- /**
- * @param string $logSeverityLevel
- * @return $this
- */
- public function log($logSeverityLevel = self::LOG_SEVERITY_LEVEL_DEFAULT) {
- $this->logger->$logSeverityLevel(strtr($this->message, $this->substitutions));
- return $this;
- }
-
- /**
- * @param string $displayMessageType
- * @param string $permission
- * @return $this
- */
- public function display($displayMessageType = self::DISPLAY_MESSAGE_TYPE_DEFAULT, $permission = '') {
- if (empty($permission) || $this->currentUser->hasPermission($permission)) {
- $this->messenger->addMessage($this->t($this->message, $this->substitutions), $displayMessageType);
- }
- return $this;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/PathProcessor/PathProcessorSitemapVariant.php b/sites/all/modules/contrib/admin/simple_sitemap/src/PathProcessor/PathProcessorSitemapVariant.php
deleted file mode 100644
index f0999cccc..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/PathProcessor/PathProcessorSitemapVariant.php
+++ /dev/null
@@ -1,25 +0,0 @@
- self::XMLNS,
- 'xmlns:xhtml' => self::XMLNS_XHTML,
- 'xmlns:image' => self::XMLNS_IMAGE,
- ];
-
- /**
- * DefaultSitemapGenerator constructor.
- * @param array $configuration
- * @param string $plugin_id
- * @param mixed $plugin_definition
- * @param \Drupal\Core\Database\Connection $database
- * @param \Drupal\Core\Extension\ModuleHandler $module_handler
- * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
- * @param \Drupal\Component\Datetime\Time $time
- * @param \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapWriter $sitemapWriter
- */
- public function __construct(
- array $configuration,
- $plugin_id,
- $plugin_definition,
- Connection $database,
- ModuleHandler $module_handler,
- LanguageManagerInterface $language_manager,
- Time $time,
- SitemapWriter $sitemapWriter
- ) {
- parent::__construct(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $database,
- $module_handler,
- $language_manager,
- $time,
- $sitemapWriter
- );
- }
-
- public static function create(
- ContainerInterface $container,
- array $configuration,
- $plugin_id,
- $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('database'),
- $container->get('module_handler'),
- $container->get('language_manager'),
- $container->get('datetime.time'),
- $container->get('simple_sitemap.sitemap_writer')
- );
- }
-
- /**
- * Generates and returns a sitemap chunk.
- *
- * @param array $links
- * All links with their multilingual versions and settings.
- *
- * @return string
- * Sitemap chunk
- */
- protected function getXml(array $links) {
- $this->writer->openMemory();
- $this->writer->setIndent(TRUE);
- $this->writer->startDocument(self::XML_VERSION, self::ENCODING);
- $this->writer->writeComment(self::GENERATED_BY);
- $this->writer->startElement('urlset');
-
- // Add attributes to document.
- $attributes = self::$attributes;
- if (!$this->isHreflangSitemap()) {
- unset($attributes['xmlns:xhtml']);
- }
- $sitemap_variant = $this->sitemapVariant;
- $this->moduleHandler->alter('simple_sitemap_attributes', $attributes, $sitemap_variant);
- foreach ($attributes as $name => $value) {
- $this->writer->writeAttribute($name, $value);
- }
-
- // Add URLs to document.
- $sitemap_variant = $this->sitemapVariant;
- $this->moduleHandler->alter('simple_sitemap_links', $links, $sitemap_variant);
- foreach ($links as $link) {
-
- // Add each translation variant URL as location to the sitemap.
- $this->writer->startElement('url');
- $this->writer->writeElement('loc', $link['url']);
-
- // If more than one language is enabled, add all translation variant URLs
- // as alternate links to this location turning the sitemap into a hreflang
- // sitemap.
- if (isset($link['alternate_urls']) && $this->isHreflangSitemap()) {
- foreach ($link['alternate_urls'] as $language_id => $alternate_url) {
- $this->writer->startElement('xhtml:link');
- $this->writer->writeAttribute('rel', 'alternate');
- $this->writer->writeAttribute('hreflang', $language_id);
- $this->writer->writeAttribute('href', $alternate_url);
- $this->writer->endElement();
- }
- }
-
- // Add lastmod if any.
- if (isset($link['lastmod'])) {
- $this->writer->writeElement('lastmod', $link['lastmod']);
- }
-
- // Add changefreq if any.
- if (isset($link['changefreq'])) {
- $this->writer->writeElement('changefreq', $link['changefreq']);
- }
-
- // Add priority if any.
- if (isset($link['priority'])) {
- $this->writer->writeElement('priority', $link['priority']);
- }
-
- // Add images if any.
- if (!empty($link['images'])) {
- foreach ($link['images'] as $image) {
- $this->writer->startElement('image:image');
- $this->writer->writeElement('image:loc', $image['path']);
- $this->writer->endElement();
- }
- }
-
- $this->writer->endElement();
- }
- $this->writer->endElement();
- $this->writer->endDocument();
-
- return $this->writer->outputMemory();
- }
-
- /**
- * @return bool
- */
- protected function isHreflangSitemap() {
- if (NULL === $this->isHreflangSitemap) {
- $this->isHreflangSitemap = count(
- array_diff_key($this->languageManager->getLanguages(),
- $this->settings['excluded_languages'])
- ) > 1;
- }
- return $this->isHreflangSitemap;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorBase.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorBase.php
deleted file mode 100644
index 952453465..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorBase.php
+++ /dev/null
@@ -1,303 +0,0 @@
- self::XMLNS,
- ];
-
- /**
- * SitemapGeneratorBase constructor.
- * @param array $configuration
- * @param string $plugin_id
- * @param mixed $plugin_definition
- * @param \Drupal\Core\Database\Connection $database
- * @param \Drupal\Core\Extension\ModuleHandler $module_handler
- * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
- * @param \Drupal\Component\Datetime\Time $time
- * @param \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapWriter $sitemap_writer
- */
- public function __construct(
- array $configuration,
- $plugin_id,
- $plugin_definition,
- Connection $database,
- ModuleHandler $module_handler,
- LanguageManagerInterface $language_manager,
- Time $time,
- SitemapWriter $sitemap_writer
- ) {
- parent::__construct($configuration, $plugin_id, $plugin_definition);
- $this->db = $database;
- $this->moduleHandler = $module_handler;
- $this->languageManager = $language_manager;
- $this->time = $time;
- $this->writer = $sitemap_writer;
- $this->sitemapVariant = $this->settings['default_variant'];
- }
-
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('database'),
- $container->get('module_handler'),
- $container->get('language_manager'),
- $container->get('datetime.time'),
- $container->get('simple_sitemap.sitemap_writer')
- );
- }
-
- /**
- * @param string $sitemap_variant
- * @return $this
- */
- public function setSitemapVariant($sitemap_variant) {
- $this->sitemapVariant = $sitemap_variant;
- return $this;
- }
-
- /**
- * @return bool
- */
- protected function isDefaultVariant() {
- return $this->sitemapVariant === $this->settings['default_variant'];
- }
-
- /**
- * @param array $links
- * @return string
- */
- abstract protected function getXml(array $links);
-
- protected function getChunkInfo() {
- return $this->db->select('simple_sitemap', 's')
- ->fields('s', ['delta', 'sitemap_created', 'type'])
- ->condition('s.type', $this->sitemapVariant)
- ->condition('s.delta', self::INDEX_DELTA, '<>')
- ->condition('s.status', 0)
- ->execute()
- ->fetchAllAssoc('delta');
- }
-
- /**
- * @param array $chunk_info
- * @return string
- */
- protected function getIndexXml(array $chunk_info) {
- $this->writer->openMemory();
- $this->writer->setIndent(TRUE);
- $this->writer->startDocument(self::XML_VERSION, self::ENCODING);
- $this->writer->writeComment(self::GENERATED_BY);
- $this->writer->startElement('sitemapindex');
-
- // Add attributes to document.
- $attributes = self::$indexAttributes;
- $sitemap_variant = $this->sitemapVariant;
- $this->moduleHandler->alter('simple_sitemap_index_attributes', $attributes, $sitemap_variant);
- foreach ($attributes as $name => $value) {
- $this->writer->writeAttribute($name, $value);
- }
-
- // Add sitemap chunk locations to document.
- foreach ($chunk_info as $chunk_data) {
- $this->writer->startElement('sitemap');
- $this->writer->writeElement('loc', $this->getCustomBaseUrl()
- . '/' . (!$this->isDefaultVariant() ? ($chunk_data->type . '/') : '') . 'sitemap.xml?page=' . $chunk_data->delta);
- $this->writer->writeElement('lastmod', date_iso8601($chunk_data->sitemap_created));
- $this->writer->endElement();
- }
-
- $this->writer->endElement();
- $this->writer->endDocument();
-
- return $this->writer->outputMemory();
- }
-
- /**
- * @param string $mode
- * @return $this
- */
- public function remove($mode = 'all') {
- self::purgeSitemapVariants($this->sitemapVariant, $mode);
-
- return $this;
- }
-
- public static function purgeSitemapVariants($variants = NULL, $mode = 'all') {
- if (NULL === $variants || !empty((array) $variants)) {
- $delete_query = \Drupal::database()->delete('simple_sitemap');
-
- switch($mode) {
- case 'published':
- $delete_query->condition('status', 1);
- break;
-
- case 'unpublished':
- $delete_query->condition('status', 0);
- break;
-
- case 'all':
- break;
-
- default:
- //todo: throw error
- }
-
- if (NULL !== $variants) {
- $delete_query->condition('type', (array) $variants, 'IN');
- }
-
- $delete_query->execute();
- }
- }
-
- /**
- * @param array $links
- * @return $this
- * @throws \Exception
- */
- public function generate(array $links) {
- $highest_id = $this->db->query('SELECT MAX(id) FROM {simple_sitemap}')->fetchField();
- $highest_delta = $this->db->query('SELECT MAX(delta) FROM {simple_sitemap} WHERE type = :type AND status = :status', [':type' => $this->sitemapVariant, ':status' => 0])
- ->fetchField();
-
- $this->db->insert('simple_sitemap')->fields([
- 'id' => NULL === $highest_id ? 0 : $highest_id + 1,
- 'delta' => NULL === $highest_delta ? self::FIRST_CHUNK_DELTA : $highest_delta + 1,
- 'type' => $this->sitemapVariant,
- 'sitemap_string' => $this->getXml($links),
- 'sitemap_created' => $this->time->getRequestTime(),
- 'status' => 0,
- ])->execute();
-
- return $this;
- }
-
- /**
- * @return $this
- * @throws \Exception
- */
- public function generateIndex() {
- if (!empty($chunk_info = $this->getChunkInfo()) && count($chunk_info) > 1) {
- $index_xml = $this->getIndexXml($chunk_info);
- $highest_id = $this->db->query('SELECT MAX(id) FROM {simple_sitemap}')->fetchField();
- $this->db->merge('simple_sitemap')
- ->keys([
- 'delta' => self::INDEX_DELTA,
- 'type' => $this->sitemapVariant,
- 'status' => 0
- ])
- ->insertFields([
- 'id' => NULL === $highest_id ? 0 : $highest_id + 1,
- 'delta' => self::INDEX_DELTA,
- 'type' => $this->sitemapVariant,
- 'sitemap_string' => $index_xml,
- 'sitemap_created' => $this->time->getRequestTime(),
- 'status' => 0,
- ])
- ->updateFields([
- 'sitemap_string' => $index_xml,
- 'sitemap_created' => $this->time->getRequestTime(),
- ])
- ->execute();
- }
-
- return $this;
- }
-
- /**
- * @return $this
- */
- public function publish() {
- $unpublished_chunk = $this->db->query('SELECT MAX(id) FROM {simple_sitemap} WHERE type = :type AND status = :status', [':type' => $this->sitemapVariant, ':status' => 0])
- ->fetchField();
-
- // Only allow publishing a sitemap variant if there is an unpublished
- // sitemap variant, as publishing involves deleting the currently published
- // variant.
- if (FALSE !== $unpublished_chunk) {
- $this->remove('published');
- $this->db->query('UPDATE {simple_sitemap} SET status = :status WHERE type = :type', [':type' => $this->sitemapVariant, ':status' => 1]);
- }
-
- return $this;
- }
-
- /**
- * @param array $settings
- * @return $this
- */
- public function setSettings(array $settings) {
- $this->settings = $settings;
- return $this;
- }
-
- /**
- * @return string
- */
- protected function getCustomBaseUrl() {
- $customBaseUrl = $this->settings['base_url'];
- return !empty($customBaseUrl) ? $customBaseUrl : $GLOBALS['base_url'];
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorInterface.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorInterface.php
deleted file mode 100644
index a44095a33..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapGeneratorInterface.php
+++ /dev/null
@@ -1,22 +0,0 @@
-alterInfo('simple_sitemap_sitemap_generators');
- $this->setCacheBackend($cache_backend, 'simple_sitemap:sitemap_generator');
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapWriter.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapWriter.php
deleted file mode 100644
index 7085162b6..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/SitemapGenerator/SitemapWriter.php
+++ /dev/null
@@ -1,13 +0,0 @@
-alterInfo('simple_sitemap_sitemap_types');
- $this->setCacheBackend($cache_backend, 'simple_sitemap:sitemap_type');
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/ArbitraryUrlGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/ArbitraryUrlGenerator.php
deleted file mode 100644
index 5e30fde3e..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/ArbitraryUrlGenerator.php
+++ /dev/null
@@ -1,82 +0,0 @@
-moduleHandler = $module_handler;
- }
-
- public static function create(
- ContainerInterface $container,
- array $configuration,
- $plugin_id,
- $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('simple_sitemap.generator'),
- $container->get('simple_sitemap.logger'),
- $container->get('module_handler')
- );
- }
-
- /**
- * @inheritdoc
- */
- public function getDataSets() {
- $arbitrary_links = [];
- $sitemap_variant = $this->sitemapVariant;
- $this->moduleHandler->alter('simple_sitemap_arbitrary_links', $arbitrary_links, $sitemap_variant);
- return array_values($arbitrary_links);
- }
-
- /**
- * @inheritdoc
- */
- protected function processDataSet($data_set) {
- return $data_set;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php
deleted file mode 100644
index 98d90a737..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/CustomUrlGenerator.php
+++ /dev/null
@@ -1,143 +0,0 @@
-here.';
-
-
- /**
- * @var \Drupal\Core\Path\PathValidator
- */
- protected $pathValidator;
-
- /**
- * @var bool
- */
- protected $includeImages;
-
- /**
- * CustomUrlGenerator constructor.
- * @param array $configuration
- * @param $plugin_id
- * @param $plugin_definition
- * @param \Drupal\simple_sitemap\Simplesitemap $generator
- * @param \Drupal\simple_sitemap\Logger $logger
- * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
- * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
- * @param \Drupal\simple_sitemap\EntityHelper $entityHelper
- * @param \Drupal\Core\Path\PathValidator $path_validator
- */
- public function __construct(
- array $configuration,
- $plugin_id,
- $plugin_definition,
- Simplesitemap $generator,
- Logger $logger,
- LanguageManagerInterface $language_manager,
- EntityTypeManagerInterface $entity_type_manager,
- EntityHelper $entityHelper,
- PathValidator $path_validator) {
- parent::__construct(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $generator,
- $logger,
- $language_manager,
- $entity_type_manager,
- $entityHelper
- );
- $this->pathValidator = $path_validator;
- }
-
- public static function create(
- ContainerInterface $container,
- array $configuration,
- $plugin_id,
- $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('simple_sitemap.generator'),
- $container->get('simple_sitemap.logger'),
- $container->get('language_manager'),
- $container->get('entity_type.manager'),
- $container->get('simple_sitemap.entity_helper'),
- $container->get('path.validator')
- );
- }
-
- /**
- * @inheritdoc
- */
- public function getDataSets() {
- $this->includeImages = $this->generator->getSetting('custom_links_include_images', FALSE);
- return array_values($this->generator->setVariants($this->sitemapVariant)->getCustomLinks());
- }
-
- /**
- * @inheritdoc
- */
- protected function processDataSet($data_set) {
- if (!(bool) $this->pathValidator->getUrlIfValidWithoutAccessCheck($data_set['path'])) {
- $this->logger->m(self::PATH_DOES_NOT_EXIST_MESSAGE,
- ['@path' => $data_set['path'], '@custom_paths_url' => $GLOBALS['base_url'] . '/admin/config/search/simplesitemap/custom'])
- ->display('warning', 'administer sitemap settings')
- ->log('warning');
- return FALSE;
- }
-
- $url_object = Url::fromUserInput($data_set['path'], ['absolute' => TRUE]);
- $path = $url_object->getInternalPath();
-
- $entity = $this->entityHelper->getEntityFromUrlObject($url_object);
-
- $path_data = [
- 'url' => $url_object,
- 'lastmod' => method_exists($entity, 'getChangedTime')
- ? date_iso8601($entity->getChangedTime()) : NULL,
- 'priority' => isset($data_set['priority']) ? $data_set['priority'] : NULL,
- 'changefreq' => !empty($data_set['changefreq']) ? $data_set['changefreq'] : NULL,
- 'images' => $this->includeImages && method_exists($entity, 'getEntityTypeId')
- ? $this->getImages($entity->getEntityTypeId(), $entity->id())
- : [],
- 'meta' => [
- 'path' => $path,
- ]
- ];
-
- // Additional info useful in hooks.
- if (NULL !== $entity) {
- $path_data['meta']['entity_info'] = [
- 'entity_type' => $entity->getEntityTypeId(),
- 'id' => $entity->id(),
- ];
- }
-
- return $path_data;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php
deleted file mode 100644
index ab3ddd3d1..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityMenuLinkContentUrlGenerator.php
+++ /dev/null
@@ -1,198 +0,0 @@
-menuLinkTree = $menu_link_tree;
- }
-
- public static function create(
- ContainerInterface $container,
- array $configuration,
- $plugin_id,
- $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('simple_sitemap.generator'),
- $container->get('simple_sitemap.logger'),
- $container->get('language_manager'),
- $container->get('entity_type.manager'),
- $container->get('simple_sitemap.entity_helper'),
- $container->get('menu.link_tree')
- );
- }
-
- /**
- * @inheritdoc
- */
- public function getDataSets() {
- $data_sets = [];
- $bundle_settings = $this->generator
- ->setVariants($this->sitemapVariant)
- ->getBundleSettings();
- if (!empty($bundle_settings['menu_link_content'])) {
- foreach ($bundle_settings['menu_link_content'] as $bundle_name => $bundle_settings) {
- if (!empty($bundle_settings['index'])) {
-
- // Retrieve the expanded tree.
- $tree = $this->menuLinkTree->load($bundle_name, new MenuTreeParameters());
- $tree = $this->menuLinkTree->transform($tree, [
- ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
- ['callable' => 'menu.default_tree_manipulators:flatten'],
- ]);
-
- foreach ($tree as $i => $item) {
- $data_sets[] = $item->link;
- }
- }
- }
- }
-
- return $data_sets;
- }
-
- /**
- * @inheritdoc
- *
- * @todo Check if menu link has not been deleted after the queue has been built.
- */
- protected function processDataSet($data_set) {
-
- /** @var MenuLinkBase $data_set */
- if (!$data_set->isEnabled()) {
- return FALSE;
- }
-
- $url_object = $data_set->getUrlObject();
-
- // Do not include external paths.
- if ($url_object->isExternal()) {
- return FALSE;
- }
-
- // If not a menu_link_content link, use bundle settings.
- $meta_data = $data_set->getMetaData();
- if (empty($meta_data['entity_id'])) {
- $entity_settings = $this->generator
- ->setVariants($this->sitemapVariant)
- ->getBundleSettings('menu_link_content', $data_set->getMenuName());
- }
-
- // If menu link is of entity type menu_link_content, take under account its entity override.
- else {
- $entity_settings = $this->generator->getEntityInstanceSettings('menu_link_content', $meta_data['entity_id']);
-
- if (empty($entity_settings['index'])) {
- return FALSE;
- }
- }
-
- // There can be internal paths that are not rooted, like 'base:/path'.
- if ($url_object->isRouted()) {
- $path = $url_object->getInternalPath();
- }
- else { // Handle base scheme.
- if (strpos($uri = $url_object->toUriString(), 'base:/') === 0 ) {
- $path = $uri[6] === '/' ? substr($uri, 7) : substr($uri, 6);
- }
- else { // Handle unforeseen schemes.
- $path = $uri;
- }
- }
-
- $url_object->setOption('absolute', TRUE);
-
- $entity = $this->entityHelper->getEntityFromUrlObject($url_object);
-
- $path_data = [
- 'url' => $url_object,
- 'lastmod' => !empty($entity) && method_exists($entity, 'getChangedTime')
- ? date_iso8601($entity->getChangedTime())
- : NULL,
- 'priority' => isset($entity_settings['priority']) ? $entity_settings['priority'] : NULL,
- 'changefreq' => !empty($entity_settings['changefreq']) ? $entity_settings['changefreq'] : NULL,
- 'images' => !empty($entity_settings['include_images']) && !empty($entity)
- ? $this->getImages($entity->getEntityTypeId(), $entity->id())
- : [],
-
- // Additional info useful in hooks.
- 'meta' => [
- 'path' => $path,
- ]
- ];
- if (!empty($entity)) {
- $path_data['meta']['entity_info'] = [
- 'entity_type' => $entity->getEntityTypeId(),
- 'id' => $entity->id(),
- ];
- }
-
- return $path_data;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
deleted file mode 100644
index 7f3d52838..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGenerator.php
+++ /dev/null
@@ -1,181 +0,0 @@
-urlGeneratorManager = $url_generator_manager;
- }
-
- public static function create(
- ContainerInterface $container,
- array $configuration,
- $plugin_id,
- $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('simple_sitemap.generator'),
- $container->get('simple_sitemap.logger'),
- $container->get('language_manager'),
- $container->get('entity_type.manager'),
- $container->get('simple_sitemap.entity_helper'),
- $container->get('plugin.manager.simple_sitemap.url_generator')
- );
- }
-
- /**
- * @inheritdoc
- */
- public function getDataSets() {
- $data_sets = [];
- $sitemap_entity_types = $this->entityHelper->getSupportedEntityTypes();
-
- foreach ($this->generator->setVariants($this->sitemapVariant)->getBundleSettings() as $entity_type_name => $bundles) {
- if (isset($sitemap_entity_types[$entity_type_name])) {
-
- // Skip this entity type if another plugin is written to override its generation.
- foreach ($this->urlGeneratorManager->getDefinitions() as $plugin) {
- if (isset($plugin['settings']['overrides_entity_type'])
- && $plugin['settings']['overrides_entity_type'] === $entity_type_name) {
- continue 2;
- }
- }
-
- $entityTypeStorage = $this->entityTypeManager->getStorage($entity_type_name);
- $keys = $sitemap_entity_types[$entity_type_name]->getKeys();
-
- foreach ($bundles as $bundle_name => $bundle_settings) {
- if (!empty($bundle_settings['index'])) {
- $query = $entityTypeStorage->getQuery();
-
- if (empty($keys['id'])) {
- $query->sort($keys['id'], 'ASC');
- }
- if (!empty($keys['bundle'])) {
- $query->condition($keys['bundle'], $bundle_name);
- }
- if (!empty($keys['status'])) {
- $query->condition($keys['status'], 1);
- }
-
- foreach ($query->execute() as $entity_id) {
- $data_sets[] = [
- 'entity_type' => $entity_type_name,
- 'id' => $entity_id,
- ];
- }
- }
- }
- }
- }
-
- return $data_sets;
- }
-
- /**
- * @inheritdoc
- */
- protected function processDataSet($data_set) {
- if (empty($entity = $this->entityTypeManager->getStorage($data_set['entity_type'])->load($data_set['id']))) {
- return FALSE;
- }
-
- $entity_id = $entity->id();
- $entity_type_name = $entity->getEntityTypeId();
-
- $entity_settings = $this->generator
- ->setVariants($this->sitemapVariant)
- ->getEntityInstanceSettings($entity_type_name, $entity_id);
-
- if (empty($entity_settings['index'])) {
- return FALSE;
- }
-
- $url_object = $entity->toUrl();
-
- // Do not include external paths.
- if (!$url_object->isRouted()) {
- return FALSE;
- }
-
- $path = $url_object->getInternalPath();
-
- $url_object->setOption('absolute', TRUE);
-
- return [
- 'url' => $url_object,
- 'lastmod' => method_exists($entity, 'getChangedTime') ? date_iso8601($entity->getChangedTime()) : NULL,
- 'priority' => isset($entity_settings['priority']) ? $entity_settings['priority'] : NULL,
- 'changefreq' => !empty($entity_settings['changefreq']) ? $entity_settings['changefreq'] : NULL,
- 'images' => !empty($entity_settings['include_images'])
- ? $this->getImages($entity_type_name, $entity_id)
- : [],
-
- // Additional info useful in hooks.
- 'meta' => [
- 'path' => $path,
- 'entity_info' => [
- 'entity_type' => $entity_type_name,
- 'id' => $entity_id,
- ],
- ]
- ];
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php
deleted file mode 100644
index 693cbfbf6..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/EntityUrlGeneratorBase.php
+++ /dev/null
@@ -1,218 +0,0 @@
-languages = $language_manager->getLanguages();
- $this->defaultLanguageId = $language_manager->getDefaultLanguage()->getId();
- $this->entityTypeManager = $entity_type_manager;
- $this->anonUser = new AnonymousUserSession();
- $this->entityHelper = $entityHelper;
- }
-
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('simple_sitemap.generator'),
- $container->get('simple_sitemap.logger'),
- $container->get('language_manager'),
- $container->get('entity_type.manager'),
- $container->get('simple_sitemap.entity_helper')
- );
- }
-
- /**
- * @param array $path_data
- * @param \Drupal\Core\Url $url_object
- * @return array
- * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
- * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
- */
- protected function getUrlVariants(array $path_data, Url $url_object) {
- $url_variants = [];
-
- if (!$url_object->isRouted()) {
- // Not a routed URL, including only default variant.
- $alternate_urls = $this->getAlternateUrlsForDefaultLanguage($url_object);
- }
- elseif ($this->settings['skip_untranslated']
- && ($entity = $this->entityHelper->getEntityFromUrlObject($url_object)) instanceof ContentEntityBase) {
-
- /** @var ContentEntityBase $entity */
- $translation_languages = $entity->getTranslationLanguages();
- if (isset($translation_languages[Language::LANGCODE_NOT_SPECIFIED])
- || isset($translation_languages[Language::LANGCODE_NOT_APPLICABLE])) {
-
- // Content entity's language is unknown, including only default variant.
- $alternate_urls = $this->getAlternateUrlsForDefaultLanguage($url_object);
- }
- else {
- // Including only translated variants of content entity.
- $alternate_urls = $this->getAlternateUrlsForTranslatedLanguages($entity, $url_object);
- }
- }
- else {
- // Not a content entity or including all untranslated variants.
- $alternate_urls = $this->getAlternateUrlsForAllLanguages($url_object);
- }
-
- foreach ($alternate_urls as $langcode => $url) {
- $url_variants[] = $path_data + [
- 'langcode' => $langcode,
- 'url' => $url,
- 'alternate_urls' => $alternate_urls
- ];
- }
-
- return $url_variants;
- }
-
- /**
- * @param \Drupal\Core\Url $url_object
- * @return array
- */
- protected function getAlternateUrlsForDefaultLanguage(Url $url_object) {
- $alternate_urls = [];
- if ($url_object->access($this->anonUser)) {
- $alternate_urls[$this->defaultLanguageId] = $this->replaceBaseUrlWithCustom($url_object
- ->setOption('language', $this->languages[$this->defaultLanguageId])->toString()
- );
- }
- return $alternate_urls;
- }
-
- /**
- * @param \Drupal\Core\Entity\ContentEntityBase $entity
- * @param \Drupal\Core\Url $url_object
- * @return array
- */
- protected function getAlternateUrlsForTranslatedLanguages(ContentEntityBase $entity, Url $url_object) {
- $alternate_urls = [];
-
- /** @var Language $language */
- foreach ($entity->getTranslationLanguages() as $language) {
- if (!isset($this->settings['excluded_languages'][$language->getId()]) || $language->isDefault()) {
- if ($entity->getTranslation($language->getId())->access('view', $this->anonUser)) {
- $alternate_urls[$language->getId()] = $this->replaceBaseUrlWithCustom($url_object
- ->setOption('language', $language)->toString()
- );
- }
- }
- }
- return $alternate_urls;
- }
-
- /**
- * @param \Drupal\Core\Url $url_object
- * @return array
- */
- protected function getAlternateUrlsForAllLanguages(Url $url_object) {
- $alternate_urls = [];
- if ($url_object->access($this->anonUser)) {
- foreach ($this->languages as $language) {
- if (!isset($this->settings['excluded_languages'][$language->getId()]) || $language->isDefault()) {
- $alternate_urls[$language->getId()] = $this->replaceBaseUrlWithCustom($url_object
- ->setOption('language', $language)->toString()
- );
- }
- }
- }
- return $alternate_urls;
- }
-
- /**
- * @param mixed $data_set
- * @return array
- * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
- * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
- */
- public function generate($data_set) {
- $path_data = $this->processDataSet($data_set);
- if (isset($path_data['url']) && $path_data['url'] instanceof Url) {
- $url_object = $path_data['url'];
- unset($path_data['url']);
- return $this->getUrlVariants($path_data, $url_object);
- }
- else {
- return FALSE !== $path_data ? [$path_data] : [];
- }
- }
-
- /**
- * @param string $entity_type_name
- * @param string $entity_id
- * @return array
- */
- protected function getImages($entity_type_name, $entity_id) {
- $images = [];
- foreach ($this->entityHelper->getEntityImageUrls($entity_type_name, $entity_id) as $url) {
- $images[]['path'] = $this->replaceBaseUrlWithCustom($url);
- }
- return $images;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php
deleted file mode 100644
index 16255ecc8..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorBase.php
+++ /dev/null
@@ -1,113 +0,0 @@
-generator = $generator;
- $this->logger = $logger;
- }
-
- public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
- return new static(
- $configuration,
- $plugin_id,
- $plugin_definition,
- $container->get('simple_sitemap.generator'),
- $container->get('simple_sitemap.logger')
- );
- }
-
- /**
- * @param array $settings
- * @return $this
- */
- public function setSettings(array $settings) {
- $this->settings = $settings;
- return $this;
- }
-
- /**
- * @param string $sitemap_variant
- * @return $this
- */
- public function setSitemapVariant($sitemap_variant) {
- $this->sitemapVariant = $sitemap_variant;
- return $this;
- }
-
- /**
- * @param string $url
- * @return string
- */
- protected function replaceBaseUrlWithCustom($url) {
- return !empty($this->settings['base_url'])
- ? str_replace($GLOBALS['base_url'], $this->settings['base_url'], $url)
- : $url;
- }
-
- /**
- * @return mixed
- */
- abstract public function getDataSets();
-
- /**
- * @param $data_set
- * @return mixed
- */
- abstract protected function processDataSet($data_set);
-
- /**
- * @param $data_set
- * @return array
- */
- public function generate($data_set) {
- $path_data = $this->processDataSet($data_set);
- return FALSE !== $path_data ? [$path_data] : [];
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorInterface.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorInterface.php
deleted file mode 100644
index 97a612719..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Plugin/simple_sitemap/UrlGenerator/UrlGeneratorInterface.php
+++ /dev/null
@@ -1,18 +0,0 @@
-alterInfo('simple_sitemap_url_generators');
- $this->setCacheBackend($cache_backend, 'simple_sitemap:url_generator');
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/BatchTrait.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/BatchTrait.php
deleted file mode 100644
index 4bb5dad5f..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/BatchTrait.php
+++ /dev/null
@@ -1,102 +0,0 @@
-batch = [
- 'title' => $this->t('Generating XML sitemaps'),
- 'init_message' => $this->t('Initializing...'),
- 'error_message' => $this->t(self::$batchErrorMessage),
- 'progress_message' => $this->t('Processing items from queue. Each sitemap variant is published as soon as its items have been processed.'),
- 'operations' => [[ __CLASS__ . '::' . 'doBatchGenerateSitemap', []]],
- 'finished' => [__CLASS__, 'finishGeneration'],
- ];
-
- switch ($from) {
-
- case 'form':
- // Start batch process.
- batch_set($this->batch);
- return TRUE;
-
- case 'drush':
- // Start drush batch process.
- batch_set($this->batch);
-
- // See https://www.drupal.org/node/638712
- $this->batch =& batch_get();
- $this->batch['progressive'] = FALSE;
-
- drush_backend_batch_process();
- return TRUE;
- }
- return FALSE;
- }
-
- /**
- * @param $context
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- *
- * @todo Make sure batch does not run at the same time as cron.
- * @todo Variants into generateSitemap().
- */
- public static function doBatchGenerateSitemap(&$context) {
-
- /** @var \Drupal\simple_sitemap\Queue\QueueWorker $queue_worker */
- $queue_worker = \Drupal::service('simple_sitemap.queue_worker');
-
- $queue_worker->generateSitemap();
- $processed_element_count = $queue_worker->getProcessedElementCount();
- $original_element_count = $queue_worker->getInitialElementCount();
-
- $context['message'] = t('@indexed out of @total total items have been processed.', [
- '@indexed' => $processed_element_count, '@total' => $original_element_count]);
- $context['finished'] = $original_element_count > 0 ? ($processed_element_count / $original_element_count) : 1;
- }
-
- /**
- * Callback function called by the batch API when all operations are finished.
- *
- * @param bool $success
- * @param array $results
- * @param array $operations
- *
- * @return bool
- *
- * @see https://api.drupal.org/api/drupal/core!includes!form.inc/group/batch/8
- */
- public static function finishGeneration($success, $results, $operations) {
- if ($success) {
- \Drupal::service('simple_sitemap.logger')
- ->m('The XML sitemaps have been regenerated.')
- ->log('info');
- }
- else {
- \Drupal::service('simple_sitemap.logger')
- ->m(self::$batchErrorMessage)
- ->display('error', 'administer sitemap settings')
- ->log('error');
- }
-
- return $success;
- }
-}
-
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/QueueWorker.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/QueueWorker.php
deleted file mode 100644
index ee7c59cf9..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/QueueWorker.php
+++ /dev/null
@@ -1,388 +0,0 @@
-settings = $settings;
- $this->manager = $manager;
- $this->state = $state;
- $this->queue = $element_queue;
- $this->logger = $logger;
- }
-
- /**
- * @return $this
- */
- public function deleteQueue() {
- $this->queue->deleteQueue();
- SitemapGeneratorBase::purgeSitemapVariants(NULL, 'unpublished');
- $this->variantProcessedNow = NULL;
- $this->generatorProcessedNow = NULL;
- $this->results = [];
- $this->processedPaths = [];
- $this->state->set('simple_sitemap.queue_items_initial_amount', 0);
- $this->state->delete('simple_sitemap.queue_stashed_results');
- $this->elementsTotal = NULL;
- $this->elementsRemaining = NULL;
-
- return $this;
- }
-
- /**
- * @param array|null $variants
- * @return $this
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function rebuildQueue($variants = NULL) {
- $all_data_sets = [];
- $sitemap_variants = $this->manager->getSitemapVariants();
-
- $type_definitions = $this->manager->getSitemapTypes();
- $this->deleteQueue();
-
- foreach ($sitemap_variants as $variant_name => $variant_definition) {
-
- // Skipping unwanted sitemap variants.
- if (NULL !== $variants && !in_array($variant_name, (array) $variants)) {
- continue;
- }
-
- $type = $variant_definition['type'];
-
- // Adding generate_sitemap operations for all data sets.
- foreach ($type_definitions[$type]['urlGenerators'] as $url_generator_id) {
-
- $data_sets = $this->manager->getUrlGenerator($url_generator_id)
- ->setSitemapVariant($variant_name)
- ->getDataSets();
-
- if (!empty($data_sets)) {
- $sitemap_variants[$variant_name]['data'] = TRUE;
- foreach ($data_sets as $data_set) {
- $all_data_sets[] = [
- 'data' => $data_set,
- 'sitemap_variant' => $variant_name,
- 'url_generator' => $url_generator_id,
- 'sitemap_generator' => $type_definitions[$type]['sitemapGenerator'],
- ];
-
- if (count($all_data_sets) === self::REBUILD_QUEUE_CHUNK_ITEM_SIZE) {
- $this->queueElements($all_data_sets);
- $all_data_sets = [];
- }
- }
- }
- }
- }
-
- if (!empty($all_data_sets)) {
- $this->queueElements($all_data_sets);
- }
- $this->getQueuedElementCount(TRUE);
-
- // todo: May not be clean to remove sitemap variants data when queuing elements.
- // todo: Add test.
- // Remove all sitemap variant instances where no results have been queued.
- $this->manager->removeSitemap(array_keys(array_filter($sitemap_variants, function($e) { return empty($e['data']); })));
-
- return $this;
- }
-
- protected function queueElements($elements) {
- $this->queue->createItems($elements);
- $this->state->set('simple_sitemap.queue_items_initial_amount', ($this->state->get('simple_sitemap.queue_items_initial_amount') + count($elements)));
- }
-
- /**
- * @param string $from
- * @return $this
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function generateSitemap($from = 'form') {
-
- $this->generatorSettings = [
- 'base_url' => $this->settings->getSetting('base_url', ''),
- 'default_variant' => $this->settings->getSetting('default_variant', NULL),
- 'skip_untranslated' => $this->settings->getSetting('skip_untranslated', FALSE),
- 'remove_duplicates' => $this->settings->getSetting('remove_duplicates', TRUE),
- 'excluded_languages' => $this->settings->getSetting('excluded_languages', []),
- ];
- $this->maxLinks = $this->settings->getSetting('max_links');
- $max_execution_time = $this->settings->getSetting('generate_duration', 10000);
- Timer::start('simple_sitemap_generator');
-
- $this->unstashResults();
-
- if (!$this->generationInProgress()) {
- $this->rebuildQueue();
- }
-
- while ($element = $this->queue->claimItem()) {
-
- if (!empty($max_execution_time) && Timer::read('simple_sitemap_generator') >= $max_execution_time) {
- break;
- }
-
- try {
- if ($element->data['sitemap_variant'] !== $this->variantProcessedNow) {
-
- if (NULL !== $this->variantProcessedNow) {
- $this->generateVariantChunksFromResults(TRUE);
- $this->publishCurrentVariant();
- }
-
- $this->variantProcessedNow = $element->data['sitemap_variant'];
- $this->generatorProcessedNow = $element->data['sitemap_generator'];
- $this->processedPaths = [];
- }
-
- $this->generateResultsFromElement($element);
-
- if (!empty($this->maxLinks) && count($this->results) >= $this->maxLinks) {
- $this->generateVariantChunksFromResults();
- }
- }
- catch (\Exception $e) {
- watchdog_exception('simple_sitemap', $e);
- }
-
- $this->queue->deleteItem($element); //todo May want to use deleteItems() instead.
- $this->elementsRemaining--;
- }
-
- if ($this->getQueuedElementCount() === 0) {
- $this->generateVariantChunksFromResults(TRUE);
- $this->publishCurrentVariant();
- }
- else {
- $this->stashResults();
- }
-
- return $this;
- }
-
- /**
- * @param $element
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- protected function generateResultsFromElement($element) {
- $results = $this->manager->getUrlGenerator($element->data['url_generator'])
- ->setSitemapVariant($this->variantProcessedNow)
- ->setSettings($this->generatorSettings)
- ->generate($element->data['data']);
-
- $this->removeDuplicates($results);
- $this->results = array_merge($this->results, $results);
- }
-
- /**
- * @param array $results
- */
- protected function removeDuplicates(&$results) {
- if ($this->generatorSettings['remove_duplicates'] && !empty($results)) {
- $result = $results[key($results)];
- if (!empty($result['meta']['path'])) {
- if (in_array($result['meta']['path'], $this->processedPaths)) {
- $results = [];
- }
- else {
- $this->processedPaths[] = $result['meta']['path'];
- }
- }
- }
- }
-
- /**
- * @param bool $complete
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- protected function generateVariantChunksFromResults($complete = FALSE) {
- if (!empty($this->results)) {
- $generator = $this->manager->getSitemapGenerator($this->generatorProcessedNow)
- ->setSitemapVariant($this->variantProcessedNow)
- ->setSettings($this->generatorSettings);
-
- if (empty($this->maxLinks) || $complete) {
- $generator->generate($this->results);
- $this->results = [];
- }
- else {
- foreach (array_chunk($this->results, $this->maxLinks, TRUE) as $chunk_links) {
- if (count($chunk_links) === $this->maxLinks || $complete) {
- $generator->generate($chunk_links);
- $this->results = array_diff_key($this->results, $chunk_links);
- }
- }
- }
- };
- }
-
- protected function publishCurrentVariant() {
- if ($this->variantProcessedNow !== NULL) {
- $this->manager->getSitemapGenerator($this->generatorProcessedNow)
- ->setSitemapVariant($this->variantProcessedNow)
- ->setSettings($this->generatorSettings)
- ->generateIndex()
- ->publish();
- }
- }
-
- protected function stashResults() {
- $this->state->set('simple_sitemap.queue_stashed_results', [
- 'variant' => $this->variantProcessedNow,
- 'generator' => $this->generatorProcessedNow,
- 'results' => $this->results,
- 'processed_paths' => $this->processedPaths,
- ]);
- $this->results = [];
- $this->processedPaths = [];
- $this->generatorProcessedNow = NULL;
- $this->variantProcessedNow = NULL;
- }
-
- protected function unstashResults() {
- if (NULL !== $results = $this->state->get('simple_sitemap.queue_stashed_results')) {
- $this->state->delete('simple_sitemap.queue_stashed_results');
- $this->results = !empty($results['results']) ? $results['results'] : [];
- $this->processedPaths = !empty($results['processed_paths']) ? $results['processed_paths'] : [];
- $this->variantProcessedNow = $results['variant'];
- $this->generatorProcessedNow = $results['generator'];
- }
- }
-
- public function getInitialElementCount() {
- if (NULL === $this->elementsTotal) {
- $this->elementsTotal = (int) $this->state->get('simple_sitemap.queue_items_initial_amount', 0);
- }
-
- return $this->elementsTotal;
- }
-
- /**
- * @param bool $force_recount
- * @return int
- */
- public function getQueuedElementCount($force_recount = FALSE) {
- if ($force_recount || NULL === $this->elementsRemaining) {
- $this->elementsRemaining = $this->queue->numberOfItems();
- }
-
- return $this->elementsRemaining;
- }
-
- /**
- * @return int
- */
- public function getStashedResultCount() {
- return count($this->state->get('simple_sitemap.queue_stashed_results', ['results' => []])['results']);
- }
-
- /**
- * @return int
- */
- public function getProcessedElementCount() {
- $initial = $this->getInitialElementCount();
- $remaining = $this->getQueuedElementCount();
-
- return $initial > $remaining ? ($initial - $remaining) : 0;
- }
-
- /**
- * @return bool
- */
- public function generationInProgress() {
- return 0 < ($this->getQueuedElementCount() + $this->getStashedResultCount());
- }
-}
-
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/SimplesitemapQueue.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/SimplesitemapQueue.php
deleted file mode 100644
index 7aab35f59..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Queue/SimplesitemapQueue.php
+++ /dev/null
@@ -1,82 +0,0 @@
-connection->queryRange('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', 0, 1, [':name' => $this->name])->fetchObject();
- if ($item) {
- $item->data = unserialize($item->data);
- return $item;
- }
- }
- catch (\Exception $e) {
- $this->catchException($e);
- }
-
- return FALSE;
- }
-
- public function createItems($data_sets) {
- $try_again = FALSE;
- try {
- $id = $this->doCreateItems($data_sets);
- }
- catch (\Exception $e) {
- // If there was an exception, try to create the table.
- if (!$try_again = $this->ensureTableExists()) {
- // If the exception happened for other reason than the missing table,
- // propagate the exception.
- throw $e;
- }
- }
- // Now that the table has been created, try again if necessary.
- if ($try_again) {
- $id = $this->doCreateItems($data_sets);
- }
-
- return $id;
- }
-
- protected function doCreateItems($data_sets) {
- $query = $this->connection->insert(static::TABLE_NAME)
- ->fields(['name', 'data', 'created']);
-
- foreach ($data_sets as $i => $data) {
- $query->values([
- $this->name,
- serialize($data),
- time(),
- ]);
- }
-
- return $query->execute();
- }
-
- public function deleteItems($item_ids) {
- try {
- $this->connection->delete(static::TABLE_NAME)
- ->condition('item_id', $item_ids, 'IN')
- ->execute();
- }
- catch (\Exception $e) {
- $this->catchException($e);
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/Simplesitemap.php b/sites/all/modules/contrib/admin/simple_sitemap/src/Simplesitemap.php
deleted file mode 100644
index b96c0f0f9..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/Simplesitemap.php
+++ /dev/null
@@ -1,948 +0,0 @@
- ['index', 'priority', 'changefreq', 'include_images'],
- 'custom' => ['priority', 'changefreq'],
- ];
-
- /**
- * @var array
- */
- protected static $linkSettingDefaults = [
- 'index' => FALSE,
- 'priority' => '0.5',
- 'changefreq' => '',
- 'include_images' => FALSE,
- ];
-
- /**
- * Simplesitemap constructor.
- * @param \Drupal\simple_sitemap\EntityHelper $entity_helper
- * @param \Drupal\simple_sitemap\SimplesitemapSettings $settings
- * @param \Drupal\simple_sitemap\SimplesitemapManager $manager
- * @param \Drupal\Core\Config\ConfigFactory $config_factory
- * @param \Drupal\Core\Database\Connection $database
- * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
- * @param \Drupal\Core\Entity\EntityTypeBundleInfoInterface $entity_type_bundle_info
- * @param \Drupal\Core\Path\PathValidator $path_validator
- * @param \Drupal\Core\Datetime\DateFormatter $date_formatter
- * @param \Drupal\Component\Datetime\Time $time
- * @param \Drupal\simple_sitemap\Queue\QueueWorker $queue_worker
- */
- public function __construct(
- EntityHelper $entity_helper,
- SimplesitemapSettings $settings,
- SimplesitemapManager $manager,
- ConfigFactory $config_factory,
- Connection $database,
- EntityTypeManagerInterface $entity_type_manager,
- EntityTypeBundleInfoInterface $entity_type_bundle_info,
- PathValidator $path_validator,
- DateFormatter $date_formatter,
- Time $time,
- QueueWorker $queue_worker
- ) {
- $this->entityHelper = $entity_helper;
- $this->settings = $settings;
- $this->manager = $manager;
- $this->configFactory = $config_factory;
- $this->db = $database;
- $this->entityTypeManager = $entity_type_manager;
- $this->entityTypeBundleInfo = $entity_type_bundle_info;
- $this->pathValidator = $path_validator;
- $this->dateFormatter = $date_formatter;
- $this->time = $time;
- $this->queueWorker = $queue_worker;
- }
-
- /**
- * Returns a specific sitemap setting or a default value if setting does not
- * exist.
- *
- * @param string $name
- * Name of the setting, like 'max_links'.
- *
- * @param mixed $default
- * Value to be returned if the setting does not exist in the configuration.
- *
- * @return mixed
- * The current setting from configuration or a default value.
- */
- public function getSetting($name, $default = FALSE) {
- return $this->settings->getSetting($name, $default);
- }
-
- /**
- * Stores a specific sitemap setting in configuration.
- *
- * @param string $name
- * Setting name, like 'max_links'.
- *
- * @param mixed $setting
- * The setting to be saved.
- *
- * @return $this
- */
- public function saveSetting($name, $setting) {
- $this->settings->saveSetting($name, $setting);
- return $this;
- }
-
- /**
- * @return \Drupal\simple_sitemap\Queue\QueueWorker
- */
- public function getQueueWorker() {
- return $this->queueWorker;
- }
-
- /**
- * @return \Drupal\simple_sitemap\SimplesitemapManager
- */
- public function getSitemapManager() {
- return $this->manager;
- }
-
- /**
- * @param array|string|true|null $variants
- * array: Array of variants to be set.
- * string: A particular variant to be set.
- * null: Default variant will be set.
- * true: All existing variants will be set.
- *
- * @return $this
- */
- public function setVariants($variants = NULL) {
- if (NULL === $variants) {
- $this->variants = FALSE !== ($default_variant = $this->getSetting('default_variant')) ? [$default_variant] : [];
- }
- elseif ($variants === TRUE) {
- $this->variants = array_keys(
- $this->manager->getSitemapVariants(NULL, FALSE));
- }
- else {
- $this->variants = (array) $variants;
- }
-
- return $this;
- }
-
- /**
- * Gets the currently set variants, the default variant, or all variants.
- *
- * @param bool $default_get_all
- * If true and no variants are set, all variants are returned. If false and
- * no variants are set, only the default variant is returned.
- *
- * @return array
- */
- protected function getVariants($default_get_all = TRUE) {
- if (NULL === $this->variants) {
- $this->setVariants($default_get_all ? TRUE : NULL);
- }
-
- return $this->variants;
- }
-
- /**
- * Returns the whole sitemap, a requested sitemap chunk,
- * or the sitemap index file.
- *
- * @param int $delta
- *
- * @return string|false
- * If no sitemap delta is provided, either a sitemap index is returned, or the
- * whole sitemap variant, if the amount of links does not exceed the max
- * links setting. If a sitemap delta is provided, a sitemap chunk is returned.
- * Returns false if the sitemap is not retrievable from the database.
- */
- public function getSitemap($delta = NULL) {
- $chunk_info = $this->fetchSitemapVariantInfo();
-
- if (empty($delta) || !isset($chunk_info[$delta])) {
-
- if (isset($chunk_info[SitemapGeneratorBase::INDEX_DELTA])) {
- // Return sitemap index if one exists.
- return $this->fetchSitemapChunk($chunk_info[SitemapGeneratorBase::INDEX_DELTA]->id)
- ->sitemap_string;
- }
- else {
- // Return sitemap chunk if there is only one chunk.
- return isset($chunk_info[SitemapGeneratorBase::FIRST_CHUNK_DELTA])
- ? $this->fetchSitemapChunk($chunk_info[SitemapGeneratorBase::FIRST_CHUNK_DELTA]->id)
- ->sitemap_string
- : FALSE;
- }
- }
- else {
- // Return specific sitemap chunk.
- return $this->fetchSitemapChunk($chunk_info[$delta]->id)->sitemap_string;
- }
- }
-
- /**
- * Fetches info about all published sitemap variants and their chunks.
- *
- * @return array
- * An array containing all published sitemap chunk IDs, deltas and creation
- * timestamps keyed by the currently set variants, or in case of only one
- * variant set the above keyed by sitemap delta.
- */
- protected function fetchSitemapVariantInfo() {
- $result = $this->db->select('simple_sitemap', 's')
- ->fields('s', ['id', 'delta', 'sitemap_created', 'type'])
- ->condition('s.status', 1)
- ->condition('s.type', $this->getVariants(), 'IN')
- ->execute();
-
- return count($this->getVariants()) > 1
- ? $result->fetchAllAssoc('type')
- : $result->fetchAllAssoc('delta');
- }
-
- /**
- * Fetches a single sitemap chunk by ID.
- *
- * @param int $id
- * The chunk ID.
- *
- * @return object
- * A sitemap chunk object.
- */
- protected function fetchSitemapChunk($id) {
- return $this->db->query('SELECT * FROM {simple_sitemap} WHERE id = :id',
- [':id' => $id])->fetchObject();
- }
-
- /**
- * Removes sitemap instances for the currently set variants.
- *
- * @return $this
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function removeSitemap() {
- $this->manager->removeSitemap($this->getVariants(FALSE));
-
- return $this;
- }
-
- /**
- * Generates all sitemaps.
- *
- * @param string $from
- * Can be 'form', 'drush', 'cron' and 'backend'.
- *
- * @return $this
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- *
- * @todo Respect $this->variants and generate for specific variants.
- * @todo Implement lock functionality.
- */
- public function generateSitemap($from = 'form') {
- switch($from) {
- case 'form':
- case 'drush':
- $this->queueWorker->batchGenerateSitemap($from);
- break;
-
- case 'cron':
- case 'backend':
- $this->queueWorker->generateSitemap($from);
- break;
- }
-
- return $this;
- }
-
- /**
- * Rebuilds the queue for the currently set variants.
- *
- * @return $this
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function rebuildQueue() {
- $this->queueWorker->rebuildQueue($this->getVariants());
-
- return $this;
- }
-
- /**
- * Returns a 'time ago' string of last timestamp generation.
- *
- * @param string|null $variant
- *
- * @return string|array|false
- * Formatted timestamp of last sitemap generation, otherwise FALSE.
- */
-/* public function getGeneratedAgo() {
- $chunks = $this->fetchSitemapVariantInfo();
- return isset($chunks[DefaultSitemapGenerator::FIRST_CHUNK_DELTA]->sitemap_created)
- ? $this->dateFormatter
- ->formatInterval($this->time->getRequestTime() - $chunks[DefaultSitemapGenerator::FIRST_CHUNK_DELTA]
- ->sitemap_created)
- : FALSE;
- }*/
-
- /**
- * Enables sitemap support for an entity type. Enabled entity types show
- * sitemap settings on their bundle setting forms. If an enabled entity type
- * features bundles (e.g. 'node'), it needs to be set up with
- * setBundleSettings() as well.
- *
- * @param string $entity_type_id
- * Entity type id like 'node'.
- *
- * @return $this
- */
- public function enableEntityType($entity_type_id) {
- $enabled_entity_types = $this->getSetting('enabled_entity_types');
- if (!in_array($entity_type_id, $enabled_entity_types)) {
- $enabled_entity_types[] = $entity_type_id;
- $this->saveSetting('enabled_entity_types', $enabled_entity_types);
- }
- return $this;
- }
-
- /**
- * Disables sitemap support for an entity type. Disabling support for an
- * entity type deletes its sitemap settings permanently and removes sitemap
- * settings from entity forms.
- *
- * @param string $entity_type_id
- *
- * @return $this
- */
- public function disableEntityType($entity_type_id) {
-
- // Updating settings.
- $enabled_entity_types = $this->getSetting('enabled_entity_types');
- if (FALSE !== ($key = array_search($entity_type_id, $enabled_entity_types))) {
- unset ($enabled_entity_types[$key]);
- $this->saveSetting('enabled_entity_types', array_values($enabled_entity_types));
- }
-
- // Deleting inclusion settings.
- $config_names = $this->configFactory->listAll('simple_sitemap.bundle_settings.');
- foreach ($config_names as $config_name) {
- $config_name_parts = explode('.', $config_name);
- if ($config_name_parts[3] === $entity_type_id) {
- $this->configFactory->getEditable($config_name)->delete();
- }
- }
-
- // Deleting entity overrides.
- $this->setVariants(TRUE)->removeEntityInstanceSettings($entity_type_id);
-
- return $this;
- }
-
- /**
- * Sets settings for bundle or non-bundle entity types. This is done for the
- * currently set variant.
- *
- * @param $entity_type_id
- * @param null $bundle_name
- * @param array $settings
- *
- * @return $this
- *
- * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
- * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
- *
- * @todo: enableEntityType automatically
- * @todo multiple variants
- */
- public function setBundleSettings($entity_type_id, $bundle_name = NULL, $settings = ['index' => TRUE]) {
- if (empty($variants = $this->getVariants(FALSE))) {
- return $this;
- }
-
- $bundle_name = NULL !== $bundle_name ? $bundle_name : $entity_type_id;
-
- if (!empty($old_settings = $this->getBundleSettings($entity_type_id, $bundle_name))) {
- $settings = array_merge($old_settings, $settings);
- }
- self::supplementDefaultSettings('entity', $settings);
-
- if ($settings != $old_settings) {
-
- // Save new bundle settings to configuration.
- $bundle_settings = $this->configFactory
- ->getEditable("simple_sitemap.bundle_settings.$variants[0].$entity_type_id.$bundle_name");
- foreach ($settings as $setting_key => $setting) {
- $bundle_settings->set($setting_key, $setting);
- }
- $bundle_settings->save();
-
- // Delete entity overrides which are identical to new bundle settings.
- $entity_ids = $this->entityHelper->getEntityInstanceIds($entity_type_id, $bundle_name);
- $query = $this->db->select('simple_sitemap_entity_overrides', 'o')
- ->fields('o', ['id', 'inclusion_settings'])
- ->condition('o.entity_type', $entity_type_id)
- ->condition('o.type', $variants[0]);
- if (!empty($entity_ids)) {
- $query->condition('o.entity_id', $entity_ids, 'IN');
- }
-
- $delete_instances = [];
- foreach ($query->execute()->fetchAll() as $result) {
- $delete = TRUE;
- $instance_settings = unserialize($result->inclusion_settings);
- foreach ($instance_settings as $setting_key => $instance_setting) {
- if ($instance_setting != $settings[$setting_key]) {
- $delete = FALSE;
- break;
- }
- }
- if ($delete) {
- $delete_instances[] = $result->id;
- }
- }
- if (!empty($delete_instances)) {
- $this->db->delete('simple_sitemap_entity_overrides')
- ->condition('id', $delete_instances, 'IN')
- ->execute();
- }
- }
-
- return $this;
- }
-
- /**
- * Gets settings for bundle or non-bundle entity types. This is done for the
- * currently set variants.
- *
- * @param string|null $entity_type_id
- * Limit the result set to a specific entity type.
- *
- * @param string|null $bundle_name
- * Limit the result set to a specific bundle name.
- *
- * @param bool $supplement_defaults
- * Supplements the result set with default custom link settings.
- *
- * @param bool $multiple_variants
- * If true, returns an array of results keyed by variant name, otherwise it
- * returns the result set for the first variant only.
- *
- * @return array|false
- * Array of settings or array of settings keyed by variant name. False if
- * entity type does not exist.
- */
- public function getBundleSettings($entity_type_id = NULL, $bundle_name = NULL, $supplement_defaults = TRUE, $multiple_variants = FALSE) {
-
- $all_bundle_settings = [];
-
- foreach ($variants = $this->getVariants(FALSE) as $variant) {
- if (NULL !== $entity_type_id) {
- $bundle_name = NULL !== $bundle_name ? $bundle_name : $entity_type_id;
-
- $bundle_settings = $this->configFactory
- ->get("simple_sitemap.bundle_settings.$variant.$entity_type_id.$bundle_name")
- ->get();
-
- // If not found and entity type is enabled, return default bundle settings.
- if (empty($bundle_settings) && $supplement_defaults) {
- if ($this->entityTypeIsEnabled($entity_type_id)
- && isset($this->entityTypeBundleInfo->getBundleInfo($entity_type_id)[$bundle_name])) {
- self::supplementDefaultSettings('entity', $bundle_settings);
- }
- else {
- $bundle_settings = NULL;
- }
- }
- }
- else {
- $config_names = $this->configFactory->listAll("simple_sitemap.bundle_settings.$variant.");
- $bundle_settings = [];
- foreach ($config_names as $config_name) {
- $config_name_parts = explode('.', $config_name);
- $bundle_settings[$config_name_parts[3]][$config_name_parts[4]] = $this->configFactory->get($config_name)->get();
- }
-
- // Supplement default bundle settings for all bundles not found in simple_sitemap.bundle_settings.*.* configuration.
- if ($supplement_defaults) {
- foreach ($this->entityHelper->getSupportedEntityTypes() as $type_id => $type_definition) {
- if ($this->entityTypeIsEnabled($type_id)) {
- foreach($this->entityTypeBundleInfo->getBundleInfo($type_id) as $bundle => $bundle_definition) {
- if (!isset($bundle_settings[$type_id][$bundle])) {
- self::supplementDefaultSettings('entity', $bundle_settings[$type_id][$bundle]);
- }
- }
- }
- }
- }
- }
- if ($multiple_variants) {
- if (!empty($bundle_settings)) {
- $all_bundle_settings[$variant] = $bundle_settings;
- }
- }
- else {
- return $bundle_settings;
- }
- }
-
- return $all_bundle_settings;
- }
-
- /**
- * Removes settings for bundle or a non-bundle entity types. This is done for
- * the currently set variants.
- *
- * @param string|null $entity_type_id
- * Limit the removal to a specific entity type.
- *
- * @param string|null $bundle_name
- * Limit the removal to a specific bundle name.
- *
- * @return $this
- *
- * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
- * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
- */
- public function removeBundleSettings($entity_type_id = NULL, $bundle_name = NULL) {
- if (empty($variants = $this->getVariants(FALSE))) {
- return $this;
- }
-
- if (NULL !== $entity_type_id) {
- $bundle_name = NULL !== $bundle_name ? $bundle_name : $entity_type_id;
-
- foreach ($variants as $variant) {
- $this->configFactory
- ->getEditable("simple_sitemap.bundle_settings.$variant.$entity_type_id.$bundle_name")->delete();
- }
-
- $this->removeEntityInstanceSettings($entity_type_id, (
- empty($ids)
- ? NULL
- : $this->entityHelper->getEntityInstanceIds($entity_type_id, $bundle_name)
- ));
- }
- else {
- foreach ($variants as $variant) {
- $config_names = $this->configFactory->listAll("simple_sitemap.bundle_settings.$variant.");
- foreach ($config_names as $config_name) {
- $this->configFactory->getEditable($config_name)->delete();
- }
- $this->removeEntityInstanceSettings();
- }
- }
-
- return $this;
- }
-
- /**
- * Supplements all missing link setting with default values.
- *
- * @param string $type
- * Can be 'entity' or 'custom'.
- *
- * @param array &$settings
- * @param array $overrides
- */
- public static function supplementDefaultSettings($type, &$settings, $overrides = []) {
- foreach (self::$allowedLinkSettings[$type] as $allowed_link_setting) {
- if (!isset($settings[$allowed_link_setting])
- && isset(self::$linkSettingDefaults[$allowed_link_setting])) {
- $settings[$allowed_link_setting] = isset($overrides[$allowed_link_setting])
- ? $overrides[$allowed_link_setting]
- : self::$linkSettingDefaults[$allowed_link_setting];
- }
- }
- }
-
- /**
- * Overrides sitemap settings for a single entity for the currently set
- * variants.
- *
- * @param string $entity_type_id
- * @param string $id
- * @param array $settings
- *
- * @return $this
- *
- * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
- * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
- */
- public function setEntityInstanceSettings($entity_type_id, $id, $settings) {
- if (empty($variants = $this->getVariants(FALSE))) {
- return $this;
- }
-
- $entity = $this->entityTypeManager->getStorage($entity_type_id)->load($id);
-
- $all_bundle_settings = $this->getBundleSettings(
- $entity_type_id, $this->entityHelper->getEntityInstanceBundleName($entity), TRUE, TRUE
- );
-
- foreach ($all_bundle_settings as $variant => $bundle_settings) {
- if (!empty($bundle_settings)) {
-
- // Check if overrides are different from bundle setting before saving.
- $override = FALSE;
- foreach ($settings as $key => $setting) {
- if (!isset($bundle_settings[$key]) || $setting != $bundle_settings[$key]) {
- $override = TRUE;
- break;
- }
- }
-
- // Save overrides for this entity if something is different.
- if ($override) {
- $this->db->merge('simple_sitemap_entity_overrides')
- ->keys([
- 'type' => $variant,
- 'entity_type' => $entity_type_id,
- 'entity_id' => $id])
- ->fields([
- 'type' => $variant,
- 'entity_type' => $entity_type_id,
- 'entity_id' => $id,
- 'inclusion_settings' => serialize(array_merge($bundle_settings, $settings))])
- ->execute();
- }
- // Else unset override.
- else {
- $this->removeEntityInstanceSettings($entity_type_id, $id);
- }
- }
- }
-
- return $this;
- }
-
- /**
- * Gets sitemap settings for an entity instance which overrides bundle
- * settings, or gets bundle settings, if they are not overridden. This is
- * done for the currently set variant.
- *
- * @param string $entity_type_id
- * @param string $id
- *
- * @return array|false
- * Array of entity instance settings or the settings of its bundle. False if
- * entity type does not exist.
- *
- * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
- * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
- *
- * @todo multiple variants
- */
- public function getEntityInstanceSettings($entity_type_id, $id) {
- if (empty($variants = $this->getVariants(FALSE))) {
- return FALSE;
- }
-
- $results = $this->db->select('simple_sitemap_entity_overrides', 'o')
- ->fields('o', ['inclusion_settings'])
- ->condition('o.type', $variants[0])
- ->condition('o.entity_type', $entity_type_id)
- ->condition('o.entity_id', $id)
- ->execute()
- ->fetchField();
-
- if (!empty($results)) {
- return unserialize($results);
- }
- else {
- $entity = $this->entityTypeManager->getStorage($entity_type_id)
- ->load($id);
- return $this->getBundleSettings(
- $entity_type_id,
- $this->entityHelper->getEntityInstanceBundleName($entity)
- );
- }
- }
-
- /**
- * Removes sitemap settings for entities that override bundle settings. This
- * is done for the currently set variants.
- *
- * @param string|null $entity_type_id
- * Limits the removal to a certain entity type.
- *
- * @param string|null $entity_ids
- * Limits the removal to entities with certain IDs.
- *
- * @return $this
- */
- public function removeEntityInstanceSettings($entity_type_id = NULL, $entity_ids = NULL) {
- if (empty($variants = $this->getVariants(FALSE))) {
- return $this;
- }
-
- $query = $this->db->delete('simple_sitemap_entity_overrides')
- ->condition('type', $variants, 'IN');
-
- if (NULL !== $entity_type_id) {
- $query->condition('entity_type', $entity_type_id);
-
- if (NULL !== $entity_ids) {
- $query->condition('entity_id', (array) $entity_ids, 'IN');
- }
- }
-
- $query->execute();
-
- return $this;
- }
-
- /**
- * Checks if an entity bundle (or a non-bundle entity type) is set to be
- * indexed for the currently set variant.
- *
- * @param string $entity_type_id
- * @param string|null $bundle_name
- *
- * @return bool
- *
- * @todo multiple variants?
- */
- public function bundleIsIndexed($entity_type_id, $bundle_name = NULL) {
- $settings = $this->getBundleSettings($entity_type_id, $bundle_name);
- return !empty($settings['index']);
- }
-
- /**
- * Checks if an entity type is enabled in the sitemap settings.
- *
- * @param string $entity_type_id
- *
- * @return bool
- */
- public function entityTypeIsEnabled($entity_type_id) {
- return in_array($entity_type_id, $this->getSetting('enabled_entity_types', []));
- }
-
- /**
- * Stores a custom path along with its settings to configuration for the
- * currently set variants.
- *
- * @param string $path
- *
- * @param array $settings
- * Settings that are not provided are supplemented by defaults.
- *
- * @return $this
- *
- * @todo Validate $settings and throw exceptions
- */
- public function addCustomLink($path, $settings = []) {
- if (empty($variants = $this->getVariants(FALSE))) {
- return $this;
- }
-
- if (!(bool) $this->pathValidator->getUrlIfValidWithoutAccessCheck($path)) {
- // todo: log error.
- return $this;
- }
- if ($path[0] !== '/') {
- // todo: log error.
- return $this;
- }
-
- $variant_links = $this->getCustomLinks(NULL, FALSE, TRUE);
- foreach ($variants as $variant) {
- $links = [];
- $link_key = 0;
- if (isset($variant_links[$variant])) {
- $links = $variant_links[$variant];
- $link_key = count($links);
- foreach ($links as $key => $link) {
- if ($link['path'] === $path) {
- $link_key = $key;
- break;
- }
- }
- }
-
- $links[$link_key] = ['path' => $path] + $settings;
- $this->configFactory->getEditable("simple_sitemap.custom_links.$variant")
- ->set('links', $links)->save();
- }
-
- return $this;
- }
-
- /**
- * Gets custom link settings for the currently set variants.
- *
- * @param string|null $path
- * Limits the result set by an internal path.
- *
- * @param bool $supplement_defaults
- * Supplements the result set with default custom link settings.
- *
- * @param bool $multiple_variants
- * If true, returns an array of results keyed by variant name, otherwise it
- * returns the result set for the first variant only.
- *
- * @return array|mixed|null
- */
- public function getCustomLinks($path = NULL, $supplement_defaults = TRUE, $multiple_variants = FALSE) {
- $all_custom_links = [];
- foreach ($variants = $this->getVariants(FALSE) as $variant) {
- $custom_links = $this->configFactory
- ->get("simple_sitemap.custom_links.$variant")
- ->get('links');
-
- $custom_links = !empty($custom_links) ? $custom_links : [];
-
- if (!empty($custom_links) && $path !== NULL) {
- foreach ($custom_links as $key => $link) {
- if ($link['path'] !== $path) {
- unset($custom_links[$key]);
- }
- }
- }
-
- if (!empty($custom_links) && $supplement_defaults) {
- foreach ($custom_links as $i => $link_settings) {
- self::supplementDefaultSettings('custom', $link_settings);
- $custom_links[$i] = $link_settings;
- }
- }
-
- $custom_links = $path !== NULL && !empty($custom_links)
- ? array_values($custom_links)[0]
- : array_values($custom_links);
-
-
- if (!empty($custom_links)) {
- if ($multiple_variants) {
- $all_custom_links[$variant] = $custom_links;
- }
- else {
- return $custom_links;
- }
- }
- }
-
- return $all_custom_links;
- }
-
- /**
- * Removes custom links from currently set variants.
- *
- * @param array|null $paths
- * Limits the removal to certain paths.
- *
- * @return $this
- */
- public function removeCustomLinks($paths = NULL) {
- if (empty($variants = $this->getVariants(FALSE))) {
- return $this;
- }
-
- if (NULL === $paths) {
- foreach ($variants as $variant) {
- $this->configFactory
- ->getEditable("simple_sitemap.custom_links.$variant")->delete();
- }
- }
- else {
- $variant_links = $this->getCustomLinks(NULL, FALSE, TRUE);
- foreach ($variant_links as $variant => $links) {
- $custom_links = $links;
- $save = FALSE;
- foreach ((array) $paths as $path) {
- foreach ($custom_links as $key => $link) {
- if ($link['path'] === $path) {
- unset($custom_links[$key]);
- $save = TRUE;
- break 2;
- }
- }
- }
- if ($save) {
- $this->configFactory->getEditable("simple_sitemap.custom_links.$variant")
- ->set('links', array_values($custom_links))->save();
- }
- }
- }
-
- return $this;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapManager.php b/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapManager.php
deleted file mode 100644
index 6acc48200..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapManager.php
+++ /dev/null
@@ -1,316 +0,0 @@
-configFactory = $config_factory;
- $this->db = $database;
- $this->sitemapTypeManager = $sitemap_type_manager;
- $this->urlGeneratorManager = $url_generator_manager;
- $this->sitemapGeneratorManager = $sitemap_generator_manager;
- $this->settings = $settings;
- }
-
- /**
- * @param string $sitemap_generator_id
- * @return \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapGenerator\SitemapGeneratorBase
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function getSitemapGenerator($sitemap_generator_id) {
- if (!isset($this->sitemapGenerators[$sitemap_generator_id])) {
- $this->sitemapGenerators[$sitemap_generator_id]
- = $this->sitemapGeneratorManager->createInstance($sitemap_generator_id);
- }
-
- return $this->sitemapGenerators[$sitemap_generator_id];
- }
-
- /**
- * @param string $url_generator_id
- * @return \Drupal\simple_sitemap\Plugin\simple_sitemap\UrlGenerator\UrlGeneratorBase
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function getUrlGenerator($url_generator_id) {
- if (!isset($this->urlGenerators[$url_generator_id])) {
- $this->urlGenerators[$url_generator_id]
- = $this->urlGeneratorManager->createInstance($url_generator_id);
- }
-
- return $this->urlGenerators[$url_generator_id];
- }
-
- /**
- * @return \Drupal\simple_sitemap\Plugin\simple_sitemap\SitemapType\SitemapTypeBase[]
- */
- public function getSitemapTypes() {
- if (empty($this->sitemapTypes)) {
- $this->sitemapTypes = $this->sitemapTypeManager->getDefinitions();
- }
-
- return $this->sitemapTypes;
- }
-
- /**
- * @param string|null $sitemap_type
- * @param bool $attach_type_info
- * @return array
- */
- public function getSitemapVariants($sitemap_type = NULL, $attach_type_info = TRUE) {
- if (NULL === $sitemap_type) {
- $variants = [];
- foreach ($this->configFactory->listAll('simple_sitemap.variants.') as $config_name) {
- $config_name_parts = explode('.', $config_name);
- $saved_variants = $this->configFactory->get($config_name)->get('variants');
- $saved_variants = $attach_type_info ? $this->attachSitemapTypeToVariants($saved_variants, $config_name_parts[2]) : $saved_variants;
- $variants = array_merge($variants, (is_array($saved_variants) ? $saved_variants : []));
- }
- }
- else {
- $variants = $this->configFactory->get("simple_sitemap.variants.$sitemap_type")->get('variants');
- $variants = is_array($variants) ? $variants : [];
- $variants = $attach_type_info ? $this->attachSitemapTypeToVariants($variants, $sitemap_type) : $variants;
- }
- array_multisort(array_column($variants, "weight"), SORT_ASC, $variants);
- return $variants;
- }
-
- /**
- * @param array $variants
- * @param string $type
- * @return array
- */
- protected function attachSitemapTypeToVariants(array $variants, $type) {
- return array_map(function($variant) use ($type) { return $variant + ['type' => $type]; }, $variants);
- }
-
- /**
- * @param array $variants
- * @return array
- */
- protected function detachSitemapTypeFromVariants(array $variants) {
- return array_map(function($variant) { unset($variant['type']); return $variant; }, $variants);
- }
-
- /**
- * @param string $name
- * @param array $definition
- * @return $this
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function addSitemapVariant($name, $definition = []) {
- $all_variants = $this->getSitemapVariants();
- if (isset($all_variants[$name])) {
- $old_variant = $all_variants[$name];
- if (!empty($definition['type']) && $old_variant['type'] !== $definition['type']) {
- $this->removeSitemapVariants($name);
- unset($old_variant);
- }
- else {
- unset($old_variant['type']);
- }
- }
-
- if (!isset($old_variant) && empty($definition['label'])) {
- $definition['label'] = (string) $name;
- }
-
- if (!isset($old_variant) && empty($definition['type'])) {
- $definition['type'] = self::DEFAULT_SITEMAP_TYPE;
- }
-
- if (isset($definition['weight'])) {
- $definition['weight'] = (int) $definition['weight'];
- }
- elseif (!isset($old_variant)) {
- $definition['weight'] = 0;
- }
-
- if (isset($old_variant)) {
- $definition = $definition + $old_variant;
- }
-
- $variants = array_merge($this->getSitemapVariants($definition['type'], FALSE), [$name => ['label' => $definition['label'], 'weight' => $definition['weight']]]);
- $this->configFactory->getEditable('simple_sitemap.variants.' . $definition['type'])
- ->set('variants', $variants)
- ->save();
-
- return $this;
- }
-
- /**
- * @param null|array|string $variant_names
- * Limit removal by specific variants.
- *
- * @return $this
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function removeSitemap($variant_names = NULL) {
- if (NULL === $variant_names || !empty((array) $variant_names)) {
- $saved_variants = $this->getSitemapVariants();
- $remove_variants = NULL === $variant_names
- ? $saved_variants
- : array_intersect_key($saved_variants, array_flip((array) $variant_names));
-
- if (!empty($remove_variants)) {
- $type_definitions = $this->getSitemapTypes();
- foreach ($remove_variants as $variant_name => $variant_definition) {
- $this->getSitemapGenerator($type_definitions[$variant_definition['type']]['sitemapGenerator'])
- ->setSitemapVariant($variant_name)
- ->remove();
- }
- }
- }
-
- return $this;
- }
-
- /**
- * @param null|array|string $variant_names
- * Limit removal by specific variants.
- *
- * @return $this
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function removeSitemapVariants($variant_names = NULL) {
- if (NULL === $variant_names || !empty((array) $variant_names)) {
-
- // Remove sitemap instances.
- $this->removeSitemap($variant_names);
-
- if (NULL === $variant_names) {
- // Remove all variants and their bundle settings.
- foreach(['variants', 'bundle_settings', 'custom_links'] as $config_name_part) {
- foreach ($this->configFactory->listAll("simple_sitemap.$config_name_part.") as $config_name) {
- $this->configFactory->getEditable($config_name)->delete();
- }
- }
- }
- else {
- // Remove bundle settings for specific variants.
- foreach ((array) $variant_names as $variant_name) {
- foreach ($this->configFactory->listAll("simple_sitemap.bundle_settings.$variant_name.") as $config_name) {
- $this->configFactory->getEditable($config_name)->delete();
- }
- }
-
- // Remove custom links for specific variants.
- foreach ((array) $variant_names as $variant_name) {
- foreach ($this->configFactory->listAll("simple_sitemap.custom_links.$variant_name") as $config_name) {
- $this->configFactory->getEditable($config_name)->delete();
- }
- }
-
- // Remove specific variants from configuration.
- $remove_variants = [];
- $variants = $this->getSitemapVariants();
- foreach ((array) $variant_names as $variant_name) {
- if (isset($variants[$variant_name])) {
- $remove_variants[$variants[$variant_name]['type']][$variant_name] = $variant_name;
- }
- }
- foreach ($remove_variants as $type => $variants_per_type) {
- $this->configFactory->getEditable("simple_sitemap.variants.$type")
- ->set('variants', array_diff_key($this->getSitemapVariants($type, FALSE), $variants_per_type))
- ->save();
- }
- }
-
- // Remove bundle setting overrides for entities.
- $query = $this->db->delete('simple_sitemap_entity_overrides');
- if (NULL !== $variant_names) {
- $query->condition('type', (array) $variant_names, 'IN');
- }
- $query->execute();
-
-
- // Remove default variant setting.
- if (NULL === $variant_names
- || in_array($this->settings->getSetting('default_variant', ''), (array) $variant_names)) {
- $this->settings->saveSetting('default_variant', '');
- }
- }
-
- return $this;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapSettings.php b/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapSettings.php
deleted file mode 100644
index 929f70350..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/src/SimplesitemapSettings.php
+++ /dev/null
@@ -1,68 +0,0 @@
-configFactory = $config_factory;
- }
-
- /**
- * Returns a specific sitemap setting or a default value if setting does not
- * exist.
- *
- * @param string $name
- * Name of the setting, like 'max_links'.
- *
- * @param mixed $default
- * Value to be returned if the setting does not exist in the configuration.
- *
- * @return mixed
- * The current setting from configuration or a default value.
- */
- public function getSetting($name, $default = FALSE) {
- $setting = $this->configFactory
- ->get('simple_sitemap.settings')
- ->get($name);
- return NULL !== $setting ? $setting : $default;
- }
-
- public function getSettings() {
- return $this->configFactory
- ->get('simple_sitemap.settings')
- ->get();
- }
-
- /**
- * Stores a specific sitemap setting in configuration.
- *
- * @param string $name
- * Setting name, like 'max_links'.
- * @param mixed $setting
- * The setting to be saved.
- *
- * @return $this
- */
- public function saveSetting($name, $setting) {
- $this->configFactory->getEditable('simple_sitemap.settings')
- ->set($name, $setting)->save();
- return $this;
- }
-}
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTest.php b/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTest.php
deleted file mode 100644
index 819c903f9..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTest.php
+++ /dev/null
@@ -1,566 +0,0 @@
-generator->generateSitemap('backend');
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('urlset');
- $this->assertSession()->responseContains(
- Url::fromRoute('')->setAbsolute()->toString()
- );
- $this->assertSession()->responseContains('1.0');
- $this->assertSession()->responseContains('daily');
- }
-
- /**
- * Test custom link.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- */
- public function testAddCustomLink() {
- $this->generator->addCustomLink(
- '/node/' . $this->node->id(),
- ['priority' => 0.2, 'changefreq' => 'monthly']
- )->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseContains('0.2');
- $this->assertSession()->responseContains('monthly');
-
- $this->drupalLogin($this->privilegedUser);
-
- $this->drupalGet('admin/config/search/simplesitemap/custom');
- $this->assertSession()->pageTextContains(
- '/node/' . $this->node->id() . ' 0.2 monthly'
- );
-
- $this->generator->addCustomLink(
- '/node/' . $this->node->id(),
- ['changefreq' => 'yearly']
- )->generateSitemap('backend');
-
- $this->drupalGet('admin/config/search/simplesitemap/custom');
- $this->assertSession()->pageTextContains(
- '/node/' . $this->node->id() . ' yearly'
- );
- }
-
- /**
- * Test default settings of custom links.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- */
- public function testAddCustomLinkDefaults() {
- $this->generator->removeCustomLinks()
- ->addCustomLink('/node/' . $this->node->id())
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseContains('0.5');
- $this->assertSession()->responseNotContains('changefreq');
- }
-
- /**
- * Test removing custom paths from the sitemap settings.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- */
- public function testRemoveCustomLinks() {
-
- // Test removing one custom path from the sitemap.
- $this->generator->addCustomLink('/node/' . $this->node->id())
- ->removeCustomLinks('/node/' . $this->node->id())
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseNotContains('node/' . $this->node->id());
-
- //todo Not working
-// // Test removing all custom paths from the sitemap.
-// $this->generator->removeCustomLinks()
-// ->generateSitemap('backend');
-//
-// $this->drupalGet($this->defaultSitemapUrl);
-// $this->assertSession()->responseNotContains(
-// Url::fromRoute('')->setAbsolute()->toString()
-// );
- }
-
- /**
- * Tests setting bundle settings.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- *
- * @todo Add form tests
- */
- public function testSetBundleSettings() {
- $this->assertFalse($this->generator->bundleIsIndexed('node', 'page'));
-
- // Index new bundle.
- $this->generator->removeCustomLinks()
- ->setBundleSettings('node', 'page', [
- 'index' => TRUE,
- 'priority' => 0.5,
- 'changefreq' => 'hourly',
- ])
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseContains('0.5');
- $this->assertSession()->responseContains('hourly');
-
- $this->assertTrue($this->generator->bundleIsIndexed('node', 'page'));
-
- // Only change bundle priority.
- $this->generator->setBundleSettings('node', 'page', ['priority' => 0.9])
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseNotContains('0.5');
- $this->assertSession()->responseContains('0.9');
-
- // Only change bundle changefreq.
- $this->generator->setBundleSettings(
- 'node',
- 'page',
- ['changefreq' => 'daily']
- )->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseNotContains('hourly');
- $this->assertSession()->responseContains('daily');
-
- // Remove changefreq setting.
- $this->generator->setBundleSettings('node', 'page', ['changefreq' => ''])
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseNotContains('changefreq');
- $this->assertSession()->responseNotContains('daily');
-
- // Index two bundles.
- $this->drupalCreateContentType(['type' => 'blog']);
-
- $node3 = $this->createNode(['title' => 'Node3', 'type' => 'blog']);
- $this->generator->setBundleSettings('node', 'page', ['index' => TRUE])
- ->setBundleSettings('node', 'blog', ['index' => TRUE])
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseContains('node/' . $node3->id());
-
- // todo Now working
-// // Set bundle 'index' setting to false.
-// $this->generator
-// ->setBundleSettings('node', 'page', ['index' => FALSE])
-// ->setBundleSettings('node', 'blog', ['index' => FALSE])
-// ->generateSitemap('backend');
-//
-// $this->drupalGet($this->defaultSitemapUrl);
-//
-// $this->assertSession()->responseNotContains('node/' . $this->node->id());
-// $this->assertSession()->responseNotContains('node/' . $node3->id());
- }
-
- /**
- * Test default settings of bundles.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- */
- public function testSetBundleSettingsDefaults() {
- $this->generator->setBundleSettings('node', 'page')
- ->removeCustomLinks()
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseContains('0.5');
- $this->assertSession()->responseNotContains('changefreq');
- }
-
- /**
- * Test the lastmod parameter in different scenarios.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- */
- public function testLastmod() {
- // Entity links should have 'lastmod'.
- $this->generator->setBundleSettings('node', 'page')
- ->removeCustomLinks()
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('lastmod');
-
- // Entity custom links should have 'lastmod'.
- $this->generator->setBundleSettings('node', 'page', ['index' => FALSE])
- ->addCustomLink('/node/' . $this->node->id())
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('lastmod');
-
- // Non-entity custom links should not have 'lastmod'.
- $this->generator->removeCustomLinks()
- ->addCustomLink('/')
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseNotContains('lastmod');
- }
-
- /**
- * Tests the duplicate setting.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function testRemoveDuplicatesSetting() {
- $this->generator->setBundleSettings('node', 'page')
- ->addCustomLink('/node/1')
- ->saveSetting('remove_duplicates', TRUE)
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertUniqueTextWorkaround('node/' . $this->node->id());
-
- $this->generator->saveSetting('remove_duplicates', FALSE)
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertNoUniqueTextWorkaround('node/' . $this->node->id());
- }
-
- /**
- * Test max links setting and the sitemap index.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- */
- public function testMaxLinksSetting() {
- $this->generator->setBundleSettings('node', 'page')
- ->saveSetting('max_links', 1)
- ->removeCustomLinks()
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('sitemap.xml?page=1');
- $this->assertSession()->responseContains('sitemap.xml?page=2');
-
- $this->drupalGet('sitemap.xml', ['query' => ['page' => 1]]);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseContains('0.5');
- $this->assertSession()->responseNotContains('node/' . $this->node2->id());
-
- $this->drupalGet('sitemap.xml', ['query' => ['page' => 2]]);
- $this->assertSession()->responseContains('node/' . $this->node2->id());
- $this->assertSession()->responseContains('0.5');
- $this->assertSession()->responseNotContains('node/' . $this->node->id());
- }
-
- /**
- * @todo testGenerateDurationSetting
- */
-
- /**
- * Test setting the base URL.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- */
- public function testBaseUrlSetting() {
- $this->generator->setBundleSettings('node', 'page')
- ->saveSetting('base_url', 'http://base_url_test')
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('http://base_url_test');
-
- // Set base URL in the sitemap index.
- $this->generator->saveSetting('max_links', 1)
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('http://base_url_test/sitemap.xml?page=1');
- }
-
- /**
- * Test overriding of bundle settings for a single entity.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- *
- * @todo: Use form testing instead of responseContains().
- */
- public function testSetEntityInstanceSettings() {
- $this->generator->setBundleSettings('node', 'page')
- ->removeCustomLinks()
- ->setEntityInstanceSettings('node', $this->node->id(), ['priority' => 0.1, 'changefreq' => 'never'])
- ->setEntityInstanceSettings('node', $this->node2->id(), ['index' => FALSE])
- ->generateSitemap('backend');
-
- // Test sitemap result.
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseContains('0.1');
- $this->assertSession()->responseContains('never');
- $this->assertSession()->responseNotContains('node/' . $this->node2->id());
- $this->assertSession()->responseNotContains('0.5');
-
- $this->drupalLogin($this->privilegedUser);
-
- // Test UI changes.
- $this->drupalGet('node/' . $this->node->id() . '/edit');
- $this->assertSession()->responseContains('');
- $this->assertSession()->responseContains('');
-
- // Test database changes.
- $result = $this->database->select('simple_sitemap_entity_overrides', 'o')
- ->fields('o', ['inclusion_settings'])
- ->condition('o.entity_type', 'node')
- ->condition('o.entity_id', $this->node->id())
- ->execute()
- ->fetchField();
- $this->assertFalse(empty($result));
-
- $this->generator->setBundleSettings('node', 'page', ['priority' => 0.1, 'changefreq' => 'never'])
- ->generateSitemap('backend');
-
- // Test sitemap result.
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
- $this->assertSession()->responseContains('0.1');
- $this->assertSession()->responseContains('never');
- $this->assertSession()->responseNotContains('node/' . $this->node2->id());
- $this->assertSession()->responseNotContains('0.5');
-
- // Test UI changes.
- $this->drupalGet('node/' . $this->node->id() . '/edit');
- $this->assertSession()->responseContains('');
- $this->assertSession()->responseContains('');
-
- // Test if entity override has been removed from database after its equal to
- // its bundle settings.
- $result = $this->database->select('simple_sitemap_entity_overrides', 'o')
- ->fields('o', ['inclusion_settings'])
- ->condition('o.entity_type', 'node')
- ->condition('o.entity_id', $this->node->id())
- ->execute()
- ->fetchField();
- $this->assertTrue(empty($result));
- }
-
- /**
- * Test indexing an atomic entity (here: a user)
- */
- public function testAtomicEntityIndexation() {
- $user_id = $this->privilegedUser->id();
- $this->generator->setBundleSettings('user')
- ->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseNotContains('user/' . $user_id);
-
- user_role_grant_permissions('anonymous', ['access user profiles']);
- drupal_flush_all_caches(); //todo Not pretty.
-
- $this->generator->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('user/' . $user_id);
- }
-
- /**
- * @todo Test indexing menu.
- */
-
- /**
- * @todo Test deleting a bundle.
- */
-
- /**
- * Test disabling sitemap support for an entity type.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- */
- public function testDisableEntityType() {
- $this->generator->setBundleSettings('node', 'page')
- ->disableEntityType('node');
-
- $this->drupalLogin($this->privilegedUser);
- $this->drupalGet('admin/structure/types/manage/page');
- $this->assertSession()->pageTextNotContains('Simple XML sitemap');
-
- $this->generator->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseNotContains('node/' . $this->node->id());
-
- $this->assertFalse($this->generator->entityTypeIsEnabled('node'));
- }
-
- /**
- * Test enabling sitemap support for an entity type.
- *
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- * @throws \Behat\Mink\Exception\ExpectationException
- *
- * @todo Test admin/config/search/simplesitemap/entities form.
- */
- public function testEnableEntityType() {
- $this->generator->disableEntityType('node')
- ->enableEntityType('node')
- ->setBundleSettings('node', 'page');
-
- $this->drupalLogin($this->privilegedUser);
- $this->drupalGet('admin/structure/types/manage/page');
- $this->assertSession()->pageTextContains('Simple XML sitemap');
-
- $this->generator->generateSitemap('backend');
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
-
- $this->assertTrue($this->generator->entityTypeIsEnabled('node'));
- }
-
- /**
- * @todo testSitemapLanguages
- */
-
- /**
- * Test adding and removing sitemap variants.
- *
- * @throws \Behat\Mink\Exception\ExpectationException
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- */
- public function testSitemapVariants() {
-
- // Test adding a variant.
- $this->generator->getSitemapManager()->addSitemapVariant('test');
-
- $this->generator
- ->setBundleSettings('node', 'page')
- ->generateSitemap('backend');
-
- $variants = $this->generator->getSitemapManager()->getSitemapVariants();
- $this->assertTrue(isset($variants['test']));
-
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
-
- // Test if generation affected the default variant only.
- $this->drupalGet('test/sitemap.xml');
- $this->assertSession()->responseNotContains('node/' . $this->node->id());
-
- $this->generator
- ->setVariants('test')
- ->setBundleSettings('node', 'page')
- ->generateSitemap('backend');
-
- // Test if bundle settings have been set for correct variant.
- $this->drupalGet($this->defaultSitemapUrl);
- $this->assertSession()->responseContains('node/' . $this->node->id());
-
- $this->generator->getSitemapManager()->removeSitemapVariants('test');
-
- $variants = $this->generator->getSitemapManager()->getSitemapVariants();
- $this->assertFalse(isset($variants['test']));
-
- // Test if sitemap has been removed along with the variant.
- $this->drupalGet('test/sitemap.xml');
- $this->assertSession()->statusCodeEquals(404);
- }
-
- /**
- * @todo Test removeSitemap().
- */
-
- /**
- * Test cases for ::testGenerationResume.
- */
- public function generationResumeProvider() {
- return [
- [1000, 500, 1],
- [1000, 500, 3, ['de']],
- [1000, 500, 5, ['de', 'es']],
- [10, 10000, 10],
- ];
- }
-
- /**
- * @throws \Drupal\Component\Plugin\Exception\PluginException
- *
- * @dataProvider generationResumeProvider
- */
- public function testGenerationResume($element_count, $generate_duration, $max_links, $langcodes = []) {
-
- $this->addLanguages($langcodes);
-
- $expected_sitemap_count = (int) ceil(($element_count * (count($langcodes) + 1)) / $max_links);
-
- $this->drupalCreateContentType(['type' => 'blog']);
- for ($i = 1; $i <= $element_count; $i++) {
- $this->createNode(['title' => 'node-' . $i, 'type' => 'blog']);
- }
-
- $this->generator
- ->removeCustomLinks()
- ->saveSetting('generate_duration', $generate_duration)
- ->saveSetting('max_links', $max_links)
- ->saveSetting('skip_untranslated', FALSE)
- ->setBundleSettings('node', 'blog');
-
- $queue = $this->generator->getQueueWorker()->rebuildQueue();
- $generate_count = 0;
- while ($queue->generationInProgress()) {
- $generate_count++;
- $this->generator->generateSitemap('backend');
- }
-
- // Test if sitemap generation has been resumed when time limit is very low.
- $this->assertTrue($generate_duration > $element_count || $generate_count > 1, 'This assertion tests if the sitemap generation is split up into batches due to a low generation time limit setting. The failing of this assertion can mean that the sitemap was wrongfully generated in one go, but it can also mean that the assumed low time setting is still high enough for a one pass generation.');
-
- // Test if correct number of sitemaps have been created.
- $chunks = $this->database->query('SELECT id FROM {simple_sitemap} WHERE delta != 0 AND status = 1');
- $chunks->allowRowCount = TRUE;
- $chunk_count = $chunks->rowCount();
- $this->assertTrue($chunk_count === $expected_sitemap_count);
-
- // Test if index has been created when necessary.
- $index = $this->database->query('SELECT id FROM {simple_sitemap} WHERE delta = 0 AND status = 1')
- ->fetchField();
- $this->assertTrue($chunk_count > 1 ? (FALSE !== $index) : !$index);
- }
-
-}
-
diff --git a/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTestBase.php b/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTestBase.php
deleted file mode 100644
index 451eda83d..000000000
--- a/sites/all/modules/contrib/admin/simple_sitemap/tests/src/Functional/SimplesitemapTestBase.php
+++ /dev/null
@@ -1,123 +0,0 @@
-generator = $this->container->get('simple_sitemap.generator');
- $this->database = $this->container->get('database');
-
- $this->drupalCreateContentType(['type' => 'page']);
- $this->node = $this->createNode(['title' => 'Node', 'type' => 'page']);
- $this->node2 = $this->createNode(['title' => 'Node2', 'type' => 'page']);
-
- // Create a user with all the permissions.
- $permissions = array_keys($this->container->get('user.permissions')->getPermissions());
- $this->privilegedUser = $this->drupalCreateUser($permissions);
- }
-
- /**
- * Helper function to replace assertUniqueText.
- *
- * Also adapt the legacy trait method because it can't be applied to Non-HTML
- * pages.
- *
- * @param string $text
- * The text to look for.
- *
- * @See \Drupal\FunctionalTests\AssertLegacyTrait::assertUniqueText().
- */
- protected function assertUniqueTextWorkaround($text) {
- $page_content = $this->getSession()->getPage()->getContent();
- $nr_found = substr_count($page_content, $text);
- $this->assertSame(1, $nr_found);
- }
-
- /**
- * Helper function to replace assertNoUniqueText.
- *
- * Also adapt the legacy trait method because it can't be applied to Non-HTML
- * pages.
- *
- * @param string $text
- * The text to look for.
- *
- * @See \Drupal\FunctionalTests\AssertLegacyTrait::assertNoUniqueText().
- */
- protected function assertNoUniqueTextWorkaround($text) {
- $page_text = $this->getSession()->getPage()->getContent();
- $nr_found = substr_count($page_text, $text);
- $this->assertGreaterThan(1, $nr_found);
- }
-
- protected function addLanguages($langcodes = 'de') {
- foreach ((array) $langcodes as $langcode) {
- ConfigurableLanguage::createFromLangcode($langcode)
- ->save();
- }
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/LICENSE.txt b/sites/all/modules/contrib/admin/toolbar_menu/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/README.txt b/sites/all/modules/contrib/admin/toolbar_menu/README.txt
deleted file mode 100644
index d08fd4db7..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/README.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-README.txt
-==========
-
-Add your favorite menu in the Drupal Toolbar
-
-Usage :
-
-- Manage your menus (Structure > Menu)
-- Go to Config > Toolbar Menu > Toolbar Menu settings
-- Pick all menus you want to appear in you toolbar
-- Save the configuration
-- Your selected menus must appears in the toolbar
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/config/schema/toolbar_menu_element.schema.yml b/sites/all/modules/contrib/admin/toolbar_menu/config/schema/toolbar_menu_element.schema.yml
deleted file mode 100644
index b53f654e1..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/config/schema/toolbar_menu_element.schema.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-toolbar_menu.toolbar_menu_element.*:
- type: config_entity
- label: 'Toolbar menu element config'
- mapping:
- id:
- type: string
- label: 'ID'
- label:
- type: label
- label: 'Label'
- uuid:
- type: string
- weight:
- type: integer
- label: 'Weight'
- menu:
- type: string
- label: 'Menu'
- rewrite_label:
- type: boolean
- label: 'Rewrite menu label with this label'
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/css/toolbar_menu.module.css b/sites/all/modules/contrib/admin/toolbar_menu/css/toolbar_menu.module.css
deleted file mode 100644
index 7e064a992..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/css/toolbar_menu.module.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.toolbar-bar .toolbar-icon-toolbar-menu:before {
- background-image: url(/core/misc/icons/bebebe/cog.svg);
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/js/toolbar_menu.js b/sites/all/modules/contrib/admin/toolbar_menu/js/toolbar_menu.js
deleted file mode 100644
index a6b7ea269..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/js/toolbar_menu.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * @file
- * Defines the behavior of the toolbar_menu module.
- *
- * Rewrite a piece of toolbar.js
- * to render all toolbar element in collapsible menu.
- */
-
-(function ($, Drupal, drupalSettings) {
-
- 'use strict';
-
- // Merge run-time settings with the defaults.
- var options = $.extend(
- {
- breakpoints: {
- 'toolbar.narrow': '',
- 'toolbar.standard': '',
- 'toolbar.wide': ''
- }
- },
- drupalSettings.toolbar,
- // Merge strings on top of drupalSettings so that they are not mutable.
- {
- strings: {
- horizontal: Drupal.t('Horizontal orientation'),
- vertical: Drupal.t('Vertical orientation')
- }
- }
- );
-
- Drupal.behaviors.toolbar_menu = {
- attach: function (context) {
- // Process the administrative toolbar.
- $(context).find('#toolbar-administration').once('toolbar-menu').each(function () {
- // Establish the toolbar models and views.
- var model = Drupal.toolbar.models.toolbarModel = new Drupal.toolbar.ToolbarModel({
- locked: JSON.parse(localStorage.getItem('Drupal.toolbar.trayVerticalLocked')) || false,
- activeTab: document.getElementById(JSON.parse(localStorage.getItem('Drupal.toolbar.activeTabID')))
- });
-
- // Render collapsible menus.
- var menuModel = Drupal.toolbar.models.menuModel = new Drupal.toolbar.MenuModel();
- Drupal.toolbar.views.menuVisualView = new Drupal.toolbar.MenuVisualView({
- el: $(this).find('.toolbar-menu-administration'),
- model: menuModel,
- strings: options.strings
- });
-
- // Handle the resolution of Drupal.toolbar.setSubtrees.
- // This is handled with a deferred so that the function may be invoked
- // asynchronously.
- Drupal.toolbar.setSubtrees.done(function (subtrees) {
- menuModel.set('subtrees', subtrees);
- var theme = drupalSettings.ajaxPageState.theme;
- localStorage.setItem('Drupal.toolbar.subtrees.' + theme, JSON.stringify(subtrees));
- // Indicate on the toolbarModel that subtrees are now loaded.
- model.set('areSubtreesLoaded', true);
- });
-
- });
- }
- };
-
-}(jQuery, Drupal, drupalSettings));
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/Entity/ToolbarMenuElement.php b/sites/all/modules/contrib/admin/toolbar_menu/src/Entity/ToolbarMenuElement.php
deleted file mode 100644
index beb6fdc38..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/src/Entity/ToolbarMenuElement.php
+++ /dev/null
@@ -1,113 +0,0 @@
-invalidateTags(['toolbar_menu']);
- }
-
- /**
- * Get the menu 'menu' property.
- *
- * @return mixed|null
- * The menu property.
- */
- public function menu() {
- return $this->get('menu');
- }
-
- /**
- * Get the full loaded menu entity.
- *
- * @return \Drupal\system\Entity\Menu|null|static
- * Loaded menu.
- */
- public function loadMenu() {
- if ($this->menu()) {
- return Menu::Load($this->menu());
- }
- return NULL;
- }
-
- /**
- * Get the 'rewrite_label' property.
- *
- * @return mixed|null
- * The rewrite_label property
- */
- public function rewriteLabel() {
- return $this->get('rewrite_label');
- }
-
- /**
- * Get the 'weight' property.
- *
- * @return mixed|null
- * The weight property
- */
- public function weight() {
- return $this->get('weight');
- }
-
- /**
- * Get the displayed label.
- *
- * If rewrite_label property is set to TRUE,
- * the label of this entity was returned.
- *
- * @return mixed|null|string
- * Display label
- */
- public function getDisplayLabel() {
- if ($this->rewriteLabel() && $this->menu()) {
- return $this->loadMenu()->label();
- }
- return $this->label();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/Form/ToolbarMenuElementEditForm.php b/sites/all/modules/contrib/admin/toolbar_menu/src/Form/ToolbarMenuElementEditForm.php
deleted file mode 100644
index 775942e97..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/src/Form/ToolbarMenuElementEditForm.php
+++ /dev/null
@@ -1,80 +0,0 @@
- 'textfield',
- '#title' => $this->t('Label'),
- '#maxlength' => 255,
- '#default_value' => $this->entity->label(),
- '#required' => TRUE,
- ];
-
- $form['id'] = [
- '#type' => 'machine_name',
- '#title' => $this->t('ID'),
- '#maxlength' => 255,
- '#default_value' => $this->entity->id(),
- '#required' => TRUE,
- '#disabled' => !$this->entity->isNew(),
- '#machine_name' => [
- 'exists' => 'Drupal\toolbar_menu\Entity\ToolbarMenuElement::load',
- ],
- ];
-
- $existing_menu = [];
- foreach ($this->entityTypeManager
- ->getStorage('menu')
- ->loadByProperties(['status' => TRUE]) as $menu) {
- $existing_menu[$menu->id()] = $menu->label();
- }
-
- $form['menu'] = [
- '#type' => 'select',
- '#title' => $this->t('Menu'),
- '#options' => $existing_menu,
- '#target_type' => 'menu',
- '#validate_reference' => TRUE,
- '#default_value' => $this->entity->menu(),
- '#required' => TRUE,
- ];
-
- $form['rewrite_label'] = [
- '#type' => 'checkbox',
- '#title' => $this->t('Display the menu label in toolbar instead of this entity label'),
- '#validate_reference' => TRUE,
- '#default_value' => $this->entity->rewriteLabel(),
- ];
-
- return parent::buildForm($form, $form_state);
- }
-
- /**
- * {@inheritdoc}
- */
- public function save(array $form, FormStateInterface $form_state) {
- parent::save($form, $form_state);
- drupal_set_message($this->t('Toolbar menu element @label saved.', ['@label' => $this->entity->label()]));
- $form_state->setRedirectUrl($this->entity->toUrl('collection'));
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/Tests/ToolbarMenuFonctionalTest.php b/sites/all/modules/contrib/admin/toolbar_menu/src/Tests/ToolbarMenuFonctionalTest.php
deleted file mode 100644
index 2afc0be8a..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/src/Tests/ToolbarMenuFonctionalTest.php
+++ /dev/null
@@ -1,90 +0,0 @@
-drupalGet('admin/config/user-interface/toolbar_menu/elements');
- $this->assertResponse(403, "Anonymous user is unauthorized to access settings page");
-
- // Add a new custom menu.
- $menu_name = 'test_menu';
- $menu_label = 'Test Menu';
- $toolbar_id = 'test_menu_in_toolbar';
- $toolbar_label = 'Test Menu in toolbar';
-
- $values = [
- 'id' => $menu_name,
- 'label' => $menu_label,
- 'description' => 'Description text',
- ];
- $menu = \Drupal::entityTypeManager()->getStorage('menu')->create($values);
- $menu->save();
-
- $adminUser = $this->drupalCreateUser([
- 'administer toolbar menu',
- 'administer permissions',
- 'access toolbar',
- ]);
-
- // Can access pages if logged in and no crop types exist.
- $this->drupalLogin($adminUser);
- $this->drupalGet('admin/config/user-interface/toolbar_menu/elements');
- $this->assertResponse(200, "User with 'administer toolbar menu' role is authorized to access settings page");
-
- // Create a new toolbar menu element.
- $this->drupalGet('admin/config/user-interface/toolbar_menu/elements/add');
- $create_toolbar_element = [
- 'label' => $toolbar_label,
- 'id' => $toolbar_id,
- 'menu' => $menu_name,
- 'rewrite_label' => FALSE,
- ];
- $this->drupalPostForm('admin/config/user-interface/toolbar_menu/elements/add', $create_toolbar_element, t('Save'));
-
- // Enforce refresh caches.
- drupal_flush_all_caches();
-
- $rid = $this->createRole(["view $toolbar_id in toolbar"], 'aaaaaa', 'AAAAAAAA');
- $adminUser->addRole($rid);
- $adminUser->save();
-
- $this->checkPermissions(["view $toolbar_id in toolbar"]);
-
- $this->drupalGet('/admin/people/permissions');
-
- $this->drupalGet('');
- $this->assertRaw($toolbar_label, 'Custom menu is viewed in toolbar');
-
- $this->drupalGet('admin/config/user-interface/toolbar_menu/elements/' . $toolbar_id);
- // Update an existing toolbar menu element.
- $update_toolbar_element = [
- 'rewrite_label' => TRUE,
- ];
- $this->drupalPostForm('admin/config/user-interface/toolbar_menu/elements/' . $toolbar_id, $update_toolbar_element, t('Save'));
-
- $this->drupalGet('');
- $this->assertRaw($menu_name, 'Custom menu is viewed in toolbar');
-
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuElementListBuilder.php b/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuElementListBuilder.php
deleted file mode 100644
index dcd72e60e..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuElementListBuilder.php
+++ /dev/null
@@ -1,41 +0,0 @@
-t('Label');
- $header['menu'] = $this->t('Menu');
- $header['rewrite_label'] = $this->t('Use menu label');
- return $header + parent::buildHeader();
- }
-
- /**
- * {@inheritdoc}
- */
- public function buildRow(EntityInterface $entity) {
- /* @var \Drupal\toolbar_menu\Entity\ToolbarMenuElement $entity */
- $row['label'] = $entity->label();
- $row['menu']['#markup'] = $entity->loadMenu()->label();
- $row['rewrite_label']['#markup'] = $entity->rewriteLabel() ? $this->t('Yes') : $this->t('No');
- return $row + parent::buildRow($entity);
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuManager.php b/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuManager.php
deleted file mode 100644
index 70342d2e4..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuManager.php
+++ /dev/null
@@ -1,110 +0,0 @@
-entityManager = $entity_manager;
- $this->account = $account->getAccount();
- $this->toolbarMenuElements = $this->entityManager->getStorage('toolbar_menu_element')->loadMultiple();
- }
-
- /**
- * Get toolbar menu elements.
- *
- * @return \Drupal\toolbar_menu\Entity\ToolbarMenuElement[]
- * An array containing toolbar menu elements.
- */
- public function getToolbarMenuElements() {
- $elements = [];
- foreach ($this->toolbarMenuElements as $key => $element) {
- if ($this->account->hasPermission($this->getPermissionName($element))) {
- $elements[$key] = $element;
- }
- };
- return $elements;
- }
-
- /**
- * Helper to clean an ID.
- *
- * @param string $id
- * The ID to clean.
- *
- * @return string
- * The cleaned ID.
- */
- public function cleanId($id) {
- return preg_replace('/[^\p{L}\p{N}]/u', '-', $id);
- }
-
- /**
- * Get the permission list.
- *
- * @return array
- * The permission list.
- */
- public function getPermissionList() {
- $permissions = [];
- foreach ($this->toolbarMenuElements as $element) {
- $permissions[$this->getPermissionName($element)] = [
- 'title' => $this->t('View @label element in the toolbar', ['@label' => $element->label()]),
- ];
- }
- return $permissions;
- }
-
- /**
- * Get the formatted permission name.
- *
- * @param \Drupal\toolbar_menu\Entity\ToolbarMenuElement $element
- * The name of the menu.
- *
- * @return string
- * The name of the permission.
- */
- protected function getPermissionName(ToolbarMenuElement $element) {
- return 'view ' . $element->id() . ' in toolbar';
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuMenuLinkTreeManipulators.php b/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuMenuLinkTreeManipulators.php
deleted file mode 100644
index ae9bd9fd4..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuMenuLinkTreeManipulators.php
+++ /dev/null
@@ -1,44 +0,0 @@
-toolbarMenuManager = $toolbar_menu_manager;
- }
-
- /**
- * Add icons on each toolbar menu items.
- *
- * @param \Drupal\Core\Menu\MenuLinkTreeElement[] $tree
- * The menu link tree to manipulate.
- *
- * @return \Drupal\Core\Menu\MenuLinkTreeElement[]
- * The manipulated menu link tree.
- */
- public function addIcons(array $tree) {
- foreach ($tree as $element) {
- $element->options['attributes']['class'][] = 'toolbar-icon';
- $element->options['attributes']['class'][] = 'toolbar-icon-link-toolbar-menu';
- $element->options['attributes']['class'][] = 'toolbar-icon-link-toolbar-menu-' . $this->toolbarMenuManager->cleanId($element->link->getPluginId());
- $element->options['attributes']['title'] = $element->link->getTitle();
- }
- return $tree;
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuPermissions.php b/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuPermissions.php
deleted file mode 100644
index 906272b70..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/src/ToolbarMenuPermissions.php
+++ /dev/null
@@ -1,49 +0,0 @@
-toolbarMenuManager = $toolbar_menu;
- }
-
- /**
- * {@inheritdoc}
- */
- public static function create(ContainerInterface $container) {
- return new static(
- $container->get('toolbar_menu.manager')
- );
- }
-
- /**
- * Returns an array of toolbar_menu permissions.
- *
- * @return array
- * The permission list.
- */
- public function permissions() {
- return $this->toolbarMenuManager->getPermissionList();
- }
-
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.info.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.info.yml
deleted file mode 100644
index f578cfdef..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.info.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: Toolbar Menu
-description: Add your favorite menu (Structure > Menu) in the Drupal Toolbar
-# core: "8.x"
-type: module
-dependencies:
- - drupal:toolbar
-configure: toolbar_menu.settings
-
-# Information added by Drupal.org packaging script on 2017-05-19
-version: '8.x-2.1+0-dev'
-core: '8.x'
-project: 'toolbar_menu'
-datestamp: 1495180394
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.install b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.install
deleted file mode 100644
index ed1fbc134..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.install
+++ /dev/null
@@ -1,44 +0,0 @@
-get('toolbar_menu.settings')->get('menus');
-
- // Create 'toolbar_menu_element' entity type.
- $entity_manager->clearCachedDefinitions();
- $toolbar_menu_entity_type = $entity_manager->getDefinition('toolbar_menu_element');
- if ($toolbar_menu_entity_type && $toolbar_menu_entity_type instanceof \Drupal\Core\Entity\EntityTypeInterface) {
- \Drupal::entityDefinitionUpdateManager()->installEntityType($toolbar_menu_entity_type);
- }
-
- // Load old configuration and create a toolbar_menu_element entity
- // if is active.
- foreach ($old_config as $menu_name => $menu_config) {
- if ($menu_config['active'] == TRUE && !$entity_manager->getStorage('toolbar_menu_element')->load($menu_name)) {
- $entity_manager->getStorage('toolbar_menu_element')->create([
- 'id' => $menu_name,
- 'label' => $menu_name,
- 'menu' => $menu_name,
- 'weight' => $menu_config['weight'],
- 'rewrite_label' => TRUE,
- ])->save();
- }
- }
-
- // Delete old and deprecated configuration.
- $config_factory->getEditable('toolbar_menu.settings')->delete();
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.libraries.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.libraries.yml
deleted file mode 100644
index 848e2c4a0..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.libraries.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-icons:
- version: 1.3
- js:
- js/toolbar_menu.js: {}
- css:
- base:
- css/toolbar_menu.module.css: {}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.action.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.action.yml
deleted file mode 100644
index b9843188e..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.action.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-entity.toolbar_menu_element.add_form:
- route_name: 'entity.toolbar_menu_element.add_form'
- title: 'Add Toolbar menu element'
- appears_on:
- - entity.toolbar_menu_element.collection
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.menu.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.menu.yml
deleted file mode 100644
index 7683e3267..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.menu.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-entity.toolbar_menu_element.collection:
- description: 'Configure Toolbar Menu to add your own element in the toolbar'
- title: 'Toolbar Menu'
- route_name: entity.toolbar_menu_element.collection
- parent: system.admin_config_ui
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.task.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.task.yml
deleted file mode 100644
index a731cf9d3..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.links.task.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-toolbar_menu.settings:
- title: 'Toolbar Menu Settings'
- route_name: toolbar_menu.settings
- base_route: toolbar_menu.settings.base
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.module b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.module
deleted file mode 100644
index 789c41b39..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.module
+++ /dev/null
@@ -1,121 +0,0 @@
-' . t('About') . '';
- $output .= '
' . t('Add your favorite menu in the Drupal Toolbar');
- $output .= '
' . t('Usage') . '
';
- $output .= '
';
- $output .= '
' . t('Manage your menus (Structure > Menu)') . '
';
- $output .= '
' . t('Go to Config > Toolbar Menu > Toolbar Menu settings') . '
';
- $output .= '
' . t('Check all menus you want to appear in your toolbar') . '
';
- $output .= '
' . t('Re-order the menu entries if you want') . '
';
- $output .= '
' . t('Save the configuration') . '
';
- $output .= '
' . t('Your selected menus must appears in the toolbar') . '
';
- $output .= '
';
- return $output;
- }
-}
-
-/**
- * Implements hook_page_top().
- *
- * Add a new cache tag for the toolbar cache.
- */
-function toolbar_menu_page_top(array &$page_top) {
- $page_top['toolbar']['#cache']['tags'][] = 'toolbar_menu';
-}
-
-/**
- * Implements hook_toolbar().
- */
-function toolbar_menu_toolbar() {
- $items = [];
-
- /** @var \Drupal\toolbar_menu\ToolbarMenuManager $toolbar_manager */
- $toolbar_manager = \Drupal::service('toolbar_menu.manager');
- foreach ($toolbar_manager->getToolbarMenuElements() as $element_id => $element) {
- $items['toolbar_menu_' . $element_id] = [
- '#type' => 'toolbar_item',
- 'tab' => [
- '#type' => 'link',
- '#title' => $element->getDisplayLabel(),
- '#url' => Url::fromRoute(''),
- '#attributes' => [
- 'title' => $element->getDisplayLabel(),
- 'class' => [
- 'toolbar-icon',
- 'toolbar-icon-toolbar-menu',
- 'toolbar-icon-toolbar-menu-' . $element_id,
- ],
- 'data-drupal-subtrees' => '',
- ],
- ],
- 'tray' => [
- '#heading' => t('@menu_label actions', ['@menu_label' => $element->getDisplayLabel()]),
- 'toolbar_menu_' . $element_id . '_links' => [
- '#type' => 'container',
- '#id' => $element->loadMenu()->id(),
- '#pre_render' => ['toolbar_menu_prerender_toolbar_tray'],
- '#attributes' => [
- 'class' => ['toolbar-menu-administration'],
- ],
- ],
- ],
- '#weight' => $element->weight(),
- '#attached' => [
- 'library' => [
- 'toolbar_menu/icons',
- ],
- ],
- '#cache' => [
- 'tags' => array_merge($element->getCacheTags(), $element->loadMenu()->getCacheTags(), ['toolbar_menu']),
- ],
- ];
- }
- return $items;
-}
-
-/**
- * Pre-render the toolbar_menu tray element.
- *
- * @param array $element
- * The tray element to pre-render.
- *
- * @return array
- * The pre-rendered tray element.
- */
-function toolbar_menu_prerender_toolbar_tray(array $element) {
- /** @var \Drupal\toolbar\Menu\ToolbarMenuLinkTree $menu_tree */
- $menu_tree = \Drupal::service('toolbar.menu_tree');
-
- $parameters = new MenuTreeParameters();
- $parameters->excludeRoot()->onlyEnabledLinks();
-
- $tree = $menu_tree->load($element['#id'], $parameters);
-
- $manipulators = [
- ['callable' => 'menu.default_tree_manipulators:checkAccess'],
- ['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'],
- ['callable' => 'toolbar_menu.menu_link_tree_manipulators:addIcons'],
- ];
- $tree = $menu_tree->transform($tree, $manipulators);
-
- $element['toolbar_menu_' . $element['#id']] = $menu_tree->build($tree);
-
- return $element;
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.permissions.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.permissions.yml
deleted file mode 100644
index ca6b4b590..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.permissions.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-administer toolbar menu:
- title: 'Administer toolbar menu'
-
-permission_callbacks:
- - Drupal\toolbar_menu\ToolbarMenuPermissions::permissions
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.routing.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.routing.yml
deleted file mode 100644
index 76f7a2e2f..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.routing.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-entity.toolbar_menu_element.collection:
- path: 'admin/config/user-interface/toolbar_menu/elements'
- defaults:
- _entity_list: 'toolbar_menu_element'
- _title: 'Toolbar menu elements'
- requirements:
- _permission: 'administer toolbar menu'
-
-entity.toolbar_menu_element.add_form:
- path: 'admin/config/user-interface/toolbar_menu/elements/add'
- defaults:
- _entity_form: 'toolbar_menu_element.default'
- _title: 'Add Toolbar menu element'
- tempstore_id: 'toolbar_menu.element'
- requirements:
- _permission: 'administer toolbar menu'
diff --git a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.services.yml b/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.services.yml
deleted file mode 100644
index 118a25c22..000000000
--- a/sites/all/modules/contrib/admin/toolbar_menu/toolbar_menu.services.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-services:
- toolbar_menu.manager:
- class: Drupal\toolbar_menu\ToolbarMenuManager
- arguments: ['@entity.manager', '@current_user']
-
- toolbar_menu.menu_link_tree_manipulators:
- class: Drupal\toolbar_menu\ToolbarMenuMenuLinkTreeManipulators
- arguments: ['@toolbar_menu.manager']
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/.gitignore b/sites/all/modules/contrib/admin/toolbar_themes/.gitignore
deleted file mode 100644
index e5cf63215..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# Git ignored.
-/node_modules/
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/Gruntfile.js b/sites/all/modules/contrib/admin/toolbar_themes/Gruntfile.js
deleted file mode 100644
index 96cb3f64e..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/Gruntfile.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Grunt tasks for Toolbar Themes.
- * http://gruntjs.com/
- */
-
-'use strict';
-
-module.exports = function(grunt) {
-
- grunt.initConfig({
-
- pkg: grunt.file.readJSON('package.json'),
-
- sass: {
- styles: {
- files: [{
- expand: true,
- cwd: 'themes',
- src: ['**/*.scss'],
- dest: 'themes',
- ext: '.css'
- }],
- options: {
- precision: 5,
- outputStyle: 'expanded',
- sourceMap: true
- }
- }
- },
-
- grunticon: {
- toolbar: {
- files: [{
- expand: true,
- cwd: 'themes/base/grunticons/original',
- src: ['*.svg'],
- dest: 'themes/base/grunticons/processed'
- }],
- options: {
- enhanceSVG: true,
- cssprefix: '.'
- }
- }
- },
-
- postcss: {
- styles: {
- src: 'themes/**/*.css',
- options: {
- map: {
- inline: false
- },
- processors: [
- require('autoprefixer')({browsers: 'last 4 versions'})
- ]
- }
- }
- },
-
- watch: {
- styles: {
- files: 'themes/**/*.scss',
- tasks: ['sass:styles', 'postcss:styles']
- }
- }
- });
-
- grunt.loadNpmTasks('grunt-postcss');
- grunt.loadNpmTasks('grunt-sass');
- grunt.loadNpmTasks('grunt-grunticon');
- grunt.loadNpmTasks('grunt-contrib-watch');
- grunt.registerTask('default', ['watch:styles']);
-};
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/LICENSE.txt b/sites/all/modules/contrib/admin/toolbar_themes/LICENSE.txt
deleted file mode 100644
index d159169d1..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/LICENSE.txt
+++ /dev/null
@@ -1,339 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/README.md b/sites/all/modules/contrib/admin/toolbar_themes/README.md
deleted file mode 100644
index 1f184cbbd..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# Toolbar Themes
-
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/config/install/toolbar_themes.settings.yml b/sites/all/modules/contrib/admin/toolbar_themes/config/install/toolbar_themes.settings.yml
deleted file mode 100644
index 4671b2c1a..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/config/install/toolbar_themes.settings.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-# Install settings.
-default_theme: toolbar_admin_menu
-icons: 0
-tabs: 0
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/css/toolbar-themes-form.css b/sites/all/modules/contrib/admin/toolbar_themes/css/toolbar-themes-form.css
deleted file mode 100644
index 5e7409fe4..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/css/toolbar-themes-form.css
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Styles provided by the Toolbar Theme module . */
-
-/*#toolbar-administration {display: none !important}*/
-
-.toolbar-themes-form {
- overflow-x: scroll;
-}
-
-.toolbar-themes-form td {
- vertical-align: top;
-}
-
-
-.toolbar-themes-form .toolbar-theme-screen-shot {
- max-width: 540px;
-}
-
-.toolbar-themes-form .toolbar-themes-meta,
-.toolbar-themes-form .toolbar-themes-meta dt,
-.toolbar-themes-form .toolbar-themes-meta dd {
- margin: 0;
-}
-
-.toolbar-themes-form .toolbar-themes-meta dt {
- clear: left;
- margin-right: 3px;
- width: 5em;
- font-weight: 600;
-}
-
-.toolbar-themes-form .toolbar-themes-meta dt,
-.toolbar-themes-form .toolbar-themes-meta dd {
- float: left;
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/js/base.js b/sites/all/modules/contrib/admin/toolbar_themes/js/base.js
deleted file mode 100644
index 526a49db4..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/js/base.js
+++ /dev/null
@@ -1,47 +0,0 @@
-(function ($, drupalSettings) {
-
- 'use strict';
-
- Drupal.behaviors.ToolbarThemes = {
- attach: function () {
-
- // Remove titles, they obscure drop menu items.
- $('#toolbar-bar a').removeAttr('title');
-
- // Wrap menu link text.
- $('#toolbar-bar .toolbar-menu a').wrapInner('');
-
- if (drupalSettings.toolbar.icons == 1) {
- // Remove toolbar tab-icon classes.
- $("#toolbar-bar .toolbar-tab a").removeClass(function (index, css) {
- return (css.match (/(^|\s)toolbar-ico\S+/g) || []).join(' ');
- });
-
- // Move icons into anchors so we can style active/hover states etc.
- if (drupalSettings.toolbar.tabs == 1) {
- $('#toolbar-bar .toolbar-tab__items-wrapper i.toolbar-icon').each(function () {
- var t = $(this).prev();
- $(this).prependTo(t);
- });
- }
-
- if ($('#toolbar-bar').hasClass('has-icons')) {
- $('#toolbar-bar .toolbar-tray-horizontal i.toolbar-icon').each(function() {
- var h = $(this).prev();
- $(this).prependTo(h);
- });
-
- $('#toolbar-bar .toolbar-tray-vertical i.toolbar-icon').each(function() {
- if ($(this).parents('.toolbar-tab').find('.trigger').hasClass('is-active')) {
- var v = $(this).siblings('.toolbar-box').find('a.toolbar-menu__link');
- } else {
- var v = $(this).prev();
- }
- $(this).prependTo(v);
- });
- }
- }
- }
- };
-
-})(jQuery, drupalSettings);
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/package.json b/sites/all/modules/contrib/admin/toolbar_themes/package.json
deleted file mode 100644
index 0a73a4776..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "toolbar_themes",
- "version": "8.0.0",
- "description": "Theme and style overrides for the Toolbar",
- "author": "Jeff Burnz",
- "email": "jmburnz@gmail.com",
- "private": true,
- "devDependencies": {
- "autoprefixer": "7.1.6",
- "grunt": "1.0.1",
- "grunt-contrib-watch": "1.0.0",
- "grunt-grunticon": "^2.3.2",
- "grunt-postcss": "0.9.0",
- "grunt-sass": "2.0.0"
- },
- "engines": {
- "node": "6.11.5",
- "npm": "5.5.1"
- },
- "repository": {
- "type": "git",
- "url": "http://cgit.drupalcode.org/toolbar_themes/"
- },
- "bugs": {
- "url": "https://www.drupal.org/project/issues/toolbar_themes"
- },
- "keywords": [
- "drupal",
- "theme",
- "toolbar"
- ],
- "license": "GPL-2.0"
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/src/Form/ToolbarThemesSettingsForm.php b/sites/all/modules/contrib/admin/toolbar_themes/src/Form/ToolbarThemesSettingsForm.php
deleted file mode 100644
index 6dc5fca4b..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/src/Form/ToolbarThemesSettingsForm.php
+++ /dev/null
@@ -1,188 +0,0 @@
-config('toolbar_themes.settings');
- $admin_theme = $this->config('system.theme')->get('admin');
-
- $form['settings'] = array(
- '#type' => 'container',
- '#tree' => TRUE,
- '#title' => t('Toolbar Themes'),
- );
-
- $form['settings']['info'] = array(
- '#type' => 'markup',
- '#prefix' => '
',
- '#markup' => t('For Adminmal the font size will only apply to the front end theme.'),
- );
- }
-
- $form['settings']['tabs'] = array(
- '#type' => 'checkbox',
- '#title' => t('Show toolbar tabs'),
- '#default_value' => $config->get('tabs'),
- '#description' => t('Unchecked this will remove tabs except for the Manage tab which is replaced by an icon.'),
- );
-
- $form['settings']['icons'] = array(
- '#type' => 'checkbox',
- '#title' => t('Show icons'),
- '#default_value' => $config->get('icons'),
- '#description' => t('Unchecked this will remove icons from tab and menu items, while orientation toggle icons and sub-menu arrows remain.'),
- );
-
- $form['settings']['actions']['#type'] = 'actions';
- $form['settings']['actions']['submit'] = array(
- '#type' => 'submit',
- '#value' => $this->t('Submit'),
- '#button_type' => 'primary',
- );
-
- return $form;
- }
-
- /**
- * {@inheritDoc}
- */
- public function validateForm(array &$form, FormStateInterface $form_state) {}
-
- /**
- * {@inheritdoc}
- */
- public function submitForm(array &$form, FormStateInterface $form_state) {
- $values = $form_state->getValues();
- $config = \Drupal::service('config.factory')->getEditable('toolbar_themes.settings');
- foreach ($values['settings'] as $key => $setting) {
- $config->set($key, $setting);
- }
- $config->save();
- parent::submitForm($form, $form_state);
- drupal_flush_all_caches();
- }
-}
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--menu.html.twig b/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--menu.html.twig
deleted file mode 100644
index 314bdadb2..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--menu.html.twig
+++ /dev/null
@@ -1,93 +0,0 @@
-{#
-/**
- * Toolbar themes theme implementation to display a toolbar menu.
- *
- * Available variables:
- * - menu_name: The machine name of the menu.
- * - items: A nested list of menu items. Each menu item contains:
- * - attributes: HTML attributes for the menu item.
- * - below: The menu item child items.
- * - title: The menu link title.
- * - url: The menu link url, instance of \Drupal\Core\Url
- * - localized_options: Menu link localized options.
- * - is_expanded: TRUE if the link has visible children within the current
- * menu tree.
- * - is_collapsed: TRUE if the link has children within the current menu tree
- * that are not currently visible.
- * - in_active_trail: TRUE if the link is in the active trail.
- * - show_icon: bool to show or hide icon markup.
- *
- * @ingroup themeable
- */
-#}
-{%- import _self as menus -%}
-{#
- We call a macro which calls itself to render the full tree.
- @see http://twig.sensiolabs.org/doc/tags/macro.html
-#}
-{{- menus.menu_links(items, attributes, 0, menu_name) -}}
-
-{%- macro menu_links(items, attributes, menu_level, menu_name) -%}
- {%- import _self as menus -%}
-
- {% if items %}
-
-
- {# Begin loop. #}
- {% for item in items %}
-
- {% if item.below is not empty %}
- {% set is_parent = true %}
- {% else %}
- {% set is_parent = false %}
- {% endif %}
-
- {%
- set item_classes = [
- 'menu-item',
- is_parent ? 'is-parent',
- item.is_expanded ? 'menu-item--expanded',
- item.is_collapsed ? 'menu-item--collapsed',
- item.in_active_trail ? 'menu-tem--active-trail',
- ]
- %}
-
- {# We set an id on list items to provide context for aria attributes. #}
-
- {% endif %}
-{%- endmacro -%}
\ No newline at end of file
diff --git a/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--toolbar.html.twig b/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--toolbar.html.twig
deleted file mode 100644
index c79c9c467..000000000
--- a/sites/all/modules/contrib/admin/toolbar_themes/templates/toolbar-themes--toolbar.html.twig
+++ /dev/null
@@ -1,56 +0,0 @@
-{#
-/**
- * Toolbar themes implementation for the administrative toolbar.
- *
- * Available variables:
- * - attributes: HTML attributes for the wrapper.
- * - toolbar_attributes: HTML attributes to apply to the toolbar.
- * - toolbar_heading: The heading or label for the toolbar.
- * - tabs: List of tabs for the toolbar.
- * - attributes: HTML attributes for the tab container.
- * - link: Link or button for the menu tab.
- * - icon_attributes: tab icon classes and attributes to style SVG grunticons.
- * - trays: Toolbar tray list, each associated with a tab. Each tray in trays
- * contains:
- * - attributes: HTML attributes to apply to the tray.
- * - label: The tray's label.
- * - links: The tray menu links.
- * - remainder: Any non-tray, non-tab elements left to be rendered.
- * - show_icons: bool to show or hide icon markup.
- *
- * @see toobar_themes_preprocess_toolbar()
- *
- * @ingroup themeable
- */
-#}
-