Bug 6617

Summary: table of contents not printing right if entered right
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: TemplatesAssignee: Jared Camins-Esakov <jcamins>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: normal    
Priority: P5 - low CC: chris, mtj, paul.poulain
Version: 3.8   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12464
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: table of contents in 505$a
table of contents in 505$t & 505$r
contents not showing if data in $t and $r
no spacing if table of contents in $t & $r
Bug 6617: Improve MARC21 enhanced contents display
Bug 6617: Improve MARC21 enhanced contents display
updated marc
opac view
staff view
Bug 6617: Improve MARC21 enhanced contents display
toc after patch
toc before the patch
Bug 6617: Improve MARC21 enhanced contents display
toc after patch
Bug 6617: Improve MARC21 enhanced contents display
[SIGNED-OFF] Bug 6617: Improve MARC21 enhanced contents display
Bug 6617: Improve MARC21 enhanced contents display (intranet)
Bug 6617: Improve MARC21 enhanced contents display (intranet)
[SIGNED-OFF] Bug 6617: Improve MARC21 enhanced contents display (intranet)
[3.8.x] Bug 6617: Improve MARC21 enhanced contents display
[3.8.x] Bug 6617: Improve MARC21 enhanced contents display (intranet)
Bug 6617 - Wrong first indicator value in test
Bug 6617 - Wrong first indicator value in test

Description Nicole C. Engard 2011-07-20 18:26:39 UTC
Created attachment 4682 [details]
table of contents in 505$a

If you're entering the table of contents in a series of $t and $r subfields (in the 505) then it doesn't print the table of contents to the OPAC or staff client right.  A formatted table of contents looks like this (505$a): 


What is a mashup? / Darlene Fichter -- Behind the scenes : some technical details on mashups / Bonaria Biancu -- Making your data available to be mashed up / Ross Singer -- Mashing up with librarian knowledge / Thomas Brevik 


A slash after the title and before the author and a double dash in between the chapters.  

See the screenshots to see what I mean.  The / should probably be entered by the cataloger, but the double dash should be entered by the template and the contents should show with XSLT turned on even if it's not in the $a only.
Comment 1 Nicole C. Engard 2011-07-20 18:27:10 UTC
Created attachment 4683 [details]
table of contents in 505$t & 505$r
Comment 2 Nicole C. Engard 2011-07-20 18:27:35 UTC
Created attachment 4684 [details]
contents not showing if data in $t and $r
Comment 3 Nicole C. Engard 2011-07-20 18:27:58 UTC
Created attachment 4685 [details]
no spacing if table of contents in $t & $r
Comment 4 Jared Camins-Esakov 2012-07-30 21:29:01 UTC Comment hidden (obsolete)
Comment 5 Nicole C. Engard 2012-08-02 18:06:14 UTC
Bug 6617: Improve MARC21 enhanced contents display
Apply? [yn] y

Applying: Bug 6617: Improve MARC21 enhanced contents display
error: patch failed: koha-tmpl/opac-tmpl/prog/en/css/opac.css:2769
error: koha-tmpl/opac-tmpl/prog/en/css/opac.css: patch does not apply
Patch failed at 0001 Bug 6617: Improve MARC21 enhanced contents display
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
Patch left in /tmp/Bug-6617-Improve-MARC21-enhanced-contents-display-i2WrDf.patch
nengard@kohavm:~/kohaclone$
Comment 6 Jared Camins-Esakov 2012-08-02 18:14:47 UTC Comment hidden (obsolete)
Comment 7 Nicole C. Engard 2012-08-02 18:16:39 UTC
it applies but now my toc is replaced with the word Test
Comment 8 Nicole C. Engard 2012-08-02 18:18:53 UTC
Oh .. that 'Test' string was my note :) hehe - so the patch removes my TOC altogether from the Title Notes tab and shows it the same way in the top XSLT as it did before.
Comment 9 Jared Camins-Esakov 2012-08-02 18:22:03 UTC
And you are using $t and $r in your table of contents? Any chance you could attach the record?
Comment 10 Nicole C. Engard 2012-08-02 18:30:55 UTC
Created attachment 11309 [details]
updated marc
Comment 11 Nicole C. Engard 2012-08-02 18:31:08 UTC Comment hidden (obsolete)
Comment 12 Nicole C. Engard 2012-08-02 18:31:51 UTC
Created attachment 11311 [details]
staff view

