ran security updates on contrib modules
ctools, video_embed_field, migrate, views_bulk_operations
This commit is contained in:
@@ -301,6 +301,11 @@ abstract class MigrationBase {
|
||||
return $this->disableHooks;
|
||||
}
|
||||
|
||||
/**
|
||||
* An array to track 'mail_system' variable if disabled.
|
||||
*/
|
||||
protected $mailSystem = array();
|
||||
|
||||
/**
|
||||
* Have we already warned about obsolete constructor argumentss on this request?
|
||||
*
|
||||
@@ -432,16 +437,11 @@ abstract class MigrationBase {
|
||||
// Record the time limit
|
||||
$this->timeLimit = ini_get('max_execution_time');
|
||||
|
||||
// Prevent any emails from being sent out on migration
|
||||
global $conf;
|
||||
if (!empty($conf['mail_system'])) {
|
||||
foreach ($conf['mail_system'] as $system => $class) {
|
||||
$conf['mail_system'][$system] = 'MigrateMailIgnore';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$conf['mail_system']['default-system'] = 'MigrateMailIgnore';
|
||||
}
|
||||
// Save the current mail system, prior to disabling emails.
|
||||
$this->saveMailSystem();
|
||||
|
||||
// Prevent emails from being sent out during migrations.
|
||||
$this->disableMailSystem();
|
||||
|
||||
// Make sure we clear our semaphores in case of abrupt exit
|
||||
drupal_register_shutdown_function(array($this, 'endProcess'));
|
||||
@@ -1355,6 +1355,39 @@ abstract class MigrationBase {
|
||||
}
|
||||
return $time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves the current mail system, or set a system default if there is none.
|
||||
*/
|
||||
protected function saveMailSystem() {
|
||||
global $conf;
|
||||
if (empty($conf['mail_system'])) {
|
||||
$conf['mail_system']['default-system'] = 'MigrateMailIgnore';
|
||||
}
|
||||
else {
|
||||
$this->mailSystem = $conf['mail_system'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables mail system to prevent emails from being sent during migrations.
|
||||
*/
|
||||
public function disableMailSystem() {
|
||||
global $conf;
|
||||
if (!empty($conf['mail_system'])) {
|
||||
foreach ($conf['mail_system'] as $system => $class) {
|
||||
$conf['mail_system'][$system] = 'MigrateMailIgnore';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores the original saved mail system for migrations that require it.
|
||||
*/
|
||||
public function restoreMailSystem() {
|
||||
global $conf;
|
||||
$conf['mail_system'] = $this->mailSystem;
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure static members (in particular, $displayFunction) get
|
||||
|
||||
@@ -141,16 +141,26 @@ abstract class Migration extends MigrationBase {
|
||||
// destination field, keep only the last (so the UI can override a source
|
||||
// field DNM that was defined in code).
|
||||
$no_destination = array();
|
||||
// But also remove a mapping of a source field to nothing, if there is
|
||||
// a mapping to something.
|
||||
$mapped_source_fields = array();
|
||||
/** @var MigrateFieldMapping $mapping */
|
||||
foreach ($this->allFieldMappings as $destination_field => $mapping) {
|
||||
$source_field = $mapping->getSourceField();
|
||||
// If the source field is not mapped to a destination field, the
|
||||
// array index is integer.
|
||||
if (is_int($destination_field)) {
|
||||
$source_field = $mapping->getSourceField();
|
||||
if (isset($no_destination[$source_field])) {
|
||||
unset($this->allFieldMappings[$no_destination[$source_field]]);
|
||||
unset($no_destination[$source_field]);
|
||||
}
|
||||
$no_destination[$source_field] = $destination_field;
|
||||
if (isset($mapped_source_fields[$source_field])) {
|
||||
unset($this->allFieldMappings[$destination_field]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$mapped_source_fields[$source_field] = $source_field;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1267,8 +1277,11 @@ abstract class Migration extends MigrationBase {
|
||||
// Are we dealing with the primary value of the destination field, or a
|
||||
// subfield?
|
||||
$destination = explode(':', $destination);
|
||||
// Count how many levels of fields are in the mapping. We'll use the
|
||||
// last one.
|
||||
$destination_count = count($destination);
|
||||
$destination_field = $destination[0];
|
||||
if (isset($destination[1])) {
|
||||
if ($destination_count == 2) {
|
||||
$subfield = $destination[1];
|
||||
// We're processing the subfield before the primary value, initialize it
|
||||
if (!property_exists($this->destinationValues, $destination_field)) {
|
||||
@@ -1282,6 +1295,24 @@ abstract class Migration extends MigrationBase {
|
||||
// Add the subfield value to the arguments array.
|
||||
$this->destinationValues->{$destination_field}['arguments'][$subfield] = $destination_values;
|
||||
}
|
||||
elseif ($destination_count == 3) {
|
||||
$subfield2 = $destination[2];
|
||||
// We're processing the subfield before the primary value, initialize it
|
||||
if (!property_exists($this->destinationValues, $destination_field)) {
|
||||
$this->destinationValues->$destination_field = array();
|
||||
}
|
||||
// We have a value, and need to convert to an array so we can add
|
||||
// arguments.
|
||||
elseif (!is_array($this->destinationValues->$destination_field)) {
|
||||
$this->destinationValues->$destination_field = array($this->destinationValues->$destination_field);
|
||||
}
|
||||
if (!is_array($this->destinationValues->{$destination_field}['arguments'][$destination[1]])) {
|
||||
// Convert first subfield level to an array so we can add to it.
|
||||
$this->destinationValues->{$destination_field}['arguments'][$destination[1]] = array( $this->destinationValues->{$destination_field}['arguments'][$destination[1]] );
|
||||
}
|
||||
// Add the subfield value to the arguments array.
|
||||
$this->destinationValues->{$destination_field}['arguments'][$destination[1]]['arguments'][$subfield2] = $destination_values;
|
||||
}
|
||||
// Just the primary value, the first time through for this field, simply
|
||||
// set it.
|
||||
elseif (!property_exists($this->destinationValues, $destination_field)) {
|
||||
|
||||
@@ -303,9 +303,11 @@ abstract class MigrateSource implements Iterator {
|
||||
// highwaters and map rows).
|
||||
$prepared = FALSE;
|
||||
if (!empty($this->idList)) {
|
||||
// Check first source key.
|
||||
if (!in_array(reset($this->currentKey), $this->idList)) {
|
||||
// If this is a compound source key, check the full key.
|
||||
$compoundKey = implode($this->multikeySeparator, $this->currentKey);
|
||||
if (count($this->currentKey) > 1 && !in_array($compoundKey, $this->idList)) {
|
||||
if (count($this->currentKey) == 1 || !in_array($compoundKey, $this->idList)) {
|
||||
// Could not find the key, skip.
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user