-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/core#47 Add clone scheduled job functionality #11945
dev/core#47 Add clone scheduled job functionality #11945
Conversation
Cool idea! I wanted to give this a full review, but I didn't get very far with Here's what I did:
I tried a new scheduled job too. Same behavior. Also worth mentioning that I think "Copy" would be slightly more consistent than "Clone", since that the language that Events and Contributions pages use. |
a52a1a0
to
5fb897c
Compare
@seanmadsen Not sure why that's failing for you? Have you got all latest DB upgrades applied on master? - sometimes I see this when I've updated dmaster and haven't run necessary DB upgrades. I've just updated the PR to use the wording "Copy" and set the name of the new job properly (it needed the "name" instead of the "title" field to be suffixed. |
@mattwire Thanks for changing "Clone" to "Copy". I did some further troubleshooting with the error I was experiencing and am now able to submit a full review. (CiviCRM Review Template WORD-1.1)
In order of priority... Changes requested to resolve
|
5fb897c
to
7a6059c
Compare
Hey @seanmadsen Thanks for your time reviewing this one and for finding out the issue with NO_ZERO_DATE. I've now updated the PR to take account of that (we should be setting last_run and scheduled_run_date to SQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(CiviCRM Review Template WORD-1.1)
- (
r-explain
) PASS - (
r-test
) PASS - (
r-code
) REQUEST CHANGES - (
r-doc
) PASS - (
r-maint
) PASS - (
r-run
) PASS - (
r-user
) PASS - (
r-tech
) PASS
@mattwire I have added some phpunit tests as described here https://github.com/mattwire/civicrm-core/pulls so you may want to handle these exceptions in your code
@mattwire there is a problem with the PR against your repo- but perhaps you could cherry-pick in or copy in the patch from @tiotsop01 |
I've taken another look at this & I'm OK merging without @tiotsop01's additional unit tests. They test 2 things
However, I don't think we need to block on 2 given the review effort & response to review that has already gone in and the fact we have a success test. |
Overview
This adds a "clone" or "copy" function to the scheduled jobs page. It is implemented as an API (job.clone) which can be called via a link from the scheduled jobs listing.
Ref https://lab.civicrm.org/dev/core/issues/47
Before
You can't clone a scheduled job. This means you have to manually copy parameters when setting up multiple similar jobs (eg. a geocoding job with different parameters).
After
You can easily clone a scheduled job.
Technical Details
Implemented as a new API function Job.clone and a BAO function "copy".
Comments
I'm not sure what the preferred naming is, "clone" or "copy". There's not much in core to be consistent with here.