Bugzilla – Attachment 14391 Details for
Bug 9326
New database update system suggests running duplicate updates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9326, 7167: Add a "execute anyway" link for versions already executed
Bug-9326-7167-Add-a-execute-anyway-link-for-versio.patch (text/plain), 3.29 KB, created by
Jonathan Druart
on 2013-01-03 13:28:34 UTC
(
hide
)
Description:
Bug 9326, 7167: Add a "execute anyway" link for versions already executed
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-01-03 13:28:34 UTC
Size:
3.29 KB
patch
obsolete
>From 866b4ac3beb753a09052a37c135da5cdad6c2b91 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 3 Jan 2013 14:25:50 +0100 >Subject: [PATCH] Bug 9326, 7167: Add a "execute anyway" link for versions > already executed > >If a version has the same md5 than an version already executed, a link >allows the administrator to execute this version anyway. >--- > C4/Update/Database.pm | 24 +++++++++++--------- > admin/updatedatabase.pl | 6 +++++ > .../prog/en/modules/admin/updatedatabase.tt | 2 ++ > 3 files changed, 21 insertions(+), 11 deletions(-) > >diff --git a/C4/Update/Database.pm b/C4/Update/Database.pm >index 5bbc950..d2b02c0 100644 >--- a/C4/Update/Database.pm >+++ b/C4/Update/Database.pm >@@ -102,7 +102,7 @@ sub get_md5 { > =cut > > sub execute_version { >- my ( $version ) = @_; >+ my ( $version, $args ) = @_; > my $report; > > my $filepath; >@@ -118,16 +118,18 @@ sub execute_version { > my $filename = $version . $extension; > > my $md5 = get_md5 $filepath; >- my $r = md5_already_exists( $md5 ); >- if ( scalar @$r ) { >- my $p = @$r[0]; >- $report->{$version} = { >- error => "ALREADY_EXISTS", >- filepath => $filepath, >- old_version => @$r[0]->{version}, >- md5 => @$r[0]->{md5}, >- }; >- return $report; >+ unless ( $args->{force} ) { >+ my $r = md5_already_exists( $md5 ); >+ if ( scalar @$r ) { >+ my $p = @$r[0]; >+ $report->{$version} = { >+ error => "ALREADY_EXISTS", >+ filepath => $filepath, >+ old_version => @$r[0]->{version}, >+ md5 => @$r[0]->{md5}, >+ }; >+ return $report; >+ } > } > > my $queries; >diff --git a/admin/updatedatabase.pl b/admin/updatedatabase.pl >index 013414d..626868b 100755 >--- a/admin/updatedatabase.pl >+++ b/admin/updatedatabase.pl >@@ -71,6 +71,12 @@ if ( $op eq 'mark_as_ok' ) { > $op = 'list'; > } > >+if ( $op eq 'force_update' ) { >+ my $version = $query->param('version'); >+ C4::Update::Database::execute_version $version, {force => 1}; >+ $op = 'list'; >+} >+ > if ( $op eq 'list' ) { > my $versions_available = C4::Update::Database::list_versions_available; > my $versions = C4::Update::Database::list_versions_already_applied; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/updatedatabase.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/updatedatabase.tt >index e0f9ceb..e51d194 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/updatedatabase.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/updatedatabase.tt >@@ -77,6 +77,8 @@ > <span style="color:orange;"> > [% r.error.filepath %] already executed in version [% r.error.old_version %] : same md5 ([% r.error.md5 %]) > [<a href="/cgi-bin/koha/admin/updatedatabase.pl?op=mark_as_ok&version=[% report_loo.version %]">Mark as OK</a>] >+ or >+ [<a href="/cgi-bin/koha/admin/updatedatabase.pl?op=force_update&version=[% report_loo.version %]">execute anyway</a>] > </span> > [% ELSIF r.error.error == "LOAD_FUNCTIONS_FAILED" %] > <span style="color:red;"> >-- >1.7.10.4
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 9326
: 14391