#1232 loggable inserta datos erroneos fixed
gitea/salix/master This commit looks good Details

This commit is contained in:
Gerard 2019-03-14 13:13:27 +01:00
parent 0a95f1b299
commit c889984d77
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ module.exports = function(Self) {
// Sets the changedModelValue to save and the instances changed in case its an updateAll
let changedModelValue = definition.settings.log.changedModelValue;
let where;
if (changedModelValue && (!ctx.instance || !ctx.instance[changedModelValue])) {
if (changedModelValue && (!ctx.instance || !ctx.instance[changedModelValue]) && ctx.where) {
changedModelId = [];
where = [];
let changedInstances = await ctx.Model.app.models[definition.name].find({where: ctx.where, fields: ['id', changedModelValue]}, options);