The script misc/maintenance/search_for_data_inconsistencies.pl search for invalid values using Koha to MARC mapping fields. The tables items and biblioitems are OK but mappings can be on biblio table : my $value = $table eq 'items' ? $i->$column : $i->biblioitem->$column; For example in UNIMARC if fails with error : The method Koha::Biblioitem->medium is not covered by tests! Trace begun at /home/koha/src/Koha/Object.pm line 880 Koha::Object::AUTOLOAD('Koha::Biblioitem=HASH(0x55c9a1905a40)') called at /home/koha/src/misc/maintenance/search_for_data_inconsistencies.pl line 196
Which mapping caused the error?
(In reply to Katrin Fischer from comment #1) > Which mapping caused the error? biblio.medium on 200$b UNIMARC
How to recreate the problem in ktd using MARC21?
(In reply to Jonathan Druart from comment #3) > How to recreate the problem in ktd using MARC21? 1) Go to framework BKS configuration 2) Edit 245$a to use an authorized value (in 'Other options'), like COUNTRY 3) Run ./misc/maintenance/search_for_data_inconsistencies.pl : You get error : == Wrong values linked to authorised values == The method Koha::Biblioitem->title is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Object.pm line 875 Koha::Object::AUTOLOAD('Koha::Biblioitem=HASH(0x564382f7c7e8)') called at misc/maintenance/search_for_data_inconsistencies.pl line 246
Yes, that's what I tried yesterday, but I don't get the error.
(In reply to Jonathan Druart from comment #5) > Yes, that's what I tried yesterday, but I don't get the error. I didn't have any biblio with frameworkcode="", I do recreate now.
Created attachment 138963 [details] [review] Bug 31239: Fix incorrect AV linked to a mapped biblio column If an AV is linked to a MARC field mapped with a biblio column, the search_for_data_inconsistencies.pl script might explode with The method Koha::Biblioitem->title is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Object.pm line 875 Koha::Object::AUTOLOAD('Koha::Biblioitem=HASH(0x556b67fa7168)') called at misc/maintenance/search_for_data_inconsistencies.pl line 246 Test plan: For a given framework, pick a biblio using it Link 245$a with an authorised value category Run the script => Notice that with this script applied you will see the warning => Without this patch you got the error
I will QA
Created attachment 140413 [details] [review] Bug 31239: Fix incorrect AV linked to a mapped biblio column If an AV is linked to a MARC field mapped with a biblio column, the search_for_data_inconsistencies.pl script might explode with The method Koha::Biblioitem->title is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Object.pm line 875 Koha::Object::AUTOLOAD('Koha::Biblioitem=HASH(0x556b67fa7168)') called at misc/maintenance/search_for_data_inconsistencies.pl line 246 Test plan: For a given framework, pick a biblio using it Link 245$a with an authorised value category Run the script => Notice that with this script applied you will see the warning => Without this patch you got the error Signed-off-by: David Nind <david@davidnind.com>
Created attachment 140698 [details] [review] Bug 31239: Fix incorrect AV linked to a mapped biblio column If an AV is linked to a MARC field mapped with a biblio column, the search_for_data_inconsistencies.pl script might explode with The method Koha::Biblioitem->title is not covered by tests! Trace begun at /kohadevbox/koha/Koha/Object.pm line 875 Koha::Object::AUTOLOAD('Koha::Biblioitem=HASH(0x556b67fa7168)') called at misc/maintenance/search_for_data_inconsistencies.pl line 246 Test plan: For a given framework, pick a biblio using it Link 245$a with an authorised value category Run the script => Notice that with this script applied you will see the warning => Without this patch you got the error Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 140699 [details] [review] Bug 31239: (QA follow-up) Fixing ternary formatting Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(In reply to Marcel de Rooy from comment #11) > Created attachment 140699 [details] [review] [review] > Bug 31239: (QA follow-up) Fixing ternary formatting > > Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> I totally disagree with this patch :D It's the formatting of perltidy, and this patch does not make it better.
Pushed to master for 22.11. Nice work everyone, thanks!
(In reply to Jonathan Druart from comment #12) > (In reply to Marcel de Rooy from comment #11) > > Created attachment 140699 [details] [review] [review] [review] > > Bug 31239: (QA follow-up) Fixing ternary formatting > > > > Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > > I totally disagree with this patch :D > It's the formatting of perltidy, and this patch does not make it better. Damn, between the time I applied on my working branch and pushing you added this comment. I had doubts myself about that follow-up, as I tend to just call perltidy and this looked weird. I will keep an eye on those.
(In reply to Tomás Cohen Arazi from comment #14) > (In reply to Jonathan Druart from comment #12) > > (In reply to Marcel de Rooy from comment #11) > > > Created attachment 140699 [details] [review] [review] [review] [review] > > > Bug 31239: (QA follow-up) Fixing ternary formatting > > > > > > Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > > > > I totally disagree with this patch :D > > It's the formatting of perltidy, and this patch does not make it better. > > Damn, between the time I applied on my working branch and pushing you added > this comment. I had doubts myself about that follow-up, as I tend to just > call perltidy and this looked weird. > > I will keep an eye on those. Matter of taste?
(In reply to Marcel de Rooy from comment #15) > (In reply to Tomás Cohen Arazi from comment #14) > > (In reply to Jonathan Druart from comment #12) > > > (In reply to Marcel de Rooy from comment #11) > > > > Created attachment 140699 [details] [review] [review] [review] [review] [review] > > > > Bug 31239: (QA follow-up) Fixing ternary formatting > > > > > > > > Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > > > > > > I totally disagree with this patch :D > > > It's the formatting of perltidy, and this patch does not make it better. > > > > Damn, between the time I applied on my working branch and pushing you added > > this comment. I had doubts myself about that follow-up, as I tend to just > > call perltidy and this looked weird. > > > > I will keep an eye on those. > > Matter of taste? It is not really relevant, Marcel. I just wanted to point perltidy generates nice formatting and is encouraged, but it is all a matter of taste after all.
Maybe we should not use ternary inside ternary with if elsif else. But it works, that's the most important ;)
Backported to 22.05.x for upcoming 22.05.07 release
applied to 21.11 for 21.11.14
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed. Nothing to document it seems, marking resolved.