Projet

Général

Profil

Révision b4adf10d

Ajouté par Assos Assos il y a plus de 9 ans

Udpate to 7.33

Voir les différences:

drupal7/modules/translation/translation.module
336 336
            'tnid' => $tnid,
337 337
            'translate' => 0,
338 338
          ))
339
          ->condition('nid', $node->translation_source->nid)
339
          ->condition('nid', $tnid)
340 340
          ->execute();
341

  
342
        // Flush the (untranslated) source node from the load cache.
343
        entity_get_controller('node')->resetCache(array($tnid));
341 344
      }
345

  
342 346
      db_update('node')
343 347
        ->fields(array(
344 348
          'tnid' => $tnid,
......
368 372
        ))
369 373
        ->condition('nid', $node->nid)
370 374
        ->execute();
375

  
371 376
      if (!empty($node->translation['retranslate'])) {
372 377
        // This is the source node, asking to mark all translations outdated.
373
        db_update('node')
374
          ->fields(array('translate' => 1))
378
        $translations = db_select('node', 'n')
379
          ->fields('n', array('nid'))
375 380
          ->condition('nid', $node->nid, '<>')
376 381
          ->condition('tnid', $node->tnid)
382
          ->execute()
383
          ->fetchCol();
384

  
385
        db_update('node')
386
          ->fields(array('translate' => 1))
387
          ->condition('nid', $translations, 'IN')
377 388
          ->execute();
389

  
390
        // Flush the modified translation nodes from the load cache.
391
        entity_get_controller('node')->resetCache($translations);
378 392
      }
379 393
    }
380 394
  }
......
420 434
        'tnid' => 0,
421 435
        'translate' => 0,
422 436
      ));
423
    if (db_query('SELECT COUNT(*) FROM {node} WHERE tnid = :tnid', array(':tnid' => $node->tnid))->fetchField() == 1) {
437

  
438
    // Determine which nodes to apply the update to.
439
    $set_nids = db_query('SELECT nid FROM {node} WHERE tnid = :tnid', array(':tnid' => $node->tnid))->fetchCol();
440
    if (count($set_nids) == 1) {
424 441
      // There is only one node left in the set: remove the set altogether.
425 442
      $query
426 443
        ->condition('tnid', $node->tnid)
427 444
        ->execute();
445

  
446
      $flush_set = TRUE;
428 447
    }
429 448
    else {
430 449
      $query
......
439 458
          ->fields(array('tnid' => $new_tnid))
440 459
          ->condition('tnid', $node->tnid)
441 460
          ->execute();
461

  
462
        $flush_set = TRUE;
442 463
      }
443 464
    }
465

  
466
    // Flush the modified nodes from the load cache.
467
    $nids = !empty($flush_set) ? $set_nids : array($node->nid);
468
    entity_get_controller('node')->resetCache($nids);
444 469
  }
445 470
}
446 471

  

Formats disponibles : Unified diff