Bug 29216 - Correct --where documentation in update_patrons_category.pl
Summary: Correct --where documentation in update_patrons_category.pl
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Caroline Cyr La Rose
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-12 21:23 UTC by Caroline Cyr La Rose
Modified: 2021-10-23 02:15 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: String patch
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05,20.11.11


Attachments
Bug 29216: Correct --where documentation in update_patrons_category.pl (1.26 KB, patch)
2021-10-12 21:32 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 29216: Correct --where documentation in update_patrons_category.pl (1.31 KB, patch)
2021-10-13 18:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 29216: Correct --where documentation in update_patrons_category.pl (1.27 KB, patch)
2021-10-13 21:04 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 29216: Correct --where documentation in update_patrons_category.pl (1.27 KB, patch)
2021-10-15 14:04 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 29216: Correct --where documentation in update_patrons_category.pl (1.32 KB, patch)
2021-10-15 15:30 UTC, David Nind
Details | Diff | Splinter Review
Bug 29216: Correct --where documentation in update_patrons_category.pl (1.38 KB, patch)
2021-10-19 22:16 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2021-10-12 21:23:48 UTC
Hi,

This is absolutely very minor, but I was reading the in-code documentation for update_patrons_category.pl for the --where parameter and I think there is an error/typo.

133 =item B<--where $conditions>
134 
135 Use this option to specify a condition built with columns from the borrowers table
136 
137 e.g.
138 --where 'email IS NULL'
139 will update all patrons with no value for email
140 
141 --where 'categorycode LIKE "%CHILD"'
142 will update all patrons with a category ending in CHILD.
143 
144 --where 'categorycode LIKE RESIDENT%'
145 will update all patrons whose category does not begin with RESIDENT.


I think this last example should be  
144 --where 'categorycode NOT LIKE RESIDENT%'
to match with the explanation below

I may be wrong, though... I will submit a patch correcting this how I think it should be and I will let the experts verify it to make sure. :)

Caroline
Comment 1 Caroline Cyr La Rose 2021-10-12 21:32:43 UTC
Created attachment 126131 [details] [review]
Bug 29216: Correct --where documentation in update_patrons_category.pl

This patch corrects one of the examples for the --where parameter in the
update_patrons_category.pl script.

To test:

1. Apply patch
2. In your favourite text editor, open misc/cronjobs/update_patrons_category.pl
3. Look for the documentation for the --where parameter (around line 133 or so)
4. Make sure the examples and their explanations make sense
5. Sign off :)
Comment 2 David Nind 2021-10-13 18:25:03 UTC
Created attachment 126231 [details] [review]
Bug 29216: Correct --where documentation in update_patrons_category.pl

This patch corrects one of the examples for the --where parameter in the
update_patrons_category.pl script.

To test:

1. Apply patch
2. In your favourite text editor, open misc/cronjobs/update_patrons_category.pl
3. Look for the documentation for the --where parameter (around line 133 or so)
4. Make sure the examples and their explanations make sense
5. Sign off :)

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Joonas Kylmälä 2021-10-13 20:42:30 UTC
The two --where examples with categorycode in them don't make sense, you can only define one categorycode to the script with the --from parameter so those examples don't do anything useful and might make the user think it is possible to have wild card selection for the --from category. I think we should just remove those examples instead.
Comment 4 Caroline Cyr La Rose 2021-10-13 21:04:21 UTC
Created attachment 126239 [details] [review]
Bug 29216: Correct --where documentation in update_patrons_category.pl

This patch removes two misleading examples of the --where parameter
documentation in update_patrons_category.pl

To test:

1. Apply patch
2. In your favourite text editor, open misc/cronjobs/update_patrons_category.pl
3. Look for the documentation for the --where parameter (around line 133 or so)
4. Make sure the examples and their explanations make sense
5. Sign off :)
Comment 5 Caroline Cyr La Rose 2021-10-13 21:05:53 UTC
Thanks David for signing off and Joonas for double checking. I removed the two examples completely. There is still the --where 'email IS NULL' example to illustrate this parameter.
Comment 6 Joonas Kylmälä 2021-10-13 21:18:35 UTC
Caroline thanks! Unfortunately the new patch is based on the now obsoleted patch so it doesn't apply on top of master version. Could you do it on top of master version again and re-submit?
Comment 7 Caroline Cyr La Rose 2021-10-15 14:04:26 UTC
Created attachment 126340 [details] [review]
Bug 29216: Correct --where documentation in update_patrons_category.pl

This patch removes two misleading examples of the --where parameter
documentation in update_patrons_category.pl

To test:

1. Apply patch
2. In your favourite text editor, open misc/cronjobs/update_patrons_category.pl
3. Look for the documentation for the --where parameter (around line 133 or so)
4. Make sure the examples and their explanations make sense
5. Sign off :)
Comment 8 Caroline Cyr La Rose 2021-10-15 14:06:00 UTC
Oops! Sorry about that! I don't fully understand how git works, so I make silly mistakes like that...

I deleted everything and redid my patch (thankfully, it was just deleting a couple of lines!). Hopefully it will now work... :/
Comment 9 David Nind 2021-10-15 15:30:31 UTC
Created attachment 126350 [details] [review]
Bug 29216: Correct --where documentation in update_patrons_category.pl

This patch removes two misleading examples of the --where parameter
documentation in update_patrons_category.pl

To test:

1. Apply patch
2. In your favourite text editor, open misc/cronjobs/update_patrons_category.pl
3. Look for the documentation for the --where parameter (around line 133 or so)
4. Make sure the examples and their explanations make sense
5. Sign off :)

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 Katrin Fischer 2021-10-19 22:16:28 UTC
Created attachment 126556 [details] [review]
Bug 29216: Correct --where documentation in update_patrons_category.pl

This patch removes two misleading examples of the --where parameter
documentation in update_patrons_category.pl

To test:

1. Apply patch
2. In your favourite text editor, open misc/cronjobs/update_patrons_category.pl
3. Look for the documentation for the --where parameter (around line 133 or so)
4. Make sure the examples and their explanations make sense
5. Sign off :)

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Jonathan Druart 2021-10-21 08:25:48 UTC
I would have picked another good example instead of removing it. Not important anyway.
Comment 12 Jonathan Druart 2021-10-21 08:33:01 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 13 Kyle M Hall 2021-10-22 15:35:47 UTC
Pushed to 21.05.x for 21.05.05
Comment 14 Fridolin Somers 2021-10-23 02:15:44 UTC
Pushed to 20.11.x for 20.11.11