Bug 38764 - Patron attribute classes don't have unique IDs
Summary: Patron attribute classes don't have unique IDs
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-20 15:09 UTC by Caroline Cyr La Rose
Modified: 2024-12-20 15:09 UTC (History)
0 users

See Also:
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 Caroline Cyr La Rose 2024-12-20 15:09:16 UTC
If you create patron attributes divided into several classes, and those attributes are visible/editable in the OPAC, the IDs attributed to the classes are not unique. Each class has the id #aai_
I noticed that in the staff interface, aai_ is followed by the code of the class (e.g. aai_CLASS1). But that is not the case in the OPAC.

To recreate:
1. Add two patron attribute classes in authorized values (I created CLASS1 and CLASS2)
   1.1. Go to Administration > Authorized values
   1.2. Search for category PA_CLASS
   1.3. Click Add
   1.4. Fill out the form 
        - Authorized value: CLASS1
        - Description: Class 1
   1.5. Click Save
   1.6. Click New authorized value for PA_CLASS
   1.7. Fill out the form 
        - Authorized value: CLASS2
        - Description: Class 2
   1.8. Click Save

2. Create two patron attribute types, add them to different classes (make sure they are visible and editable in OPAC)
   2.1. Go to Administration > Patron attribute types
   2.2. Click New patron attribute type
   2.3. Fill out the form
        - Patron attribute type code: ATTR1
        - Description: Attribute 1
        - Display in OPAC: check
        - Editable in OPAC: check
        - Class: Class 1
   2.4. Click Save
   2.5. Click New patron attribute type
   2.6. Fill out the form
        - Patron attribute type code: ATTR2
        - Description: Attribute 2
        - Display in OPAC: check
        - Editable in OPAC: check
        - Class: Class 2
   2.7. Click Save

3. Enable PatronSelfRegistration (if using KTD, skip this step, it is already enabled by default)
   3.1. Go to Administration > System preferences
   3.2. Search for PatronSelfRegistration
   3.3. Change value to Allow
   3.4. Choose a patron category in PatronSelfRegistrationDefaultCategory
   3.5. Click Save all OPAC preferences

4. Create an account in the OPAC
   4.1. Go to the OPAC
   4.2. Click Create account
   --> Note that at the bottom of the form, the Attributes 1 and 2 and in their Classes 1 and 2
   4.3. Open the developer tools console
   --> Note the warning about duplicate IDs
   4.4. Cancel the account creation

5. View personal details page of existing patron
   5.1. Log into the OPAC with an existing patron
   5.2. Go to Personal details
   --> Note that at the bottom of the form, the Attributes 1 and 2 and in their Classes 1 and 2
   5.3. Open the developer tools console
   --> Note the warning about duplicate IDs