update core to 7.36

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-19 19:33:23 +02:00
parent 6de56c702c
commit 802ec0c6f3
271 changed files with 4111 additions and 1227 deletions

View File

@@ -5,8 +5,8 @@ package = Testing
version = VERSION
hidden = TRUE
; Information added by Drupal.org packaging script on 2014-05-08
version = "7.28"
; Information added by Drupal.org packaging script on 2015-04-02
version = "7.36"
project = "drupal"
datestamp = "1399522731"
datestamp = "1427943826"

View File

@@ -6,8 +6,8 @@ version = VERSION
core = 7.x
files[] = translation.test
; Information added by Drupal.org packaging script on 2014-05-08
version = "7.28"
; Information added by Drupal.org packaging script on 2015-04-02
version = "7.36"
project = "drupal"
datestamp = "1399522731"
datestamp = "1427943826"

View File

@@ -336,9 +336,13 @@ function translation_node_insert($node) {
'tnid' => $tnid,
'translate' => 0,
))
->condition('nid', $node->translation_source->nid)
->condition('nid', $tnid)
->execute();
// Flush the (untranslated) source node from the load cache.
entity_get_controller('node')->resetCache(array($tnid));
}
db_update('node')
->fields(array(
'tnid' => $tnid,
@@ -368,13 +372,23 @@ function translation_node_update($node) {
))
->condition('nid', $node->nid)
->execute();
if (!empty($node->translation['retranslate'])) {
// This is the source node, asking to mark all translations outdated.
db_update('node')
->fields(array('translate' => 1))
$translations = db_select('node', 'n')
->fields('n', array('nid'))
->condition('nid', $node->nid, '<>')
->condition('tnid', $node->tnid)
->execute()
->fetchCol();
db_update('node')
->fields(array('translate' => 1))
->condition('nid', $translations, 'IN')
->execute();
// Flush the modified translation nodes from the load cache.
entity_get_controller('node')->resetCache($translations);
}
}
}
@@ -420,11 +434,16 @@ function translation_remove_from_set($node) {
'tnid' => 0,
'translate' => 0,
));
if (db_query('SELECT COUNT(*) FROM {node} WHERE tnid = :tnid', array(':tnid' => $node->tnid))->fetchField() == 1) {
// Determine which nodes to apply the update to.
$set_nids = db_query('SELECT nid FROM {node} WHERE tnid = :tnid', array(':tnid' => $node->tnid))->fetchCol();
if (count($set_nids) == 1) {
// There is only one node left in the set: remove the set altogether.
$query
->condition('tnid', $node->tnid)
->execute();
$flush_set = TRUE;
}
else {
$query
@@ -439,8 +458,14 @@ function translation_remove_from_set($node) {
->fields(array('tnid' => $new_tnid))
->condition('tnid', $node->tnid)
->execute();
$flush_set = TRUE;
}
}
// Flush the modified nodes from the load cache.
$nids = !empty($flush_set) ? $set_nids : array($node->nid);
entity_get_controller('node')->resetCache($nids);
}
}