Skip to content
Snippets Groups Projects
Verified Commit 4bab3268 authored by Dave Long's avatar Dave Long
Browse files

Issue #3371828 by quietone: NodeCompleteNodeTranslationLookup should return...

Issue #3371828 by quietone: NodeCompleteNodeTranslationLookup should return NULL for non translated lookups

(cherry picked from commit c6eb9052)
parent 5b37bdb1
No related branches found
No related tags found
14 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.,!7567Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7565Issue #3153723 by quietone, Hardik_Patel_12: Change the scaffolding...,!7509Change label "Block description" to "Block type",!7344Issue #3292350 by O'Briat, KlemenDEV, hswong3i, smustgrave, quietone: Update...,!6922Issue #3412959 by quietone, smustgrave, longwave: Fix 12 'un' words,!6848Issue #3417553 by longwave: Remove withConsecutive() in CacheCollectorTest,!6720Revert "Issue #3358581 by pfrenssen, _tarik_, a.dmitriiev, smustgrave:...,!6560Update ClaroPreRender.php, confirming classes provided are in array format,!6528Issue #3414261 by catch: Add authenticated user umami performance tests,!6501Issue #3263668 by omkar-pd, Wim Leers, hooroomoo: Re-enable inline form errors...,!6354Draft: Issue #3380392 by phma: Updating language weight from the overview reverts label if translated,!6324Issue #3416723 by Ludo.R: Provide a "node type" views default argument
Pipeline #75596 passed
Pipeline: drupal

#75598

    ......@@ -30,6 +30,10 @@ class NodeCompleteNodeTranslationLookup extends ProcessPluginBase {
    */
    public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (is_array($value) && count($value) === 3) {
    // If the language is 'und' then the node was not translated.
    if ($value[2] === 'und') {
    return NULL;
    }
    unset($value[1]);
    return array_values($value);
    }
    ......
    ......@@ -43,9 +43,6 @@ protected function setUp(): void {
    $this->executeMigrations([
    'language',
    'd6_node_settings',
    'd6_node',
    'd6_node_translation',
    'd6_url_alias',
    ]);
    }
    ......@@ -72,6 +69,29 @@ private function assertPath(int $pid, array $conditions, PathAliasInterface $pat
    * Tests the URL alias migration.
    */
    public function testUrlAlias() {
    $this->executeMigrations([
    'd6_node',
    'd6_node_translation',
    'd6_url_alias',
    ]);
    $this->checkUrlMigration();
    }
    /**
    * Tests the URL alias migration using the node complete migration.
    */
    public function testNodeCompleteUrlAlias() {
    $this->executeMigrations([
    'd6_node_complete',
    'd6_url_alias',
    ]);
    $this->checkUrlMigration();
    }
    /**
    * Checks the migration results.
    */
    protected function checkUrlMigration() {
    $id_map = $this->getMigration('d6_url_alias')->getIdMap();
    // Test that the field exists.
    $conditions = [
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment