https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461
Phil Ringnalda <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion CC| |[email protected] --- Comment #4 from Phil Ringnalda <[email protected]> --- A space is an invalid character in some positions, a character with a particular meaning in some positions, and only rarely a synonym for "dunno what should be here." | is closer to the mark, since it's defined as "no attempt to code" for every position except 0-5. However, just pipe-padding instead of space-padding won't work except in the case where value.length going into the plugin was 39, because if it's 38 or less, the plugin is *broken*. If the length going in is 37 (delete everything back to and including position 37, the last letter of the language) and you then use the plugin to change the value for one of the last two positions, your value will actually be put into position 37 rather than where it belongs. Do what seems reasonable until you try it, type 210220s in the text input and then trigger the plugin, and fill things in in random order, first setting the Cataloging source so you don't forget, then seeing that Index and Literary form and Biography are wrong and changing them, then going back up to put in your single date without realizing you're also supposed to put in spaces for the second date, then go back down and put in the language, then back up for the place of publication. You now have a random-length 008 with random letters in random spots. So, three cases: The value going into the plugin is 0 characters long. That is already handled by creating a value with some imperfect default values The value going into the plugin is 1 to 5 characters long. That's a broken date-entered, which can't be fixed with pipes, it can only be deleted and treated the same as 0 characters. The value going into the plugin is 6-39 characters long, which can be fixed by either applying our somewhat imperfect default values to any missing characters, or less-imperfectly by pipe-filling. Inconveniently, you can't just pad with either pipes or the remaining characters from our default blindly, since filling position 35-39 with pipes is just fine, but filling position 36-39 is invalid, since "e||" is not a valid language code. So it's an awkward case of length 6-7 you can pad, 8-11 you have to truncate to 7 and pad, 12 you can pad, 13-15 you have to truncate to 12 and pad, etc. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
