Bug 38762: Make compare_es_to_db.pl provide links to staff interface

This patch makes the script provide links to the staff interface instead
of the OPAC. This way, the links can just be picked to access the
problematic records for fixing them.

To test:
1. Run:
   $ ktd --shell
  k$ perl misc/maintenance/compare_es_to_db.pl
=> FAIL: Generated links point to the OPAC
2. Apply this patch
3. Repeat 1
=> SUCCESS: Generated links are useful as they point to the staff
interface
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Tomás Cohen Arazi 2024-12-20 10:07:38 -03:00 committed by Katrin Fischer
parent 1dd5bc8c0c
commit cc0aa072dd
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834

View file

@ -77,9 +77,9 @@ foreach my $index ( ( 'biblios', 'authorities' ) ) {
} }
# Fetch values for providing record links # Fetch values for providing record links
my $es_params = $searcher->get_elasticsearch_params; my $es_params = $searcher->get_elasticsearch_params;
my $es_base = "$es_params->{nodes}[0]/" . $searcher->index_name; my $es_base = "$es_params->{nodes}[0]/" . $searcher->index_name;
my $opac_base = C4::Context->preference('OPACBaseURL'); my $staff_base = C4::Context->preference('staffClientBaseURL');
print "\nComparing arrays, this may take a while\n"; print "\nComparing arrays, this may take a while\n";
@ -94,10 +94,11 @@ foreach my $index ( ( 'biblios', 'authorities' ) ) {
for my $problem (@koha_problems) { for my $problem (@koha_problems) {
if ( $index eq 'biblios' ) { if ( $index eq 'biblios' ) {
print " #$problem"; print " #$problem";
print " Visit here to see record: $opac_base/cgi-bin/koha/opac-detail.pl?biblionumber=$problem\n"; print
" Visit here to see record: $staff_base/cgi-bin/koha/catalogue/detail.pl?biblionumber=$problem\n";
} elsif ( $index eq 'authorities' ) { } elsif ( $index eq 'authorities' ) {
print "#$problem"; print "#$problem";
print " Visit here to see record: $opac_base/cgi-bin/koha/opac-authoritiesdetail.pl?authid=$problem\n"; print " Visit here to see record: $staff_base/cgi-bin/koha/authorities/detail.pl?authid=$problem\n";
} }
} }
} }