[Bug 14248] New: Optionally display authorship for news items
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Bug ID: 14248 Summary: Optionally display authorship for news items Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: gmcharlt@gmail.com Reporter: xarragon@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 14247 This patch adds the ability to display the name of the user who authored a specific news item. It will by default work as before, not displaying any information. Enabling it will make Koha more suitable as a simple CMS and/or blog. It depends on the patches for bugs 14246 and 14247. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #1 from Martin Persson <xarragon@gmail.com> --- Created attachment 39363 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39363&action=edit Changes to templates and perl files to enable display Should merge with f52084df0e395fdf89d80ca2fd77844273a8cf7c -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Martin Persson <xarragon@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39363|0 |1 is obsolete| | --- Comment #2 from Martin Persson <xarragon@gmail.com> --- Comment on attachment 39363 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39363 Changes to templates and perl files to enable display Needs to be changed to allow OPAC/Staff display preferences indenpendently. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Martin Persson <xarragon@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |xarragon@gmail.com Status|NEW |Needs Signoff --- Comment #3 from Martin Persson <xarragon@gmail.com> --- Created attachment 39415 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39415&action=edit Template/script changes to handle news author display Depends on bug 14247 patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Martin Persson <xarragon@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #4 from Martin Persson <xarragon@gmail.com> --- Test plan: * Apply both dependant patches, in order: 14246, 14247 * Apply this patch * Go to Staff client, Select 'Tools' -> 'News'; there should be a new column named 'Author' for news items. * Add a new news item; the full name of the current user should be displayed in the 'Author' column. * Go to 'Home' -> 'Administration' -> 'Global system preferences' -> 'Tools', change the display of news author from 'None' to either of the other values. * Check the OPAC start page, the author should only be shown if set to 'both' or 'opac only'. * Check the Staff client start page, the author should only be shown if set to 'both' or 'staff client only'. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #5 from Marc Véron <veron@veron.ch> --- Created attachment 39441 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=39441&action=edit [Singned-off] Bug 14248: Optionally display the author for news Based on the changes in bugs 14246 and 14247, this final patch enables the display of the user's title, first- and surname for individual news items, making Koha suitable as a simple blog. Depends on patch for bug 14247. Sponsored-by: Halland County Library Works as expected. Signed-off-by: Marc Véron <veron@veron.ch> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch Attachment #39415|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Status|Signed Off |Failed QA --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- Martin, Actually the 3 patches (from bug 14246 and 14247) could have been attached to this bug report. No need to open 3 bug reports for 1 enh :) I have some remarks concerning this patch: 1/ You add changes to a module file, in most of the cases, you have to provide tests to make sure there won't be regression later. Here you have to test C4::NewsChannels::get_opac_news, have a look at t/db_dependent/NewsChannels.t 2/ A value for a pref can be retrieved directly from the template. I would tend not to pass the display_news_author variable to the template, but check/compare the syspref value in the template. Since this is debatable, it's not blocker. Marked as Failed QA for 1. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Viktor Sarge <viktor.sarge@regionhalland.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |viktor.sarge@regionhalland. | |se -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #7 from Viktor Sarge <viktor.sarge@regionhalland.se> --- Jonathan - glad to hear we could have done all three in one thread. That was my fault. I recalled guidelines being to separate different types of changes in different threads (database change, syspref to use it and display logic in different patches). But that might be for larger patches or all together wrong(?) Thanks for swift testing Marc & Jonathan! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #8 from Martin Persson <xarragon@gmail.com> --- Thanks for the feedback. Tests will be added; omitting them was an oversight, albeit a greivous one. I apologzie for that. I saw the other way of handling data to the template but was not sure which one was better; I realize that simple display options really have no business poking through to the business logic in the Perl file itself. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Viktor Sarge from comment #7)
Jonathan - glad to hear we could have done all three in one thread. That was my fault. I recalled guidelines being to separate different types of changes in different threads (database change, syspref to use it and display logic in different patches). But that might be for larger patches or all together wrong(?)
Not really, we split big feature/enh in small bug reports if we can split it, and if it makes sense. Most of the time the DB and sysprefs changes are attached to the same bug report. I would prefer to see them managed in a separate patch, but not everybody does it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Martin Persson <xarragon@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #39441|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248
--- Comment #10 from Martin Persson <xarragon@gmail.com> ---
Created attachment 43046
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43046&action=edit
Bug 14248 - Optionally display authorship for news
Test plan:
* Apply dependant patches 14246 and 14247.
* Apply current patch.
* Log into the Staff client, go to
'Administration' -> 'Global Preferences' -> 'Tools',
a new section titled 'News' should appear with a single option named
'NewsAuthorDisplay'.
Available values should be 'Not at all', 'OPAC only', 'Staff client only' and
Both OPAC and staff client'. By default the value should be 'Not at all'
(to mimic existing behaviour, important!).
* Change the value to something different and save the changes.
* Go to 'Tools' -> 'News' and add some news items (at least 2).
* Use the MySQL command line tool to edit the opac_news table,
removing the user id from one of the news items:
$ mysql -u kohaadmin -p -D koha
> SELECT `idnew`, `title`, `borrowernumber` FROM `opac_news`;
* Make a mental note of one of the 'newid' numbers to change.
> UPDATE `opac_news` SET `borrowernumber` = NULL WHERE `idnew` =
<your-id-here>;
* Now one of the news items will have no user id, and no author should be
shown for it.
* Go to OPAC and Staff client and make sure the display modes works as
intended.
* Repeat for all values, making sure that the settings works as intended.
* The changed news item should have no author info shown at any time.
* The unchanged news item should show your own user name if the
settings match the section where it is displayed.
Sponsored-By: Halland County Library
--
You are receiving this mail because:
You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #11 from Martin Persson <xarragon@gmail.com> --- The last, updated patch has been rewritten to make use of the Koha Preferences system rather than the template variables. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Martin Persson <xarragon@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #12 from Martin Persson <xarragon@gmail.com> --- There are tests included in the original bug, 14246. They cover the changes in NewsChannel.pm, ar they enough to pass QA? Changing to 'Needs Signoff', please reset if not appropiate. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248
Marc Véron <veron@veron.ch> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #43046|0 |1
is obsolete| |
--- Comment #13 from Marc Véron <veron@veron.ch> ---
Created attachment 43421
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43421&action=edit
Bug 14248 - Optionally display authorship for news
Test plan:
* Apply dependant patches 14246 and 14247.
* Apply current patch.
* Log into the Staff client, go to
'Administration' -> 'Global Preferences' -> 'Tools',
a new section titled 'News' should appear with a single option named
'NewsAuthorDisplay'.
Available values should be 'Not at all', 'OPAC only', 'Staff client only' and
Both OPAC and staff client'. By default the value should be 'Not at all'
(to mimic existing behaviour, important!).
* Change the value to something different and save the changes.
* Go to 'Tools' -> 'News' and add some news items (at least 2).
* Use the MySQL command line tool to edit the opac_news table,
removing the user id from one of the news items:
$ mysql -u kohaadmin -p -D koha
> SELECT `idnew`, `title`, `borrowernumber` FROM `opac_news`;
* Make a mental note of one of the 'newid' numbers to change.
> UPDATE `opac_news` SET `borrowernumber` = NULL WHERE `idnew` =
<your-id-here>;
* Now one of the news items will have no user id, and no author should be
shown for it.
* Go to OPAC and Staff client and make sure the display modes works as
intended.
* Repeat for all values, making sure that the settings works as intended.
* The changed news item should have no author info shown at any time.
* The unchanged news item should show your own user name if the
settings match the section where it is displayed.
Sponsored-By: Halland County Library
Tested on top of Bugs 1246 and 1247, works as advertised.
Note: Some whitespaces changed / removed in koha-news.tt to pass qa tools.
Signed-off-by: Marc Véron <veron@veron.ch>
--
You are receiving this mail because:
You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtompset@hotmail.com --- Comment #14 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Jonathan Druart from comment #6)
Martin,
Actually the 3 patches (from bug 14246 and 14247) could have been attached to this bug report. No need to open 3 bug reports for 1 enh :)
I agree. However, 14246 and 14247 are passable in my opinion. This one is not.
I have some remarks concerning this patch: 1/ You add changes to a module file, in most of the cases, you have to provide tests to make sure there won't be regression later. Here you have to test C4::NewsChannels::get_opac_news, have a look at t/db_dependent/NewsChannels.t
There are no tests added. Suggestion: test to see that the title, firstname, and surname keys exist in at least the first row of results. This is why I'm leaving it failed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Mark, thx for clearing this up - I see now how the 3 patches go together. I think all we are missing is the tests asked for on this bug report. Martin - small steps are great - this just went a little too far :) It would have been ok to do the database changes and the feature in one go in this case, as this is a nice contained feature. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #16 from Martin Persson <xarragon@gmail.com> --- Yes, thanks. This was the first ticket I created of any complexity and it got messy. I am sorry, I have since learned. I am now starting to complement it to have it pass QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #17 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 43766 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43766&action=edit Bug 14248: Regression tests requested TEST PLAN --------- 1) apply patch 2) prove -v t/db_dependent/NewsChannels.t 3) run koha qa test tools. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Martin Persson <xarragon@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43766|0 |1 is obsolete| | --- Comment #18 from Martin Persson <xarragon@gmail.com> --- Created attachment 43769 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43769&action=edit Bug 14248: Regression tests requested TEST PLAN --------- 1) apply patch 2) prove -v t/db_dependent/NewsChannels.t 3) run koha qa test tools. Signed-off-by: Martin Persson <xarragon@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #19 from Martin Persson <xarragon@gmail.com> --- Not sure if it is enough to sign off on tests for my own code made by a third party, but there you go. Not touching status. All tests passes on a clean test system. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #20 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- If you are ok with the tests, signing them off is perfectly fine. Just important you don't sign your own things :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248
--- Comment #21 from Katrin Fischer <katrin.fischer@bsz-bw.de> ---
Created attachment 43916
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43916&action=edit
[PASSED QA] Bug 14248 - Optionally display authorship for news
Test plan:
* Apply dependant patches 14246 and 14247.
* Apply current patch.
* Log into the Staff client, go to
'Administration' -> 'Global Preferences' -> 'Tools',
a new section titled 'News' should appear with a single option named
'NewsAuthorDisplay'.
Available values should be 'Not at all', 'OPAC only', 'Staff client only' and
Both OPAC and staff client'. By default the value should be 'Not at all'
(to mimic existing behaviour, important!).
* Change the value to something different and save the changes.
* Go to 'Tools' -> 'News' and add some news items (at least 2).
* Use the MySQL command line tool to edit the opac_news table,
removing the user id from one of the news items:
$ mysql -u kohaadmin -p -D koha
> SELECT `idnew`, `title`, `borrowernumber` FROM `opac_news`;
* Make a mental note of one of the 'newid' numbers to change.
> UPDATE `opac_news` SET `borrowernumber` = NULL WHERE `idnew` =
<your-id-here>;
* Now one of the news items will have no user id, and no author should be
shown for it.
* Go to OPAC and Staff client and make sure the display modes works as
intended.
* Repeat for all values, making sure that the settings works as intended.
* The changed news item should have no author info shown at any time.
* The unchanged news item should show your own user name if the
settings match the section where it is displayed.
Sponsored-By: Halland County Library
Tested on top of Bugs 1246 and 1247, works as advertised.
Note: Some whitespaces changed / removed in koha-news.tt to pass qa tools.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
--
You are receiving this mail because:
You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #22 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 43917 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43917&action=edit [PASSED QA] Bug 14248: Regression tests requested TEST PLAN --------- 1) apply patch 2) prove -v t/db_dependent/NewsChannels.t 3) run koha qa test tools. Signed-off-by: Martin Persson <xarragon@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #23 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 43918 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=43918&action=edit Bug 12428: QA Follow-up: Wrap borrower's title in a span to make it possible to hide I think showing the title with the user name is quite unusual for Koha. Wrapping the title in a span with a unique class makes it possible to hide it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43769|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #43421|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #24 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- There is just one small thing that is irritating to me about this patch set - the display of the news author's name: <title> <firstname> <surname>. Thinking of blogs and similar I think the <title> is not needed. I think we could maybe remove it. I provided a follow-up wrapping the title into a span with a unique class so now you can hide it if you want to. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #25 from Viktor Sarge <viktor.sarge@regionhalland.se> --- Thanks Katrin! We don't use title either, but we solved that by removing the field in the "add patron" form and without any value in the field things display ok without having to mod other areas/reports that includes title. I like the span approach. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 --- Comment #26 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I was not sure if it was from your specification that it showed up in the patch - so I didn't want to remove it totally. We still could I guess - it will show now by default until you remove it. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14248 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #27 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. Thanks Martin, Mark and Katrina! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org