the title/author toc shows now - but doesn't have any formatting like in the opac.
Comment 13 Jared Camins-Esakov 2012-08-02 18:59:09 UTC Comment hidden (obsolete)
Comment 14 Nicole C. Engard 2012-08-02 19:01:18 UTC Comment hidden (obsolete)
Comment 15 Nicole C. Engard 2012-08-02 19:02:40 UTC
Created attachment 11315 [details]
toc before the patch

TOC is to the right of the cover image (coming from open library) before the patch.
Comment 16 Jared Camins-Esakov 2012-08-02 19:10:21 UTC Comment hidden (obsolete)
Comment 17 Nicole C. Engard 2012-08-02 19:12:39 UTC
Created attachment 11317 [details]
toc after patch

This time most of the stuff is to the right, but not the TOC.
Comment 18 Jared Camins-Esakov 2012-08-02 19:49:19 UTC Comment hidden (obsolete)
Comment 19 Nicole C. Engard 2012-08-03 12:21:42 UTC
Created attachment 11326 [details] [review]
[SIGNED-OFF] Bug 6617: Improve MARC21 enhanced contents display

The display of "Enhanced" 505 (contents) fields in the MARC21
XSLT is very poor, resulting in large, unreadable blocks of text,
and -- for some series -- so much unnecessary duplication in the
Notes tab that important information is entirely obscured. This
patch reformats "enhanced" contents fields (MARC21 505 fields with
$t and $r) so as to be more readable by breaking up entries on
separate lines and making titles bold (to make them stand out more).

This patch does not address duplication of information in the Notes
tab, per discussion on the #koha IRC channel.

To test:
1) View record with enhanced 505 field before applying patch. Observe
   it is very unfriendly.
2) Apply patch.
3) View same record, note that display is much improved.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>

This first patch works as advertised. It formats the table of
contents on the opac detail display in a cleaner format.

I recommend that future follow ups fix the staff client to match
and update the title notes tabs on the opac and staff client
to also match the cleaner format for table of contents.
Comment 20 Jared Camins-Esakov 2012-08-04 15:18:32 UTC
(In reply to comment #19)
> I recommend that future follow ups fix the staff client to match
> and update the title notes tabs on the opac and staff client
> to also match the cleaner format for table of contents.

I will be updating the XSLT in the staff client shortly. While I would love for the title notes tab to be usable, that is a much larger project, and not one to jumble in with this bug.
Comment 21 Jared Camins-Esakov 2012-08-04 15:34:27 UTC Comment hidden (obsolete)
Comment 22 Jared Camins-Esakov 2012-08-04 15:35:00 UTC
First patch has been signed off. Second has not.
Comment 23 Jared Camins-Esakov 2012-08-04 16:56:20 UTC Comment hidden (obsolete)
Comment 24 Katrin Fischer 2012-08-05 21:39:02 UTC
Created attachment 11368 [details] [review]
[SIGNED-OFF] Bug 6617: Improve MARC21 enhanced contents display (intranet)

The display of "Enhanced" 505 (contents) fields in the MARC21
XSLT is very poor, resulting in large, unreadable blocks of text,
and -- for some series -- so much unnecessary duplication in the
Notes tab that important information is entirely obscured. This
patch reformats "enhanced" contents fields (MARC21 505 fields with
$t and $r) so as to be more readable by breaking up entries on
separate lines and making titles bold (to make them stand out more).

This patch does not address duplication of information in the Notes
tab, per discussion on the #koha IRC channel.

To test:
1) View record with enhanced 505 field before applying patch. Observe
it is very unfriendly.
2) Apply patch.
3) View same record, note that display is much improved.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Display in staff and OPAC is consistent and improved after
applying the patch.
Comment 25 Mason James 2012-08-10 08:41:19 UTC
(In reply to comment #24)
> Created attachment 11368 [details] [review]
> [SIGNED-OFF] Bug 6617: Improve MARC21 enhanced contents display (intranet)
> 
> The display of "Enhanced" 505 (contents) fields in the MARC21
> XSLT is very poor, resulting in large, unreadable blocks of text,
> and -- for some series -- so much unnecessary duplication in the
> Notes tab that important information is entirely obscured. This
> patch reformats "enhanced" contents fields (MARC21 505 fields with
> $t and $r) so as to be more readable by breaking up entries on
> separate lines and making titles bold (to make them stand out more).
> 
> This patch does not address duplication of information in the Notes
> tab, per discussion on the #koha IRC channel.
> 
> To test:
> 1) View record with enhanced 505 field before applying patch. Observe
> it is very unfriendly.
> 2) Apply patch.
> 3) View same record, note that display is much improved.
> 
> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
> Display in staff and OPAC is consistent and improved after
> applying the patch.



