-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
CRM-17669 and CRM-17686, flexible scheduled jobs #7505
Conversation
konadave
commented
Dec 28, 2015
- CRM-17669: Add additional run frequencies for scheduled jobs
- CRM-17686: Add field to scheduled job form to specify first/next run
Can one of the admins verify this patch? |
jenkins, add to whitelist |
@@ -156,6 +159,13 @@ public function setDefaultValues() { | |||
|
|||
CRM_Core_DAO::storeValues($dao, $defaults); | |||
|
|||
// CRM-17686 | |||
if (!empty($dao->scheduled_run_date)) { | |||
$ts = strtotime($dao->scheduled_run_date); |
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.
Isn't this value already a timestamp?
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.
timestamp is UTC adjusted and stored internally as a timestamp, but is returned by a query in the same format as datetime.
You're right, I screwed up on the disabling of the extension. I have fixed it on my end per your comments above. I think disabling is fine. I will be updating the extension and will add comment to info.xml that it's incompatible with 4.7, so if someone attempts to re-enable it later they should see that. If there is a way for the extension to determine the current version and fail a re-enable attempt, let me know and I'll get that added. |
I don't see that change reflected in this PR. Once you commit your change can you push it to this branch to update the PR. |
I was working with a beta4 install for writing/testing, then copying files over to my core repo. So I don't have the datepicker at the moment. I will be gitifying my beta4 install later, but for now I must go shovel some snow. |
@colemanw I believe I've addressed all your comments from yesterday. Thanks for your help. Let me know if you see anything else that you need me to take care of. |
<td class="label">{$form.scheduled_run_date.label}</td> | ||
<td>{$form.scheduled_run_date.html}<br /> | ||
<div dlass="description">{ts}Do not run this job before this date / time. The run frequency selected above will apply thereafter.{/ts}<br /> | ||
{ts}Leave blank to run{/ts} {if $action eq 1}{ts}as soon as possible{/ts}{else}{ts}at next run frequency{/ts}{/if}. |
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.
Sentence fragments are hard (sometimes impossible) to translate.
I'd suggest doing the full sentence both times. Might feel "less efficient" to write it out twice, but will make translators happier.
I have found out how to determine the currently running version of CiviCRM. I would like to use this information in flexiblejobs_civicrm_install and/or flexiblejobs_civicrm_enable to gracefully fail if not 4.6.x. Is this possible? |
I think that might be overkill. Marking it as compat with 4.6 only in the xml, plus disabling it during 4.7 upgrade in this PR, ought to cover all bases. |
Whoops looks like the test suite is encountering a fatal error when testing this PR. Click "details" and then "console output" to see what's happening. The most relevant line from the console I see is:
|
That's a MySQL error, which leads me to believe it's an issue with CRM/Upgrade/Incremental/sql/4.7.beta5.mysql.tpl Here are a couple of examples of timestamp fields being declared in the exact same way... https://github.com/civicrm/civicrm-core/blob/master/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl#L13 I don't understand why those would be OK and mine isn't? |
If I delete |
If I change the default value to CURRENT_TIMESTAMP, that should generally be acceptable. When a job is added without a scheduled date specified it would get the default value. The next time that cron runs the job would pass the needsRunning test (as any new job would) and the scheduled date will get reset to NULL. So it really won't affect anything But, it would set |
@colemanw Please see my comment from this morning. Can / should I do that? |
jenkins, retest this please |
Sorry I also don't see any problem with your sql and why it would crash the tests. Maybe @eileenmcnaughton or @totten can spot it. |
@@ -61,6 +61,13 @@ | |||
<add>4.1</add> | |||
</field> | |||
<field> | |||
<name>scheduled_run_date</name> | |||
<type>timestamp</type> | |||
<default>NULL</default> |
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.
Try removing this - I think required=FALSE (or omitting required) is equivalent to default is NULL - but I'm not sure it's valid to explicitly set default to NULL
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.
@eileenmcnaughton Both of the other timestamp NULL DEFAULT NULL
fields I referenced both have <default>NULL</default>
in their schema definition, but they both also have <required>false</required>
which my definition does not. Do you think if I add that to Job.xml that it would pass the test?
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.
Worth trying I guess!
@colemanw Just noticed that beta5 has been released. That means I need to add my alter table statement to |
I can just edit out my alter table statement in |
I'll let @totten field that question about upgrades and merges since he's been working on making that process less of a headache. |
Yeah, I've been working off-and-on on #7440. At the moment, it's still WIP (getting my head around multilingual upgrades), and there's no ETA, so let's continue with business-as-usual until the PR is merged. In the case, my suggestion would be:
(Note: Rebasing works well as long as the |
...to specify first/next run
jobs. Also removes run frequencies added in CRM-16500 as they are no longer needed.
...when upgrading.
4a276c4
to
902e557
Compare
@colemanw When I made commit |
might be unrelated. jenkins, retest this please. |
still looks unrelated. jenkins retest this please |
retest this please |
This test fail is also affecting Brian's PR |
CRM-17669 and CRM-17686, flexible scheduled jobs
I'm merging this because the test failures are not due to this PR. |
Yay - I think this is a great improvement. Thanks Dave for persevering!! |
Thank you all for your patience and willingness to work with the newbie. I learned a lot. |