From eb77bae18c72e0256c1948afdbb31a5ddca15153 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 24 Jul 2024 13:12:17 +0000 Subject: [PATCH] Bug 37448: Make use of build_sample_biblio and build_sample_item The script is brilliant, but for biblios and items we should make use of build_sample_biblio and build_sample_item or this data does not get indexed + linked tables rows get missed To test, before this patch, run: 1) misc/devel/create_test_data.pl -n 5 -s Biblio -d title=Test Notice the 'Test' biblio is created on the database, but doesnt show on searches, and accessing it directly through URL throws a 500 error (because metadata does not exist for the biblio) 2) Apply this patch. Repeat the step above. Notice it now shows on searches and visiting the biblio directly shows no errors Signed-off-by: Pedro Amorim --- misc/devel/create_test_data.pl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/misc/devel/create_test_data.pl b/misc/devel/create_test_data.pl index 61ccbed0b4..6447ca0b25 100755 --- a/misc/devel/create_test_data.pl +++ b/misc/devel/create_test_data.pl @@ -44,12 +44,19 @@ GetOptions( pod2usage(1) if $help || !$number || !$source; for ( 1 .. $number ) { - $builder->build( - { - source => $source, - value => $values, - } - ); + + if($source eq 'Biblio'){ + $builder->build_sample_biblio( $values ) + }elsif($source eq 'Item'){ + $builder->build_sample_item( $values ) + }else{ + $builder->build( + { + source => $source, + value => $values, + } + ); + } } =head1 NAME -- 2.39.2