patch looks good, passing QA on all patches

xslt files pass validation. 
 mason@xen1:~/git/head$ prove ./t/00-valid-xml.t 
 Result: PASS


mason@xen1:~/git/head$ koha-qa.pl -c 2
        * e4ad597 Bug 6617: Improve MARC21 enhanced contents display (intranet)
                koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
                koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
                koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl
        * 1a9cbf9 Bug 6617: Improve MARC21 enhanced contents display
                koha-tmpl/opac-tmpl/prog/en/css/opac.css
                koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
                koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl

- perlcritic-progressive tests... OK
- perl -c syntax tests... OK
- xt/tt_valid.t tests... OK
- xt/author/valid-template.t tests... OK
Comment 26 Chris Cormack 2012-08-12 06:26:16 UTC
Patch doesn't apply cleanly on 3.8.x, please submit one if it is needed
Comment 27 Jared Camins-Esakov 2012-08-14 17:15:12 UTC Comment hidden (obsolete)
Comment 28 Jared Camins-Esakov 2012-08-14 17:15:29 UTC Comment hidden (obsolete)
Comment 29 Chris Cormack 2012-08-14 21:21:25 UTC
Thanks for the rebased patches, they contain no string changes, pushed to 3.8.x will be in 3.8.4
Comment 30 Tomás Cohen Arazi (tcohen) 2012-08-23 16:01:58 UTC Comment hidden (obsolete)
Comment 31 Paul Poulain 2012-09-04 15:56:13 UTC
Patch does not apply anymore because of opac.css

Probably very trivial fix, but vi says:
<<<<<<< HEAD
=======
*/

.contents {
    width: 75%;
}

.contentblock {
    position: relative;
    margin-left: 2em;
}

.contents .t:first-child:before {
    content: "→ ";
}

.contents .t:before {
    content: "\A→ ";
    white-space: pre;
}

.contents .t {
    font-weight: bold;
    display: inline;
}

>>>>>>> Bug 6617: Improve MARC21 enhanced contents display


the */ seems suspicious, so I let you provide an updated fix
Comment 32 Jared Camins-Esakov 2012-09-04 16:18:09 UTC
Created attachment 11964 [details] [review]
Bug 6617 - Wrong first indicator value in test

Testing the first indicator value=2 should be used for labeling 'Partial content'.

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Comment 33 Jared Camins-Esakov 2012-09-04 16:19:55 UTC
I obsoleted the patches for 3.8.x. The other patches apply without any conflicts. I also signed off on the third patch, which corrects a related bug. It's a one-line patch so should be pretty quick to QA, but the first two patches have already passed QA.
Comment 34 Paul Poulain 2012-09-05 13:58:31 UTC
Patch pushed to master (MARC21, I haven't tested it myself, trusting others)