Unverified Commit 18eae73c authored by alexpott's avatar alexpott

Issue #3080492 by quietone, Gábor Hojtsy: Migrate fixed vocabulary term...

Issue #3080492 by quietone, Gábor Hojtsy: Migrate fixed vocabulary term reference fields as translatable to conform to data expectations when nodes get merged
parent 668e08a7
......@@ -152,11 +152,11 @@ public function prepareRow(Row $row) {
$row->setSourceProperty('allowed_vid', $allowed_vid);
// If there is an i18n_mode use it to determine if this field is
// translatable. It is TRUE only for i18n_mode 'Translate', all others are
// FALSE. When there is a term reference field with two vocabularies where
// one vocabulary is translatable and other is not the field itself is set
// to not translatable. Note mode '5' is not used for taxonomy but is
// listed here for completeness.
// translatable. It is TRUE for i18n_modes 'Vocab Fixed' and 'Translate',
// for all others it is FALSE. When there is a term reference field with
// two vocabularies where one vocabulary is translatable and other is not
// the field itself is set to not translatable. Note mode '5' is not used
// for taxonomy but is listed here for completeness.
// - 0: No multilingual options.
// - 1: Localize. Localizable object.
// - 2: Fixed Language.
......@@ -170,10 +170,10 @@ public function prepareRow(Row $row) {
->fields('v', ['i18n_mode'])
->condition('machine_name', $vocabulary, 'IN');
$results = $query->execute()->fetchAllAssoc('i18n_mode');
$translatable = TRUE;
$translatable = FALSE;
foreach ($results as $result) {
if ($result['i18n_mode'] != '4') {
$translatable = FALSE;
if ($result['i18n_mode'] == '2' || $result['i18n_mode'] == '4') {
$translatable = TRUE;
}
}
$row->setSourceProperty('translatable', $translatable);
......
......@@ -164,7 +164,7 @@ public function testFieldInstances() {
$this->assertFalse($field->isTranslatable());
// Test the translation settings for taxonomy fields.
$this->assertEntity('node.article.field_vocab_fixed', 'vocab_fixed', 'entity_reference', FALSE, FALSE);
$this->assertEntity('node.article.field_vocab_fixed', 'vocab_fixed', 'entity_reference', FALSE, TRUE);
$this->assertEntity('node.article.field_vocab_localize', 'vocab_localize', 'entity_reference', FALSE, FALSE);
$this->assertEntity('node.article.field_vocab_translate', 'vocab_translate', 'entity_reference', FALSE, TRUE);
}
......
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