Skip to content

EspoCRM – Open Source CRM Application

Restore model collection on page back

Yurii57d9639d6e56
diff --git a/client/src/views/modals/detail.js b/client/src/views/modals/detail.js
index 8cd53a5750..1b18e887f5 100644
--- a/client/src/views/modals/detail.js
+++ b/client/src/views/modals/detail.js
@@ -594,6 +594,9 @@ class DetailModalView extends ModalView {
collection.fetch()
.then(() => {
+ // Restore as it can be removed by fetch.
+ this.model.collection = collection;
+
const indexOfRecord = collection.length - 1;
if (indexOfRecord < 0) {
diff --git a/client/src/views/record/detail.ts b/client/src/views/record/detail.ts
index 2236dac521..316db56917 100644
--- a/client/src/views/record/detail.ts
+++ b/client/src/views/record/detail.ts
@@ -2420,6 +2420,9 @@ class DetailRecordView<S extends DetailRecordViewSchema = DetailRecordViewSchema
collection.fetch()
.then(() => {
+ // Restore as it's removed by fetch.
+ this.model.collection = collection;
+
const indexOfRecord = collection.length - 1;
if (indexOfRecord < 0) {