Skip to content

Commit

Permalink
FIO-7074/FIO-7379: Fixes some issues caused by Wizzard was not always…
Browse files Browse the repository at this point in the history
… setting _data to submission data
  • Loading branch information
alexandraRamanenka committed Nov 6, 2023
1 parent 6627908 commit eb97ae5
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/Wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -897,25 +897,23 @@ export default class Wizard extends Webform {
}

setValue(submission, flags = {}, ignoreEstablishment) {
this._submission = submission;
if (
(flags && flags.fromSubmission && (this.options.readOnly || this.editMode) && !this.isHtmlRenderMode()) ||
(flags && flags.fromSubmission && (this.prefixComps.length || this.suffixComps.length) && submission._id) ||
(this.options.server && (this.prefixComps.length || this.suffixComps.length))
) {
this._data = submission.data;
}

if (!ignoreEstablishment) {
this.establishPages(submission.data);
}
const changed = this.getPages({ all: true }).reduce((changed, page) => {
return this.setNestedValue(page, submission.data, flags, changed) || changed;
}, false);

this.mergeData(this.data, submission.data);

if (changed) {
this.pageFieldLogic(this.page);
}

submission.data = this.data;
this._submission = submission;

if (!ignoreEstablishment) {
this.establishPages(submission.data);
}

this.setEditMode(submission);

return changed;
Expand Down

0 comments on commit eb97ae5

Please sign in to comment.