Bug 20101 - Cronjob automatic_item_modification_by_age.pl does not log run in action logs
Summary: Cronjob automatic_item_modification_by_age.pl does not log run in action logs
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Kyle M Hall
QA Contact: Marcel de Rooy
URL:
Keywords:
: 20095 (view as bug list)
Depends on: 11023
Blocks:
  Show dependency treegraph
 
Reported: 2018-01-30 16:09 UTC by Kyle M Hall
Modified: 2020-05-14 16:10 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06, 19.05.11


Attachments
Bug 20101 - Cronjob automatic_item_modification_by_age.pl does not log run in action logs (1.29 KB, patch)
2018-01-30 16:11 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20101 - Cronjob automatic_item_modification_by_age.pl does not log run in action logs (1.34 KB, patch)
2018-01-30 17:20 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 20101: Followup - quiet warns (1.86 KB, patch)
2018-01-30 17:57 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 20101: Followup - quiet warns (1.92 KB, patch)
2018-01-30 17:59 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20101: Cronjob automatic_item_modification_by_age.pl does not log run in action logs (1.38 KB, patch)
2020-04-09 17:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20101: Followup - quiet warns (1.94 KB, patch)
2020-04-09 17:33 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20101: Follow-up - quiet warns (1.94 KB, patch)
2020-04-13 11:06 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20101: Follow-up - No need to clear syspref cache (1018 bytes, patch)
2020-04-13 11:20 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 20101: Cronjob automatic_item_modification_by_age.pl does not log run in action logs (1.46 KB, patch)
2020-04-17 07:30 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 Kyle M Hall 2018-01-30 16:09:48 UTC
C4::Log::cronlogaction() was never implemented in automatic_item_modification_by_age.pl.
Comment 1 Kyle M Hall 2018-01-30 16:11:53 UTC
Created attachment 71064 [details] [review]
Bug 20101 - Cronjob automatic_item_modification_by_age.pl does not log run in action logs

C4::Log::cronlogaction() was never implemented in automatic_item_modification_by_age.pl.

Test Plan:
1) Apply this patch
2) Enable CronjobLog
3) Run automatic_item_modification_by_age.pl succesfully
4) Note the run is noted in the action logs
Comment 2 M. Tompsett 2018-01-30 17:20:09 UTC
Created attachment 71068 [details] [review]
Bug 20101 - Cronjob automatic_item_modification_by_age.pl does not log run in action logs

C4::Log::cronlogaction() was never implemented in automatic_item_modification_by_age.pl.

Test Plan:
1) Apply this patch
2) Enable CronjobLog
3) Run automatic_item_modification_by_age.pl succesfully
4) Note the run is noted in the action logs

NOTE: Create rule in tools!

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 3 M. Tompsett 2018-01-30 17:57:15 UTC
Created attachment 71069 [details] [review]
Bug 20101: Followup - quiet warns

If the user has never run the tools, the system preference
won't exist, the JSON will be empty, and warns will trigger.

TEST PLAN
---------
1) back up systempreferences and log files as desired.
2) in sql client:
    S> delete from systempreferences where
    variable='automatic_item_modification_by_age_configuration';
    S> quit
3) run the following commands on a kohadevbox:
    echo  | sudo tee /var/log/koha/kohadev/plack-error.log
    restart_all
4) test the first patch
5) cat /var/log/koha/kohadev/plack-error.log
   -- notice there is a nasty warn
6) apply this patch
7) repeat steps 3-5
   -- this time no nasty warns
8) run koha qa test tools
Comment 4 Kyle M Hall 2018-01-30 17:59:48 UTC
Created attachment 71070 [details] [review]
Bug 20101: Followup - quiet warns

If the user has never run the tools, the system preference
won't exist, the JSON will be empty, and warns will trigger.

TEST PLAN
---------
1) back up systempreferences and log files as desired.
2) in sql client:
    S> delete from systempreferences where
    variable='automatic_item_modification_by_age_configuration';
    S> quit
3) run the following commands on a kohadevbox:
    echo  | sudo tee /var/log/koha/kohadev/plack-error.log
    restart_all
4) test the first patch
5) cat /var/log/koha/kohadev/plack-error.log
   -- notice there is a nasty warn
6) apply this patch
7) repeat steps 3-5
   -- this time no nasty warns
8) run koha qa test tools

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 George Williams (NEKLS) 2018-01-30 20:20:31 UTC
*** Bug 20095 has been marked as a duplicate of this bug. ***
Comment 6 Katrin Fischer 2018-02-04 12:21:50 UTC
Looking at the logs the interface is shown as 'opac', should this not be command-line?

