Skip to content
Snippets Groups Projects
Commit b183486e authored by Thomas Bindhammer's avatar Thomas Bindhammer
Browse files

Merge branch 'cm_fixes_kwsoft' into 'upgrade/2021.2.0'

fix communication.contact_id > communication.object_rowid

See merge request !9
parents 187b5009 1578957b
No related branches found
No related tags found
2 merge requests!12Upgrade/2021.2.0,!9fix communication.contact_id > communication.object_rowid
import("system.util");
import("Employee_lib");
import("upgrade_lib");
import("system.logging");
......@@ -646,7 +647,11 @@ function getConfig_COMM() {
}], // COMMID
[iMove, {
Source: 1,
Target: "COMMUNICATION.CONTACT_ID"
Target: "COMMUNICATION.OBJECT_ROWID"
}], // RELATION_ID
[iMove, {
Value: "Contact",
Target: "COMMUNICATION.OBJECT_TYPE"
}], // RELATION_ID
[iDecode, {
Source: 2,
......@@ -1551,7 +1556,7 @@ function getConfig_ASYS_BINARIES() {
* @TODO the binaries have to outsourced BEFORE or simultaneously with the migration
* @TODO documentation
*/
function getConfig_ASYS_BINARIES(pObj) {
function getConfig_ASYS_BINARIES_blobHandler(pObj) {
var condition = pObj.hasOwnProperty("condition") ? pObj.condition : "1=1";
......@@ -3757,4 +3762,4 @@ function iLoginToEmployeeID(pObject)
this.setOutput(pObject, res);
return true;
}
}
\ No newline at end of file
......@@ -26,6 +26,7 @@ function iUpgradeDocument(pObject) {
var columns = [];
var values = [];
var dataObj = {};
var action = "";
//set binaryid by overgiven ID or select via condition
if(pObject.hasOwnProperty("ID")) {
......@@ -52,18 +53,26 @@ function iUpgradeDocument(pObject) {
switch (pObject.Action) {
case "I":
action = "inserting";
_insert();
this.recordCounts.insert++;
break;
case "U":
action = "updating";
_update();
this.recordCounts.update++;
break;
default:
var rowCount = db.getRowCount(table, ["ID"], null, [dataObj.ID], alias);
if(rowCount == "0") {
action = "inserting";
_insert();
this.recordCounts.insert++;
} else {
action = "updating";
_update();
this.recordCounts.update++;
}
break;
}
......@@ -74,8 +83,12 @@ function iUpgradeDocument(pObject) {
}
catch(ex)
{
logging.log(ex);
logging.log(ex, logging.ERROR, [
"error in importer function iUpgradeDocument while " + action + " binaryfile \"" + (dataObj.ID ? dataObj.ID : "no uid") + "\"",
ex["rhinoException"] ? ex["rhinoException"].toString() : (ex.name + ": " + ex.message + " " + ex.stack)
]);
resultDocument = false;
this.recordCounts.skip++;
}
function _insert() {
......@@ -103,11 +116,11 @@ function iUpgradeDocument(pObject) {
null,
values,
table + ".ID = '" + dataObj.ID + "'",
// use sqlBuilder, when db.quote Bug is fixed
// newWhere(table + ".ID", dataObj.ID, null, null, alias).toString(),
// use sqlBuilder, when db.quote Bug is fixed
// newWhere(table + ".ID", dataObj.ID, null, null, alias).toString(),
alias
);
}
return resultDocument;
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment