Bug 35577

Summary: Self-registration creates empty patron attributes
Product: Koha Reporter: David Roberts <david.roberts>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description David Roberts 2023-12-14 23:57:17 UTC
When creating a new users using the self-registration feature, all extended patron attributes are created as empty lines in the database even if they are not completed in the form:

 select * from borrower_attributes where borrowernumber = 265932;
+--------+----------------+-----------+-----------+
| id     | borrowernumber | code      | attribute |
+--------+----------------+-----------+-----------+
| 408566 |         265932 | JOBROLE   | Test      |
| 408567 |         265932 | ESRCAT    |           |
| 408568 |         265932 | NOTIF     |           |
| 408569 |         265932 | CONTRACT  |           |
| 408570 |         265932 | STUDY     |           |
| 408571 |         265932 | CONT_TYPE |           |
| 408572 |         265932 | TRUST_OTH |           |
| 408573 |         265932 | TRUST     |           |
+--------+----------------+-----------+-----

Editing this user record in the staff client then deletes the empty attributes:

select * from borrower_attributes where borrowernumber = 265932;
+--------+----------------+-----------+-----------+
| id     | borrowernumber | code      | attribute |
+--------+----------------+-----------+-----------+
| 408574 |         265932 | CONT_TYPE | TEMP      |
| 408575 |         265932 | JOBROLE   | Test      |
+--------+----------------+-----------+-----------+