don't mutate the fallback search terms
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 8 Jul 2020 21:18:05 +0000 (17:18 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 8 Jul 2020 21:18:05 +0000 (17:18 -0400)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts

index f17309f..778ba1b 100644 (file)
@@ -111,7 +111,8 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit, OnChanges
                             this.searchConjunction = defaultSearch.conjunction;
                         } else if (this.fallbackSearchTerms.length) {
                             this.searchTerms.length = 0;
-                            this.fallbackSearchTerms.forEach(term => this.searchTerms.push(term));
+                            JSON.parse(JSON.stringify(this.fallbackSearchTerms))
+                                .forEach(term => this.searchTerms.push(term)); // need a copy
                         } else {
                             this.addSearchTerm();
                         }