Lines 504-509
ok(MARC::Record::new_from_xml($results_hashref->{biblioserver}->{RECORDS}->[0],'
Link Here
|
504 |
|
504 |
|
505 |
like( $newresults[0]->{XSLTResultsRecord}, qr/<variable name="anonymous_session">1<\/variable>/, "Variable injected correctly" ); |
505 |
like( $newresults[0]->{XSLTResultsRecord}, qr/<variable name="anonymous_session">1<\/variable>/, "Variable injected correctly" ); |
506 |
|
506 |
|
|
|
507 |
my $biblio_id = $newresults[0]->{biblionumber}; |
508 |
my $fw = C4::Biblio::GetFrameworkCode($biblio_id); |
509 |
|
510 |
my $dbh = C4::Context->dbh; |
511 |
# Hide subfield 'p' in OPAC |
512 |
$dbh->do(qq{ |
513 |
UPDATE marc_subfield_structure |
514 |
SET hidden=4 |
515 |
WHERE frameworkcode='$fw' AND |
516 |
tagfield=952 AND |
517 |
tagsubfield='p'; |
518 |
}); |
519 |
|
520 |
# Hide subfield 'y' in Staff |
521 |
$dbh->do(qq{ |
522 |
UPDATE marc_subfield_structure |
523 |
SET hidden=-7 |
524 |
WHERE frameworkcode='$fw' AND |
525 |
tagfield=952 AND |
526 |
tagsubfield='y'; |
527 |
}); |
528 |
|
529 |
Koha::Caches->get_instance->flush_all; |
530 |
|
531 |
@newresults = searchResults( |
532 |
{ 'interface' => 'opac' }, |
533 |
$query_desc, |
534 |
$results_hashref->{'biblioserver'}->{'hits'}, |
535 |
17, |
536 |
0, |
537 |
0, |
538 |
$results_hashref->{'biblioserver'}->{"RECORDS"} |
539 |
); |
540 |
|
541 |
unlike( $newresults[0]->{XSLTResultsRecord}, qr/<subfield code="p">TEST11111<\/subfield>/, '952\$p hidden in OPAC' ); |
542 |
|
543 |
@newresults = searchResults( |
544 |
{ 'interface' => 'intranet' }, |
545 |
$query_desc, |
546 |
$results_hashref->{'biblioserver'}->{'hits'}, |
547 |
17, |
548 |
0, |
549 |
0, |
550 |
$results_hashref->{'biblioserver'}->{"RECORDS"} |
551 |
); |
552 |
|
553 |
unlike( $newresults[0]->{XSLTResultsRecord}, qr/<subfield code="y">Books<\/subfield>/, '952\$y hidden on staff interface' ); |
554 |
|
507 |
( $error, $query, $simple_query, $query_cgi, |
555 |
( $error, $query, $simple_query, $query_cgi, |
508 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
556 |
$query_desc, $limit, $limit_cgi, $limit_desc, |
509 |
$query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en'); |
557 |
$query_type ) = buildQuery([], [ 'pqf=@attr 1=_ALLRECORDS @attr 2=103 ""' ], [], [], [], 0, 'en'); |
Lines 853-859
sub run_unimarc_search_tests {
Link Here
|
853 |
} |
901 |
} |
854 |
|
902 |
|
855 |
subtest 'MARC21 + DOM' => sub { |
903 |
subtest 'MARC21 + DOM' => sub { |
856 |
plan tests => 85; |
904 |
plan tests => 87; |
857 |
run_marc21_search_tests(); |
905 |
run_marc21_search_tests(); |
858 |
}; |
906 |
}; |
859 |
|
907 |
|
860 |
- |
|
|