diff --git a/core/modules/forum/config/schema/forum.schema.yml b/core/modules/forum/config/schema/forum.schema.yml index f74587c..8f6f903 100644 --- a/core/modules/forum/config/schema/forum.schema.yml +++ b/core/modules/forum/config/schema/forum.schema.yml @@ -64,3 +64,8 @@ block.settings.forum_new_block: block_count: type: integer label: 'Block count' + +# Forum's third party settings only exist to ensure that the node type is +# dependent on the forum module. +node_type.third_party.forum: + type: ignore diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 730790d..445146c 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -738,13 +738,24 @@ function forum_system_info_alter(&$info, Extension $file, $type) { // It is not safe to call entity_load_multiple_by_properties() during // maintenance mode. if ($type == 'module' && !defined('MAINTENANCE_MODE') && $file->getName() == 'forum') { - $nodes = entity_load_multiple_by_properties('node', ['type' => 'forum']); + $factory = \Drupal::service('entity.query'); + $nodes = $factory->get('node') + ->condition('type', 'forum') + ->count() + ->accessCheck(FALSE) + ->range(0, 1) + ->execute(); if (!empty($nodes)) { $info['required'] = TRUE; $info['explanation'] = t('To uninstall Forum first delete all Forum content.'); } $vid = \Drupal::config('forum.settings')->get('vocabulary'); - $terms = entity_load_multiple_by_properties('taxonomy_term', ['vid' => $vid]); + $terms = $factory->get('taxonomy_term') + ->condition('vid', $vid) + ->count() + ->accessCheck(FALSE) + ->range(0, 1) + ->execute(); if (!empty($terms)) { $vocabulary = Vocabulary::load($vid); $access = \Drupal::currentUser()->hasPermission('administer taxonomy');