From 96eb2e4b9f40d66089e57091413baf7a13f80722 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Wed, 20 Mar 2024 16:36:20 -0300 Subject: [PATCH 01/11] Removed Social Lets Connect Usage module and they references --- .../social_lets_connect_usage.settings.yml | 9 -- .../social_lets_connect_usage.schema.yml | 17 --- .../social_lets_connect_usage.info.yml | 10 -- .../social_lets_connect_usage.links.menu.yml | 5 - .../social_lets_connect_usage.module | 65 ----------- .../social_lets_connect_usage.permissions.yml | 3 - .../social_lets_connect_usage.routing.yml | 7 -- .../social_lets_connect_usage.services.yml | 5 - .../src/Annotation/ShareUsageDataPlugin.php | 40 ------- .../src/Form/LetsConnectUsageSettingsForm.php | 84 -------------- .../src/Plugin/QueueWorker/SendUsageData.php | 90 --------------- .../ShareUsageDataPlugin/EntityTypeCount.php | 81 -------------- .../ShareUsageDataPlugin/ModulesInstalled.php | 67 ------------ .../OpenSocialVersion.php | 39 ------- .../ShareUsageDataPlugin/SystemData.php | 43 -------- .../ShareUsageDataPlugin/WebsiteUrl.php | 32 ------ .../src/Plugin/ShareUsageDataPluginBase.php | 103 ------------------ .../Plugin/ShareUsageDataPluginInterface.php | 25 ----- .../Plugin/ShareUsageDataPluginManager.php | 32 ------ .../social_lets_connect.install | 16 --- phpstan-baseline.neon | 49 --------- 21 files changed, 822 deletions(-) delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/config/install/social_lets_connect_usage.settings.yml delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/config/schema/social_lets_connect_usage.schema.yml delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.info.yml delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.links.menu.yml delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.module delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.permissions.yml delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.routing.yml delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.services.yml delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Annotation/ShareUsageDataPlugin.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Form/LetsConnectUsageSettingsForm.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/QueueWorker/SendUsageData.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/EntityTypeCount.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/SystemData.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/WebsiteUrl.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginBase.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginInterface.php delete mode 100644 modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginManager.php diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/config/install/social_lets_connect_usage.settings.yml b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/config/install/social_lets_connect_usage.settings.yml deleted file mode 100644 index d646e506089..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/config/install/social_lets_connect_usage.settings.yml +++ /dev/null @@ -1,9 +0,0 @@ -usage_data_enabled: true -usage_data: - website_url: website_url - entity_type_count: entity_type_count - open_social_version: open_social_version - system_data: system_data - modules_installed: modules_installed -refresh_interval: 86400 -url: 'https://connect.getopensocial.com/usage' diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/config/schema/social_lets_connect_usage.schema.yml b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/config/schema/social_lets_connect_usage.schema.yml deleted file mode 100644 index c51a81ef8f8..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/config/schema/social_lets_connect_usage.schema.yml +++ /dev/null @@ -1,17 +0,0 @@ -social_lets_connect_usage.usage_data_enabled: - type: boolean - label: 'Usage data sharing enabled' - -social_lets_connect_usage.usage_data: - type: sequence - sequence: - - type: string - - label: 'Usage data shared with Open Social team' - -social_lets_connect_usage.refresh_interval: - type: integer - label: 'Refresh interval in seconds' - -social_lets_connect_usage.url: - type: string - label: 'URL to send the usage data to' diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.info.yml b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.info.yml deleted file mode 100644 index e4474b2d2b7..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.info.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: 'Social Lets Connect Usage' -type: module -description: 'Share usage data Open Social development team and help us improve the product.' -core_version_requirement: ^9 || ^10 -package: 'Social Lets Connect' -lifecycle: deprecated -lifecycle_link: https://www.drupal.org/project/social/issues/3406822 - -dependencies: - - social_lets_connect diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.links.menu.yml b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.links.menu.yml deleted file mode 100644 index 68253ab2b47..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.links.menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -social_lets_connect_usage.data_sharing_settings: - title: 'Usage data sharing settings' - parent: social_lets_connect.main - route_name: social_lets_connect_usage.data_sharing_settings - weight: -2 diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.module b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.module deleted file mode 100644 index 02ebe8f38c1..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.module +++ /dev/null @@ -1,65 +0,0 @@ -get('social_lets_connect_usage.last_send', 0); - $times_send = \Drupal::state() - ->get('social_lets_connect_usage.times_send', 0); - - $settings = \Drupal::config('social_lets_connect_usage.settings'); - if ($settings->get('usage_data_enabled')) { - - $refresh_interval = $settings->get('refresh_interval'); - - if (($current_time - $last_send) >= $refresh_interval) { - /** @var \Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPluginManager $plugin_manager */ - $plugin_manager = \Drupal::service('plugin.manager.share_usage_data_plugin'); - $plugin_definitions = $plugin_manager->getDefinitions(); - $usage_data = []; - foreach ($plugin_definitions as $plugin_id => $plugin_definition) { - $instance = $plugin_manager->createInstance($plugin_id); - $usage_data[$plugin_id] = FALSE; - if ($instance->enabled()) { - $usage_data[$plugin_id] = $instance->getValue(); - } - } - - global $base_url; - $private_key = \Drupal::service('private_key'); - $site_key = Crypt::hmacBase64($base_url, $private_key->get()); - - $send_data = []; - $send_data['site_key'] = $site_key; - $send_data['send_info'] = [ - 'last_send' => $last_send, - 'times_send' => $times_send, - 'current_time' => $current_time, - ]; - $send_data['usage_data'] = $usage_data; - - $queue = \Drupal::queue('send_usage_data'); - $queue->createItem($send_data); - - // Update last run. - \Drupal::state() - ->set('social_lets_connect_usage.last_send', $current_time); - $times_send++; - \Drupal::state() - ->set('social_lets_connect_usage.times_send', $times_send); - } - - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.permissions.yml b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.permissions.yml deleted file mode 100644 index c29dca76744..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.permissions.yml +++ /dev/null @@ -1,3 +0,0 @@ -administer usage data sharing settings: - title: 'Administer usage data sharing settings' - description: 'Allows access to change settings of usage data sharing to Open Social team.' diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.routing.yml b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.routing.yml deleted file mode 100644 index f44f9d58998..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.routing.yml +++ /dev/null @@ -1,7 +0,0 @@ -social_lets_connect_usage.data_sharing_settings: - path: '/admin/open-social/usage-data-sharing' - defaults: - _form: '\Drupal\social_lets_connect_usage\Form\LetsConnectUsageSettingsForm' - _title: 'Usage data sharing settings' - requirements: - _permission: 'administer usage data sharing settings' diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.services.yml b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.services.yml deleted file mode 100644 index 3c298ad24a6..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - plugin.manager.share_usage_data_plugin: - class: Drupal\social_lets_connect_usage\Plugin\ShareUsageDataPluginManager - parent: default_plugin_manager - arguments: ['@container.namespaces', '@cache.discovery', '@module_handler'] diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Annotation/ShareUsageDataPlugin.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Annotation/ShareUsageDataPlugin.php deleted file mode 100644 index 0fd1e9d7741..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Annotation/ShareUsageDataPlugin.php +++ /dev/null @@ -1,40 +0,0 @@ - 'item', - '#markup' => $this->t('Open Social would like to collect non-personal data to improve the product and your experience. We will never collect any personal data. You can choose which data you want to share with the Open Social team below (or none at all). The usage data is sent every 24 hours to the team.'), - ]; - $form['usage_data_enabled'] = [ - '#type' => 'checkbox', - '#title' => $this->t('Share usage data with Open Social team'), - '#description' => $this->t("Tick the box to specify which data you want to share. Keep unchecked if you don’t want to share any data."), - '#default_value' => $this->config('social_lets_connect_usage.settings')->get('usage_data_enabled'), - ]; - $form['usage_data'] = [ - '#type' => 'checkboxes', - '#options' => [ - 'website_url' => $this->t('Community URL'), - 'entity_type_count' => $this->t('Number of items per entity (e.g., nr. of members, topics, events, etc.)'), - 'open_social_version' => $this->t('Open Social version'), - 'system_data' => $this->t('System data (operating system, PHP version, and extensions)'), - 'modules_installed' => $this->t('Add-on information (including installed modules, profiles, and themes)'), - ], - '#title' => $this->t('Select which usage data to share'), - '#default_value' => $this->config('social_lets_connect_usage.settings')->get('usage_data'), - '#states' => [ - 'visible' => [ - ':input[name="usage_data_enabled"]' => ['checked' => TRUE], - ], - ], - ]; - - return parent::buildForm($form, $form_state); - } - - /** - * {@inheritdoc} - */ - public function submitForm(array &$form, FormStateInterface $form_state) { - // Filter out unchecked items. - $usage_data = $form_state->getValue('usage_data'); - foreach ($usage_data as $data => $value) { - if (!$value) { - unset($usage_data[$data]); - } - } - - // Save config. - $config = $this->config('social_lets_connect_usage.settings'); - $config->set('usage_data', $usage_data); - $usage_data_enabled = $form_state->getValue('usage_data_enabled'); - $config->set('usage_data_enabled', $usage_data_enabled); - $config->save(); - - parent::submitForm($form, $form_state); - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/QueueWorker/SendUsageData.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/QueueWorker/SendUsageData.php deleted file mode 100644 index befce887542..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/QueueWorker/SendUsageData.php +++ /dev/null @@ -1,90 +0,0 @@ -config = $config; - $this->client = $client; - } - - /** - * {@inheritdoc} - */ - public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { - return new static( - $configuration, - $plugin_id, - $plugin_definition, - $container->get('config.factory'), - $container->get('http_client') - ); - } - - /** - * Will process a queue item. - * - * $send_data['site_key'] = $site_key; - * $send_data['send_info'] = [ - * 'last_send' => $last_send, - * 'times_send' => $times_send, - * 'current_time' => $current_time, - * ]; - * $send_data['usage_data'] = array $usage_data; - */ - public function processItem($data) { - $config = $this->config->get('social_lets_connect_usage.settings'); - $usage_data_url = $config->get('url'); - - try { - $response = $this->client->post($usage_data_url, ['json' => $data]); - } - catch (RequestException $e) { - return FALSE; - } - return Json::decode($response->getBody()->getContents()); - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/EntityTypeCount.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/EntityTypeCount.php deleted file mode 100644 index 902da9daf5c..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/EntityTypeCount.php +++ /dev/null @@ -1,81 +0,0 @@ -entityTypeManager->getDefinitions(); - - foreach ($definitions as $definition) { - $entity_type_id = $definition->id(); - // We don't need to add config entities. - if ($definition instanceof ConfigEntityType) { - continue; - } - - $entity_bundle_info = \Drupal::service('entity_type.bundle.info'); - $bundle_info = $entity_bundle_info->getBundleInfo($entity_type_id); - $bundles = []; - - if (count($bundle_info) > 1) { - foreach ($bundle_info as $bundle_id => $bundle_data) { - // Suppress warning about unused variable. - unset($bundle_data); - $keys = $definition->getKeys(); - $bundle_key = $keys['bundle'] ?? 'bundle'; - - $query = \Drupal::entityQuery($entity_type_id); - $query->condition($bundle_key, $bundle_id); - $query->accessCheck(); - $query->count(); - $count = $query->execute(); - - $row = [ - 'bundle' => $bundle_id, - 'count' => $count, - ]; - - $bundles[] = $row; - } - } - - $storage = $this->entityTypeManager->getStorage($entity_type_id); - $query = $storage->getAggregateQuery(); - $query->accessCheck(); - $query->count(); - $count = $query->execute(); - - $entity = [ - 'entity_type' => $entity_type_id, - 'count' => $count, - 'bundles' => $bundles, - ]; - - $value[$entity_type_id] = $entity; - } - - return $value; - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php deleted file mode 100644 index a8f030bcb2b..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php +++ /dev/null @@ -1,67 +0,0 @@ -reset()->getList(); - $modules = $this->getExtensionsInfo($modules); - $theme_data = \Drupal::service('theme_handler')->rebuildThemeData(); - $themes = $this->getExtensionsInfo($theme_data); - $profiles = \Drupal::service('extension.list.profile')->reset()->getList(); - $profiles = $this->getExtensionsInfo($profiles); - - $value['modules'] = $modules; - $value['profiles'] = $profiles; - $value['themes'] = [ - 'themes' => $themes, - 'default' => \Drupal::service('theme_handler')->getDefault(), - ]; - - return $value; - } - - /** - * Get safe extensions info. - * - * @param \Drupal\Core\Extension\Extension[] $projects - * An array of extensions. - * - * @return array - * Returns an array of projects with safe values. - */ - private function getExtensionsInfo(array $projects): array { - $value = []; - uasort($projects, [ModuleExtensionList::class, 'sortByName']); - foreach ($projects as $project) { - $name = $project->getName(); - $value[$name] = [ - 'type' => $project->getType(), - 'name' => $name, - ]; - } - return $value; - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php deleted file mode 100644 index d000d0b5c56..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php +++ /dev/null @@ -1,39 +0,0 @@ -getExtensionInfo($profile); - if (!empty($info['version'])) { - $version = $info['version']; - } - } - return [ - 'version' => $version, - ]; - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/SystemData.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/SystemData.php deleted file mode 100644 index 068ec4d66ce..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/SystemData.php +++ /dev/null @@ -1,43 +0,0 @@ - [ - 'version' => [ - 'version' => PHP_VERSION, - 'major_minor' => PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION, - ], - 'info' => [ - 'extensions' => get_loaded_extensions(), - ], - ], - 'os' => [ - php_uname(), - ], - ]; - return $info; - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/WebsiteUrl.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/WebsiteUrl.php deleted file mode 100644 index d260e60a62a..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/WebsiteUrl.php +++ /dev/null @@ -1,32 +0,0 @@ - $base_url, - ]; - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginBase.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginBase.php deleted file mode 100644 index 46af8e4c621..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginBase.php +++ /dev/null @@ -1,103 +0,0 @@ -entityTypeManager = $entity_type_manager; - $this->config = $config; - } - - /** - * The create method. - * - * @param \Symfony\Component\DependencyInjection\ContainerInterface $container - * Container interface. - * @param array $configuration - * An array of configuration. - * @param string $plugin_id - * The plugin id. - * @param mixed $plugin_definition - * The plugin definition. - * - * @return \Drupal\Core\Plugin\ContainerFactoryPluginInterface|\Drupal\social_user_export\Plugin\UserExportPluginBase - * Returns the UserExportPluginBase. - */ - 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('config.factory') - ); - } - - /** - * Get the value. - * - * @return array - * $json array. - */ - public function getValue() { - return []; - } - - /** - * Check if this plugin should be enabled. - */ - public function enabled() { - $config = $this->config->get('social_lets_connect_usage.settings'); - $usage_data_settings = $config->get('usage_data'); - - $plugin_definition = $this->getPluginDefinition(); - if (!empty($plugin_definition['setting']) && in_array($plugin_definition['setting'], $usage_data_settings)) { - return TRUE; - } - return FALSE; - } - -} diff --git a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginInterface.php b/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginInterface.php deleted file mode 100644 index 0c37567cc19..00000000000 --- a/modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginInterface.php +++ /dev/null @@ -1,25 +0,0 @@ -alterInfo('social_lets_connect_usage_share_usage_data_plugin_info'); - $this->setCacheBackend($cache_backend, 'social_lets_connect_usage_share_usage_data_plugin_plugins'); - } - -} diff --git a/modules/custom/social_lets_connect/social_lets_connect.install b/modules/custom/social_lets_connect/social_lets_connect.install index 83c107db11a..8d2ec9508d6 100644 --- a/modules/custom/social_lets_connect/social_lets_connect.install +++ b/modules/custom/social_lets_connect/social_lets_connect.install @@ -11,19 +11,3 @@ function social_lets_connect_update_last_removed() : int { return 10001; } - -/** - * Uninstall social_lets_connect_usage module. - */ -function social_lets_connect_update_12001() : void { - // This update hook was previously called social_core_update_10001 which meant - // it didn't run. - $modules = [ - 'social_lets_connect_usage', - ]; - \Drupal::service('module_installer')->uninstall($modules); - - // Delete configs. - $config = \Drupal::configFactory()->getEditable('social_lets_connect_usage.settings'); - $config->delete(); -} diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f75b5692331..804a39aed3f 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -2431,56 +2431,7 @@ parameters: path: modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php - - message: "#^Call to an undefined method object\\:\\:enabled\\(\\)\\.$#" - count: 1 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.module - - - - message: "#^Call to an undefined method object\\:\\:getValue\\(\\)\\.$#" - count: 1 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.module - - - message: "#^Function social_lets_connect_usage_cron\\(\\) has no return type specified\\.$#" - count: 1 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/social_lets_connect_usage.module - - - - message: "#^Method Drupal\\\\social_lets_connect_usage\\\\Form\\\\LetsConnectUsageSettingsForm\\:\\:submitForm\\(\\) has no return type specified\\.$#" - count: 1 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Form/LetsConnectUsageSettingsForm.php - - - - message: "#^Method Drupal\\\\social_lets_connect_usage\\\\Plugin\\\\QueueWorker\\\\SendUsageData\\:\\:processItem\\(\\) has no return type specified\\.$#" - count: 1 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/QueueWorker/SendUsageData.php - - - - message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#" - count: 2 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/EntityTypeCount.php - - - - message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#" - count: 4 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/ModulesInstalled.php - - - - message: "#^\\\\Drupal calls should be avoided in classes, use dependency injection instead$#" - count: 2 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPlugin/OpenSocialVersion.php - - - - message: "#^Method Drupal\\\\social_lets_connect_usage\\\\Plugin\\\\ShareUsageDataPluginBase\\:\\:enabled\\(\\) has no return type specified\\.$#" - count: 1 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginBase.php - - - - message: "#^Method Drupal\\\\social_lets_connect_usage\\\\Plugin\\\\ShareUsageDataPluginInterface\\:\\:enabled\\(\\) has no return type specified\\.$#" - count: 1 - path: modules/custom/social_lets_connect/modules/social_lets_connect_usage/src/Plugin/ShareUsageDataPluginInterface.php - - - message: "#^Function social_lets_connect_toolbar_alter\\(\\) has no return type specified\\.$#" count: 1 path: modules/custom/social_lets_connect/social_lets_connect.module From 46f8e2887ab594789a7a5a0ed4aecb630603f4ae Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Wed, 20 Mar 2024 16:39:09 -0300 Subject: [PATCH 02/11] Removed Social Lazy Loading Images module and they references --- .../social_lazy_loading_images.info.yml | 9 -- .../social_lazy_loading_images.services.yml | 5 -- .../SocialLazyLoadingImageDisplayOverride.php | 89 ------------------- phpstan-baseline.neon | 5 -- 4 files changed, 108 deletions(-) delete mode 100644 modules/custom/social_lazy_loading/social_lazy_loading_images/social_lazy_loading_images.info.yml delete mode 100644 modules/custom/social_lazy_loading/social_lazy_loading_images/social_lazy_loading_images.services.yml delete mode 100644 modules/custom/social_lazy_loading/social_lazy_loading_images/src/SocialLazyLoadingImageDisplayOverride.php diff --git a/modules/custom/social_lazy_loading/social_lazy_loading_images/social_lazy_loading_images.info.yml b/modules/custom/social_lazy_loading/social_lazy_loading_images/social_lazy_loading_images.info.yml deleted file mode 100644 index 81e9c0815e7..00000000000 --- a/modules/custom/social_lazy_loading/social_lazy_loading_images/social_lazy_loading_images.info.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: 'Social Lazy Loading Image' -type: module -description: 'Module for lazy loading images using the blazy library.' -core_version_requirement: ^9 || ^10 -lifecycle: deprecated -lifecycle_link: "https://www.drupal.org/node/3173719" -package: Social -dependencies: - - drupal:lazy diff --git a/modules/custom/social_lazy_loading/social_lazy_loading_images/social_lazy_loading_images.services.yml b/modules/custom/social_lazy_loading/social_lazy_loading_images/social_lazy_loading_images.services.yml deleted file mode 100644 index 46479892604..00000000000 --- a/modules/custom/social_lazy_loading/social_lazy_loading_images/social_lazy_loading_images.services.yml +++ /dev/null @@ -1,5 +0,0 @@ -services: - social_lazy_loading_images.overrider: - class: Drupal\social_lazy_loading_images\SocialLazyLoadingImageDisplayOverride - tags: - - { name: config.factory.override, priority: 200 } diff --git a/modules/custom/social_lazy_loading/social_lazy_loading_images/src/SocialLazyLoadingImageDisplayOverride.php b/modules/custom/social_lazy_loading/social_lazy_loading_images/src/SocialLazyLoadingImageDisplayOverride.php deleted file mode 100644 index 51de51ddf42..00000000000 --- a/modules/custom/social_lazy_loading/social_lazy_loading_images/src/SocialLazyLoadingImageDisplayOverride.php +++ /dev/null @@ -1,89 +0,0 @@ - 'field_event_image', - 'core.entity_view_display.node.event.hero' => 'field_event_image', - 'core.entity_view_display.node.event.activity' => 'field_event_image', - 'core.entity_view_display.node.event.activity_comment' => 'field_event_image', - // Topic. - 'core.entity_view_display.node.topic.teaser' => 'field_topic_image', - 'core.entity_view_display.node.topic.activity' => 'field_topic_image', - 'core.entity_view_display.node.topic.activity_comment' => 'field_topic_image', - // Page. - 'core.entity_view_display.node.page.teaser' => 'field_page_image', - 'core.entity_view_display.node.page.activity' => 'field_page_image', - 'core.entity_view_display.node.page.activity_comment' => 'field_page_image', - // Groups. - 'core.entity_view_display.group.flexible_group.teaser' => 'field_group_image', - 'core.entity_view_display.group.flexible_group.hero' => 'field_group_image', - // Posts. - 'core.entity_view_display.post.photo.activity' => 'field_post_image', - 'core.entity_view_display.post.photo.activity_comment' => 'field_post_image', - 'core.entity_view_display.post.photo.default' => 'field_post_image', - // Books. - 'core.entity_view_display.node.book.teaser' => 'field_book_image', - 'core.entity_view_display.node.book.activity' => 'field_book_image', - 'core.entity_view_display.node.book.activity_comment' => 'field_book_image', - // Profile. - 'core.entity_view_display.profile.profile.compact' => 'field_profile_image', - 'core.entity_view_display.profile.profile.compact_notification' => 'field_profile_image', - 'core.entity_view_display.profile.profile.compact_teaser' => 'field_profile_image', - 'core.entity_view_display.profile.profile.hero' => 'field_profile_image', - 'core.entity_view_display.profile.profile.small' => 'field_profile_image', - 'core.entity_view_display.profile.profile.small_teaser' => 'field_profile_image', - 'core.entity_view_display.profile.profile.table' => 'field_profile_image', - 'core.entity_view_display.profile.profile.teaser' => 'field_profile_image', - ]; - - foreach ($config_fields as $config_name => $field_name) { - if (in_array($config_name, $names)) { - $overrides[$config_name]['dependencies']['module']['lazy'] = 'lazy'; - $overrides[$config_name]['content'][$field_name]['third_party_settings']['lazy'] = ['lazy_image' => '1']; - } - } - - return $overrides; - } - - /** - * {@inheritdoc} - */ - public function getCacheableMetadata($name) { - return new CacheableMetadata(); - } - - /** - * {@inheritdoc} - */ - public function createConfigObject($name, $collection = StorageInterface::DEFAULT_COLLECTION) { - return NULL; - } - - /** - * {@inheritdoc} - */ - public function getCacheSuffix() { - return 'SocialLazyLoadingImageDisplayOverride'; - } - -} diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 804a39aed3f..264646e5ae3 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -2415,11 +2415,6 @@ parameters: count: 1 path: modules/custom/social_language/src/SocialLanguageServiceProvider.php - - - message: "#^Method Drupal\\\\social_lazy_loading_images\\\\SocialLazyLoadingImageDisplayOverride\\:\\:createConfigObject\\(\\) should return Drupal\\\\Core\\\\Config\\\\StorableConfigBase but returns null\\.$#" - count: 1 - path: modules/custom/social_lazy_loading/social_lazy_loading_images/src/SocialLazyLoadingImageDisplayOverride.php - - message: "#^Method Drupal\\\\social_lazy_loading\\\\SocialLazyLoadingTextFormatOverride\\:\\:addFilterOverride\\(\\) has no return type specified\\.$#" count: 1 From bd17a5b1f5bdff69cebc287ff4004593c5c83c43 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Wed, 20 Mar 2024 19:33:30 -0300 Subject: [PATCH 03/11] Removed deprecateion function from Social Event modules --- .../src/Form/EnrollInviteEmailForm.php | 7 ---- .../src/Form/EventInviteEnrollActionForm.php | 3 +- .../social_event_max_enroll.services.yml | 1 - .../src/Service/EventMaxEnrollService.php | 17 ++------ .../social_event/social_event.services.yml | 5 --- .../src/Form/EnrollActionForm.php | 8 ---- .../src/Service/SocialEventEnrollService.php | 42 ------------------- .../SocialEventEnrollServiceInterface.php | 29 ------------- phpstan-baseline.neon | 28 ------------- 9 files changed, 5 insertions(+), 135 deletions(-) delete mode 100644 modules/social_features/social_event/src/Service/SocialEventEnrollService.php delete mode 100644 modules/social_features/social_event/src/Service/SocialEventEnrollServiceInterface.php diff --git a/modules/social_features/social_event/modules/social_event_invite/src/Form/EnrollInviteEmailForm.php b/modules/social_features/social_event/modules/social_event_invite/src/Form/EnrollInviteEmailForm.php index 3b961c36eaf..8b2da4b6170 100644 --- a/modules/social_features/social_event/modules/social_event_invite/src/Form/EnrollInviteEmailForm.php +++ b/modules/social_features/social_event/modules/social_event_invite/src/Form/EnrollInviteEmailForm.php @@ -15,7 +15,6 @@ use Drupal\social_core\Form\InviteEmailBaseForm; use Drupal\social_event\Entity\Node\Event; use Drupal\social_event\EventEnrollmentInterface; -use Drupal\social_event\Service\SocialEventEnrollServiceInterface; use Drupal\social_event_max_enroll\Service\EventMaxEnrollService; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -39,11 +38,6 @@ class EnrollInviteEmailForm extends InviteEmailBaseForm { */ protected Token $token; - /** - * The social event enroll. - */ - protected SocialEventEnrollServiceInterface $eventEnrollService; - /** * The module handler service. */ @@ -76,7 +70,6 @@ public static function create(ContainerInterface $container) { $instance->entityStorage = $instance->entityTypeManager->getStorage('event_enrollment'); $instance->tempStoreFactory = $container->get('tempstore.private'); $instance->token = $container->get('token'); - $instance->eventEnrollService = $container->get('social_event.enroll'); $instance->moduleHandler = $container->get('module_handler'); if ($instance->moduleHandler->moduleExists('social_event_max_enroll')) { $instance->eventMaxEnrollService = $container->get('social_event_max_enroll.service'); diff --git a/modules/social_features/social_event/modules/social_event_invite/src/Form/EventInviteEnrollActionForm.php b/modules/social_features/social_event/modules/social_event_invite/src/Form/EventInviteEnrollActionForm.php index 201e2d57ada..f11a29f32f4 100644 --- a/modules/social_features/social_event/modules/social_event_invite/src/Form/EventInviteEnrollActionForm.php +++ b/modules/social_features/social_event/modules/social_event_invite/src/Form/EventInviteEnrollActionForm.php @@ -5,6 +5,7 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Form\FormStateInterface; use Drupal\node\Entity\Node; +use Drupal\social_event\Entity\Node\Event; use Drupal\social_event\EventEnrollmentInterface; use Drupal\social_event\Form\EnrollActionForm; @@ -32,7 +33,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Node $nod if (!$current_user->isAnonymous()) { // Check if enrollment is enabled. - if ($node === NULL || !$this->eventEnrollService->isEnabled($node)) { + if ($node === NULL || ($node instanceof Event && !$node->isEnrollmentEnabled())) { return []; } $conditions = [ diff --git a/modules/social_features/social_event/modules/social_event_max_enroll/social_event_max_enroll.services.yml b/modules/social_features/social_event/modules/social_event_max_enroll/social_event_max_enroll.services.yml index c8ec581c149..0b01455a3ec 100644 --- a/modules/social_features/social_event/modules/social_event_max_enroll/social_event_max_enroll.services.yml +++ b/modules/social_features/social_event/modules/social_event_max_enroll/social_event_max_enroll.services.yml @@ -9,7 +9,6 @@ services: arguments: - '@entity_type.manager' - '@config.factory' - - '@social_event.enroll' social_event_invite.route_subscriber: class: Drupal\social_event_max_enroll\Routing\RouteSubscriber tags: diff --git a/modules/social_features/social_event/modules/social_event_max_enroll/src/Service/EventMaxEnrollService.php b/modules/social_features/social_event/modules/social_event_max_enroll/src/Service/EventMaxEnrollService.php index 9f11334b0fe..66a1bf54cfe 100644 --- a/modules/social_features/social_event/modules/social_event_max_enroll/src/Service/EventMaxEnrollService.php +++ b/modules/social_features/social_event/modules/social_event_max_enroll/src/Service/EventMaxEnrollService.php @@ -5,7 +5,7 @@ use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\node\NodeInterface; -use Drupal\social_event\Service\SocialEventEnrollServiceInterface; +use Drupal\social_event\Entity\Node\Event; /** * Class EventMaxEnrollService. @@ -28,13 +28,6 @@ class EventMaxEnrollService implements EventMaxEnrollServiceInterface { */ protected $configFactory; - /** - * The social event enroll. - * - * @var \Drupal\social_event\Service\SocialEventEnrollServiceInterface - */ - protected $socialEventEnroll; - /** * EventMaxEnrollService constructor. * @@ -42,20 +35,16 @@ class EventMaxEnrollService implements EventMaxEnrollServiceInterface { * The entity type manager. * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory * Injection of the configFactory. - * @param \Drupal\social_event\Service\SocialEventEnrollServiceInterface $social_event_enroll - * The social event enroll. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ public function __construct( EntityTypeManagerInterface $entity_type_manager, - ConfigFactoryInterface $configFactory, - SocialEventEnrollServiceInterface $social_event_enroll + ConfigFactoryInterface $configFactory ) { $this->storage = $entity_type_manager->getStorage('event_enrollment'); $this->configFactory = $configFactory; - $this->socialEventEnroll = $social_event_enroll; } /** @@ -88,7 +77,7 @@ public function getEnrollmentsLeft(NodeInterface $node) { */ public function isEnabled(NodeInterface $node) { // Check if we're working with an event. - if ($this->socialEventEnroll->isEnabled($node)) { + if ($node instanceof Event && $node->isEnrollmentEnabled()) { $config = $this->configFactory->get('social_event_max_enroll.settings'); // Check if feature is enabled. diff --git a/modules/social_features/social_event/social_event.services.yml b/modules/social_features/social_event/social_event.services.yml index b85e1175f18..22600d86426 100644 --- a/modules/social_features/social_event/social_event.services.yml +++ b/modules/social_features/social_event/social_event.services.yml @@ -15,11 +15,6 @@ services: tags: - { name: config.factory.override, priority: 5 } - { name: social_language_defaults } - social_event.enroll: - class: Drupal\social_event\Service\SocialEventEnrollService - arguments: - - '@config.factory' - deprecated: The "%service_id%" service is deprecated in social:11.5.0 and is removed from social:13.0.0. See https://www.drupal.org/project/social/issues/3306568 social_event.enrollments_access: class: Drupal\social_event\Access\EventEnrollmentsAccessCheck tags: diff --git a/modules/social_features/social_event/src/Form/EnrollActionForm.php b/modules/social_features/social_event/src/Form/EnrollActionForm.php index dddd42db020..575df33150e 100644 --- a/modules/social_features/social_event/src/Form/EnrollActionForm.php +++ b/modules/social_features/social_event/src/Form/EnrollActionForm.php @@ -68,13 +68,6 @@ class EnrollActionForm extends FormBase { */ protected $moduleHandler; - /** - * The event enroll service. - * - * @var \Drupal\social_event\Service\SocialEventEnrollServiceInterface - */ - protected $eventEnrollService; - /** * The form builder. * @@ -107,7 +100,6 @@ public static function create(ContainerInterface $container) { $instance->userStorage = $container->get('entity_type.manager')->getStorage('user'); $instance->configFactory = $container->get('config.factory'); $instance->moduleHandler = $container->get('module_handler'); - $instance->eventEnrollService = $container->get('social_event.enroll'); $instance->formBuilder = $container->get('form_builder'); $instance->eventHelper = $container->get('social_event.status_helper'); return $instance; diff --git a/modules/social_features/social_event/src/Service/SocialEventEnrollService.php b/modules/social_features/social_event/src/Service/SocialEventEnrollService.php deleted file mode 100644 index 83ef2385c4b..00000000000 --- a/modules/social_features/social_event/src/Service/SocialEventEnrollService.php +++ /dev/null @@ -1,42 +0,0 @@ -eventSettings = $config_factory->get('social_event.settings'); - } - - /** - * {@inheritdoc} - */ - public function isEnabled(NodeInterface $node) { - @trigger_error(__METHOD__ . '() is deprecated in social:11.5.0 and is removed from social:13.0.0. Use bundled node object itself `$event->isEnrollmentEnabled()` instead. See https://www.drupal.org/project/social/issues/3306568', E_USER_DEPRECATED); - return $node instanceof Event && - $node->isEnrollmentEnabled(); - } - -} diff --git a/modules/social_features/social_event/src/Service/SocialEventEnrollServiceInterface.php b/modules/social_features/social_event/src/Service/SocialEventEnrollServiceInterface.php deleted file mode 100644 index 89d3a00bf5e..00000000000 --- a/modules/social_features/social_event/src/Service/SocialEventEnrollServiceInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -isEnrollmentEnabled()` instead. - * @see https://www.drupal.org/project/social/issues/3306568 - */ - public function isEnabled(NodeInterface $node); - -} diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 264646e5ae3..b3c9579bef7 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5321,11 +5321,6 @@ parameters: count: 1 path: modules/social_features/social_event/modules/social_event_invite/src/Form/EnrollInviteEmailForm.php - - - message: "#^The \"social_event\\.enroll\" service is deprecated in social\\:11\\.5\\.0 and is removed from social\\:13\\.0\\.0\\. See https\\://www\\.drupal\\.org/project/social/issues/3306568$#" - count: 1 - path: modules/social_features/social_event/modules/social_event_invite/src/Form/EnrollInviteEmailForm.php - - message: "#^Method Drupal\\\\social_event_invite\\\\Form\\\\EnrollInviteUserForm\\:\\:cancelForm\\(\\) has no return type specified\\.$#" count: 1 @@ -5341,15 +5336,6 @@ parameters: count: 1 path: modules/social_features/social_event/modules/social_event_invite/src/Form/EnrollInviteUserForm.php - - - message: """ - #^Call to deprecated method isEnabled\\(\\) of class Drupal\\\\social_event\\\\Service\\\\SocialEventEnrollServiceInterface\\: - in social\\:11\\.5\\.0 and is removed from social\\:13\\.0\\.0\\. Use - bundled node object itself `\\$event\\-\\>isEnrollmentEnabled\\(\\)` instead\\.$# - """ - count: 1 - path: modules/social_features/social_event/modules/social_event_invite/src/Form/EventInviteEnrollActionForm.php - - message: "#^Method Drupal\\\\social_event_invite\\\\Form\\\\EventInviteEnrollActionForm\\:\\:submitForm\\(\\) has no return type specified\\.$#" count: 1 @@ -6000,15 +5986,6 @@ parameters: count: 1 path: modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php - - - message: """ - #^Call to deprecated method isEnabled\\(\\) of class Drupal\\\\social_event\\\\Service\\\\SocialEventEnrollServiceInterface\\: - in social\\:11\\.5\\.0 and is removed from social\\:13\\.0\\.0\\. Use - bundled node object itself `\\$event\\-\\>isEnrollmentEnabled\\(\\)` instead\\.$# - """ - count: 1 - path: modules/social_features/social_event/modules/social_event_max_enroll/src/Service/EventMaxEnrollService.php - - message: "#^Method Drupal\\\\social_event_max_enroll\\\\SocialEventMaxEnrollServiceProvider\\:\\:alter\\(\\) has no return type specified\\.$#" count: 1 @@ -6564,11 +6541,6 @@ parameters: count: 1 path: modules/social_features/social_event/src/Form/EnrollActionForm.php - - - message: "#^The \"social_event\\.enroll\" service is deprecated in social\\:11\\.5\\.0 and is removed from social\\:13\\.0\\.0\\. See https\\://www\\.drupal\\.org/project/social/issues/3306568$#" - count: 1 - path: modules/social_features/social_event/src/Form/EnrollActionForm.php - - message: "#^Method Drupal\\\\social_event\\\\Form\\\\EnrollRequestAnonymousForm\\:\\:buildForm\\(\\) has parameter \\$options with no type specified\\.$#" count: 1 From c973ec0afed804a95cc33c5907f7cca11165f540 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Thu, 21 Mar 2024 09:07:48 -0300 Subject: [PATCH 04/11] Removed deprecateion function from Activity Logger modules --- .../src/Service/ActivityLoggerFactory.php | 50 ------------------- phpstan-baseline.neon | 5 -- 2 files changed, 55 deletions(-) diff --git a/modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php b/modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php index 8b270e85dea..887c0b4d720 100644 --- a/modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php +++ b/modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php @@ -302,56 +302,6 @@ private function debugMessageTemplateIsCompatible(string $message_type) : bool { return TRUE; } - /** - * Create field instances. - * - * @param string $message_type - * The typeof message. - * @param array $fields - * The data to insert in the field instances. - */ - protected function createFieldInstances($message_type, array $fields) { - @trigger_error(__METHOD__ . ' is deprecated in social:11.7.0 and is removed from social:13.0.0. Create the fields using `config/install` instead. See https://www.drupal.org/node/3232246', E_USER_DEPRECATED); - foreach ($fields as $field) { - $id = 'message.' . $message_type . '.' . $field['name']; - $config_storage = $this->entityTypeManager - ->getStorage('field_config'); - // Create field instances if they do not exists. - if ($config_storage->load($id) === NULL) { - $field_instance = [ - 'langcode' => 'en', - 'status' => TRUE, - 'config' => [ - 'field.storage.message.' . $field['name'], - 'message.template.' . $message_type, - ], - 'module' => ['options'], - 'id' => $id, - 'field_name' => $field['name'], - 'entity_type' => 'message', - 'bundle' => $message_type, - 'label' => '', - 'description' => '', - 'required' => FALSE, - 'translatable' => FALSE, - 'default_value' => [], - 'default_value_callback' => '', - 'field_type' => $field['type'], - ]; - - if ($field['type'] === 'list_string') { - $field_instance['module'] = ['options']; - $field_instance['settings'] = []; - } - elseif ($field['type'] === 'dynamic_entity_reference') { - $field_instance['module'] = ['dynamic_entity_reference']; - $field_instance['settings'] = []; - } - $config_storage->create($field_instance)->save(); - } - } - } - /** * Checks if a message already exists. * diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index b3c9579bef7..c3b8366d425 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -780,11 +780,6 @@ parameters: count: 1 path: modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php - - - message: "#^Method Drupal\\\\activity_logger\\\\Service\\\\ActivityLoggerFactory\\:\\:createFieldInstances\\(\\) has no return type specified\\.$#" - count: 1 - path: modules/custom/activity_logger/src/Service/ActivityLoggerFactory.php - - message: "#^Function activity_send_schema\\(\\) has no return type specified\\.$#" count: 1 From 4d97d664a094568e858304acf6dd17d99bf14e12 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Thu, 21 Mar 2024 09:17:20 -0300 Subject: [PATCH 05/11] Removed deprecateion function from Social Album modules --- .../social_album/social_album.install | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/modules/social_features/social_album/social_album.install b/modules/social_features/social_album/social_album.install index 375820431f1..79a1b2763f3 100644 --- a/modules/social_features/social_album/social_album.install +++ b/modules/social_features/social_album/social_album.install @@ -63,26 +63,6 @@ function social_album_install() { _social_album_blocks(); } -/** - * Add new paths where blocks should be displayed. - * - * @param string $pages - * The current sequence of block paths. - * @param array $paths - * List of blocks which should be updated and paths which should be added. - * - * @deprecated in social:11.4.0 and is removed from social:13.0.0. Use - * _social_core_blocks_paths instead. - * - * @see https://www.drupal.org/node/3291491 - * - * @return string - * List of block paths with new paths. - */ -function _social_album_install_blocks(string $pages, array $paths) { - return _social_core_blocks_paths($pages, $paths); -} - /** * Implements hook_uninstall(). */ From e6b48758d3f3068c4f5840e77680f21418022270 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Thu, 21 Mar 2024 09:40:37 -0300 Subject: [PATCH 06/11] Removed deprecateion function from Social Core modules --- .../social_core/social_core.api.php | 20 ------------------- .../src/Controller/SocialCoreController.php | 6 ------ .../src/Routing/RouteSubscriber.php | 6 ------ 3 files changed, 32 deletions(-) diff --git a/modules/social_features/social_core/social_core.api.php b/modules/social_features/social_core/social_core.api.php index ba1918edf2f..aca535143ce 100755 --- a/modules/social_features/social_core/social_core.api.php +++ b/modules/social_features/social_core/social_core.api.php @@ -66,26 +66,6 @@ function hook_social_core_title_alter(array &$titles) { $titles['node']['bundles']['event'] = 'an'; } -/** - * Provide a method to alter the article for a node. E.g. 'a', 'an', 'the'. - * - * @param array $node_types - * The filter format that is default. - * - * @deprecated in social:11.4.0 and is removed from social:13.0.0. Use - * hook_social_core_title_alter instead. - * - * @see https://www.drupal.org/node/3285045 - * @see \Drupal\social_core\Routing\RouteSubscriber::alterRoutes() - * @see \Drupal\social_core\Controller\SocialCoreController::addPageTitle() - * - * @ingroup social_core_api - */ -function hook_social_node_title_prefix_articles_alter(array &$node_types) { - // The default is set to 'a'. - $node_types['discussions'] = 'an'; -} - /** * Provides route for node page where should be displayed simple title. * diff --git a/modules/social_features/social_core/src/Controller/SocialCoreController.php b/modules/social_features/social_core/src/Controller/SocialCoreController.php index 2582d87b7c4..16a5726e441 100644 --- a/modules/social_features/social_core/src/Controller/SocialCoreController.php +++ b/modules/social_features/social_core/src/Controller/SocialCoreController.php @@ -244,12 +244,6 @@ public function addPageTitle(): string { if (!isset($titles['node']['bundles'])) { $titles['node']['bundles'] = []; } - - $this->moduleHandler()->alterDeprecated( - 'Deprecated in social:11.4.0 and is removed from social:13.0.0. Use hook_social_core_title_alter instead. See https://www.drupal.org/node/3285045', - 'social_node_title_prefix_articles', - $titles['node']['bundles'], - ); } if (($route_name = $this->routeMatch->getRouteName()) === NULL) { diff --git a/modules/social_features/social_core/src/Routing/RouteSubscriber.php b/modules/social_features/social_core/src/Routing/RouteSubscriber.php index 56796b27e76..73ca37bddfa 100644 --- a/modules/social_features/social_core/src/Routing/RouteSubscriber.php +++ b/modules/social_features/social_core/src/Routing/RouteSubscriber.php @@ -52,12 +52,6 @@ protected function alterRoutes(RouteCollection $collection) { if (!isset($titles['node']['bundles'])) { $titles['node']['bundles'] = []; } - - $this->moduleHandler->alterDeprecated( - 'Deprecated in social:11.4.0 and is removed from social:13.0.0. Use hook_social_core_title_alter instead. See https://www.drupal.org/node/3285045', - 'social_node_title_prefix_articles', - $titles['node']['bundles'], - ); } // Write our own page title resolver for creation pages. From d94524824719b2483b9e5179618af9ebbc7ab3c1 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Thu, 21 Mar 2024 10:07:14 -0300 Subject: [PATCH 07/11] Removed deprecateion function from Social Group modules --- .../social_group_flexible_group.api.php | 33 ------ .../social_group_flexible_group.module | 18 --- .../views/filter/FlexibleGroupNodeAccess.php | 106 ------------------ .../social_group_request.api.php | 32 ------ .../social_group/social_group.module | 29 ----- .../social_group/src/JoinManager.php | 7 -- phpstan-baseline.neon | 5 - 7 files changed, 230 deletions(-) delete mode 100644 modules/social_features/social_group/modules/social_group_flexible_group/src/Plugin/views/filter/FlexibleGroupNodeAccess.php delete mode 100644 modules/social_features/social_group/modules/social_group_request/social_group_request.api.php diff --git a/modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.api.php b/modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.api.php index 15d7a87711b..66fef7d02cc 100644 --- a/modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.api.php +++ b/modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.api.php @@ -22,39 +22,6 @@ function hook_social_group_flexible_group_content_routes_alter(array &$content_r $content_routes[] = 'view.group_members.page_group_members'; } -/** - * Provide a description for a given key from the flexible group visibility. - * - * @param string $key - * The visibility option name. - * @param string $description - * An explanation of a visibility option as HTML markup text. - * - * @deprecated in social:11.5.0 and is removed from social:13.0.0. Use - * hook_social_group_group_visibility_description_alter instead. - * - * @see https://www.drupal.org/node/3302921 - * - * @ingroup social_group_api - */ -function hook_social_group_flexible_group_allowed_visibility_description_alter(string $key, string &$description) { - switch ($key) { - case 'custom_role_1': - $description = '

