Commit 01d85e15 authored by webchick's avatar webchick

Issue #2301045 by Gábor Hojtsy: Fixed Standard profile has views which include...

Issue #2301045 by Gábor Hojtsy: Fixed Standard profile has views which include elements dependent on uninstalled modules, not valid in config.
parent 9e7f617e
......@@ -344,6 +344,9 @@ public function blockForm($form, &$form_state) {
* @see \Drupal\block\BlockBase::blockValidate()
*/
public function validateConfigurationForm(array &$form, array &$form_state) {
// Remove the admin_label form item element value so it will not persist.
unset($form_state['values']['admin_label']);
// Transform the #type = checkboxes value to a numerically indexed array.
$form_state['values']['cache']['contexts'] = array_values(array_filter($form_state['values']['cache']['contexts']));
......
# Schema for the views plugins of the Language module.
views.argument.language:
type: views_argument
label: 'Language'
views.field.language:
type: views_field
label: 'Language'
views.filter.language:
type: views.filter.in_operator
label: 'Language'
views.filter_value.language:
type: string
label: 'Language'
......@@ -53,7 +53,6 @@ display:
changed: changed
edit_node: edit_node
delete_node: delete_node
translation_link: translation_link
dropbutton: dropbutton
timestamp: title
info:
......@@ -111,13 +110,6 @@ display:
separator: ''
empty_column: false
responsive: ''
translation_link:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
dropbutton:
sortable: false
default_sort_order: asc
......@@ -268,24 +260,6 @@ display:
text: Delete
plugin_id: node_link_delete
provider: node
translation_link:
id: translation_link
table: node
field: translation_link
label: ''
exclude: true
alter:
alter_text: false
element_class: ''
element_default_classes: true
hide_alter_empty: true
hide_empty: false
empty_zero: false
empty: ''
text: Translate
optional: true
plugin_id: content_translation_link
provider: content_translation
dropbutton:
id: dropbutton
table: views
......@@ -294,7 +268,6 @@ display:
fields:
edit_node: edit_node
delete_node: delete_node
translation_link: translation_link
destination: true
plugin_id: dropbutton
provider: views
......
......@@ -173,22 +173,6 @@ protected function doTestAuthoringInfo() {
}
}
/**
* Tests translate link on content admin page.
*/
function testTranslateLinkContentAdminPage() {
$this->drupalLogin($this->administrator);
$page = $this->drupalCreateNode(array('type' => 'page'));
$article = $this->drupalCreateNode(array('type' => 'article', 'langcode' => $this->langcodes[0]));
// Verify translation links.
$this->drupalGet('admin/content');
$this->assertResponse(200);
$this->assertLinkByHref('node/' . $article->id() . '/translations');
$this->assertNoLinkByHref('node/' . $page->id() . '/translations');
}
/**
* Tests that translation page inherits admin status of edit page.
*/
......
......@@ -77,7 +77,6 @@ display:
created: created
access: access
edit_node: edit_node
translation_link: translation_link
dropbutton: dropbutton
info:
user_bulk_form:
......@@ -125,11 +124,6 @@ display:
separator: ''
empty_column: false
responsive: priority-low
translation_link:
align: ''
separator: ''
empty_column: false
responsive: ''
dropbutton:
sortable: false
default_sort_order: asc
......@@ -511,58 +505,6 @@ display:
text: Edit
plugin_id: user_link_edit
provider: user
translation_link:
id: translation_link
table: users
field: translation_link
relationship: none
group_type: group
admin_label: ''
label: 'Translation link'
exclude: true
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: ''
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
text: Translate
optional: true
plugin_id: content_translation_link
provider: content_translation
dropbutton:
id: dropbutton
table: views
......@@ -613,7 +555,6 @@ display:
hide_alter_empty: true
fields:
edit_node: edit_node
translation_link: translation_link
user_bulk_form: '0'
name: '0'
status: '0'
......
......@@ -52,19 +52,4 @@ protected function getNewEntityValues($langcode) {
return array('name' => $this->name) + parent::getNewEntityValues($langcode);
}
/**
* Tests translate link on user admin list.
*/
function testTranslateLinkUserAdminPage() {
$this->admin_user = $this->drupalCreateUser(array_merge(parent::getTranslatorPermissions(), array('access administration pages', 'administer users')));
$this->drupalLogin($this->admin_user);
$uid = $this->createEntity(array('name' => $this->randomName()), $this->langcodes[0]);
// Verify translation links.
$this->drupalGet('admin/people');
$this->assertResponse(200);
$this->assertLinkByHref('user/' . $uid . '/translations');
}
}
......@@ -143,3 +143,7 @@ views.argument.date_year_month:
created:
type: string
label: 'Date Year month'
views.argument.language:
type: views_argument
label: 'Language'
......@@ -174,3 +174,7 @@ views.field.url:
views.field.xss:
type: views_field
label: 'Xss'
views.field.language:
type: views_field
label: 'Language'
......@@ -140,3 +140,11 @@ views.filter_value.boolean:
views.filter_value.combine:
type: string
views.filter.language:
type: views.filter.in_operator
label: 'Language'
views.filter_value.language:
type: string
label: 'Language'
......@@ -2,12 +2,10 @@
/**
* @file
* Contains Drupal\language\Plugin\views\argument\LanguageArgument.
* Contains Drupal\views\Plugin\views\argument\LanguageArgument.
*/
namespace Drupal\language\Plugin\views\argument;
use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
namespace Drupal\views\Plugin\views\argument;
/**
* Defines an argument handler to accept a language.
......
......@@ -2,12 +2,11 @@
/**
* @file
* Contains Drupal\language\Plugin\views\field\LanguageField.
* Contains Drupal\views\Plugin\views\field\LanguageField.
*/
namespace Drupal\language\Plugin\views\field;
namespace Drupal\views\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\views\ResultRow;
/**
......
......@@ -2,12 +2,10 @@
/**
* @file
* Contains Drupal\language\Plugin\views\filter\LanguageFilter.
* Contains Drupal\views\Plugin\views\filter\LanguageFilter.
*/
namespace Drupal\language\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\InOperator;
namespace Drupal\views\Plugin\views\filter;
/**
* Provides filtering by language.
......
......@@ -7,7 +7,7 @@
namespace Drupal\standard\Tests;
use Drupal\comment\Entity\Comment;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\simpletest\WebTestBase;
/**
......@@ -17,6 +17,8 @@
*/
class StandardTest extends WebTestBase {
use SchemaCheckTestTrait;
protected $profile = 'standard';
/**
......@@ -86,6 +88,18 @@ function testStandard() {
$this->drupalGet('rss.xml');
$this->assertText('Foobar');
$this->assertNoText('Then she picked out two somebodies, Sally and me');
// Now we have all configuration imported, test all of them for schema
// conformance. Ensures all imported default configuration is valid when
// standard profile modules are enabled.
$names = $this->container->get('config.storage')->listAll();
$factory = $this->container->get('config.factory');
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */
$typed_config = $this->container->get('config.typed');
foreach ($names as $name) {
$config = $factory->get($name);
$this->assertConfigSchema($typed_config, $name, $config->get());
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment