Bug 17960: Rename opac_news.new with opac_news.content
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 17 Jan 2017 07:29:23 +0000 (08:29 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 6 Feb 2017 17:42:12 +0000 (17:42 +0000)
commita233f06574f5ca6417245cba58162af1360bf327
tree7fef17ad28d57dc5bf3616e2b9da0620e924c922
parenta6b13fbcb315d3749da23d494c11e4b6f9e70165
Bug 17960: Rename opac_news.new with opac_news.content

The field opac_news.new is very confusing and should be renamed.
If you want to access it via Koha::NewsItem you will have trouble:

  use Koha::News;
  my $news_item = Koha::News->next;
  say $news_item->new;

=> Attempt to bless into a reference at /home/vagrant/kohaclone/Koha/Object.pm line 78.

This patchset is going to rename this DB field to opac_news_content instead.

Since the opac_news.new can be used in notice templates, we need to warn the
user during the update DB process that some templates must be updated.

Test plan:
0/ Apply the first patch "Add a test to highlight the issue" and confirm that
the test fail
1/ Apply this second patch
2/ Execute the DB entry
3/ Confirm that you get a warning if at least one of your notice templates is
using opac_news.new
4/ Confirm that the test new pass
5/ Add/update and delete a news
6/ Confirm that the RSS new feed still works as expected

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
installer/data/mysql/atomicupdate/bug_17960.perl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql
koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-news-rss.tt
t/db_dependent/Koha/News.t
t/db_dependent/NewsChannels.t
tools/koha-news.pl