Update to drupal 8.0.0-rc1. For more information, see https://www.drupal.org/node/2582663
This commit is contained in:
parent
eb34d130a8
commit
f32e58e4b1
8476 changed files with 211648 additions and 170042 deletions
|
@ -1,4 +1,3 @@
|
|||
# Changes the default value of the promote base field on the forum node type.
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
|
@ -8,7 +7,7 @@ id: node.forum.promote
|
|||
field_name: promote
|
||||
entity_type: node
|
||||
bundle: forum
|
||||
label: Promoted to front page
|
||||
label: 'Promoted to front page'
|
||||
description: ''
|
||||
required: false
|
||||
translatable: true
|
||||
|
@ -16,5 +15,7 @@ default_value:
|
|||
-
|
||||
value: 0
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
settings:
|
||||
on_label: 'On'
|
||||
off_label: 'Off'
|
||||
field_type: boolean
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
# Changes the label of the title base field on the forum node type.
|
||||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
|
@ -9,6 +8,7 @@ field_name: title
|
|||
entity_type: node
|
||||
bundle: forum
|
||||
label: Subject
|
||||
description: ''
|
||||
required: true
|
||||
translatable: true
|
||||
default_value: { }
|
||||
|
|
|
@ -13,13 +13,6 @@ mode: default
|
|||
content:
|
||||
author:
|
||||
weight: -2
|
||||
subject:
|
||||
type: string_textfield
|
||||
weight: 10
|
||||
settings:
|
||||
size: 60
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
comment_body:
|
||||
type: text_textarea
|
||||
weight: 11
|
||||
|
@ -27,5 +20,11 @@ content:
|
|||
rows: 5
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
subject:
|
||||
type: string_textfield
|
||||
weight: 10
|
||||
settings:
|
||||
size: 60
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
hidden: { }
|
||||
third_party_settings: { }
|
||||
|
|
|
@ -8,27 +8,24 @@ dependencies:
|
|||
- node.type.forum
|
||||
module:
|
||||
- comment
|
||||
- entity_reference
|
||||
- text
|
||||
id: node.forum.default
|
||||
targetEntityType: node
|
||||
bundle: forum
|
||||
mode: default
|
||||
content:
|
||||
title:
|
||||
type: string_textfield
|
||||
weight: -5
|
||||
body:
|
||||
type: text_textarea_with_summary
|
||||
weight: 27
|
||||
settings:
|
||||
size: 60
|
||||
rows: 9
|
||||
summary_rows: 3
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
uid:
|
||||
type: entity_reference_autocomplete
|
||||
weight: 5
|
||||
settings:
|
||||
match_operator: CONTAINS
|
||||
size: 60
|
||||
placeholder: ''
|
||||
comment_forum:
|
||||
type: comment_default
|
||||
weight: 20
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
created:
|
||||
type: datetime_timestamp
|
||||
|
@ -47,23 +44,24 @@ content:
|
|||
display_label: true
|
||||
weight: 16
|
||||
third_party_settings: { }
|
||||
comment_forum:
|
||||
type: comment_default
|
||||
weight: 20
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
taxonomy_forums:
|
||||
type: options_select
|
||||
weight: 26
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
body:
|
||||
type: text_textarea_with_summary
|
||||
weight: 27
|
||||
title:
|
||||
type: string_textfield
|
||||
weight: -5
|
||||
settings:
|
||||
rows: 9
|
||||
summary_rows: 3
|
||||
size: 60
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
uid:
|
||||
type: entity_reference_autocomplete
|
||||
weight: 5
|
||||
settings:
|
||||
match_operator: CONTAINS
|
||||
size: 60
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
hidden: { }
|
||||
third_party_settings: { }
|
||||
|
|
|
@ -10,6 +10,11 @@ targetEntityType: taxonomy_term
|
|||
bundle: forums
|
||||
mode: default
|
||||
content:
|
||||
description:
|
||||
type: text_textfield
|
||||
weight: 0
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
name:
|
||||
type: string_textfield
|
||||
weight: -5
|
||||
|
@ -17,10 +22,5 @@ content:
|
|||
size: 60
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
description:
|
||||
type: text_textfield
|
||||
weight: 0
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
hidden: { }
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
forum_container: true
|
||||
|
|
|
@ -20,4 +20,3 @@ content:
|
|||
links:
|
||||
weight: 100
|
||||
hidden: { }
|
||||
third_party_settings: { }
|
||||
|
|
|
@ -8,7 +8,6 @@ dependencies:
|
|||
- node.type.forum
|
||||
module:
|
||||
- comment
|
||||
- taxonomy
|
||||
- text
|
||||
- user
|
||||
id: node.forum.default
|
||||
|
@ -16,13 +15,6 @@ targetEntityType: node
|
|||
bundle: forum
|
||||
mode: default
|
||||
content:
|
||||
taxonomy_forums:
|
||||
type: entity_reference_label
|
||||
weight: -1
|
||||
label: above
|
||||
settings:
|
||||
link: true
|
||||
third_party_settings: { }
|
||||
body:
|
||||
label: hidden
|
||||
type: text_default
|
||||
|
@ -38,6 +30,11 @@ content:
|
|||
third_party_settings: { }
|
||||
links:
|
||||
weight: 100
|
||||
hidden:
|
||||
langcode: true
|
||||
third_party_settings: { }
|
||||
taxonomy_forums:
|
||||
type: entity_reference_label
|
||||
weight: -1
|
||||
label: above
|
||||
settings:
|
||||
link: true
|
||||
third_party_settings: { }
|
||||
hidden: { }
|
||||
|
|
|
@ -8,7 +8,6 @@ dependencies:
|
|||
- field.field.node.forum.taxonomy_forums
|
||||
- node.type.forum
|
||||
module:
|
||||
- taxonomy
|
||||
- text
|
||||
- user
|
||||
id: node.forum.teaser
|
||||
|
@ -16,13 +15,6 @@ targetEntityType: node
|
|||
bundle: forum
|
||||
mode: teaser
|
||||
content:
|
||||
taxonomy_forums:
|
||||
type: entity_reference_label
|
||||
weight: 10
|
||||
label: above
|
||||
settings:
|
||||
link: true
|
||||
third_party_settings: { }
|
||||
body:
|
||||
label: hidden
|
||||
type: text_summary_or_trimmed
|
||||
|
@ -32,7 +24,12 @@ content:
|
|||
third_party_settings: { }
|
||||
links:
|
||||
weight: 101
|
||||
taxonomy_forums:
|
||||
type: entity_reference_label
|
||||
weight: 10
|
||||
label: above
|
||||
settings:
|
||||
link: true
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
langcode: true
|
||||
comment_forum: true
|
||||
third_party_settings: { }
|
||||
|
|
|
@ -16,5 +16,5 @@ content:
|
|||
settings: { }
|
||||
third_party_settings: { }
|
||||
label: above
|
||||
hidden: { }
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
forum_container: true
|
||||
|
|
|
@ -17,5 +17,4 @@ translatable: true
|
|||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
field_type: text_long
|
||||
|
|
|
@ -18,5 +18,4 @@ default_value: { }
|
|||
default_value_callback: ''
|
||||
settings:
|
||||
display_summary: true
|
||||
third_party_settings: { }
|
||||
field_type: text_with_summary
|
||||
|
|
|
@ -29,5 +29,4 @@ settings:
|
|||
form_location: true
|
||||
anonymous: 0
|
||||
preview: 1
|
||||
third_party_settings: { }
|
||||
field_type: comment
|
||||
|
|
|
@ -4,8 +4,7 @@ dependencies:
|
|||
config:
|
||||
- field.storage.node.taxonomy_forums
|
||||
- node.type.forum
|
||||
module:
|
||||
- taxonomy
|
||||
- taxonomy.vocabulary.forums
|
||||
id: node.forum.taxonomy_forums
|
||||
field_name: taxonomy_forums
|
||||
entity_type: node
|
||||
|
@ -17,12 +16,11 @@ translatable: true
|
|||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
handler: default
|
||||
handler: 'default:taxonomy_term'
|
||||
handler_settings:
|
||||
target_bundles:
|
||||
forums: forums
|
||||
sort:
|
||||
field: _none
|
||||
auto_create: true
|
||||
third_party_settings: { }
|
||||
field_type: entity_reference
|
||||
|
|
|
@ -17,7 +17,6 @@ default_value:
|
|||
value: 0
|
||||
default_value_callback: ''
|
||||
settings:
|
||||
on_label: Yes
|
||||
off_label: No
|
||||
third_party_settings: { }
|
||||
on_label: 'Yes'
|
||||
off_label: 'No'
|
||||
field_type: boolean
|
||||
|
|
|
@ -16,3 +16,4 @@ cardinality: 1
|
|||
translatable: true
|
||||
indexes: { }
|
||||
persist_with_no_fields: false
|
||||
custom_storage: false
|
||||
|
|
|
@ -10,9 +10,10 @@ entity_type: node
|
|||
type: entity_reference
|
||||
settings:
|
||||
target_type: taxonomy_term
|
||||
module: taxonomy
|
||||
module: core
|
||||
locked: false
|
||||
cardinality: 1
|
||||
translatable: true
|
||||
indexes: { }
|
||||
persist_with_no_fields: false
|
||||
custom_storage: false
|
||||
|
|
|
@ -14,3 +14,4 @@ cardinality: 1
|
|||
translatable: false
|
||||
indexes: { }
|
||||
persist_with_no_fields: false
|
||||
custom_storage: false
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- forum
|
||||
enforced:
|
||||
module:
|
||||
- forum
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- forum
|
||||
enforced:
|
||||
module:
|
||||
- forum
|
||||
|
@ -11,4 +9,3 @@ vid: forums
|
|||
description: 'Forum navigation vocabulary'
|
||||
hierarchy: 1
|
||||
weight: -10
|
||||
third_party_settings: { }
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.forum
|
||||
module:
|
||||
- node
|
||||
id: node.forum
|
||||
targetEntityType: node
|
||||
bundle: forum
|
||||
|
@ -23,16 +30,11 @@ fieldMappings:
|
|||
uid:
|
||||
properties:
|
||||
- 'schema:author'
|
||||
mapping_type: 'rel'
|
||||
mapping_type: rel
|
||||
comment_count:
|
||||
properties:
|
||||
- 'schema:interactionCount'
|
||||
datatype_callback:
|
||||
callable: 'Drupal\rdf\SchemaOrgDataConverter::interactionCount'
|
||||
arguments:
|
||||
interaction_type: 'UserComments'
|
||||
dependencies:
|
||||
config:
|
||||
- node.type.forum
|
||||
module:
|
||||
- node
|
||||
interaction_type: UserComments
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- taxonomy.vocabulary.forums
|
||||
module:
|
||||
- taxonomy
|
||||
id: taxonomy_term.forums
|
||||
targetEntityType: taxonomy_term
|
||||
bundle: forums
|
||||
|
@ -11,8 +18,3 @@ fieldMappings:
|
|||
description:
|
||||
properties:
|
||||
- 'schema:description'
|
||||
dependencies:
|
||||
config:
|
||||
- taxonomy.vocabulary.forums
|
||||
module:
|
||||
- taxonomy
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
/**
|
||||
* @file
|
||||
* Styling for the Forum module.
|
||||
*/
|
||||
|
||||
.forum__description {
|
||||
font-size: 0.9em;
|
||||
margin: 0.5em;
|
||||
}
|
||||
.forum td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.forum__icon {
|
||||
background-image: url(../icons/forum-icons.png);
|
||||
background-repeat: no-repeat;
|
||||
float: left; /* LTR */
|
||||
height: 24px;
|
||||
margin: 0 9px 0 0; /* LTR */
|
||||
width: 24px;
|
||||
}
|
||||
[dir="rtl"] .forum__icon {
|
||||
float: right;
|
||||
margin: 0 0 0 9px;
|
||||
}
|
||||
.forum__title {
|
||||
overflow: hidden;
|
||||
}
|
||||
.forum .indented {
|
||||
margin-left: 20px; /* LTR */
|
||||
}
|
||||
[dir="rtl"] .forum .indented {
|
||||
margin-left: 0;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.forum__topic-status--new {
|
||||
background-position: -24px 0;
|
||||
}
|
||||
.forum__topic-status--hot {
|
||||
background-position: -48px 0;
|
||||
}
|
||||
.forum__topic-status--hot-new {
|
||||
background-position: -72px 0;
|
||||
}
|
||||
.forum__topic-status--sticky {
|
||||
background-position: -96px 0;
|
||||
}
|
||||
.forum__topic-status--closed {
|
||||
background-position: -120px 0;
|
||||
}
|
|
@ -175,10 +175,3 @@ function forum_schema() {
|
|||
|
||||
return $schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_update_last_removed().
|
||||
*/
|
||||
function forum_update_last_removed() {
|
||||
return 7003;
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
forum.index:
|
||||
version: VERSION
|
||||
css:
|
||||
component:
|
||||
css/forum.theme.css: {}
|
|
@ -23,7 +23,7 @@ function forum_help($route_name, RouteMatchInterface $route_match) {
|
|||
$output = '';
|
||||
$output .= '<h3>' . t('About') . '</h3>';
|
||||
$output .= '<p>' . t('The Forum module lets you create threaded discussion forums with functionality similar to other message board systems. In a forum, users post topics and threads in nested hierarchies, allowing discussions to be categorized and grouped.') . '</p>';
|
||||
$output .= '<p>' . t('The Forum module adds and uses a content type called <em>Forum topic</em>. For background information on content types, see the <a href="!node_help">Node module help page</a>.', array('!node_help'=>\Drupal::url('help.page', array('name' => 'node')))) . '</p>';
|
||||
$output .= '<p>' . t('The Forum module adds and uses a content type called <em>Forum topic</em>. For background information on content types, see the <a href=":node_help">Node module help page</a>.', array(':node_help'=>\Drupal::url('help.page', array('name' => 'node')))) . '</p>';
|
||||
$output .= '<p>' . t('A forum is represented by a hierarchical structure, consisting of:');
|
||||
$output .= '<ul>';
|
||||
$output .= '<li>' . t('<em>Forums</em> (for example, <em>Recipes for cooking vegetables</em>)') . '</li>';
|
||||
|
@ -32,15 +32,15 @@ function forum_help($route_name, RouteMatchInterface $route_match) {
|
|||
$output .= '<li>' . t('Optional <em>containers</em>, used to group similar forums. Forums can be placed inside containers, and vice versa.').'</li>';
|
||||
$output .= '</ul>';
|
||||
$output .= '</p>';
|
||||
$output .= '<p>' . t('For more information, see <a href="!forum">the online documentation for the Forum module</a>.', array('!forum' => 'https://www.drupal.org/documentation/modules/forum')) . '</p>';
|
||||
$output .= '<p>' . t('For more information, see the <a href=":forum">online documentation for the Forum module</a>.', array(':forum' => 'https://www.drupal.org/documentation/modules/forum')) . '</p>';
|
||||
$output .= '<h3>' . t('Uses') . '</h3>';
|
||||
$output .= '<dl>';
|
||||
$output .= '<dt>' . t('Setting up the forum structure') . '</dt>';
|
||||
$output .= '<dd>' . t('Visit the <a href="!forums">Forums page</a> to set up containers and forums to hold your discussion topics.', array('!forums' => \Drupal::url('forum.overview'))) . '</dd>';
|
||||
$output .= '<dd>' . t('Visit the <a href=":forums">Forums page</a> to set up containers and forums to hold your discussion topics.', array(':forums' => \Drupal::url('forum.overview'))) . '</dd>';
|
||||
$output .= '<dt>' . t('Starting a discussion') . '</dt>';
|
||||
$output .= '<dd>' . t('The <a href="!create-topic">Forum topic</a> link on the <a href="!content-add">Add content</a> page creates the first post of a new threaded discussion, or thread.', array('!create-topic' => \Drupal::url('node.add', array('node_type' => 'forum')), '!content-add' => \Drupal::url('node.add_page'))) . '</dd>';
|
||||
$output .= '<dd>' . t('The <a href=":create-topic">Forum topic</a> link on the <a href=":content-add">Add content</a> page creates the first post of a new threaded discussion, or thread.', array(':create-topic' => \Drupal::url('node.add', array('node_type' => 'forum')), ':content-add' => \Drupal::url('node.add_page'))) . '</dd>';
|
||||
$output .= '<dt>' . t('Navigating in the forum') . '</dt>';
|
||||
$output .= '<dd>' . t('Enabling the Forum module provides a default <em>Forums</em> menu item in the Tools menu that links to the <a href="!forums">Forums page</a>.', array('!forums' => \Drupal::url('forum.index'))) . '</dd>';
|
||||
$output .= '<dd>' . t('Enabling the Forum module provides a default <em>Forums</em> menu item in the Tools menu that links to the <a href=":forums">Forums page</a>.', array(':forums' => \Drupal::url('forum.index'))) . '</dd>';
|
||||
$output .= '<dt>' . t('Moving forum topics') . '</dt>';
|
||||
$output .= '<dd>' . t('A forum topic (and all of its comments) may be moved between forums by selecting a different forum while editing a forum topic. When moving a forum topic between forums, the <em>Leave shadow copy</em> option creates a link in the original forum pointing to the new location.') . '</dd>';
|
||||
$output .= '<dt>' . t('Locking and disabling comments') . '</dt>';
|
||||
|
@ -75,7 +75,7 @@ function forum_help($route_name, RouteMatchInterface $route_match) {
|
|||
return '<p>' . t('A forum holds related forum topics.') . '</p>';
|
||||
|
||||
case 'forum.settings':
|
||||
return '<p>' . t('Adjust the display of your forum topics. Organize the forums on the <a href="!forum-structure">forum structure page</a>.', array('!forum-structure' => \Drupal::url('forum.overview'))) . '</p>';
|
||||
return '<p>' . t('Adjust the display of your forum topics. Organize the forums on the <a href=":forum-structure">forum structure page</a>.', array(':forum-structure' => \Drupal::url('forum.overview'))) . '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -456,7 +456,7 @@ function template_preprocess_forums(&$variables) {
|
|||
}
|
||||
$forum_submitted = array('#theme' => 'forum_submitted', '#topic' => (object) array(
|
||||
'uid' => $topic->getOwnerId(),
|
||||
'name' => $topic->getOwner()->getUsername(),
|
||||
'name' => $topic->getOwner()->getDisplayName(),
|
||||
'created' => $topic->getCreatedTime(),
|
||||
));
|
||||
$variables['topics'][$id]->submitted = drupal_render($forum_submitted);
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.7 KiB |
|
@ -1,5 +1,5 @@
|
|||
id: d6_forum_settings
|
||||
label: Drupal 6 forum configuration
|
||||
label: Forum configuration
|
||||
migration_tags:
|
||||
- Drupal 6
|
||||
source:
|
||||
|
|
29
core/modules/forum/migration_templates/d7_forum_settings.yml
Normal file
29
core/modules/forum/migration_templates/d7_forum_settings.yml
Normal file
|
@ -0,0 +1,29 @@
|
|||
id: d7_forum_settings
|
||||
label: Forum configuration
|
||||
migration_tags:
|
||||
- Drupal 7
|
||||
source:
|
||||
plugin: variable
|
||||
variables:
|
||||
- forum_hot_topic
|
||||
- forum_per_page
|
||||
- forum_order
|
||||
- forum_block_num_active
|
||||
- forum_block_num_new
|
||||
- forum_nav_vocabulary
|
||||
process:
|
||||
'block/active/limit': forum_block_num_active
|
||||
'block/new/limit': forum_block_num_new
|
||||
'topics/hot_threshold': forum_hot_topic
|
||||
'topics/page_limit': forum_per_page
|
||||
'topics/order': forum_order
|
||||
vocabulary:
|
||||
plugin: migration
|
||||
migration: d7_taxonomy_vocabulary
|
||||
source: forum_nav_vocabulary
|
||||
destination:
|
||||
plugin: config
|
||||
config_name: forum.settings
|
||||
migration_dependencies:
|
||||
required:
|
||||
- d7_taxonomy_vocabulary
|
|
@ -67,7 +67,7 @@ abstract class ForumBreadcrumbBuilderBase implements BreadcrumbBuilderInterface
|
|||
*/
|
||||
public function build(RouteMatchInterface $route_match) {
|
||||
$breadcrumb = new Breadcrumb();
|
||||
$breadcrumb->setCacheContexts(['route']);
|
||||
$breadcrumb->addCacheContexts(['route']);
|
||||
|
||||
$links[] = Link::createFromRoute($this->t('Home'), '<front>');
|
||||
|
||||
|
|
|
@ -224,7 +224,6 @@ class ForumController extends ControllerBase {
|
|||
'#sortby' => $config->get('topics.order'),
|
||||
'#forums_per_page' => $config->get('topics.page_limit'),
|
||||
);
|
||||
$build['#attached']['library'][] = 'forum/forum.index';
|
||||
if (empty($term->forum_container->value)) {
|
||||
$build['#attached']['feed'][] = array('taxonomy/term/' . $term->id() . '/feed', 'RSS - ' . $term->getName());
|
||||
}
|
||||
|
|
|
@ -87,9 +87,9 @@ class Overview extends OverviewTerms {
|
|||
unset($form['actions']['reset_alphabetical']);
|
||||
|
||||
// Use the existing taxonomy overview submit handler.
|
||||
$form['terms']['#empty'] = $this->t('No containers or forums available. <a href="@container">Add container</a> or <a href="@forum">Add forum</a>.', array(
|
||||
'@container' => $this->url('forum.add_container'),
|
||||
'@forum' => $this->url('forum.add_forum')
|
||||
$form['terms']['#empty'] = $this->t('No containers or forums available. <a href=":container">Add container</a> or <a href=":forum">Add forum</a>.', array(
|
||||
':container' => $this->url('forum.add_container'),
|
||||
':forum' => $this->url('forum.add_forum')
|
||||
));
|
||||
return $form;
|
||||
}
|
||||
|
|
|
@ -76,9 +76,9 @@ class ForumUninstallValidator implements ModuleUninstallValidatorInterface {
|
|||
$vocabulary = $this->getForumVocabulary();
|
||||
if ($this->hasTermsForVocabulary($vocabulary)) {
|
||||
if ($vocabulary->access('view')) {
|
||||
$reasons[] = $this->t('To uninstall Forum, first delete all <a href="@url">%vocabulary</a> terms', [
|
||||
$reasons[] = $this->t('To uninstall Forum, first delete all <a href=":url">%vocabulary</a> terms', [
|
||||
'%vocabulary' => $vocabulary->label(),
|
||||
'@url' => $vocabulary->url('overview-form'),
|
||||
':url' => $vocabulary->url('overview-form'),
|
||||
]);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -83,6 +83,7 @@ class ForumTest extends WebTestBase {
|
|||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->drupalPlaceBlock('system_breadcrumb_block');
|
||||
$this->drupalPlaceBlock('page_title_block');
|
||||
|
||||
// Create users.
|
||||
$this->adminUser = $this->drupalCreateUser(array(
|
||||
|
|
|
@ -20,9 +20,7 @@ class MigrateForumConfigsTest extends MigrateDrupal6TestBase {
|
|||
use SchemaCheckTestTrait;
|
||||
|
||||
/**
|
||||
* Modules to enable.
|
||||
*
|
||||
* @var array
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = array('comment', 'forum', 'taxonomy');
|
||||
|
||||
|
@ -31,11 +29,7 @@ class MigrateForumConfigsTest extends MigrateDrupal6TestBase {
|
|||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->prepareMigrations(array(
|
||||
'd6_taxonomy_vocabulary' => array(
|
||||
array(array(1), array('vocabulary_1_i_0_')),
|
||||
)
|
||||
));
|
||||
$this->executeMigration('d6_taxonomy_vocabulary');
|
||||
$this->executeMigration('d6_forum_settings');
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\forum\Tests\d7\MigrateForumSettingsTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\forum\Tests\Migrate\d7;
|
||||
|
||||
use Drupal\migrate\Entity\Migration;
|
||||
use Drupal\migrate\MigrateExecutable;
|
||||
use Drupal\migrate_drupal\Tests\d7\MigrateDrupal7TestBase;
|
||||
|
||||
/**
|
||||
* Tests migration of Forum's variables to configuration.
|
||||
*
|
||||
* @group forum
|
||||
*/
|
||||
class MigrateForumSettingsTest extends MigrateDrupal7TestBase {
|
||||
|
||||
// Don't alphabetize these. They're in dependency order.
|
||||
public static $modules = [
|
||||
'comment',
|
||||
'field',
|
||||
'filter',
|
||||
'text',
|
||||
'node',
|
||||
'taxonomy',
|
||||
'forum',
|
||||
];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('d7_taxonomy_vocabulary');
|
||||
$this->executeMigration('d7_forum_settings');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the migration of Forum's settings to configuration.
|
||||
*/
|
||||
public function testForumSettingsMigration() {
|
||||
$config = $this->config('forum.settings');
|
||||
$this->assertIdentical(9, $config->get('block.active.limit'));
|
||||
$this->assertIdentical(4, $config->get('block.new.limit'));
|
||||
$this->assertIdentical(10, $config->get('topics.hot_threshold'));
|
||||
$this->assertIdentical(25, $config->get('topics.page_limit'));
|
||||
$this->assertIdentical(1, $config->get('topics.order'));
|
||||
$this->assertIdentical('forums', $config->get('vocabulary'));
|
||||
}
|
||||
|
||||
}
|
|
@ -27,8 +27,7 @@ class ForumBreadcrumbBuilderBaseTest extends UnitTestCase {
|
|||
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$cache_contexts_manager->expects($this->any())
|
||||
->method('validate_tokens');
|
||||
$cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
|
||||
$container = new Container();
|
||||
$container->set('cache_contexts_manager', $cache_contexts_manager);
|
||||
\Drupal::setContainer($container);
|
||||
|
|
|
@ -28,8 +28,7 @@ class ForumListingBreadcrumbBuilderTest extends UnitTestCase {
|
|||
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$cache_contexts_manager->expects($this->any())
|
||||
->method('validate_tokens');
|
||||
$cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
|
||||
$container = new Container();
|
||||
$container->set('cache_contexts_manager', $cache_contexts_manager);
|
||||
\Drupal::setContainer($container);
|
||||
|
|
|
@ -27,8 +27,7 @@ class ForumNodeBreadcrumbBuilderTest extends UnitTestCase {
|
|||
$cache_contexts_manager = $this->getMockBuilder('Drupal\Core\Cache\Context\CacheContextsManager')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$cache_contexts_manager->expects($this->any())
|
||||
->method('validate_tokens');
|
||||
$cache_contexts_manager->method('assertValidTokens')->willReturn(TRUE);
|
||||
$container = new Container();
|
||||
$container->set('cache_contexts_manager', $cache_contexts_manager);
|
||||
\Drupal::setContainer($container);
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
namespace Drupal\Tests\forum\Unit;
|
||||
|
||||
use Drupal\simpletest\AssertHelperTrait;
|
||||
use Drupal\Tests\UnitTestCase;
|
||||
|
||||
/**
|
||||
|
@ -15,6 +16,8 @@ use Drupal\Tests\UnitTestCase;
|
|||
*/
|
||||
class ForumUninstallValidatorTest extends UnitTestCase {
|
||||
|
||||
use AssertHelperTrait;
|
||||
|
||||
/**
|
||||
* @var \Drupal\forum\ForumUninstallValidator|\PHPUnit_Framework_MockObject_MockObject
|
||||
*/
|
||||
|
@ -46,7 +49,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
|
|||
$module = 'not_forum';
|
||||
$expected = [];
|
||||
$reasons = $this->forumUninstallValidator->validate($module);
|
||||
$this->assertSame($expected, $reasons);
|
||||
$this->assertSame($expected, $this->castSafeStrings($reasons));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -69,7 +72,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
|
|||
$module = 'forum';
|
||||
$expected = [];
|
||||
$reasons = $this->forumUninstallValidator->validate($module);
|
||||
$this->assertSame($expected, $reasons);
|
||||
$this->assertSame($expected, $this->castSafeStrings($reasons));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,7 +97,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
|
|||
'To uninstall Forum, first delete all <em>Forum</em> content',
|
||||
];
|
||||
$reasons = $this->forumUninstallValidator->validate($module);
|
||||
$this->assertSame($expected, $reasons);
|
||||
$this->assertSame($expected, $this->castSafeStrings($reasons));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +132,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
|
|||
'To uninstall Forum, first delete all <a href="/path/to/vocabulary/overview"><em class="placeholder">Vocabulary label</em></a> terms',
|
||||
];
|
||||
$reasons = $this->forumUninstallValidator->validate($module);
|
||||
$this->assertSame($expected, $reasons);
|
||||
$this->assertSame($expected, $this->castSafeStrings($reasons));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,7 +166,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
|
|||
'To uninstall Forum, first delete all <em class="placeholder">Vocabulary label</em> terms',
|
||||
];
|
||||
$reasons = $this->forumUninstallValidator->validate($module);
|
||||
$this->assertSame($expected, $reasons);
|
||||
$this->assertSame($expected, $this->castSafeStrings($reasons));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -197,7 +200,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
|
|||
'To uninstall Forum, first delete all <a href="/path/to/vocabulary/overview"><em class="placeholder">Vocabulary label</em></a> terms',
|
||||
];
|
||||
$reasons = $this->forumUninstallValidator->validate($module);
|
||||
$this->assertSame($expected, $reasons);
|
||||
$this->assertSame($expected, $this->castSafeStrings($reasons));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -230,7 +233,7 @@ class ForumUninstallValidatorTest extends UnitTestCase {
|
|||
'To uninstall Forum, first delete all <em class="placeholder">Vocabulary label</em> terms',
|
||||
];
|
||||
$reasons = $this->forumUninstallValidator->validate($module);
|
||||
$this->assertSame($expected, $reasons);
|
||||
$this->assertSame($expected, $this->castSafeStrings($reasons));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue