[Bug 11592] New: opac-detail.pl and opac-MARCdetail.pl do not respect marc tag visibility
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Bug ID: 11592 Summary: opac-detail.pl and opac-MARCdetail.pl do not respect marc tag visibility Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: mtompset@hotmail.com QA Contact: testopia@bugs.koha-community.org It is possible to change the visibility in OPAC by affecting the value of hidden in marc_subfield_structure (Home->Administration->MARC frameworks->BKS Subfields -> ... -> Advanced Constraints -> Uncheck/Check OPAC). opac-MARCdetail.pl, for the most part, respects it, but if things normally displayed in opac-detail.pl are marked as not having visibility in OPAC (unchecked), they are still displayed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |mtompset@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #1 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24600 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24600&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. Lastly, opac-showmarc now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|opac-detail.pl and |opac scripts do not respect |opac-MARCdetail.pl do not |MARC tag visibility |respect marc tag visibility | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24600|0 |1 is obsolete| | --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24601 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24601&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. Lastly, opac-showmarc now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- Still to do: Add tests for new functions to C4/Biblio. :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24601|0 |1 is obsolete| | --- Comment #4 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24611 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24611&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. Lastly, opac-showmarc now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24611|0 |1 is obsolete| | --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24629 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24629&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. Lastly, opac-showmarc now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |robin@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Small patch |Medium patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24629|0 |1 is obsolete| | --- Comment #6 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24654 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24654&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24654|0 |1 is obsolete| | --- Comment #7 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24655 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24655&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #8 from Robin Sheat <robin@catalyst.net.nz> --- Comment on attachment 24655 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24655 Bug 11592 - opac scripts do not respect marc tag visibility Review of attachment 24655: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=11592&attachment=24655) ----------------------------------------------------------------- Will this also hide appropriate fields in opac-ISBDdetail that should be hidden? ::: C4/Biblio.pm @@ +1222,5 @@
+ +C<$OpacHideMARC> is a ref to a hash which contains a series +of key value pairs indicating if that field (key) is +hidden (value == 1) or not (value == 0). +
How can this be used to get information about something that doesn't have a kohafield attached? e.g. I want to hide marc field 505 from the OPAC, but it doesn't have a corresponding Koha field. Would this still work? @@ +1230,5 @@
+ +sub GetOpacHideMARC { + my ( $frameworkcode ) = shift || ''; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("SELECT kohafield AS field,tagfield AS tag,hidden FROM marc_subfield_structure WHERE LENGTH(kohafield)>0 AND frameworkcode=? ORDER BY field,tagfield;");
I would suspect that doing WHERE kohafield <> '' might be a tiny bit faster than asking it to do a length calculation. Probably negligible though. I'd probably also fix the spacing as right now it looks like it groups wrongly in the columns that it's selecting, even though it doesn't. @@ +1238,5 @@
+ foreach my $fullfield (keys %{$data}) { + my @tmpsplit = split(/\./,$fullfield); + my $field = $tmpsplit[-1]; + foreach my $tag (keys %{$data->{$fullfield}}) { + if ($data->{$fullfield}->{$tag}->{'hidden'}>0) {
!=0 is likely to be marginally faster (unless negatives are a thing you care about.) @@ +1270,5 @@
+ my $filtered_record = $record->clone; + + my ( $frameworkcode ) = shift || ''; + + my $marcsubfieldstructure = GetMarcStructure(0,$frameworkcode);
Maybe allow the marcsubfieldstructure to be passed in instead of the framework code. This becomes important if this happens over and over, as it'll do a big bunch of database work each time, this makes things very slow when it could be cached outside and passed in. It should be easy enough to see if you have a scalar or a ref, and so whether you have a code or the structure. @@ +1274,5 @@
+ my $marcsubfieldstructure = GetMarcStructure(0,$frameworkcode); + if ($marcsubfieldstructure->{'000'}->{'@'}->{hidden}>0) { + # LDR field is excluded from $record->fields(). + # if we hide it here, the MARCXML->MARC::Record->MARCXML transformation blows up. + }
This if doesn't actually do anything. @@ +1977,4 @@
push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop, authoritylink => $authoritylink, + } if $authoritylink || $#subfields_loop>=0;
$#subfields_loop>=0 is a bit of an ugly construction. Best to use just @subfields_loop, it does the same thing and is easier to read. ::: opac/opac-detail.pl @@ +489,4 @@
}
my $dat = &GetBiblioData($biblionumber); +my $OpacHideMARC = &GetOpacHideMARC($dat->{'frameworkcode'});
& is a perl4-ism, not required. @@ +654,5 @@
+my ($st_tag,$st_subtag) = GetMarcFromKohaField('bibliosubtitle.subtitle',$dat->{'frameworkcode'}); +my $subtitle; +if ($st_tag && $st_subtag) { + my @subtitles = $record->subfield($st_tag,$st_subtag); + $subtitle = \@subtitles if scalar @subtitles;
you don't need to say 'scalar' here. @@ +656,5 @@
+if ($st_tag && $st_subtag) { + my @subtitles = $record->subfield($st_tag,$st_subtag); + $subtitle = \@subtitles if scalar @subtitles; +} +if ($subtitle && scalar @$subtitle) {
nor here -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #9 from M. Tompsett <mtompset@hotmail.com> ---
Will this also hide appropriate fields in opac-ISBDdetail that should be hidden?
I didn't even look at opac-ISBDdetail -- we don't use it. I suppose I should. Though, it has that syspref related to the output for it. I'll add a filter call.
+C<$OpacHideMARC> is a ref to a hash which contains a series +of key value pairs indicating if that field (key) is +hidden (value == 1) or not (value == 0). +
How can this be used to get information about something that doesn't have a kohafield attached? e.g. I want to hide marc field 505 from the OPAC, but it doesn't have a corresponding Koha field. Would this still work?
OpacHideMARC is intended as a hack for the loop in opac-detail that creates template parameters based on koha field names. It was around like 699 in the master, 713 in the patch. This is how [% title %] and other parameters are created. This covers the half of the problem that doesn't use the MARC record directly. If you are trying to hide something that doesn't have a kohafield, you are looking at the other function: GetFilteredOpacBiblio. This takes the MARC record and strips out things marked to be hidden.
+ my $sth = $dbh->prepare("SELECT kohafield AS field,tagfield AS tag,hidden FROM marc_subfield_structure WHERE LENGTH(kohafield)>0 AND frameworkcode=? ORDER BY field,tagfield;");
I would suspect that doing WHERE kohafield <> '' might be a tiny bit faster than asking it to do a length calculation.
I didn't do testing, but LENGTH(NULL) = 0, right? Which way handles the NULL case better? -- Just checked >'' is used elsewhere and returns the same number on my data.
Probably negligible though. I'd probably also fix the spacing as right now it looks like it groups wrongly in the columns that it's selecting, even though it doesn't.
I don't understand what you are trying to say. OH! field,tagfield lacks spacing. Will fix that to improve readability.
+ if ($data->{$fullfield}->{$tag}->{'hidden'}>0) {
!=0 is likely to be marginally faster (unless negatives are a thing you care about.)
valid values for hidden range from -15 to +... anyways... <=0 OPAC visibility is checked. >0 OPAC visibility is unchecked. So, yes, care about negatives.
@@ +1270,5 @@
+ my $filtered_record = $record->clone; + + my ( $frameworkcode ) = shift || ''; + + my $marcsubfieldstructure = GetMarcStructure(0,$frameworkcode);
Maybe allow the marcsubfieldstructure to be passed in instead of the framework code. This becomes important if this happens over and over, as it'll do a big bunch of database work each time, this makes things very slow when it could be cached outside and passed in.
It should be easy enough to see if you have a scalar or a ref, and so whether you have a code or the structure.
Hmm... GetMarcStructure is cached. Look in C4/Biblio.pm for "sub GetMarcStructure". You will see the $marc_structure_cache line just above that, and it being used at the top of the function.
@@ +1274,5 @@
+ my $marcsubfieldstructure = GetMarcStructure(0,$frameworkcode); + if ($marcsubfieldstructure->{'000'}->{'@'}->{hidden}>0) { + # LDR field is excluded from $record->fields(). + # if we hide it here, the MARCXML->MARC::Record->MARCXML transformation blows up. + }
This if doesn't actually do anything.
It explains why I didn't hide the LDR record. As this function is called only once, I don't think it is a big deal, but I will comment it out so people don't get the idea to fix the remaining LDR field problem this way.
@@ +1977,4 @@
push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop, authoritylink => $authoritylink, + } if $authoritylink || $#subfields_loop>=0;
$#subfields_loop>=0 is a bit of an ugly construction. Best to use just @subfields_loop, it does the same thing and is easier to read.
Okay, I suppose I can try that.
my $dat = &GetBiblioData($biblionumber); +my $OpacHideMARC = &GetOpacHideMARC($dat->{'frameworkcode'});
& is a perl4-ism, not required.
Okay, I was confused a little by it used in some places and not in others. I'll remove my &.
+ $subtitle = \@subtitles if scalar @subtitles;
you don't need to say 'scalar' here.
+if ($subtitle && scalar @$subtitle) {
nor here
I'll test and remove, once confirmed. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #10 from Robin Sheat <robin@catalyst.net.nz> --- (In reply to M. Tompsett from comment #9)
Hmm... GetMarcStructure is cached. Look in C4/Biblio.pm for "sub GetMarcStructure". You will see the $marc_structure_cache line just above that, and it being used at the top of the function.
Ah, interesting. It's also cached in memcache which actually slows things down. This explains why. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24655|0 |1 is obsolete| | --- Comment #11 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24657 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24657&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so that it should be filtered. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Click on ISBD view to ensure nothing broke. 24) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24657|0 |1 is obsolete| | --- Comment #12 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24658 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24658&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so that it should be filtered. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Click on ISBD view to ensure nothing broke. 24) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24658|0 |1 is obsolete| | --- Comment #13 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24659 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24659&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so that it should be filtered. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Click on ISBD view to ensure nothing broke. 24) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #14 from M. Tompsett <mtompset@hotmail.com> --- opac-search.pl is out of scope for now. opac-ISDBdetail.pl could be cleaned up more, but the focus of this was more consistency between opac-MARCdetail and opac-detail pages. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24659|0 |1 is obsolete| | --- Comment #15 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24660 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24660&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so that it should be filtered. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Click on ISBD view to ensure nothing broke. 24) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #16 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24661 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24661&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24661|0 |1 is obsolete| | --- Comment #17 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24662 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24662&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24660|0 |1 is obsolete| | --- Comment #18 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24663 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24663&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so that it should be filtered. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Click on ISBD view to ensure nothing broke. 24) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24662|0 |1 is obsolete| | --- Comment #19 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 24664 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24664&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Robin Sheat <robin@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24663|0 |1 is obsolete| | Attachment #24664|0 |1 is obsolete| | --- Comment #20 from Robin Sheat <robin@catalyst.net.nz> --- Created attachment 24875 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24875&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #21 from Robin Sheat <robin@catalyst.net.nz> --- Created attachment 24876 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24876&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so that it should be filtered. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Click on ISBD view to ensure nothing broke. 24) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #22 from Robin Sheat <robin@catalyst.net.nz> --- (sorry, attached them the wrong way around due to expecting git bz to work like most git commands.) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24875|0 |1 is obsolete| | --- Comment #23 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24952 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24952&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24876|0 |1 is obsolete| | --- Comment #24 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 24953 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=24953&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so that it should be filtered. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Click on ISBD view to ensure nothing broke. 24) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #25 from David Cook <dcook@prosentient.com.au> --- Looking forward to this one going in. It would be a great help... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #26 from David Cook <dcook@prosentient.com.au> --- A few additional thoughts... 1) A follow-up should probably be added for a few other OPAC scripts like opac-basket.pl, opac-sendbasket.pl, opac-sendshelf.pl, etc., since these will all show the unfiltered MARC record. 2) It would be nice to see a future version of this that filters for both the OPAC and the staff client. Passing a "context" in and checking the 'hidden' values against a hashref of hashrefs might be a quick way of doing that: my $display = { opac => { 0 => 1, -1 => 1, -2 => 1, -3 => 1, -4 => 1, -5 => 1, -6 => 1, -7 => 1, }, intranet => { -6 => 1, -5 => 1, -1 => 1, 0 => 1, 1 => 1, 4 => 1, 6 => 1, 7 => 1, }, }; 3) I've added a few notes in Splinter Review for ways I think that the filter sub could be improved. Since this has already passed QA, I'll just leave them as notes. If it's too late to make changes, I'll probably send a patch with some of them after it's pushed in any case. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #27 from M. Tompsett <mtompset@hotmail.com> --- ARG! This no longer applies. And because the t/db_dependent/Biblio.t file has gotten more complicated that a straight list of tests, I'm not sure how to rebase. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #28 from M. Tompsett <mtompset@hotmail.com> --- Rebase need caused by bug 11912. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_3_16_candidate -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_3_16_candidate | Status|Passed QA |Patch doesn't apply CC| |gmcharlt@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #29 from M. Tompsett <mtompset@hotmail.com> --- I think I have something working, but I need to get my unimarc VM updated and do a test on it first. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24952|0 |1 is obsolete| | --- Comment #30 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 28002 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28002&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #24953|0 |1 is obsolete| | --- Comment #31 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 28003 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28003&action=edit Bug 11592 - opac scripts do not respect marc tag visibility Added two functions to C4/Biblio: GetFilteredOpacBiblio and GetOpacHideMARC. GetFilteredOpacBiblio returns a MARC::Record stripped of all the fields and subfields which are supposed to be hidden in OPAC. GetOpacHideMARC returns a hash of whether a particular key (eg. title, subtitle, etc.) is hidden. A value of 0 means no, a value of 1 means hidden. Made GetCOinSBiblio function handle hiding of 245$a more gracefully. Also, modified GetMarcSubjects to not generate an array entry of empty values. Tweaked C4/XSLT.pm to delete a field, if there weren't any subfields to actually update with. Properly hid 245$a, in the case that there is no visibility for OPAC, for opac-MARCdetail. opac-detail now filters the MARC::Record according to the hidden value in marc_subfield_structure properly. It also corrects a couple minor issues with a parameter not passed being used in a concatenation. How the subtitle values calculation works changed. It is now based on marc_subfield_structure and not fieldmapping. And, the GetBiblioData hash that generates template variables is now filtered by the results of a GetOpacHideMARC call. The opac-showmarc page now converts the MARCXML record to a MARC::Record to easily filter using GetFilteredOpacBiblio, which is then turned back into MARCXML for processing. The opac-export script now filters the biblio record to match what is currently displayed. Added tests to t/db_dependent/Biblio.t to test the functionality of the two functions added into C4::Biblio. Added a GetFilteredOpacBiblio call into opac-ISBDdetail page, so that it should be filtered. TEST PLAN --------- 1) Backup DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) Refresh the opac-MARCdetail page. Title should hide now. 17) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 18) Click Normal view 19) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 20) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 21) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. The goal was hiding properly things above the items. 22) And lastly, attempt to Save record in the various formats using the dropdown and clicking Go. -- The results should be filtered. 23) Click on ISBD view to ensure nothing broke. 24) Restore DB, because hiding 000,003,005,008,020,040,245,etc. are not useful across an entire framework. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #32 from M. Tompsett <mtompset@hotmail.com> --- Since bug 11912 forced Biblio.t to UNIMARC and MARC21 marcflavour the tests, I needed to tweak the test cases to properly handle UNIMARC vs. MARC21 testing. It would be good to see if someone that uses UNIMARC could signoff this bug. The test plan is the same as comment 31, but obviously 200$a is title under UNIMARC. My test cases ran as expected under UNIMARC and MARC21. Test both. :) Perhaps I should have removed the sign offs from the second patch? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #33 from M. Tompsett <mtompset@hotmail.com> --- (In reply to David Cook from comment #26)
A few additional thoughts...
1) A follow-up should probably be added for a few other OPAC scripts like opac-basket.pl, opac-sendbasket.pl, opac-sendshelf.pl, etc., since these will all show the unfiltered MARC record.
Ah, right. GetMarcBiblio.
2) It would be nice to see a future version of this that filters for both the OPAC and the staff client.
Passing a "context" in and checking the 'hidden' values against a hashref of hashrefs might be a quick way of doing that...
I am reconsidering these suggestions, since tweaking a lot of file is as much of a pain as testing the far reaching effects of modifying GetMarcBiblio. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #34 from M. Tompsett <mtompset@hotmail.com> --- And this is where converting the parameters of GetMarcBiblio to a hash reference would be useful, because optional parameters are a pain otherwise. *sigh* -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED --- Comment #35 from M. Tompsett <mtompset@hotmail.com> --- Moving back to assigned, while I think and work on this a little more. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28003|0 |1 is obsolete| | --- Comment #36 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 28477 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28477&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Next, opac-export and opac-showmarc were tweaked to use the new parameter calling convention to filter properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28477|0 |1 is obsolete| | --- Comment #37 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 28478 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28478&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Next, opac-export and opac-showmarc were tweaked to use the new parameter calling convention to filter properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be hidden... 13) Until you click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields are treated separately, so I don't believe they could be hidden in the table using the MARC visibility. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28002|0 |1 is obsolete| | --- Comment #38 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 28479 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28479&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28478|0 |1 is obsolete| | --- Comment #39 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 28480 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28480&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #40 from M. Tompsett <mtompset@hotmail.com> --- I think this is it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolyn.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #41 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 28480 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28480 Bug 11592 - MARC Visibility settings not respected Review of attachment 28480: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=11592&attachment=28480) ----------------------------------------------------------------- Overall, I really want to see this patch get into Koha. However, I think there is some unnecessary code, some potentially incorrect code, and some code that probably belongs in a different bug/patch. ::: C4/Biblio.pm @@ +1322,5 @@
+ my $display = ShouldDisplayOnInterface(); + + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare("SELECT kohafield AS field, tagfield AS tag, hidden FROM marc_subfield_structure WHERE kohafield>'' AND frameworkcode=? ORDER BY field, tagfield;"); + my $rv = $sth->execute($frameworkcode);
Why is there a "my $rv" here? It shouldn't be needed. @@ +1331,5 @@
+ my @tmpsplit = split(/\./,$fullfield); + my $field = $tmpsplit[-1]; + foreach my $tag (keys %{$data->{$fullfield}}) { + my $show = $display->{$interface}->{ $data->{$fullfield}->{$tag}->{'hidden'} }; + if (!$show || $show==0) {
$show should always be 1 or undefined, so I wouldn't think $show==0 would be necessary @@ +1334,5 @@
+ my $show = $display->{$interface}->{ $data->{$fullfield}->{$tag}->{'hidden'} }; + if (!$show || $show==0) { + $shouldhidemarc{ $field } = 1; + } + elsif ( !exists($shouldhidemarc{ $field }) ) {
It shouldn't be necessary to add fields that aren't hidden to this hash. Plus, since the value is 0, you'll most likely get the same end result you would if you didn't have this block of code. @@ +1493,5 @@
+ # LDR field is excluded from $record->fields(). + # if we hide it here, the MARCXML->MARC::Record->MARCXML + # transformation blows up. + #} + foreach my $fields ($record->fields()) {
Should probably use $field rather than $fields, as this incorrect pluralization gets confusing lower down. @@ +1495,5 @@
+ # transformation blows up. + #} + foreach my $fields ($record->fields()) { + my $tag = $fields->tag(); + my $hidden;
This $hidden variable isn't really necessary. If it should be hidden, you should just hide/delete it upon detection. The code looks like it would work either way, but it would be easier to read with less needless code. @@ +1500,5 @@
+ if ($tag>=10) { + foreach my $subpairs ($fields->subfields()) { + my ($subtag,$value) = @$subpairs; + my $visibility = $marcsubfieldstructure->{$tag}->{$subtag}->{hidden}; + $visibility //= 0;
Is there are a reason to have this extra line instead of "my $visibility = $marcsubfieldstructure->{$tag}->{$subtag}->{hidden} // 0"? @@ +1670,4 @@
$oauthors .= "&rft.au=$au"; } } + $title = $record->subfield( '245', 'a' ) // '';
Why is this in this patch? @@ +2122,4 @@
push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop, authoritylink => $authoritylink, + } if $authoritylink || @subfields_loop;
Why is this in this patch? ::: C4/XSLT.pm @@ +93,5 @@
+ @new_subfields + ) ); + } + else { + $record->delete_fields($field);
What is this doing here, and why is it in this patch? ::: opac/opac-detail.pl @@ +683,4 @@
my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); my $marchostsarray = GetMarcHosts($record,$marcflavour); +my ($st_tag,$st_subtag) = GetMarcFromKohaField('bibliosubtitle.subtitle',$dat->{'frameworkcode'});
I think that this section is a mistake. What is bibliosubtitle.subtitle? Also, why would this be in this patch? ::: opac/opac-showmarc.pl @@ +55,4 @@
if ($view eq 'card' || $view eq 'html') { my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber); + if (!$importid && $view eq 'html') {
I haven't looked at the context, but why not filter for all cases here? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #42 from M. Tompsett <mtompset@hotmail.com> --- (In reply to David Cook from comment #41)
::: C4/Biblio.pm
+ my $rv = $sth->execute($frameworkcode);
Why is there a "my $rv" here? It shouldn't be needed.
It was debugging code that I forgot to strip. :)
+ if (!$show || $show==0) {
$show should always be 1 or undefined, so I wouldn't think $show==0 would be necessary.
Actually, 1, 0, or undefined. Someone could put => 0 into the hash checked. I'll confirm if I can simplify the logic.
@@ +1334,5 @@
+ my $show = $display->{$interface}->{ $data->{$fullfield}->{$tag}->{'hidden'} }; + if (!$show || $show==0) { + $shouldhidemarc{ $field } = 1; + } + elsif ( !exists($shouldhidemarc{ $field }) ) {
It shouldn't be necessary to add fields that aren't hidden to this hash. Plus, since the value is 0, you'll most likely get the same end result you would if you didn't have this block of code.
I don't like having undefined values. Those tend to generate annoying floody errors when some comparison works but was expecting a number, for example.
@@ +1493,5 @@
+ # LDR field is excluded from $record->fields(). + # if we hide it here, the MARCXML->MARC::Record->MARCXML + # transformation blows up. + #} + foreach my $fields ($record->fields()) {
Should probably use $field rather than $fields, as this incorrect pluralization gets confusing lower down.
Okay, that makes sense.
@@ +1495,5 @@
+ # transformation blows up. + #} + foreach my $fields ($record->fields()) { + my $tag = $fields->tag(); + my $hidden;
This $hidden variable isn't really necessary. If it should be hidden, you should just hide/delete it upon detection. The code looks like it would work either way, but it would be easier to read with less needless code.
If you look at the hidden value setting that would be inside an if/else. I scoped it wider, so there was no need to have two lines of code. Fine, two lines of code it is.
+ my $visibility = $marcsubfieldstructure->{$tag}->{$subtag}->{hidden}; + $visibility //= 0;
Is there are a reason to have this extra line instead of "my $visibility = $marcsubfieldstructure->{$tag}->{$subtag}->{hidden} // 0"?
Yes, because otherwise visibility is undef. It should be a valid number (-7 to +7) reflecting valid values set in the Advanced Constraints screen.
@@ +1670,4 @@
$oauthors .= "&rft.au=$au"; } } + $title = $record->subfield( '245', 'a' ) // '';
Why is this in this patch?
This fixes a floody error I had during testing. I suppose it could be another patch. I'll confirm.
@@ +2122,4 @@
push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop, authoritylink => $authoritylink, + } if $authoritylink || @subfields_loop;
Why is this in this patch?
This properly hides the subjects.
::: C4/XSLT.pm @@ +93,5 @@
+ @new_subfields + ) ); + } + else { + $record->delete_fields($field);
What is this doing here, and why is it in this patch?
If you try to delete the last subfield of a field, you need to delete the field. If I recall, deleting the last subfield fails. Fields/subfields are deleted (from memory) to hide them from being displayed.
::: opac/opac-detail.pl @@ +683,4 @@
my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); my $marchostsarray = GetMarcHosts($record,$marcflavour); +my ($st_tag,$st_subtag) = GetMarcFromKohaField('bibliosubtitle.subtitle',$dat->{'frameworkcode'});
I think that this section is a mistake.
GetRecordValue, which is what was there initially, does not grab values from marc_subfield_structure, but rather fieldmapping. This means the subtitle is not properly hidden.
What is bibliosubtitle.subtitle? Also, why would this be in this patch?
The value in the marc_subfield_structure table. Subtitles are a mess in Koha.
::: opac/opac-showmarc.pl @@ +55,4 @@
if ($view eq 'card' || $view eq 'html') { my $xmlrecord= $importid? $record->as_xml(): GetXmlBiblio($biblionumber); + if (!$importid && $view eq 'html') {
I haven't looked at the context, but why not filter for all cases here?
I think this is related to the save as exports. This is what worked for me. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #43 from M. Tompsett <mtompset@hotmail.com> --- (In reply to David Cook from comment #41)
@@ +1334,5 @@
+ my $show = $display->{$interface}->{ $data->{$fullfield}->{$tag}->{'hidden'} }; + if (!$show || $show==0) { + $shouldhidemarc{ $field } = 1; + } + elsif ( !exists($shouldhidemarc{ $field }) ) {
It shouldn't be necessary to add fields that aren't hidden to this hash. Plus, since the value is 0, you'll most likely get the same end result you would if you didn't have this block of code.
SELECT tagfield,tagsubfield,kohafield FROM marc_subfield_structure WHERE frameworkcode='' AND tagfield IN ('541','952') ORDER BY kohafield; items.stocknumber is a pain. This is why this code exists. If the first one is hidden (I didn't sort the keys, so it is "random") or visible, the other value doesn't affect it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28480|0 |1 is obsolete| | --- Comment #44 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 28724 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=28724&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|opac scripts do not respect |opac detail scripts do not |MARC tag visibility |respect MARC tag visibility -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #45 from M. Tompsett <mtompset@hotmail.com> --- I changed the title of be 'opac detail scripts', because there are still various OPAC pages this patch doesn't fix. However, these patches provide a way to correct those other problems. I'm hoping others will have time to fix them. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |chris@bigballofwax.co.nz --- Comment #46 from Chris Cormack <chris@bigballofwax.co.nz> --- The second patch has conflicts in the 2 test files, if you fix them up I'll sign off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28724|0 |1 is obsolete| | --- Comment #47 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 31356 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31356&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28479|0 |1 is obsolete| | --- Comment #48 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 32382 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32382&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #31356|0 |1 is obsolete| | --- Comment #49 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 32383 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32383&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=7933 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com --- Comment #50 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- *** Bug 7933 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #51 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- The patches currently don't apply for me: Apply? [(y)es, (n)o, (i)nteractive] i Applying: Bug 11592 - MARC Visibility settings not respected fatal: sha1 information is lacking or useless (C4/Biblio.pm). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #52 from M. Tompsett <mtompset@hotmail.com> --- The removal of the prog theme broke this, specifically bug 13170. Bug 11912 and other related bugs which touched t/db_dependent/Biblio.t affected this as well. I'm working on a rebase. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #53 from M. Tompsett <mtompset@hotmail.com> --- (In reply to M. Tompsett from comment #52)
Bug 11912 and other related bugs which touched t/db_dependent/Biblio.t affected this as well. I'm working on a rebase.
Oops. Bug 12570, because it was t/Biblio.t :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32382|0 |1 is obsolete| | --- Comment #54 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 33356 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33356&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33356|0 |1 is obsolete| | --- Comment #55 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 33357 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33357&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32383|0 |1 is obsolete| | --- Comment #56 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 33358 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33358&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33358|0 |1 is obsolete| | --- Comment #57 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 33689 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=33689&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33689|0 |1 is obsolete| | --- Comment #58 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 35855 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35855&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> TOOK me awhile but it works -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35855|0 |1 is obsolete| | --- Comment #59 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 35856 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35856&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33357|0 |1 is obsolete| | --- Comment #60 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 35857 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35857&action=edit Bug 11592 - Updated License Text and use Modern::Perl Why not clean up the License Agreement stuff while the files are being changed? Used the current one found at: http://wiki.koha-community.org/wiki/Coding_Guidelines#Licence Changed the strict and warning lines into just a Modern::Perl. Signed-off-by: Robin Sheat <robin@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Brendan Gallagher <brendan@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35856|0 |1 is obsolete| | --- Comment #61 from Brendan Gallagher <brendan@bywatersolutions.com> --- Created attachment 35858 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35858&action=edit Bug 11592 - MARC Visibility settings not respected The advanced constraints section while editing subfield structure for a particular MARC bibliographic framework allow the user to set visibility settings for OPAC and Intranet. These settings are not fully respected. This was first discovered while comparing the information displayed on the opac-MARCdetail and opac-detail pages. To this end, this patch will provide the ability to correct this problem across the board as desired, but will focus primarily on the OPAC interface. This was accomplished by adding 3 functions to C4/Biblio.pm: - ShouldDisplayOnInterface - ShouldHideMARC - GetFilteredBiblio And also by modifying GetMarcBiblio to filter or not based on parameter style and parameter values passed. ShouldDisplayOnInterface is a wrapper routine which just returns a hash of hashes which let us know if something is visible (1) or not (0 or undef) for a given interface (opac or intranet). This allows us to add/remove to the advance constraints section and then not have to update multiple routines to keep the filtering working properly, though if it is a drastic refactoring that would be necessary. ShouldHideMARC takes a field from marc_subfield_structure, and determines if it should be hidden. It does this for all the fields for a given framework code on a particular interface. If no framework code is given, the framework code used is the default one. If not interface is specified, OPAC is assumed. This routine returns a hash reference to the corresponding hash that was built. GetFilteredBiblio takes a MARC::Record, clones it, and then strips all the fields that should not be visible for a given framework code and interface. If no framework code is specied, it assumes the default one. If no interface is given, OPAC is assumed. The routine then returns the filtered record. GetMarcBiblio was modified to accept a hash style parameter. This allowed for filtering if the new convention was used, and no apparent change if the old convention is used. These functions allowed for filtering, but frequently there were problems with titles, subjects, etc. This required other tweaks. In C4/Biblio.pm, GetMarcSubjects was returning the subject, even it was supposed to be hidden. C4/XSLT.pm tried to replace a field with no field, rather than properly delete it. With the filtering being implemented based on the parameter style, it just required a minor tweak in opac-ISDBdetail to filter. The title needed to be purposefully not set if it was supposed to be hidden in opac-MARCdetail. However, opac-detail was interesting challenge. First, changing the parameter style did filtering, but the output still was leaking things which should be hidden. This is the main reason ShouldHideMARC was written, because there is an insidious little loop that runs through a set of keys and sets template parameters to values. Second, By skipping to the next key based on the hash ref returned by ShouldHideMARC, the template parameter is not set, and thus the value is properly hidden. Third, the subtitle was grabbed by GetRecordValue. This was refactored so filtering worked properly. Then opac-MARCdetail's 'view plain' was still showing details. This required converting the XML record to a MARC::Record, filtering it, and then converting it back. By tweaking opac-export and opac-showmarc to use the new parameter calling convention, records were filtered properly. And of course, with modifications and additions to C4/Biblio.pm, tests were required. t/Biblio.t has been modified to check the new function ShouldDisplayOnInterface. t/db_dependent/Biblio.t has also been modified. It confirms that both old and new calling conventions work. It also tests hiding the title field (200$a UNIMARC, 245$a MARC). It includes tests for ShouldHideMARC, GetFilteredBiblio, and GetMarcBiblio. TEST PLAN --------- 1) Back up your DB 2) Go to any OPAC detail page and note the biblio number. 3) Log into the staff client and determine the framework code for that biblio number. 4) The steps should be done with OPACXSLTDetailsDisplay set to blank. 5) Home -> Koha administration -> MARC bibliographic framework -> MARC structure (for the matching framework) 6) On the OPAC detail page, click MARC view 7) In the staff client, for every tag listed in the OPAC -> Subfields -> click the first link Then running through all the tabs, click Advanced constraints and uncheck OPAC visibility. Then click Save Changes 8) Refresh the opac-MARCdetail page in OPAC -- what you hid should be mostly hidden TITLE will still display, even if you hide 245$a! 9) Click Normal view, and all the hidden things are still mostly showing! 10) The steps should be done with OPACXSLTDetailsDisplay set to default (or some custom one?). 11) Refresh the opac-detail page. Still mostly showing all the hidden things. 12) Click MARC view, and everything should be mostly hidden as before until you... 13) Click the 'view plain' link. 14) Apply the patch. 15) Run the Koha QA test tool. 16) perldoc C4::Biblio -- Look for ShouldHideMARC and confirm that the perldoc entries are okay. 17) prove -v t/Biblio.t -- 'Visibility values confirmed.' test should pass. 18) prove -v t/db_dependent/Biblio.t -- tests 26 through 41 should pass for UNIMARC and MARC21. It would be good to test this patch on both types of systems. 19) Refresh the opac-MARCdetail page. Title should hide now. 20) Click the 'view plain' link. -- LDR and 999$c and 999$d were displaying for me. I realized that I hadn't hidden 999, because the opac-MARCdetail page doesn't display it. LDR is the only known leak. 21) Click Normal view 22) Now all the opac-detail page should hide things just like the opac-MARCdetail page. 23) In the staff client, change the OPACXSLTDetailsDisplay to a blank value. 24) Recheck opac-detail and opac-MARC detail pages again, including the view plain link, and everything should hidden similarly. -- NOTE: LDR is the only known leak. NOTE: 952 fields do hide in 'MARC view', but not normal view. This patch does not deal with 952 fields. 25) Attempt to 'Save record' in a variety of types. -- Only unhidden fields should display. Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #62 from Jonathan Druart <jonathan.druart@biblibre.com> --- Be care, prototype of GetMarcBiblio is modified here, bug 12252 did it too! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #63 from Jonathan Druart <jonathan.druart@biblibre.com> --- Comment on attachment 35858 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35858 Bug 11592 - MARC Visibility settings not respected Review of attachment 35858: --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=11592&attachment=35858) ----------------------------------------------------------------- ::: C4/Biblio.pm @@ +1369,5 @@
=cut
sub GetMarcBiblio { + my @catch_parameters = @_; +
Passing a hashref would be better. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #64 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Jonathan Druart from comment #62)
Be care, prototype of GetMarcBiblio is modified here, bug 12252 did it too!
This change catches the old way and a hashref. Though, because a third parameter was added in 12252, this would require a more detailed look there. However, that would more likely come anyways if that is pushed to master first anyways, because this would need a rebase. Thanks for the heads up. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #65 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to M. Tompsett from comment #64)
(In reply to Jonathan Druart from comment #62)
Be care, prototype of GetMarcBiblio is modified here, bug 12252 did it too!
This change catches the old way and a hashref. Though, because a third parameter was added in 12252, this would require a more detailed look there. However, that would more likely come anyways if that is pushed to master first anyways, because this would need a rebase. Thanks for the heads up.
I would consider this bugfix if it was implemented as a Koha::RecordProcessor filter for MARC::Record objects, rather than just another hook to C4::Search. That way we could use it wherever we need it. BUT I have to say that I've been playing with an implementation that works with MARCMXL instead (using XSLT) and could help us simplicy results rendering and probably performance. I'm trying to finish the patches (the hackfest had me busy with other stuff) so I can attach them for peer review. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #66 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Tomás Cohen Arazi from comment #65)
I would consider this bugfix if it was implemented as a Koha::RecordProcessor filter for MARC::Record objects, rather than just another hook to C4::Search. That way we could use it wherever we need it.
This does NOT touch C4::Search at all. My initial worry is the whole inclusion loop making debugging a pain! But your idea of effectively moving all the stuff added to C4::Biblio into a filter module is good, if there isn't some magical loop which makes debugging a pain.
BUT I have to say that I've been playing with an implementation that works with MARCMXL instead (using XSLT) and could help us simplicy results rendering and probably performance.
I'm trying to finish the patches (the hackfest had me busy with other stuff) so I can attach them for peer review.
I was going to attempt to go that way. My concern is if we have MARCXML filters and non-XML filters, we need to make sure they are identical. I suppose part of the unit tests to add into the continuous integration. :) This is why I was wondering if perhaps we would go completely MARCXML internally, as I vaguely recall some indexing limit which you hit for a MARC Record, but perhaps that is unrelated. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #67 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- tcohen: could you please update your comments on bug 11592 as related to bug 12252 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #68 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Some comments from IRC: [16:32] marcelr so i was curious about your position before starting qa [16:32] tcohen my decision about that kind of stuff is that we should definitely resurrect Koha::RecordProcessor [16:33] tcohen so, Mark should implement (if that's what he wants) a Koha::Filter for MARC records [16:33] marcelr which would mean: rewrite the patch set first [16:33] tcohen I wrote my own for MARCXML (in the form of XML::LibXML::Document objects, which is the result of parsing XML) [16:33] tcohen so, I already have an implementation [16:34] tcohen that "can be used" wherever we want [16:34] tcohen the problem with MArk's is that it is MARC::Record specific, and is hooked in the wrong place (IMHO) [16:34] tcohen it can be discussed [16:34] marcelr where is yours now? [16:35] tcohen https://github.com/tomascohen/koha/tree/xslt_filtering [16:35] tcohen I introduced a Koha::Filter::MARCXML::ViewPolicy filter class Returning to this later.. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #69 from M. Tompsett <mtompset@hotmail.com> --- (In reply to M. de Rooy from comment #68)
Some comments from IRC: [16:33] tcohen so, Mark should implement (if that's what he wants) a Koha::Filter for MARC records
Which is something I will get around to doing. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Marjorie Barry-Vila <marjorie.barry-vila@ccsr.qc.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marjorie.barry-vila@ccsr.qc | |.ca -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major Priority|P5 - low |P3 --- Comment #70 from Mason James <mtj@kohaaloha.com> --- I increased the severity of this big should be increased, as it's a big security problem -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #71 from Jonathan Druart <jonathan.druart@biblibre.com> --- What's next here? Is it ready to QA? Looking at the last comments I'd say no. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |In Discussion --- Comment #72 from M. Tompsett <mtompset@hotmail.com> --- I have yet to implement a filter. This would be a huge rewrite. However, some of the things in this patch could be split off to tinier bugs. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 Irma Birchall <irma@calyx.net.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |irma@calyx.net.au -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 --- Comment #73 from M. Tompsett <mtompset@hotmail.com> --- Progress is being made on this bug. I have a filter. Now to break the mess into parts, and assemble in small testable pieces while tweaking other code to use it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=15382 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11592 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15382 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15382 [Bug 15382] 245$a visibility constraints not respected in opac-MARCdetail.pl -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org