'; - $description .= '' . t('Custom role 1')->render() . ''; - $description .= '-' . t('All users with this role can see it')->render(); - $description .= '

'; - break; - - case 'custom_role_2': - $description = '

'; - $description .= '' . t('Custom role 2')->render() . ''; - $description .= '-' . t('All users with this role can change it')->render(); - $description .= '

'; - break; - } -} - /** * @} End of "addtogroup hooks". */ diff --git a/modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.module b/modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.module index e87c9e6a1e4..1dc47cff21b 100644 --- a/modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.module +++ b/modules/social_features/social_group/modules/social_group_flexible_group/social_group_flexible_group.module @@ -42,24 +42,6 @@ function social_group_flexible_group_social_group_types_alter(array &$social_gro $social_group_types[] = 'flexible_group'; } -/** - * Implements hook_views_data_alter(). - * - * @deprecated in social:11.9.0 and is removed from social:13.0.0. - * Use views filter "node_access" from "node" module instead. - * @see https://www.drupal.org/project/social/issues/3358489 - */ -function social_group_flexible_group_views_data_alter(array &$data): void { - $data['node_access']['flexible_group_node_access'] = [ - 'title' => t('Filter nodes, with visibility group, placed in group you are not a member of.'), - 'filter' => [ - 'title' => t('Filter nodes, with visibility group, placed in group you are not a member of.'), - 'help' => t('Filter nodes, with visibility group, placed in group you are not a member of.'), - 'id' => 'flexible_group_node_access', - ], - ]; -} - /** * Implements hook_form_FORM_ID_form_alter(). */ diff --git a/modules/social_features/social_group/modules/social_group_flexible_group/src/Plugin/views/filter/FlexibleGroupNodeAccess.php b/modules/social_features/social_group/modules/social_group_flexible_group/src/Plugin/views/filter/FlexibleGroupNodeAccess.php deleted file mode 100644 index 201b6bf5076..00000000000 --- a/modules/social_features/social_group/modules/social_group_flexible_group/src/Plugin/views/filter/FlexibleGroupNodeAccess.php +++ /dev/null @@ -1,106 +0,0 @@ -view->getUser(); - /** @var \Drupal\views\Plugin\views\query\Sql $query */ - $query = $this->query; - - $group_access = NULL; - if (!$account->hasPermission('administer nodes') && !$account->hasPermission('bypass node access')) { - // Ensure we check for group content. - // Join node table(s). - $configuration = [ - 'left_table' => 'node_field_data', - 'left_field' => 'nid', - 'table' => 'group_relationship_field_data', - 'field' => 'entity_id', - 'operator' => '=', - ]; - - $join = Views::pluginManager('join')->createInstance('standard', $configuration); - // @phpstan-ignore-next-line - $query->addRelationship('membership', $join, 'node_field_data'); - - // Add extra condition for Group Membership - // related check in Flexible groups. - // @phpstan-ignore-next-line - $group_memberships = \Drupal::service('social_group.helper_service')->getAllGroupsForUser($account->id()); - if (!empty($group_memberships) && !$account->isAnonymous()) { - // OR content is GROUP. - $group_access = new Condition('OR'); - $group_access->condition('membership.gid', $group_memberships, 'IN'); - } - - // Also check for Open / Public within groups. - $configuration = [ - 'left_table' => 'node_field_data', - 'left_field' => 'nid', - 'table' => 'node__field_content_visibility', - 'field' => 'entity_id', - 'operator' => '=', - ]; - - $join = Views::pluginManager('join')->createInstance('standard', $configuration); - // @phpstan-ignore-next-line - $query->addRelationship('field_visibility_relationship', $join, 'node__field_content_visibility'); - - $group_visible = new Condition('OR'); - $group_visible->condition('field_content_visibility_value', 'public'); - if (!$account->isAnonymous()) { - $group_visible->condition('field_content_visibility_value', 'community'); - } - if ($group_access !== NULL) { - $group_visible->condition($group_access); - } - - // And we should check for open / public. - $query->addWhere('visibility', $group_visible); - } - } - - /** - * {@inheritdoc} - */ - public function getCacheContexts(): array { - $contexts = parent::getCacheContexts(); - - $contexts[] = 'user.node_grants:view'; - - return $contexts; - } - -} diff --git a/modules/social_features/social_group/modules/social_group_request/social_group_request.api.php b/modules/social_features/social_group/modules/social_group_request/social_group_request.api.php deleted file mode 100644 index 221ac535af3..00000000000 --- a/modules/social_features/social_group/modules/social_group_request/social_group_request.api.php +++ /dev/null @@ -1,32 +0,0 @@ -moduleHandler->alterDeprecated( - 'Deprecated in social:11.2.0 and is removed from social:13.0.0. Use hook_social_group_join_method_usage instead. See https://www.drupal.org/node/3254715', - 'social_group_request', - $new_types, - ); - $added_types = $removed_types = []; foreach (array_unique(array_merge($old_types, $new_types)) as $type) { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index c3b8366d425..0db9d2c5970 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -3066,11 +3066,6 @@ parameters: count: 1 path: modules/social_features/social_album/social_album.install - - - message: "#^Not allowed to call private function _social_core_blocks_paths from module social_album\\.$#" - count: 1 - path: modules/social_features/social_album/social_album.install - - message: "#^Not allowed to call private function _social_core_install_blocks from module social_album\\.$#" count: 1 From 4ca7b7132fdb9dc28e5f26e38ea4ae788757fa35 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Thu, 21 Mar 2024 10:08:50 -0300 Subject: [PATCH 08/11] Removed deprecateion function from Social Tagging modules --- .../social_tagging/social_tagging.module | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/modules/social_features/social_tagging/social_tagging.module b/modules/social_features/social_tagging/social_tagging.module index f7225767cc7..0f9082bd361 100644 --- a/modules/social_features/social_tagging/social_tagging.module +++ b/modules/social_features/social_tagging/social_tagging.module @@ -608,25 +608,6 @@ function social_tagging_form_views_exposed_form_alter(&$form, FormStateInterface } } -/** - * Main term names to machine name for on node edit / validate. - * - * @param string $text - * A node. - * - * @return mixed|string - * A machine name so it can be used programmatically. - * - * @deprecated in social:11.3.10 and is removed from social:13.0.0. Use - * \Drupal::service('social_core.machine_name')->transform() instead. - * - * @see https://www.drupal.org/node/3306214 - */ -function social_tagging_to_machine_name($text) { - @trigger_error('social_tagging_to_machine_name() is deprecated in social:11.3.10 and is removed from social:13.0.0. Use "\Drupal::service(\'social_core.machine_name\')->transform()" instead. See https://www.drupal.org/node/3306214', E_USER_DEPRECATED); - return preg_replace('@[^a-z0-9-]+@', '_', strtolower($text)); -} - /** * Implements hook_preprocess_profile(). */ From 4f52bfa8d4a4f894761d74d3a51357198f5b7e30 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Thu, 21 Mar 2024 10:12:22 -0300 Subject: [PATCH 09/11] Removed deprecateion function from Social Content Block modules --- .../social_content_block.api.php | 35 ------------------- 1 file changed, 35 deletions(-) diff --git a/modules/social_features/social_content_block/social_content_block.api.php b/modules/social_features/social_content_block/social_content_block.api.php index 848079cf4d6..0725d1e52f2 100644 --- a/modules/social_features/social_content_block/social_content_block.api.php +++ b/modules/social_features/social_content_block/social_content_block.api.php @@ -8,41 +8,6 @@ use Drupal\block_content\BlockContentInterface; use Drupal\Core\Database\Query\SelectInterface; -/** - * Provides a method to alter the query to get content. - * - * @param \Drupal\Core\Database\Query\SelectInterface $query - * The query to alter the results. - * @param \Drupal\block_content\BlockContentInterface $block_content - * The current block content. - * - * @deprecated in social:11.1.0 and is removed from social:13.0.0. Use - * hook_query_social_content_block_alter instead. - * - * @see https://www.drupal.org/node/3258202 - * - * @ingroup social_content_block_api - */ -function hook_social_content_block_query_alter(SelectInterface $query, BlockContentInterface $block_content): void { - /** @var \Drupal\Core\Field\EntityReferenceFieldItemListInterface $field */ - $field = $block_content->field_topic_type; - - // Add topic type tags. - if (!$field->isEmpty()) { - $alias = $query->innerJoin( - 'node__field_topic_type', - 'tt', - '%alias.entity_id = n.nid', - ); - - $query->condition( - "$alias.field_topic_type_target_id", - array_column($field->getValue(), 'target_id'), - 'IN', - ); - } -} - /** * Alter the list of content block plugin definitions. * From e6c9ba60cef7eb30d252f985e536ee8bcc330bf5 Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Thu, 21 Mar 2024 10:33:30 -0300 Subject: [PATCH 10/11] Removed unused import class - PHPCS Warnnings --- .../social_content_block/social_content_block.api.php | 3 --- modules/social_features/social_group/social_group.module | 1 - 2 files changed, 4 deletions(-) diff --git a/modules/social_features/social_content_block/social_content_block.api.php b/modules/social_features/social_content_block/social_content_block.api.php index 0725d1e52f2..d337f1bf114 100644 --- a/modules/social_features/social_content_block/social_content_block.api.php +++ b/modules/social_features/social_content_block/social_content_block.api.php @@ -5,9 +5,6 @@ * Hooks provided by the Social Content Block module. */ -use Drupal\block_content\BlockContentInterface; -use Drupal\Core\Database\Query\SelectInterface; - /** * Alter the list of content block plugin definitions. * diff --git a/modules/social_features/social_group/social_group.module b/modules/social_features/social_group/social_group.module index 71493c384fd..ef06bd11c85 100644 --- a/modules/social_features/social_group/social_group.module +++ b/modules/social_features/social_group/social_group.module @@ -39,7 +39,6 @@ use Drupal\node\NodeInterface; use Drupal\social_core\Service\MembersPageHelperService; use Drupal\social_group\Controller\SocialGroupController; use Drupal\social_group\Controller\SocialGroupListBuilder; -use Drupal\social_group\Element\SocialGroupEntityAutocomplete; use Drupal\social_group\Entity\Access\SocialGroupAccessControlHandler; use Drupal\social_group\Entity\Group; use Drupal\social_group\Plugin\Field\SocialGroupReferenceItemList; From 4ee7475e90c3434843662a2af1deb5be60f9c90d Mon Sep 17 00:00:00 2001 From: Vinicius Rodrigues Pereira Date: Thu, 21 Mar 2024 12:32:37 -0300 Subject: [PATCH 11/11] Fixed all behat-tests related with deprecated group-type --- tests/behat/features/bootstrap/GroupContext.php | 13 ++----------- .../activity-stream/create-topic-event.feature | 2 +- .../groups-edit-join-method-flexible.feature | 5 ++--- .../groups/groups-requires-verified.feature | 8 +++++--- .../groups/groups-revisions-disabled.feature | 3 +-- .../post/post-create-disabled.feature | 16 +++------------- .../capabilities/post/post-group.feature | 2 +- .../profile/restricted-full-name.feature | 6 +++--- 8 files changed, 18 insertions(+), 37 deletions(-) diff --git a/tests/behat/features/bootstrap/GroupContext.php b/tests/behat/features/bootstrap/GroupContext.php index 137bc6e0e92..1ce6faa2586 100644 --- a/tests/behat/features/bootstrap/GroupContext.php +++ b/tests/behat/features/bootstrap/GroupContext.php @@ -186,18 +186,9 @@ public function createGroupMembers(TableNode $groupMembersTable) { * @When create a :group_type group using its creation page: */ public function whenICreateAGroupUsingTheForm(string $group_type, TableNode $fields): void { - $group_types = [ - 'flexible' => 'flexible_group', - ]; - $group_type_selector = $group_types[$group_type] ?? NULL; - if ($group_type_selector === NULL) { - $type_names = "'" . implode("', '", array_keys($group_types)) . "'"; - throw new \Exception("Group type must be one of $type_names but got '$group_type'"); - } - - $this->visitPath("/group/add"); + $this->visitPath("/group/add/flexible_group"); if ($this->getSession()->getStatusCode() !== 200) { - throw new \Exception("Could not go to `/group/add` page."); + throw new \Exception("Could not go to `/group/add/flexible_group` page."); } $page = $this->getSession()->getPage(); diff --git a/tests/behat/features/capabilities/activity-stream/create-topic-event.feature b/tests/behat/features/capabilities/activity-stream/create-topic-event.feature index 1e780b0d2e0..1e189c9cdb2 100644 --- a/tests/behat/features/capabilities/activity-stream/create-topic-event.feature +++ b/tests/behat/features/capabilities/activity-stream/create-topic-event.feature @@ -121,7 +121,7 @@ Feature: See and get notified when content is created | CreateUser | 1 | CreateUser | verified | | SeeUser | 1 | SeeUser | verified | And I am logged in as "CreateUser" - And I am on "group/add" + And I am on "group/add/flexible_group" When I fill in "Title" with "Test open group" And I fill in the "edit-field-group-description-0-value" WYSIWYG editor with "Description text" diff --git a/tests/behat/features/capabilities/groups/groups-edit-join-method-flexible.feature b/tests/behat/features/capabilities/groups/groups-edit-join-method-flexible.feature index d4a6e63e8e7..fa4e7aa04c4 100644 --- a/tests/behat/features/capabilities/groups/groups-edit-join-method-flexible.feature +++ b/tests/behat/features/capabilities/groups/groups-edit-join-method-flexible.feature @@ -10,8 +10,7 @@ Feature: Edit my group as a group manager | Group Manager | gm_1@example.com | GoalGorilla | 1 | verified | And I am logged in as "Group Manager" - And I am on "group/add" - And I wait for AJAX to finish + And I am on "group/add/flexible_group" When I click radio button "Community" with the id "edit-field-flexible-group-visibility-community" And I fill in "Title" with "Test flexible group" @@ -25,7 +24,7 @@ Feature: Edit my group as a group manager And I click "Manage members" And I should see "Add members" - # TB-4365 - As a Group Manager I want to change group join-method + # TB-4365 - As a Group Manager I want to change group join-method And I click "Edit group" And I wait for AJAX to finish And I click radio button "Invite only" with the id "edit-field-group-allowed-join-method-added" diff --git a/tests/behat/features/capabilities/groups/groups-requires-verified.feature b/tests/behat/features/capabilities/groups/groups-requires-verified.feature index d3fbf89fe45..32806e4264c 100644 --- a/tests/behat/features/capabilities/groups/groups-requires-verified.feature +++ b/tests/behat/features/capabilities/groups/groups-requires-verified.feature @@ -1,4 +1,4 @@ -@api @group +@api Feature: Limit access to group creation I want to limit who can create group to ensure a healthy community. @@ -6,12 +6,14 @@ Feature: Limit access to group creation Given I disable that the registered users to be verified immediately And I am logged in as a user with the authenticated role - When I am on "group/add" + When I am on "group/add/flexible_group" + Then I should see "Access denied" Scenario: Verified users should be able to create groups Given I disable that the registered users to be verified immediately And I am logged in as a user with the verified role - When I am on "group/add" + When I am on "group/add/flexible_group" + Then I should not see "Access denied" diff --git a/tests/behat/features/capabilities/groups/groups-revisions-disabled.feature b/tests/behat/features/capabilities/groups/groups-revisions-disabled.feature index ef3fddeaffe..b58bda285e6 100644 --- a/tests/behat/features/capabilities/groups/groups-revisions-disabled.feature +++ b/tests/behat/features/capabilities/groups/groups-revisions-disabled.feature @@ -10,8 +10,7 @@ Feature: Revisions are disabled for open group | Group Manager One | gm_1@example.com | GoalGorilla | 1 | verified | | Group Member Two | gm_2@example.com | Drupal | 1 | verified | And I am logged in as "Group Manager One" - And I am on "group/add" - And I wait for AJAX to finish + And I am on "group/add/flexible_group" When I fill in "Title" with "Test open group" And I wait for "1" seconds diff --git a/tests/behat/features/capabilities/post/post-create-disabled.feature b/tests/behat/features/capabilities/post/post-create-disabled.feature index 1750ec1209b..f7e7bbde6fc 100644 --- a/tests/behat/features/capabilities/post/post-create-disabled.feature +++ b/tests/behat/features/capabilities/post/post-create-disabled.feature @@ -12,9 +12,7 @@ Feature: Group manager should to be able to disabled posts in groups for members | Group Manager | gm_1@example.com | 1 | verified | | Group Member | gm_2@example.com | 1 | verified | And I am logged in as "Group Manager" - And I am on "group/add" - And I wait for AJAX to finish - + And I am on "group/add/flexible_group" And I should see checked the box "Enable posts for members" And I fill in "Title" with "Test flexible group" And I fill in the "edit-field-group-description-0-value" WYSIWYG editor with "Description text" @@ -24,45 +22,37 @@ Feature: Group manager should to be able to disabled posts in groups for members And I press "Save" When I click "Stream" in the "Tabs" - - Then I fill in "Say something to the group" with "This is a post in Flexible Group." + And I fill in "Say something to the group" with "This is a post in Flexible Group." And I press "Post" And I should see the success message "Your post has been posted." And I should see "This is a post in Flexible Group." And I should see "Group Manager posted in Test flexible group" in the "Main content front" #Create the post as a group member. - And I am logged in as "Group Member" + Then I am logged in as "Group Member" And I am on "all-groups" And I should see "Test flexible group" - And I click "Test flexible group" And I should see the link "Join" in the "Hero block" And I should not see "Say something to the group" - And I click "Join" And I should see "Join group Test flexible group" And I press "Join group" And I should see "Say something to the group" And I should see "Group Manager posted in Test flexible group" in the "Main content front" - And I fill in "Say something to the group" with "Member posted in Flexible Group." And I press "Post" And I should see "Group Member posted in Test flexible group" in the "Main content front" And I should see "Member posted in Flexible Group." in the "Main content front" - # Disable posting in flegible group. And I am logged in as "Group Manager" And I am on "all-groups" And I click "Test flexible group" - And I click "Edit group" And I uncheck the box "Enable posts for members" And I press "Save" - And I click "Stream" in the "Tabs" And I should see "Say something to the group" - And I am logged in as "Group Member" And I am on "all-groups" And I click "Test flexible group" diff --git a/tests/behat/features/capabilities/post/post-group.feature b/tests/behat/features/capabilities/post/post-group.feature index 01b0274ccd9..62722a10cd1 100644 --- a/tests/behat/features/capabilities/post/post-group.feature +++ b/tests/behat/features/capabilities/post/post-group.feature @@ -10,7 +10,7 @@ Feature: Create Post on Group | Group User One | group_user_1@example.com | 1 | verified | | Group User Two | group_user_2@example.com | 1 | verified | And I am logged in as "Group User One" - And I am on "group/add" + And I am on "group/add/flexible_group" When I fill in "Title" with "Test open group" And I fill in the "edit-field-group-description-0-value" WYSIWYG editor with "Description text" diff --git a/tests/behat/features/capabilities/profile/restricted-full-name.feature b/tests/behat/features/capabilities/profile/restricted-full-name.feature index 50e9dfbeea9..2260e65111d 100644 --- a/tests/behat/features/capabilities/profile/restricted-full-name.feature +++ b/tests/behat/features/capabilities/profile/restricted-full-name.feature @@ -239,7 +239,7 @@ Feature: I want to restrict full name visibility when nickname is used # Check sorting members in group. # First of all we need create a group. - And I am on "group/add" + And I am on "group/add/flexible_group" And I fill in "Title" with "Test open group" And I fill in the "edit-field-group-description-0-value" WYSIWYG editor with "Description text" And I click radio button "Public" @@ -381,7 +381,7 @@ Feature: I want to restrict full name visibility when nickname is used # Check sorting members in group. # First of all we need create a group. - And I am on "group/add" + And I am on "group/add/flexible_group" And I fill in "Title" with "Test open group" And I fill in the "edit-field-group-description-0-value" WYSIWYG editor with "Description text" And I click radio button "Public" @@ -524,7 +524,7 @@ Feature: I want to restrict full name visibility when nickname is used # Check sorting members in group. # First of all we need create a group. - And I am on "group/add" + And I am on "group/add/flexible_group" And I fill in "Title" with "Test open group" And I fill in the "edit-field-group-description-0-value" WYSIWYG editor with "Description text" And I click radio button "Public"