Comments

vegantriathlete’s picture

StatusFileSize
new2.91 KB
new120 bytes

Okay, Randy I'm lost about how I'm supposed to create the patch. I'm in my git cloned repository. I'm on branch 6.x.-1.dev. I've done

git add cron_example and git add cron_example/*. I've successfully (I think) done git commit -m "Create the cron_example". I don't get anything when I run git diff > create-cron-example-1289482-1.patch. It's just an empty file.

So, I'm attaching the .info and .module files here. Check them out and let me know if you like them and what I need to do.

vegantriathlete’s picture

Status: Active » Needs review

Forgot to change the status before.

vegantriathlete’s picture

StatusFileSize
new2.93 KB
new118 bytes

I have changed the access arguments to "administer site configuration" since I am using admin/reports/status/run-cron. I also corrected the name for the .info file.

mile23’s picture

Nice.

Couple things: Need unix line endings, first of all.

Second, git diff with no other options will tell you what's changed between the current commit and the files. So if you've committed the changes, there's no difference. Helpful hints here: http://stackoverflow.com/questions/1191282/git-diff-commits-difference

rfay’s picture

Status: Needs review » Needs work

Thanks so much for working on this!

The git patch instructions will work for you.

Essentially:
1. Make the new submodule.
2. Check it in
3. Diff against the original (git diff origin/7.x-1.x >/tmp/examples.cron_example.patch)

rfay’s picture

marked #1289488: Port cron_example to D7 as a duplicate; it already has some good work in it, but it makes sense for the whole process to happen here, and we should start with the D7 code. @vegantriathlete it seems to me like there's some really interesting cron + queue options in D7 - please make sure those get in here if that's core and not contrib.

vegantriathlete’s picture

Status: Needs work » Needs review

Randy,
I'm not sure what options (cron + queue) you want me to consider. Regardless, isn't it better to keep the hook_cron example as brain-dead simple as possible? Please provide more feedback.

vegantriathlete’s picture

@Mile23: It's strange. I thought I have notepad++ set up to create unix line endings. Does this have to do with the encoding? Right now I have it set to encode in ANSI. I've successfully rolled patches using the setup before.

Maybe when I'm rolling the patch the diff function is taking care of the line endings for me. So, maybe when I roll this properly the issue will take care of itself.

vegantriathlete’s picture

Note: I am playing with this a bit more to do some other things and I am noticing that the access arguments don't seem to be working the way I intended. This is not quite ready for prime time, yet.

vegantriathlete’s picture

@rfay: Maybe you were talking about http://api.drupal.org/api/drupal/modules--system--system.api.php/functio.... That is a separate hook and I think we should do a separate example.

rfay’s picture

That's what I was thinking about, and it should be covered in the D7 version.

However, we do not do an example for every hook. We do examples on a concept by concept basis. Otherwise we'd have 253,456 examples, and nobody would bother any more.

vegantriathlete’s picture

Gotcha. I'll think about how to include the additional hook in the D7 version of the example.

rfay’s picture

Assigned: vegantriathlete » rfay

I'm taking a look at this.

rfay’s picture

Assigned: rfay » Unassigned
StatusFileSize
new8.67 KB

Here's a version including hook_cron_queue_info(). I think with tests and a bit of cleanup it should be OK.

Status: Needs review » Needs work

The last submitted patch, examples.cron_example_1289482_14.patch, failed testing.

rfay’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs work » Needs review

Oops. Didn't realize this issue was set to 6.x. Had a 7.x info file.

rfay’s picture

rfay’s picture

Component: Other » Cron Example
StatusFileSize
new12.67 KB

And here it is with tests.

mile23’s picture

StatusFileSize
new12.9 KB

Looks lovely. Could use some more obsessive comments, however. :-)

Here it is after coder and some doxy tweaks:

vegantriathlete’s picture

Sorry for being AWOL on this, guys. I've been swamped with work. Thanks for jumping in.

rfay’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.