Bug 10463 - Quote of the day feature not selecting random quotes
Summary: Quote of the day feature not selecting random quotes
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-13 13:37 UTC by David Noe
Modified: 2014-12-07 20:02 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10463 - Quote of the day feature not selecting random quotes (2.15 KB, patch)
2013-06-13 13:48 UTC, Kyle M Hall
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 10463 - Quote of the day feature not selecting random quotes (2.20 KB, patch)
2013-07-17 04:12 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
Bug 10463 - Quote of the day feature not selecting random quotes (2.29 KB, patch)
2013-07-25 12:04 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Noe 2013-06-13 13:37:20 UTC
When the Quote of the Day tool selects a new new quote, it updates the timestamp and does not take the timezone into account.  Thus the time is set to +4 hours (e.g. 2013-06-11 13:33:48 when the time is 2013-06-11 09:33:48).  It then repeats the same quote every day.

To replicate:

set Administration >> System preferences >> OPAC preferences >> Features >> QuoteOfTheDay to Enable

In Home >> Tools >> Quote Editor, add several quotes.

In the opac, refresh the home page. You should get a quote of the day at the top.

mysql> select * from quotes;

note the timestamp of the quote selected by the tool. It will not match the date on the machine.

If you change the date to the previous date and refresh the opac, the tool wlill select another quote, which will not change unless forced.
Comment 1 Kyle M Hall 2013-06-13 13:48:48 UTC Comment hidden (obsolete)
Comment 2 Srdjan Jankovic 2013-07-17 04:12:18 UTC Comment hidden (obsolete)
Comment 3 Marcel de Rooy 2013-07-25 12:04:00 UTC
Created attachment 19947 [details] [review]
Bug 10463 - Quote of the day feature not selecting random quotes

When the Quote of the Day tool selects a new new quote, it updates the
timestamp and does not take the timezone into account.  Thus the time is
set to +4 hours (e.g. 2013-06-11 13:33:48 when the time is 2013-06-11
        09:33:48).  It then repeats the same quote every day.

To replicate:

set Administration >> System preferences >> OPAC preferences >> Features
>> QuoteOfTheDay to Enable

In Home >> Tools >> Quote Editor, add several quotes.

In the opac, refresh the home page. You should get a quote of the day at
the top.

mysql> select * from quotes;

note the timestamp of the quote selected by the tool. It will not match
the date on the machine.

If you change the date to the previous date and refresh the opac, the
tool wlill select another quote, which will not change unless forced.

Test Plan:
1) Remove all your quotes and import a fresh set
2) Enable the quote of the day and view the opac
3) Look at your quotes table and note the timestamp is incorrect
4) Repeat steps 1 and 2
5) Look at your quotes table and note the timestamp is now correct

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2013-07-25 12:08:32 UTC
QA Comment:
Looks good to me. No koha-qa complaints..

Not blocking this patch, but just wondering why we are continuously updating the timestamp of the selected quote for everyone hitting the opac. We do not need a timestamp here, but just a date. And only the first user of the day should trigger a table update. After that no updates are needed for the rest of the day..

Passed QA
Comment 5 Marcel de Rooy 2013-07-25 12:16:06 UTC
(In reply to M. de Rooy from comment #4)
> Not blocking this patch, but just wondering why we are continuously updating
> the timestamp of the selected quote for everyone hitting the opac. We do not
> need a timestamp here, but just a date. And only the first user of the day
> should trigger a table update. After that no updates are needed for the rest
> of the day..

This is not a correct observation however. So just ignore it..
Comment 6 Galen Charlton 2013-07-25 15:05:34 UTC
Pushed to master.  Thanks, Kyle!
Comment 7 Tomás Cohen Arazi 2013-08-16 15:57:50 UTC
This patch has been pushed to 3.12.x, will be in 3.12.4.

Thanks Kyle!
Comment 8 Bernardo Gonzalez Kriegel 2013-09-13 22:52:30 UTC
Pushed to 3.10.x, will be in 3.10.11