Adding multiple ocaid's in edit UI only adds one
Edit UI allows admin to add multiple ocaid's (archive.org ids) but only sets 1.
To reproduce
- Edit a book on local env (e.g. http://localhost:8080/books/OL2058361M/The_wit_wisdom_of_Mark_Twainsadf/edit
- Add 3 random IA ids
- Save.
Actual: Only the first IA id will persist; all others ignored. Expected: Support adding multiple OCAIDs.
Note it's not a requirement of this issue that the Read buttons query all OCAIDs, but we need a way to unblock imports of records like this.
Suggestion: add identifiers['ia'] that stores all OCAIDs, and leaves .ocaid for the "main" ocaid for backwards compat.
@mekarpeles Is this still an issue? If so, are you willing to be assignee? Note: being assignee doesn't necessarily mean you are the one doing the work for the issue but responsible for collecting information needed to devise a solution. From the wiki:
At submission and prior to triage, the assigned owner is not necessarily the person who will fix the issue (it is not necessarily even established, at that point, if or when the issue will be fixed at all), but rather they are the person who will do as much or as little as needed to handle the issue (asking questions, soliciting input, establishing and updating the priority, checking if it is a duplicate, etc).
Once an issue is labeled State: Work In Progress, the owner is the individual doing the work, or leading/coordinating the group that is doing the work.
(Confirmed this is still an issue)
Assigning jdlrobson (not tagging by request) per slack discussion since it's UI related
Edit UI allows admin to add multiple ocaid's (archive.org ids) but only sets 1. What edit id?
@cdrini or @mekarpeles can somebody expand the description so it's clear to someone who doesn't know how our project works what we want to fix here and how.
@jdlrobson updated; does that look ok?
Thank you @cdrini .perfect!
@hornc this seems like it may have a front-end portion and a back-end portion, can we assign you as the Lead for this one?
This can be fixed by adding something as simple as:
if (['ocaid'].includes(data.name) && document.getElementsByName("edition--identifiers--0--name").length === 1) {
return error("#id-errors", "id-value", "$_('ID can only be used once per edition')".replace(/ID/, label));
}
However, before that happens, I believe the inline js should be moved from openlibrary/templates/books/edit/edition.html per #4474.
Additionally, if #5093 is merged then it would probably make sense to use that component and do validation in Vue.
However, before that happens, I believe the inline js should be moved from openlibrary/templates/books/edit/edition.html per #4474.
Yep doing that first would be great (and that would include removal of the jsdef). It would also allow us to add a unit test. Is that something you'd be willing to help out with?
@Eds-Dbug are you still interested in working on this? If so, let me know if you need any help :)
ocaid is a single string value in current schema: https://github.com/internetarchive/openlibrary/blob/12d140f9bf8fe54018b1dc292ecdf9d5646843d1/openlibrary/schemata/edition.schema.json#L51C6-L56
The bug here is with the UI not adhering to the schema; it presumably lets you add multiple IA IDs, which it shouldn't let you do. Dropping in priority though since adding IA identifiers is now restricted to accounts with elevated permissions.
If this issue remains unresolved, no promises yet but I might pick it up.
On Wed, Nov 12, 2025 at 10:54 AM Drini Cami @.***> wrote:
cdrini left a comment (internetarchive/openlibrary#395) https://github.com/internetarchive/openlibrary/issues/395#issuecomment-3522559830
The bug here is with the UI not adhering to the schema; it presumably lets you add multiple IA IDs, which it shouldn't let you do. Dropping in priority though since adding IA identifiers is now restricted to accounts with elevated permissions.
— Reply to this email directly, view it on GitHub https://github.com/internetarchive/openlibrary/issues/395#issuecomment-3522559830, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT4EQGG244XDFNOXCNXB6IL34NJZVAVCNFSM6AAAAACL33LKJKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMRSGU2TSOBTGA . You are receiving this because you were mentioned.Message ID: @.***>
@Eds-Dbug go for it!