katlog.orgdevelopment journal Demo catalogueDemo
BG005
Bug report2 min read

Code 02: how the system quietly closed a third of the collection

A test reader requested a book, and it turned out it couldn’t be issued: “No available copies”. The cause was two digits from Aleph — and the system deciding their meaning on its own.

This bug wasn’t found by a code review but by ordinary work. For the screenshots in this journal, a test reader requested three books and the librarian began preparing them. For the second, “Die Schmetterlinge Europas”, the preparation dialog answered: no copies available.

Katlog: the “Prepare?” dialog — no copies available
The book is on the shelf, but the system considers it unavailable. The screenshot shows the Russian interface.

Two digits from Aleph

The copies of this book had the status code 02 in their holdings lines. We didn’t know what it means in Aleph — and agreed from the start not to guess (see “Inside Aleph”). The agent guessed: during import it read 02 as “unavailable” and marked those copies as “Reserved”.

1,806copies with code 02
≈ 30%of the collection became “unavailable”
0error messages

No button broke, no message appeared. Almost a third of the collection simply became impossible to lend — while readers could still request it.

Two more guesses nearby

  • The EB4 collection (235 copies) was missing from the settings: collection codes containing a digit weren’t recognised.
  • Call-number letters in the “Collection” filter. For copies without a collection code, the system took the first letter of the call number — F, A, B — for a collection.

All three bugs share a pattern: where data was missing, the program filled it in by itself.

How it was fixed

  1. A table of status codes in the settingsFor each Aleph code — 01, 02, 04, 09 — the librarian chooses the meaning: available, reading room only, not for loan, unavailable. Until a choice is made: “available”.
  2. The original code is stored separatelyThe Aleph code and the Katlog circulation status are different things. Readers only see “on shelf” or “on loan”.
  3. An honest request formIf a book can’t go out on home loan, the “Home loan” button doesn’t appear; if it can’t be lent at all, the form says why.
  4. Collections recognised correctlyEB4 and EB5 found their 236 copies, and call-number letters no longer pose as collections.
The lessonGuessing looks like help. But an unknown value has to stay unknown until a person who knows the collection decides. The most dangerous bugs are quiet ones: they don’t break buttons, they change what the data means.