Bug 18111: Swap framework_name and frameworkcode
authorMark Tompsett <mtompset@hotmail.com>
Sun, 19 Feb 2017 04:06:16 +0000 (23:06 -0500)
committerKatrin Fischer <katrin.fischer.83@web.de>
Tue, 21 Feb 2017 20:54:39 +0000 (21:54 +0100)
With the frameworkcode changed to an empty string, which really
is closer to the physical reality, some javascript somewhere
breaks. This means the spinner does not appear when you confirm
that you wish to import it.

TEST PLAN
----------
1) apply first patch
2) export default framework, doesn't matter format
3) import default framework using that file.
4) answer yes or whatever it is.
   -- spinner does not appear.
5) apply this patch
6) import default framework use the same file.
7) answer yes or whatever it is.
   -- spinner does appear.
8) decide if you wish to find and fix the javascript conditions.
   if yes -- do so, and then obsolete this once you have.
   if not -- sign this off after running koha qa test tools

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 1ce61ac6a372783b39a11386018e08d92ccd8f39)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

admin/import_export_framework.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt

index 60dcf7f..b2d090d 100755 (executable)
@@ -46,8 +46,8 @@ unless ($authenticated) {
     exit 0;
 }
 
-my $frameworkcode = $input->param('frameworkcode') || '';
-my $framework_name = $frameworkcode || 'default';
+my $framework_name = $input->param('frameworkcode') || 'default';
+my $frameworkcode = ($framework_name eq 'default') ? q{} : $framework_name;
 my $action = $input->param('action') || 'export';
 
 ## Exporting
index 714d4fb..50cd4b2 100644 (file)
               </div>
               <form action="/cgi-bin/koha/admin/import_export_framework.pl" name="form_i_default" id="form_i_default" method="post" enctype="multipart/form-data" class="form_import">
                 <div class="modal-body">
-                  <input type="hidden" name="frameworkcode" value="" />
+                  <input type="hidden" name="frameworkcode" value="default" />
                   <input type="hidden" name="action" value="import" />
                   <p><label for="file_import_default">Upload file:</label> <input type="file" name="file_import_default" id="file_import_default" class="input_import" /></p>
                     <div id="importing_default" style="display:none" class="importing"><img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /><span class="importing_msg"></span></div>