Otherwise patches work ok, but please fix the patch subjects to match:
https://wiki.koha-community.org/wiki/Commit_messages
Comment 7 Kyle M Hall 2020-04-09 17:33:33 UTC
Created attachment 102652 [details] [review]
Bug 20101: Cronjob automatic_item_modification_by_age.pl does not log run in action logs

C4::Log::cronlogaction() was never implemented in automatic_item_modification_by_age.pl.

Test Plan:
1) Apply this patch
2) Enable CronjobLog
3) Run automatic_item_modification_by_age.pl succesfully
4) Note the run is noted in the action logs

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 8 Kyle M Hall 2020-04-09 17:33:43 UTC
Created attachment 102653 [details] [review]
Bug 20101: Followup - quiet warns

If the user has never run the tools, the system preference
won't exist, the JSON will be empty, and warns will trigger.

TEST PLAN
---------
1) back up systempreferences and log files as desired.
2) in sql client:
    S> delete from systempreferences where
    variable='automatic_item_modification_by_age_configuration';
    S> quit
3) run the following commands on a kohadevbox:
    echo  | sudo tee /var/log/koha/kohadev/plack-error.log
    restart_all
4) test the first patch
5) cat /var/log/koha/kohadev/plack-error.log
   -- notice there is a nasty warn
6) apply this patch
7) repeat steps 3-5
   -- this time no nasty warns
8) run koha qa test tools

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Kyle M Hall 2020-04-09 17:51:37 UTC
(In reply to Katrin Fischer from comment #6)
> Looking at the logs the interface is shown as 'opac', should this not be
> command-line?

The interface is labeled as 'cron' in my testing, and is not modified by this patch.
Comment 10 Marcel de Rooy 2020-04-10 08:14:01 UTC
C4::Context::clear_syspref_cache;

I think there should be no need to do such thing here.
Comment 11 Marcel de Rooy 2020-04-10 08:16:24 UTC
        * Commit title does not contain 'follow-up' correctly spelt - ef873f25fb
Comment 12 Kyle M Hall 2020-04-13 11:06:31 UTC
Created attachment 102809 [details] [review]
Bug 20101: Follow-up - quiet warns

If the user has never run the tools, the system preference
won't exist, the JSON will be empty, and warns will trigger.

TEST PLAN
---------
1) back up systempreferences and log files as desired.
2) in sql client:
    S> delete from systempreferences where
    variable='automatic_item_modification_by_age_configuration';
    S> quit
3) run the following commands on a kohadevbox:
    echo  | sudo tee /var/log/koha/kohadev/plack-error.log
    restart_all
4) test the first patch
5) cat /var/log/koha/kohadev/plack-error.log
   -- notice there is a nasty warn
6) apply this patch
7) repeat steps 3-5
   -- this time no nasty warns
8) run koha qa test tools

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 13 Kyle M Hall 2020-04-13 11:20:57 UTC
Created attachment 102810 [details] [review]
Bug 20101: Follow-up - No need to clear syspref cache
Comment 14 Jonathan Druart 2020-04-15 14:50:59 UTC
IMO the 2 follow-ups do not belong to this bug report. I would obsolete them, then PQA/push that first patch that waited for too long already.
Comment 15 Marcel de Rooy 2020-04-17 07:30:34 UTC
Created attachment 103118 [details] [review]
Bug 20101: Cronjob automatic_item_modification_by_age.pl does not log run in action logs

C4::Log::cronlogaction() was never implemented in automatic_item_modification_by_age.pl.

Test Plan:
1) Apply this patch
2) Enable CronjobLog
3) Run automatic_item_modification_by_age.pl succesfully
4) Note the run is noted in the action logs

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 16 Marcel de Rooy 2020-04-17 07:30:51 UTC
(In reply to Jonathan Druart from comment #14)
> IMO the 2 follow-ups do not belong to this bug report. I would obsolete
> them, then PQA/push that first patch that waited for too long already.

Agreed
Comment 17 Martin Renvoize 2020-04-17 08:18:46 UTC
This sort of feels like something that could move into the Koha::Script base class at some point.. however not here.
Comment 18 Martin Renvoize 2020-04-17 08:20:31 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 19 Joy Nelson 2020-05-05 23:08:37 UTC
backported to 19.11.x for 19.11.06
Comment 20 Lucas Gass 2020-05-14 16:10:23 UTC
backported to 19.05.x for 19.05.11