Bugzilla – Attachment 30826 Details for
Bug 12091
HTML from auth_subfields_structure.tt doesn't pass firefox's html validator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12091: HTML from auth_subfields_structure.tt doesn't pass firefox's html validator
PASSED-QA-Bug-12091-HTML-from-authsubfieldsstructu.patch (text/plain), 11.79 KB, created by
Katrin Fischer
on 2014-08-15 10:28:32 UTC
(
hide
)
Description:
[PASSED QA] Bug 12091: HTML from auth_subfields_structure.tt doesn't pass firefox's html validator
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-08-15 10:28:32 UTC
Size:
11.79 KB
patch
obsolete
>From 6925db9e06bac86ce8576610a388125273ae7a9b Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Wed, 13 Aug 2014 12:54:30 -0400 >Subject: [PATCH] [PASSED QA] Bug 12091: HTML from auth_subfields_structure.tt > doesn't pass firefox's html validator >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This cleans up the HTML in auth_subfields_structure.pl and >auth_subfields_structure.tt by: >- fixing some attributes >- removing some attributes >- and using a handy-dandy validation plug-in that Owen pointed > me at the other day. > >TEST PLAN >--------- > 1) Install HTML Validator Plugin (Html Validator 0.9.5.8 Firefox addon) > 2) Log in to staff client > 3) Koha administration > 4) Authority types (on the right, 5 down from Catalog header) > 5) Click 'MARC structure' of any auth type > 6) Click 'subfields' (I believe for any Tag >= 010) > 7) Click 'Edit subfields' > 8) Right click and select 'View Page Source' > -- Lots of HTML validation errors > 9) View the 'Authorized value:' and 'Thesaurus:' drop down lists. > -- Patch cleans up code, so lists should remain unchanged > after applying patch >10) Apply the patch >11) Refresh the page (make sure it isn't cached!) >12) Right click and select 'View Page Source' > -- It should be down to 10 errors / 11 warnings. > NOTE: I think this means there is a code problem with > actually editing authorities properly! > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Work as described, much less validation errors, no koha-qa errors > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >CÃleans up code, also removes SQL in favor of using a method. >No regressions found. >--- > admin/auth_subfields_structure.pl | 32 ++++------- > .../en/modules/admin/auth_subfields_structure.tt | 62 ++++++++++++++-------- > 2 files changed, 51 insertions(+), 43 deletions(-) > >diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl >index 67c7fac..96088bd 100755 >--- a/admin/auth_subfields_structure.pl >+++ b/admin/auth_subfields_structure.pl >@@ -23,6 +23,7 @@ use C4::Output; > use C4::Auth; > use CGI; > use C4::Context; >+use C4::Koha; > > > sub string_search { >@@ -91,25 +92,14 @@ if ($op eq 'add_form') { > push @kohafields, "auth_header.".$field; > } > >- # build authorised value list >- $sth2 = $dbh->prepare("select distinct category from authorised_values"); >- $sth2->execute; >- my @authorised_values; >- push @authorised_values,""; >- while ((my $category) = $sth2->fetchrow_array) { >- push @authorised_values, $category; >- } >- push (@authorised_values,"branches"); >- push (@authorised_values,"itemtypes"); >- >- # build thesaurus categories list >- $sth2 = $dbh->prepare("select authtypecode from auth_types"); >- $sth2->execute; >- my @authtypes; >- push @authtypes, ""; >- while ( ( my $authtypecode ) = $sth2->fetchrow_array ) { >- push @authtypes, $authtypecode; >- } >+ # build authorised value list >+ my $authorised_values = C4::Koha::GetAuthorisedValueCategories; >+ unshift @$authorised_values, ''; >+ push @$authorised_values, 'branches'; >+ push @$authorised_values, 'itemtypes'; >+ >+ # build thesaurus categories list >+ my @authtypes = (sort keys getauthtypes); > > # build value_builder list > my @value_builder=(''); >@@ -160,7 +150,7 @@ if ($op eq 'add_form') { > }; > $row_data{authorised_value} = { > id => "authorised_value$i", >- values => \@authorised_values, >+ values => $authorised_values, > default => $data->{'authorised_value'}, > }; > $row_data{frameworkcode} = { >@@ -239,7 +229,7 @@ if ($op eq 'add_form') { > }; > $row_data{authorised_value} = { > id => "authorised_value", >- values => \@authorised_values, >+ values => $authorised_values, > default => "", > }; > $row_data{frameworkcode} = { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >index 9c0f95b..bc72266 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt >@@ -89,15 +89,17 @@ function displayMoreConstraint(numlayer){ > <li><label for="liblibrarian[% loo.row %]">Text for librarian: </label><input id="liblibrarian[% loo.row %]" type="text" name="liblibrarian" value="[% loo.liblibrarian %]" size="40" maxlength="80" /></li> > <li><label for="libopac[% loo.row %]">Text for OPAC: </label><input type="text" id="libopac[% loo.row %]" name="libopac" value="[% loo.libopac %]" size="40" maxlength="80" /></li> > <li><label for="tab[% loo.row %]">Managed in tab: </label> >- <select name="tab" tabindex="" size="1" id="[% loo.tab.id %]"> >+ <select name="tab" size="1" id="[% loo.tab.id %]"> > [%- IF ( loo.tab.default == -1 ) -%] > <option value="-1" selected="selected">ignore</option> > [%- ELSE -%] > <option value="-1">ignore</option> > [%- END -%] > [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%] >- [%- IF ( loo.tab.default == t ) -%] >+ [%- IF ( loo.tab.default == t && t.length>0 ) -%] > <option value="[%- t -%]" selected="selected">[%- t -%]</option> >+ [%- ELSIF ( loo.tab.default == t ) -%] >+ <option value="[%- t -%]" selected="selected"> </option> > [%- ELSE -%] > <option value="[%- t -%]">[%- t -%]</option> > [%- END -%] >@@ -144,49 +146,65 @@ function displayMoreConstraint(numlayer){ > <li> > <label for="kohafield[% loo.row %]">Koha field:</label> > <select name="kohafield" id="[% loo.kohafield.id %]" size="1"> >- [% FOREACH value IN loo.kohafield.values %] >- [% IF ( value == loo.kohafield.default ) %] >+ [%- FOREACH value IN loo.kohafield.values %] >+ [% IF ( value == loo.kohafield.default && value.length>0 ) -%] > <option value="[% value %]" selected="selected">[% value %]</option> >- [% ELSE %] >+ [%- ELSIF ( value == loo.kohafield.default ) -%] >+ <option value="[% value %]" selected="selected"> </option> >+ [%- ELSIF ( value.length==0 ) -%] >+ <option value="[% value %]"> </option> >+ [%- ELSE -%] > <option value="[% value %]">[% value %]</option> >- [% END %] >- [% END %] >+ [%- END -%] >+ [%- END %] > </select> > </li> > <li> > <label for="authorised_value[% loo.row %]">Authorized value:</label> > <select name="authorised_value" id="[% loo.authorised_value.id %]" size="1"> >- [% FOREACH value IN loo.authorised_value.values %] >- [% IF ( value == loo.authorised_value.default ) %] >+ [%- FOREACH value IN loo.authorised_value.values %] >+ [% IF ( value == loo.authorised_value.default && value.length>0 ) -%] > <option value="[% value %]" selected="selected">[% value %]</option> >- [% ELSE %] >+ [%- ELSIF ( value == loo.authorised_value.default ) -%] >+ <option value="[% value %]" selected> </option> >+ [%- ELSIF ( value.length==0 ) -%] >+ <option value="[% value %]"> </option> >+ [%- ELSE -%] > <option value="[% value %]">[% value %]</option> >- [% END %] >- [% END %] >+ [%- END -%] >+ [%- END %] > </select> > </li> > <li> > <label for="frameworkcode[% loo.row %]">Thesaurus:</label> > <select name="frameworkcode" id="[% loo.frameworkcode.id %]" size="1"> >- [% FOREACH value IN loo.frameworkcode.values %] >- [% IF ( value == loo.frameworkcode.default ) %] >+ [%- FOREACH value IN loo.frameworkcode.values %] >+ [% IF ( value == loo.frameworkcode.default && value.length>0 ) -%] > <option value="[% value %]" selected="selected">[% value %]</option> >- [% ELSE %] >+ [%- ELSIF ( value == loo.frameworkcode.default ) -%] >+ <option value="[% value %]" selected="selected"> </option> >+ [%- ELSIF ( value.length==0 ) -%] >+ <option value="[% value %]"> </option> >+ [%- ELSE -%] > <option value="[% value %]">[% value %]</option> >- [% END %] >- [% END %] >+ [%- END -%] >+ [%- END %] > </select> > </li> > <li> > <label for="value_builder[% loo.row %]">Plugin:</label> > <select name="value_builder" id="[% loo.value_builder.id %]" size="1"> >- [% FOREACH value IN loo.value_builder.values %] >- [% IF ( value == loo.value_builder.default ) %] >+ [%- FOREACH value IN loo.value_builder.values %] >+ [% IF ( value == loo.value_builder.default && value.length>0 ) -%] > <option value="[% value %]" selected="selected">[% value %]</option> >- [% ELSE %] >+ [%- ELSIF ( value == loo.value_builder.default ) -%] >+ <option value="[% value %]" selected="selected"> </option> >+ [%- ELSIF ( value.length==0 ) -%] >+ <option value="[% value %]"> </option> >+ [%- ELSE -%] > <option value="[% value %]">[% value %]</option> >- [% END %] >- [% END %] >+ [%- END -%] >+ [%- END %] > </select> > </li> > </ol> >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12091
:
27152
|
27674
|
30767
|
30768
|
30773
|
30774
|
30778
|
30779
| 30826