Issue #2301045 by Gábor Hojtsy: Fixed Standard profile has views which include elements dependent on uninstalled modules, not valid in config.

8.0.x
webchick 2014-07-18 11:30:01 -04:00
parent 9e7f617e78
commit 01d85e15f2
13 changed files with 40 additions and 146 deletions

View File

@ -344,6 +344,9 @@ abstract class BlockBase extends ContextAwarePluginBase implements BlockPluginIn
* @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']));

View File

@ -1,17 +0,0 @@
# 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'

View File

@ -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

View File

@ -173,22 +173,6 @@ class NodeTranslationUITest extends ContentTranslationUITest {
}
}
/**
* 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.
*/

View File

@ -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'

View File

@ -52,19 +52,4 @@ class UserTranslationUITest extends ContentTranslationUITest {
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');
}
}

View File

@ -143,3 +143,7 @@ views.argument.date_year_month:
created:
type: string
label: 'Date Year month'
views.argument.language:
type: views_argument
label: 'Language'

View File

@ -174,3 +174,7 @@ views.field.url:
views.field.xss:
type: views_field
label: 'Xss'
views.field.language:
type: views_field
label: 'Language'

View File

@ -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'

View File

@ -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.

View File

@ -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;
/**

View File

@ -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.

View File

@ -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 @@ use Drupal\simpletest\WebTestBase;
*/
class StandardTest extends WebTestBase {
use SchemaCheckTestTrait;
protected $profile = 'standard';
/**
@ -86,6 +88,18 @@ class StandardTest extends WebTestBase {
$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());
}
}
}