Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443205
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443205
Commits
65312647
Commit
65312647
authored
9 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2493557
by pfrenssen: Fatal error when creating a translatable vocabulary type
parent
cb451afa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/modules/taxonomy/src/Tests/VocabularyTranslationTest.php
+59
-0
59 additions, 0 deletions
.../modules/taxonomy/src/Tests/VocabularyTranslationTest.php
core/modules/taxonomy/src/VocabularyForm.php
+0
-20
0 additions, 20 deletions
core/modules/taxonomy/src/VocabularyForm.php
with
59 additions
and
20 deletions
core/modules/taxonomy/src/Tests/VocabularyTranslationTest.php
0 → 100644
+
59
−
0
View file @
65312647
<?php
/**
* @file
* Contains \Drupal\taxonomy\Tests\VocabularyTranslationTest.
*/
namespace
Drupal\taxonomy\Tests
;
use
Drupal\Component\Utility\Unicode
;
/**
* Tests content translation for vocabularies.
*
* @group taxonomy
*/
class
VocabularyTranslationTest
extends
TaxonomyTestBase
{
/**
* {@inheritdoc}
*/
public
static
$modules
=
array
(
'content_translation'
,
'language'
);
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
parent
::
setUp
();
// Create an administrative user.
$this
->
drupalLogin
(
$this
->
drupalCreateUser
([
'administer taxonomy'
,
'administer content translation'
,
]));
}
/**
* Tests language settings for vocabularies.
*/
function
testVocabularyLanguage
()
{
$this
->
drupalGet
(
'admin/structure/taxonomy/add'
);
// Check that the field to enable content translation is available.
$this
->
assertField
(
'edit-default-language-content-translation'
,
'The content translation checkbox is present on the page.'
);
// Create the vocabulary.
$vid
=
Unicode
::
strtolower
(
$this
->
randomMachineName
());
$edit
[
'name'
]
=
$this
->
randomMachineName
();
$edit
[
'description'
]
=
$this
->
randomMachineName
();
$edit
[
'langcode'
]
=
'en'
;
$edit
[
'vid'
]
=
$vid
;
$edit
[
'default_language[content_translation]'
]
=
TRUE
;
$this
->
drupalPostForm
(
NULL
,
$edit
,
t
(
'Save'
));
// Check if content translation is enabled on the edit page.
$this
->
drupalGet
(
'admin/structure/taxonomy/manage/'
.
$vid
);
$this
->
assertFieldChecked
(
'edit-default-language-content-translation'
,
'The content translation was correctly selected.'
);
}
}
This diff is collapsed.
Click to expand it.
core/modules/taxonomy/src/VocabularyForm.php
+
0
−
20
View file @
65312647
...
...
@@ -115,26 +115,6 @@ public function form(array $form, FormStateInterface $form_state) {
return
parent
::
form
(
$form
,
$form_state
,
$vocabulary
);
}
/**
* {@inheritdoc}
*/
protected
function
actions
(
array
$form
,
FormStateInterface
$form_state
)
{
// If we are displaying the delete confirmation skip the regular actions.
if
(
!
$form_state
->
get
(
'confirm_delete'
))
{
$actions
=
parent
::
actions
(
$form
,
$form_state
);
// We cannot leverage the regular submit handler definition because we
// have button-specific ones here. Hence we need to explicitly set it for
// the submit action, otherwise it would be ignored.
if
(
$this
->
moduleHandler
->
moduleExists
(
'content_translation'
))
{
array_unshift
(
$actions
[
'submit'
][
'#submit'
],
'content_translation_language_configuration_element_submit'
);
}
return
$actions
;
}
else
{
return
array
();
}
}
/**
* {@inheritdoc}
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment