[Bug 17960] New: Rename opac_news.new
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Bug ID: 17960 Summary: Rename opac_news.new Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org 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. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |14757 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14757 [Bug 14757] Allow the use of Template Toolkit syntax for slips and notices -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59406 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59406&action=edit Bug 17960: Add a test to highlight the issue With only this patch applied, proving t/db_dependent/Koha/News.t will return "Attempt to bless into a reference at /home/vagrant/kohaclone/Koha/Object.pm line 78." -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59407 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59407&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59408 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59408&action=edit Bug 17960: Update installed files git grep opac_news.new installer should not return any occurrences in sql files -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59409 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59409&action=edit Bug 17960: DBIC Schema changes for opac_news.content -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Rename opac_news.new |Rename opac_news.new with | |opac_news.content -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |17966 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17966 [Bug 17966] TT syntax for notices - Prove that ISSUESLIP is compatible -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |mtompset@hotmail.com --- Comment #5 from M. Tompsett <mtompset@hotmail.com> --- On my non-kohadevbox I drop'd the db and created it, applied all the patches, ran a web install only doing mandatory default stuff, and then I tried this: mtompset@debian:~/kohaclone$ prove t/db_dependent/Koha/News.t t/db_dependent/Koha/News.t .. 1/5 # Failed test 'The content method return the content of the news' # at t/db_dependent/Koha/News.t line 50. # got: '' # expected: undef # Looks like you failed 1 test of 5. t/db_dependent/Koha/News.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/5 subtests Test Summary Report ------------------- t/db_dependent/Koha/News.t (Wstat: 256 Tests: 5 Failed: 1) Failed test: 4 Non-zero exit status: 1 Files=1, Tests=5, 1 wallclock secs ( 0.02 usr 0.00 sys + 0.72 cusr 0.01 csys = 0.75 CPU) Result: FAIL While I would have expected a failure (and I did get one) before applying the last three on an older DB, I was not expect a failure after the upgrade and all patches applied. Nor after a drop and recreate web install. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59488 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59488&action=edit Bug 17960: Add opac_news.content values in tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com Status|Needs Signoff |Failed QA --- Comment #7 from Josef Moravec <josef.moravec@gmail.com> --- There is missing content in opac-maint.tt, nad intranet-main.tt see git grep koha_new.new -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 59768 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59768&action=edit Bug 17960: Replace missing occurrences -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #59406|0 |1 is obsolete| | Attachment #59407|0 |1 is obsolete| | Attachment #59408|0 |1 is obsolete| | Attachment #59409|0 |1 is obsolete| | Attachment #59488|0 |1 is obsolete| | Attachment #59768|0 |1 is obsolete| | --- Comment #9 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 59772 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59772&action=edit [SIGNED-OFF] Bug 17960: Add a test to highlight the issue With only this patch applied, proving t/db_dependent/Koha/News.t will return "Attempt to bless into a reference at /home/vagrant/kohaclone/Koha/Object.pm line 78." Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #10 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 59773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59773&action=edit [SIGNED-OFF] 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #11 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 59774 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59774&action=edit [SIGNED-OFF] Bug 17960: Update installed files git grep opac_news.new installer should not return any occurrences in sql files Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #12 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 59775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59775&action=edit [SIGNED-OFF] Bug 17960: DBIC Schema changes for opac_news.content Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #13 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 59776 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59776&action=edit [SIGNED-OFF] Bug 17960: Add opac_news.content values in tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #14 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 59777 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59777&action=edit [SIGNED-OFF] Bug 17960: Replace missing occurrences Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #59772|0 |1 is obsolete| | Attachment #59773|0 |1 is obsolete| | Attachment #59774|0 |1 is obsolete| | Attachment #59775|0 |1 is obsolete| | Attachment #59776|0 |1 is obsolete| | Attachment #59777|0 |1 is obsolete| | --- Comment #15 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 59861 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59861&action=edit Bug 17960: Add a test to highlight the issue With only this patch applied, proving t/db_dependent/Koha/News.t will return "Attempt to bless into a reference at /home/vagrant/kohaclone/Koha/Object.pm line 78." Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #16 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 59862 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59862&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #17 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 59863 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59863&action=edit Bug 17960: Update installed files git grep opac_news.new installer should not return any occurrences in sql files Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #18 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 59864 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59864&action=edit Bug 17960: DBIC Schema changes for opac_news.content Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #19 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 59865 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59865&action=edit Bug 17960: Add opac_news.content values in tests Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #20 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 59866 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=59866&action=edit Bug 17960: Replace missing occurrences Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |NOTICE - If you are using release notes| |opac_news.new in your | |notice templates, you | |should update it to | |opac_news.content CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #21 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to master for 17.05, thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I can see that this change makes sense, but do we strictly need it for 16.11.x? I'd like to avoid db changes if possible and not sure if this fixes a current bug. It will also require to update notice templates. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #23 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #22)
I can see that this change makes sense, but do we strictly need it for 16.11.x? I'd like to avoid db changes if possible and not sure if this fixes a current bug. It will also require to update notice templates.
No, I do not think we need to backport it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED --- Comment #24 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Thx for the quick answer! This won't be included in 16.11.x. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #25 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Was wondering - why not have a database update fix this automatically? Should only be a find&replace kind of thing? ) NOTICE - If you are using opac_news.new in your notice templates, you should update it to opac_news.content -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #26 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #25)
Was wondering - why not have a database update fix this automatically? Should only be a find&replace kind of thing? )
NOTICE - If you are using opac_news.new in your notice templates, you should update it to opac_news.content
I would prefer to add things like bug 17898 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #27 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- For SQL it's hard, I think for notice templates it shoudl work alright with a database update, because the placeholders are easy to select. Something like this might work: UPDATE letter SET content = REPLACE(content, '<<opac_news.new>>', '<<opac_news.content>>'); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 --- Comment #28 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Yes, I was thinking about reports. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18121 --- Comment #29 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #25)
Was wondering - why not have a database update fix this automatically? Should only be a find&replace kind of thing?
See bug 18121. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18121 [Bug 18121] Rename opac_news.new with opac_news.content - replace notice template -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |z.tajoli@cineca.it Text to go in the|NOTICE - If you are using |The db field opac_news.new release notes|opac_news.new in your |is renamed |notice templates, you |opac_news.content. |should update it to |So if |opac_news.content |you are using opac_news.new | |in your notice templates, | |you should update it to | |opac_news.content. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17960 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|The db field opac_news.new |The database column release notes|is renamed |opac_news.new is renamed to |opac_news.content. |opac_news.content. The |So if |notice templates using that |you are using opac_news.new |placeholder should have |in your notice templates, |been updated automatically |you should update it to |(bug 18121). |opac_news.content. | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org