Bug 13912 added DefaultCountryField008 to allow defaulting the place of publication to something other than the previous default of xxu ("somewhere in the United States, but I don't know what state"). Trying to follow the Koha Way of never changing existing behavior, only adding a preference to fix it, it intended to fall back to xxu, but https://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=cataloguing/value_builder/marc21_field_008.pl;h=b3c5d0c47f908edaa376b397a3bae5ecf8013c9e;hb=HEAD#l80 thought the preference would be undefined if it wasn't set, and then a QA followup updated the DB to add it so it's always defined, and the // "xxu" is unreached and the default value of the pref, '', gets space-padded to three characters long, ' '. Since we've now gone 3.3 years with the default having switched from the unfortunate choice of 'xxu' to the invalid ' ' without anyone filing a bug about it, I assert that the Koha Way is wrong in this case, that nobody actually wanted to retain the behavior of defaulting to saying that every book was published in an unknown US state (or if they did exist, they already fixed it by using that as their DefaultCountryField008), and we can fix the bug of defaulting to an invalid value by choosing a new default when DefaultCountryField008 isn't set, the value "|||" which is "no attempt to code" which is precisely the case when the cataloger doesn't change it and the system adminstrator doesn't say it should have a particular value whether or not that value is correct.
Created attachment 117126 [details] [review] Bug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code" Current code intended to set a fallback of xxu, an unknown state in the US, but because the preference is always defined, just sometimes unset, it actually falls back to three spaces, an invalid value. This patch instead uses the fallback value ||| which means no attempt to code. Test plan: 1. Without the patch, verify that the value of the system preference DefaultCountryField008 is empty. 2. Cataloging - New record - Default framework (if you have the Advanced editor enabled, Settings - Switch to basic editor, this only applies to the basic editor) 3. On tab 0, click in the text input for field 008 which fills in default values, then click the Tag editor button at the end of the field 4. In the popup window, verify that the value for 15-17 is shown as ### indicating three spaces 5. Apply patch, repeat the steps above, verify that the value is now |||
Bah, forgot the last two steps, 6. Set DefaultCountryField008 to abc 7. Repeat steps 2-3 and verify that the value for 15-17 is abc
Created attachment 117134 [details] [review] Bug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code" Current code intended to set a fallback of xxu, an unknown state in the US, but because the preference is always defined, just sometimes unset, it actually falls back to three spaces, an invalid value. This patch instead uses the fallback value ||| which means no attempt to code. Test plan: 1. Without the patch, verify that the value of the system preference DefaultCountryField008 is empty. 2. Cataloging - New record - Default framework (if you have the Advanced editor enabled, Settings - Switch to basic editor, this only applies to the basic editor) 3. On tab 0, click in the text input for field 008 which fills in default values, then click the Tag editor button at the end of the field 4. In the popup window, verify that the value for 15-17 is shown as ### indicating three spaces 5. Apply patch, repeat the steps above, verify that the value is now ||| Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Works as expected and provides a more sane default. Signing off.
Created attachment 119041 [details] [review] Bug 27738: Set fallback for unset DefaultCountryField008 to |||, "no attempt to code" Current code intended to set a fallback of xxu, an unknown state in the US, but because the preference is always defined, just sometimes unset, it actually falls back to three spaces, an invalid value. This patch instead uses the fallback value ||| which means no attempt to code. Test plan: 1. Without the patch, verify that the value of the system preference DefaultCountryField008 is empty. 2. Cataloging - New record - Default framework (if you have the Advanced editor enabled, Settings - Switch to basic editor, this only applies to the basic editor) 3. On tab 0, click in the text input for field 008 which fills in default values, then click the Tag editor button at the end of the field 4. In the popup window, verify that the value for 15-17 is shown as ### indicating three spaces 5. Apply patch, repeat the steps above, verify that the value is now ||| Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
+ - " Empty defaults to ||| for No attempt to code." Is the uppercase expected ("No")?
Fun question! To me, it's clearly a quote of the formal description of the fill character from the spec, where no is always capitalized. However, when I went looking for an example in the spec, I realized that the spec editors very carefully duck the question: they'll use the actual term from descriptions when it is at the start of a sentence, but otherwise they'll use other phrases like "when no attempt has been made to code." The single example of using the actual term I found in the 008 spec was 15-17 - Place of publication, production, or execution Two- or three-character alphabetic code that indicates the place of publication, production, or execution. which argues that I'm wrong. Perhaps " Empty defaults to ||| - No attempt to code." (which is a copy-paste from the spec, including the dash) would be more correct, but I'd be just as happy with a lowercase no.
Created attachment 119211 [details] [review] Bug 27738: Fix wording
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.05
Pushed to 20.05.x for 20.05.11
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.