Bugzilla – Attachment 6790 Details for
Bug 7360
Importing a SQL file for frameworks based on Default Framework deletes the default framework
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch proposed
0001-Bug-7360-Import-Default-framework-into-other-deletes.patch (text/plain), 2.05 KB, created by
laurenthdl
on 2011-12-14 16:34:52 UTC
(
hide
)
Description:
patch proposed
Filename:
MIME Type:
Creator:
laurenthdl
Created:
2011-12-14 16:34:52 UTC
Size:
2.05 KB
patch
obsolete
>From 7e32061d086fe64b1f4731e818bc558849481c6c Mon Sep 17 00:00:00 2001 >From: Admin User Koha <koha@biblibre.com> >Date: Wed, 14 Dec 2011 17:31:00 +0100 >Subject: [PATCH] Bug 7360 Import Default framework into other deletes default Framework > >Step to reproduce : >- export default framework as SQL >- create new framework >- Import the exported SQL file into this new framework. >Go to default framework : >It disappeared. > >If some libraries want to share default frameworks, then it is a major bug. >This patch fixes the test in order to cope with 0 character framework name. >--- > C4/ImportExportFramework.pm | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/ImportExportFramework.pm b/C4/ImportExportFramework.pm >index a2b650b..d85e64f 100755 >--- a/C4/ImportExportFramework.pm >+++ b/C4/ImportExportFramework.pm >@@ -776,7 +776,7 @@ sub _parseSQLLine > my $stmt = SQL::Statement->new($line, $parser); > my $where = $stmt->where(); > if ($where && $where->op() eq '=' && $line =~ /^\s*DELETE/) { >- $line =~ s/frameworkcode='.+?'/frameworkcode='$frameworkcode';/ unless ($_ =~ /frameworkcode='$frameworkcode'/); >+ $line =~ s/frameworkcode='.*?'/frameworkcode='$frameworkcode';/ unless ($_ =~ /frameworkcode='$frameworkcode'/); > } else { > my @arrFields; > my @arrValues; >@@ -817,7 +817,7 @@ sub _parseSQLLine > if ($error) { > $line .= ';' unless ($line =~ /;$/); > if ($line =~ /^\s*DELETE/) { >- $line =~ s/frameworkcode='.+?'/frameworkcode='$frameworkcode'/ unless ($_ =~ /frameworkcode='$frameworkcode'/); >+ $line =~ s/frameworkcode='.*?'/frameworkcode='$frameworkcode'/ unless ($_ =~ /frameworkcode='$frameworkcode'/); > } elsif ($line =~ /^\s*INSERT\s+INTO\s+(.*?)\s+\((.*?frameworkcode.*?)\)\s+VALUES\s+\((.+)\)\s*;\s*$/) { > my $table = $1; > my $fields = $2; >-- >1.7.2.5 >
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 7360
:
6790
|
6792