Bug 39795 - Data loss when editing vendor.addressX
Summary: Data loss when editing vendor.addressX
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: 24.11
Hardware: All All
: P5 - low major
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 38010
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-30 19:36 UTC by Jonathan Druart
Modified: 2025-04-30 19:36 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-04-30 19:36:30 UTC
It's related to this code from vue/components/Vendors/VendorFormAdd.vue

+                    let physical = "";
+                    vendor.address1 && (physical += vendor.address1 + "\n");
+                    vendor.address2 && (physical += vendor.address2 + "\n");
+                    vendor.address3 && (physical += vendor.address3 + "\n");
+                    vendor.address4 && (physical += vendor.address4 + "\n");
+                    this.vendor.physical = physical;


+            if (vendor.physical) {
+                const addressLines = vendor.physical.split("\n");
+                if (addressLines.length > 4) {
+                    addressLines.length = 4;
+                }
+                addressLines.forEach((line, i) => {
+                    vendor[`address${i + 1}`] = line;
+                });
+            }


The existing bug has been ported when writing bug 38010 but it should be fixed.

If you enter physical address on more than 4 lines, save
=> Only the first 4 lines are kept.