MDL-51781 tool_log: marked log values as NOT_MAPPED if mapping not found

This commit is contained in:
Mark Nelson
2015-10-15 01:25:43 -07:00
parent b117fac04b
commit f74fe5ba52
2 changed files with 9 additions and 2 deletions
@@ -105,7 +105,8 @@ abstract class restore_tool_log_logstore_subplugin extends restore_subplugin {
($mapping['restore'] === \core\event\base::NOT_MAPPED)) {
$data->objectid = \core\event\base::NOT_MAPPED;
} else {
$data->objectid = $this->get_mappingid($mapping['restore'], $data->objectid);
$data->objectid = $this->get_mappingid($mapping['restore'], $data->objectid,
\core\event\base::NOT_FOUND);
}
}
} else {
@@ -131,7 +132,8 @@ abstract class restore_tool_log_logstore_subplugin extends restore_subplugin {
($mapping['restore'] === \core\event\base::NOT_MAPPED)) {
$data->other[$key] = \core\event\base::NOT_MAPPED;
} else {
$data->other[$key] = $this->get_mappingid($mapping['restore'], $value);
$data->other[$key] = $this->get_mappingid($mapping['restore'], $value,
\core\event\base::NOT_FOUND);
}
}
}
+5
View File
@@ -80,6 +80,11 @@ abstract class base implements \IteratorAggregate {
*/
const NOT_MAPPED = -31337;
/**
* The value used when an id can not be found during a restore.
*/
const NOT_FOUND = -31338;
/** @var array event data */
protected $data;