Bug 17206: Fix switch to default framework
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 7 Sep 2016 09:26:12 +0000 (10:26 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 12 Sep 2016 09:02:35 +0000 (09:02 +0000)
When editing a bibliographic record, if you switch the framework to
default, the page is reloaded but the framework is not changed.
From the pl script, you can see that the frameworkcode is set to the one
of the biblio if set to false. The empty string, which means default,
should be taken into account.

Test plan:
- Create a record using the Fast add framework
- Save the record
- Open the record for editing
- Use the "Settings" pull down to change the framework to default
- Try another framework
- Try changing to default from there

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

cataloguing/addbiblio.pl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt

index e9ff81e..a1f7208 100755 (executable)
@@ -710,7 +710,7 @@ my $userflags = 'edit_catalogue';
 
 my $changed_framework = $input->param('changed_framework');
 $frameworkcode = &GetFrameworkCode($biblionumber)
-  if ( $biblionumber and not($frameworkcode) and $op ne 'addbiblio' );
+  if ( $biblionumber and not( defined $frameworkcode) and $op ne 'addbiblio' );
 
 if ($frameworkcode eq 'FA'){
     $userflags = 'fast_cataloging';
index f6dc696..c66d24a 100644 (file)
         $(".change-framework").on("click", function(){
             var frameworkcode = $(this).data("frameworkcode");
             $("#frameworkcode").val( frameworkcode );
-            Changefwk( frameworkcode );
+            Changefwk();
         });
     });
 
@@ -370,7 +370,7 @@ function GetZ3950Terms(){
     return strQuery;
 }
 
-function Changefwk(FwkList) {
+function Changefwk() {
     var f = document.f;
     f.op.value = "[% op %]";
     f.biblionumber.value = "[% biblionumberdata %]";