Bugzilla – Attachment 61958 Details for
Bug 18121
Rename opac_news.new with opac_news.content - replace notice template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18121: Replace opac_news.new with opac_news.content in notices templates
Bug-18121-Replace-opacnewsnew-with-opacnewscontent.patch (text/plain), 2.13 KB, created by
Marcel de Rooy
on 2017-04-07 06:31:01 UTC
(
hide
)
Description:
Bug 18121: Replace opac_news.new with opac_news.content in notices templates
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-04-07 06:31:01 UTC
Size:
2.13 KB
patch
obsolete
>From 238f3c2ea7698d20212e85bae275a8e020e71a4a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 15 Feb 2017 08:39:23 +0000 >Subject: [PATCH] Bug 18121: Replace opac_news.new with opac_news.content in > notices templates >Content-Type: text/plain; charset=utf-8 > >Bug 17960 replaces opac_news.new with opac_news.content, we can replace >the content of the notices' templates automatically. > >Test plan: >Checkout a commit prior to bug 17960. Install a new DB with sample data. >You should have notices with <<opac_news.new>> > >Switch to a branch with this patch, on top of master > >Execute the updatedatabase.pl sript >=> The notices with opac_news.new should have been replaced with >opac_news.content > >Signed-off-by: Srdjan <srdjan@catalyst.net.nz> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > installer/data/mysql/updatedatabase.pl | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index cee8ad0..2ad9c9f 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -13868,16 +13868,12 @@ if( CheckVersion( $DBversion ) ) { > $dbh->do(q|ALTER TABLE opac_news CHANGE COLUMN new content text NOT NULL|); > } > >- my ( $used_in_templates ) = $dbh->selectrow_array(q| >- SELECT COUNT(*) FROM letter WHERE content LIKE "%<<opac_news.new>>%"; >+ $dbh->do(q| >+ UPDATE letter SET content = REPLACE(content, "<<opac_news.new>>", "<<opac_news.content>>") WHERE content LIKE "%<<opac_news.new>>%" > |); >- if ( $used_in_templates ) { >- print "WARNING - It seems that you are using the opac_news.new column in your notice templates\n"; >- print "Since it has now been renamed with opac_news.content, you should update them.\n"; >- } > > SetVersion( $DBversion ); >- print "Upgrade to $DBversion done (Bug 17960 - Rename opac_news with opac_news.content)\n"; >+ print "Upgrade to $DBversion done (Bug 17960 - Rename opac_news with opac_news.content (template notices have been updated!))\n"; > } > > $DBversion = "16.12.00.008"; >-- >2.1.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 18121
:
60243
|
61350
| 61958