Bugzilla – Attachment 81405 Details for
Bug 21704
Editing subfields in bibliographic frameworks is broken (TT filter)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21704: Edit framework subfield link is broken (TT filter)
Bug-21704-Edit-framework-subfield-link-is-broken-T.patch (text/plain), 8.01 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-10-28 12:44:41 UTC
(
hide
)
Description:
Bug 21704: Edit framework subfield link is broken (TT filter)
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-10-28 12:44:41 UTC
Size:
8.01 KB
patch
obsolete
>From 2e4a843d40d576de201673d35c63b703a70dea02 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Sun, 28 Oct 2018 09:36:32 -0300 >Subject: [PATCH] Bug 21704: Edit framework subfield link is broken (TT filter) > >This patch removes URL building from the controller >(admin/marctagstructure.pl) and does it on the templates, using the >right 'uri' filter for the query parameters. > >It also removes: >- No longer used attributes that are passed to the template >- Duplicated code in the templates > >To test: >- Go to Home > Administration > MARC bibliographic framework >- On any of the listed frameworks, pick the 'MARC structure' action in >the dropdown >- On any subfield, hover on the actions dropdown >=> FAIL: The URLs are wrongly formed >- Click on the links >=> FAIL: You get errors because of the bad URL >- Apply this patch >- Reload the 'MARC structure' page >- On any subfield, hover on the actions dropdown >=> SUCCESS: LInks look correct >- Click on any of them >=> SUCCESS: They work! >- Use the 'Display only used tags/subfields' checkbox >=> SUCCESS: No behaviour change! >- Sign off :-D > >Sponsored-by: Theke Solutions >--- > admin/marctagstructure.pl | 6 --- > .../prog/en/modules/admin/marctagstructure.tt | 40 ++++--------------- > 2 files changed, 7 insertions(+), 39 deletions(-) > >diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl >index 43de4fb4ae..e42ce4fa48 100755 >--- a/admin/marctagstructure.pl >+++ b/admin/marctagstructure.pl >@@ -248,9 +248,6 @@ if ($op eq 'add_form') { > $row_data{authorised_value} = $results[$i]->{'mts_authorised_value'}; > $row_data{ind1_defaultvalue} = $results[$i]->{'mts_ind1_defaultvalue'}; > $row_data{ind2_defaultvalue} = $results[$i]->{'mts_ind2_defaultvalue'}; >- $row_data{subfield_link} = "marc_subfields_structure.pl?op=add_form&tagfield=".$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; >- $row_data{edit} = "$script_name?op=add_form&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; >- $row_data{delete} = "$script_name?op=delete_confirm&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode; > $j=$i; > my @internal_loop = (); > while ( ( $j < $cnt ) and ( $results[$i]->{'tagfield'} == $results[$j]->{'tagfield'} ) ) { >@@ -295,9 +292,6 @@ if ($op eq 'add_form') { > $row_data{authorised_value} = $results->[$i]{'authorised_value'}; > $row_data{ind1_defaultvalue} = $results->[$i]{'ind1_defaultvalue'}; > $row_data{ind2_defaultvalue} = $results->[$i]{'ind2_defaultvalue'}; >- $row_data{subfield_link} = "marc_subfields_structure.pl?tagfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; >- $row_data{edit} = "$script_name?op=add_form&searchfield=" .$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; >- $row_data{delete} = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'tagfield'}."&frameworkcode=".$frameworkcode; > push(@loop_data, \%row_data); > } > $template->param(loop => \@loop_data); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >index 121480806e..1910451ff5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt >@@ -41,7 +41,7 @@ > > [% IF ( else ) %] > <div id="toolbar" class="btn-toolbar"> >- <a class="btn btn-default btn-sm" id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&frameworkcode=[% framework.frameworkcode | html %]"><i class="fa fa-plus"></i> New tag</a> >+ <a class="btn btn-default btn-sm" id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-plus"></i> New tag</a> > </div>[% END %] > > <h1>MARC Framework for [% IF framework %][% framework.frameworktext | html %] ([% framework.frameworkcode | html %])[% ELSE %]default MARC framework[% END %]</h1> >@@ -184,18 +184,19 @@ > </tr> > </thead> > <tbody> >- [% IF ( select_display ) %] >- [% FOREACH loo IN loop %] >+ [% FOREACH loo IN loop %] > <tr> > <td>[% loo.tagfield | html %]</td> > <td> > [% loo.liblibrarian | html %] >+ [% IF ( select_display ) %] > [% FOREACH subfield IN loo.subfields %] > <p> > Tab:[% subfield.tab | html %] | $[% subfield.tagsubfield | html %] > [% subfield.liblibrarian | html %] [% IF ( subfield.kohafield ) %][% subfield.kohafield | html %][% END %][% IF ( subfield.repeatable ) %], repeatable[% END %][% IF ( subfield.mandatory ) %], Mandatory[% END %][% IF ( subfield.seealso ) %], See [% subfield.seealso | html %][% END %][% IF ( subfield.authorised_value ) %], [% subfield.authorised_value | html %][% END %][% IF ( subfield.authtypecode ) %], [% subfield.authtypecode | html %][% END %][% IF ( subfield.value_builder ) %], [% subfield.value_builder | html %][% END %] > </p> > [% END %] >+ [% END %] > </td> > <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td> > <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td> >@@ -207,43 +208,16 @@ > <a class="btn btn-default btn-xs dropdown-toggle" id="marctagactions[% loo.tagfield | html %]" role="button" data-toggle="dropdown" href="#"> > Actions <b class="caret"></b></a> > <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="marctagactions[% loo.tagfield | html %]"> >- <li><a href="[% loo.subfield_link | uri %]"><i class="fa fa-eye"></i> Subfields</a></li> >- <li><a href="[% loo.edit | uri %]"><i class="fa fa-pencil"></i> Edit</a></li> >- <li><a href="[% loo.delete | uri %]"><i class="fa fa-trash"></i> Delete</a></li> >+ <li><a href="marc_subfields_structure.pl?op=add_form&tagfield=[% loo.tagfield | uri %]&frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-eye"></i> Subfields</a></li> >+ <li><a href="?op=add_form&searchfield=[% loo.tagfield | uri %]&frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-pencil"></i> Edit</a></li> >+ <li><a href="?op=delete_confirm&searchfield=[% loo.tagfield | uri %]&frameworkcode=[% framework.frameworkcode | uri %]"><i class="fa fa-trash"></i> Delete</a></li> > </ul> > </div> > </td> > </tr> >- [% END %] >- [% ELSE %] >- [% FOREACH loo IN loop %] >- <tr> >- <td>[% loo.tagfield | html %]</td> >- <td>[% loo.liblibrarian | html %]</td> >- <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td> >- <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td> >- <td>[% loo.authorised_value | html %]</td> >- <td>[% loo.ind1_defaultvalue | html %]</td> >- <td>[% loo.ind2_defaultvalue | html %]</td> >- <td> >- <div class="dropdown"> >- <a class="btn btn-default btn-xs dropdown-toggle" id="marctagactions[% loo.tagfield | html %]" role="button" data-toggle="dropdown" href="#"> >- Actions <b class="caret"></b></a> >- <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="marctagactions[% loo.tagfield | html %]"> >- <li><a href="[% loo.subfield_link | uri %]"><i class="fa fa-eye"></i> Subfields</a></li> >- <li><a href="[% loo.edit | uri %]"><i class="fa fa-pencil"></i> Edit</a></li> >- <li><a href="[% loo.delete | uri %]"><i class="fa fa-trash"></i> Delete</a></li> >- </ul> >- </div> >- </td> >- </tr> >- [% END %] > [% END %] > </tbody> > </table> >- >- >- > [% END %] > > </main> >-- >2.19.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 21704
:
81405
|
81407
|
81428
|
81429
|
81432
|
81433
|
81434