security updates
have to check views and entityreference for custom patches
This commit is contained in:
@@ -10,9 +10,9 @@ files[] = i18n_sync.install
|
||||
files[] = i18n_sync.module.inc
|
||||
files[] = i18n_sync.node.inc
|
||||
files[] = i18n_sync.test
|
||||
; Information added by drupal.org packaging script on 2013-08-21
|
||||
version = "7.x-1.10"
|
||||
; Information added by Drupal.org packaging script on 2015-01-26
|
||||
version = "7.x-1.12"
|
||||
core = "7.x"
|
||||
project = "i18n"
|
||||
datestamp = "1377069696"
|
||||
datestamp = "1422286982"
|
||||
|
||||
|
@@ -11,8 +11,6 @@
|
||||
*
|
||||
* Notes:
|
||||
* This module needs to run after taxonomy, i18n, translation. Check module weight.
|
||||
*
|
||||
* @ TODO Test with CCK when possible, api may have changed.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -71,25 +69,6 @@ function i18n_sync_field_info_alter(&$fields) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_form_FORM_ID_alter().
|
||||
*/
|
||||
function i18n_sync_form_node_admin_content_alter(&$form, &$form_state) {
|
||||
if (!empty($form['operation']) && $form['operation']['#value'] == 'delete') {
|
||||
$form['#submit'] = array_merge(array('i18n_sync_node_delete_submit'), $form['#submit']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_form_FORM_ID_alter().
|
||||
*/
|
||||
function i18n_sync_form_node_delete_confirm_alter(&$form, &$form_state) {
|
||||
// Intercept form submission so we can handle uploads, replace callback
|
||||
$form['#submit'] = array_merge(array('i18n_sync_node_delete_submit'), $form['#submit']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Implements hook_form_FORM_ID_alter().
|
||||
*/
|
||||
@@ -145,42 +124,6 @@ function i18n_sync_form_node_type_form_alter(&$form, &$form_state) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit callback for
|
||||
* - node delete confirm
|
||||
* - node multiple delete confirm
|
||||
*/
|
||||
function i18n_sync_node_delete_submit($form, $form_state) {
|
||||
if ($form_state['values']['confirm']) {
|
||||
if (!empty($form_state['values']['nid'])) {
|
||||
// Single node
|
||||
i18n_sync_node_delete_prepare($form_state['values']['nid']);
|
||||
}
|
||||
elseif (!empty($form_state['values']['nodes'])) {
|
||||
// Multiple nodes
|
||||
foreach ($form_state['values']['nodes'] as $nid => $value) {
|
||||
i18n_sync_node_delete_prepare($nid);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Then it will go through normal form submission
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare node for deletion, work out synchronization issues
|
||||
*/
|
||||
function i18n_sync_node_delete_prepare($nid) {
|
||||
$node = node_load($nid);
|
||||
// Delete file associations when files are shared with existing translations
|
||||
// so they are not removed by upload module
|
||||
if (!empty($node->tnid) && module_exists('upload')) {
|
||||
$result = db_query('SELECT u.* FROM {upload} u WHERE u.nid = %d AND u.fid IN (SELECT t.fid FROM {upload} t WHERE t.fid = u.fid AND t.nid <> u.nid)', $nid);
|
||||
while ($up = db_fetch_object($result)) {
|
||||
db_query("DELETE FROM {upload} WHERE fid = %d AND vid = %d", $up->fid, $up->vid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether this node is to be synced
|
||||
*/
|
||||
|
@@ -39,6 +39,7 @@ function i18n_sync_node_translation($node, $translations, $field_names, $op) {
|
||||
continue;
|
||||
}
|
||||
// Load full node, we need all data here.
|
||||
entity_get_controller('node')->resetCache(array($translation->nid));
|
||||
$translation = node_load($translation->nid);
|
||||
$i18n_options = i18n_sync_node_options($node->type);
|
||||
// Invoke callback for each field, the default is just copy over
|
||||
|
Reference in New Issue
Block a user