When running search_for_data_inconsistencies.pl on 20.05 and later, I get the following errors: Use of uninitialized value $tmp_kohafield in pattern match (m//) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 151. Use of uninitialized value $tmp_kohafield in substitution (s///) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 154. Can't call method "get_column" on an undefined value at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 157. The script seems to be looking for something in authorised_values that it't not finding. I've verified that every authorised_value used in a marc_subfield_structure exists and has at least one value.
Created attachment 121424 [details] [review] Bug 28352: Only check authorised values mapped to DB fields The errors reported seem to be caused by authorised values mapped to MARC fields but not mapped to a koha field. We should additionally make sure to check the Default framework Also, adding comment to indicate we only check records with items, because we do TO test: 1 - In a framework that is not the default map a MARC field to an authorised value, but not a koha field 2 - In SQL, force the kohafield to NULL for the mapping you just make UPDATE marc_subfield_structure SET kohafield = NULL WHERE frameworkcode='BKS' and authorised_value='HINGS_AS' 3 - perl misc/maintenance/search_for_data_inconsistencies.pl 4 - get the following errors: Use of uninitialized value $tmp_kohafield in pattern match (m//) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 151. Use of uninitialized value $tmp_kohafield in substitution (s///) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 154. Can't call method "get_column" on an undefined value at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 157. 5 - Apply patch 6 - Repeat 7 - No more errors
Created attachment 123447 [details] [review] Bug 28352: Only check authorised values mapped to DB fields The errors reported seem to be caused by authorised values mapped to MARC fields but not mapped to a koha field. We should additionally make sure to check the Default framework Also, adding comment to indicate we only check records with items, because we do TO test: 1 - In a framework that is not the default map a MARC field to an authorised value, but not a koha field 2 - In SQL, force the kohafield to NULL for the mapping you just make UPDATE marc_subfield_structure SET kohafield = NULL WHERE frameworkcode='BKS' and authorised_value='HINGS_AS' 3 - perl misc/maintenance/search_for_data_inconsistencies.pl 4 - get the following errors: Use of uninitialized value $tmp_kohafield in pattern match (m//) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 151. Use of uninitialized value $tmp_kohafield in substitution (s///) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 154. Can't call method "get_column" on an undefined value at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 157. 5 - Apply patch 6 - Repeat 7 - No more errors Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
I was just about to open the same issue ;) Thanks a lot Nick :D
Highlighed by bug 27852.
My fix was 143 next unless $kohafield and $av; But yours is better.
Created attachment 125599 [details] [review] Bug 28352: Only check authorised values mapped to DB fields The errors reported seem to be caused by authorised values mapped to MARC fields but not mapped to a koha field. We should additionally make sure to check the Default framework Also, adding comment to indicate we only check records with items, because we do TO test: 1 - In a framework that is not the default map a MARC field to an authorised value, but not a koha field 2 - In SQL, force the kohafield to NULL for the mapping you just make UPDATE marc_subfield_structure SET kohafield = NULL WHERE frameworkcode='BKS' and authorised_value='HINGS_AS' 3 - perl misc/maintenance/search_for_data_inconsistencies.pl 4 - get the following errors: Use of uninitialized value $tmp_kohafield in pattern match (m//) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 151. Use of uninitialized value $tmp_kohafield in substitution (s///) at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 154. Can't call method "get_column" on an undefined value at /kohadevbox/koha/misc/maintenance/search_for_data_inconsistencies.pl line 157. 5 - Apply patch 6 - Repeat 7 - No more errors Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.05
Pushed to 20.11.x for 20.11.11
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.