Fix object navigation error

This commit is contained in:
Patrik J. Braun
2026-01-24 21:02:32 +01:00
parent 69393226f6
commit b2336b27c0
@@ -98,11 +98,13 @@ export class MediaButtonModalComponent implements OnInit, OnDestroy {
executeAction(): void { executeAction(): void {
if (this.modalData && this.isFormValid()) { if (this.modalData && this.isFormValid()) {
// save value to reuse in the next modal // save value to reuse in the next modal
this.modalData.button.popup.customFields.forEach(field => { if (this.modalData?.button?.popup?.customFields) {
if (field.keepValue) { this.modalData.button.popup.customFields.forEach(field => {
this.modalService.setValue(field.id, this.formData.customFields[field.id]); if (field.keepValue) {
} this.modalService.setValue(field.id, this.formData.customFields[field.id]);
}); }
});
}
this.modalService.executeButtonAction( this.modalService.executeButtonAction(
this.modalData.button, this.modalData.button,
this.modalData.media, this.modalData.media,
@@ -152,6 +154,7 @@ export class MediaButtonModalComponent implements OnInit, OnDestroy {
if (this.modalData?.button?.popup?.customFields) { if (this.modalData?.button?.popup?.customFields) {
this.formData.customFields = {}; this.formData.customFields = {};
this.modalData.button.popup.customFields.forEach(field => { this.modalData.button.popup.customFields.forEach(field => {
// load last value if we should keep it
if (field.keepValue && this.modalService.getValue(field.id) !== undefined) { if (field.keepValue && this.modalService.getValue(field.id) !== undefined) {
this.formData.customFields[field.id] = this.modalService.getValue(field.id); this.formData.customFields[field.id] = this.modalService.getValue(field.id);
return; return;