https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6892

Hugo Agud (OREX Digital) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #27 from Hugo Agud (OREX Digital) <[email protected]> ---
Tested on a community sandbox (main at f7f4ff7, MARC21, Zebra), using the demo
record from attachment 204254, imported as biblionumber 439. Both patches apply
cleanly with no whitespace warnings, and the sandbox QA run reports [PASS] for
MARCdetail.tt and [SKIP] for MARC21slimUtils.xsl, with no failures.

Staff interface, MARC view (MARCdetail.pl), the 21 $u subfields of the demo
record. Before the patches, all 21 were rendered as links and 10 of them
pointed at a relative URL, so they resolved to /cgi-bin/koha/catalogue/<value>:
example.com (x2), [email protected] (x2), locis.loc.gov (x2),
ftp.gnu.org/gnu/ (x2) and 123456789 (x2). After the patches, 16 are links and 5
are plain text, and the 5 left as text are exactly the ones with no indicator.
The prefixes are the expected ones: ind1=4 -> http://, ind1=0 -> mailto:,
ind1=2 -> telnet://, ind1=1 -> ftp://, ind1=3 -> tel:. Values that already
carried a protocol are untouched, and no relative href is left.

OPAC with TrackClicks = Track: the 20 links of the 856 fields now go through
tracklinks.pl with the URI already carrying its protocol, which is what the
follow-up fixes.

Three notes, none of them blocking.

1. The commit message says the check is "^[A-Za-z]:", a single character before
the colon, which would not match "http:". The code correctly uses
"^[a-zA-Z]+:". Only the message needs fixing.

2. The staff interface and the OPAC now disagree when indicator 1 is empty. The
staff patch leaves those values unlinked, while the OPAC's AddMissingProtocol
falls back to http:// in its <xsl:otherwise>, so with TrackClicks on the
tracked URI becomes http://[email protected] and http://123456789. That
fallback is older than this patch, but the follow-up now carries it into the
tracked links as well, so it may deserve a bug of its own.

3. The staff fix depends on tab0X.tag_ind, and MARCdetail.pl only sets it in
one branch (lines 206-219): not when hide_marc is enabled, and not for a
repeated tag when LabelMARCView is 'economical'. Measured with this record and
both patches applied: with LabelMARCView = standard, 16 of the 21 subfields are
linked; switching to 'economical' drops that to 12. It may be worth passing the
indicators to the template independently of the display preferences. Note also
that test plan step e refers to "LabelMARCView=Do", but the code compares the
preference against 'economical', so that step cannot be followed as written.

For the record, two things that look risky but are not: tag_ind cannot be the
bare string "0", because display_marc_indicators turns blanks into "#", so an
856 with ind1=0 arrives as "0#" and the mailto: case does fire; and the OPAC
change lands in the shared renderMARCOnlineResourceField template, so it also
covers the results page and the 857 field, which I did not test as the demo
record has none.

I reviewed and signed this off myself, with AI assistance for running the test
plan and cross-checking the code, as allowed by Coding Guidelines 1.8.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to