Fixed #566: transform function broken, regression since `v5.20.0`

This commit is contained in:
jos 2018-08-17 20:20:36 +02:00
parent eb56fc38b4
commit ffe727849e
2 changed files with 12 additions and 4 deletions

View File

@ -3,6 +3,11 @@
https://github.com/josdejong/jsoneditor
## 2018-08-17, version 5.23.1
- Fixed #566: transform function broken, regression since `v5.20.0`.
## 2018-08-15, version 5.23.0
- Implemented support for custom validation using a new `onValidate` callback.

View File

@ -3621,15 +3621,18 @@ Node.prototype.transform = function (query) {
try {
// apply the JMESPath query
var oldValue = this.getInternalValue();
var newValue = jmespath.search(oldValue, query);
var oldInternalValue = this.getInternalValue();
var oldValue = this.getValue();
var newValue = jmespath.search(oldValue, query);
this.setValue(newValue);
var newInternalValue = this.getInternalValue();
this.editor._onAction('transform', {
path: this.getInternalPath(),
oldValue: oldValue,
newValue: this.getInternalValue()
oldValue: oldInternalValue,
newValue: newInternalValue
});
this.showChilds();