Closed (fixed)
Project:
Scheduler
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2010 at 15:09 UTC
Updated:
14 Feb 2011 at 19:20 UTC
Jump to comment: Most recent file

Comments
Comment #1
sirkitree commentedUpdate to the patch. The method I'm using in this patch to generate the values for the various date formats was missing the prefix.
Comment #2
eric-alexander schaefer commentedI am not terribly good acquainted with the token module. I only know those tokens from the Pathauto module. What could you do with those scheduler tokens? What's your use case?
Comment #3
dave reidYou're duplicating the raw timestamp tokens. The date helper function already gives you prefix-raw as evidenced in your screenshot.
Comment #4
sirkitree commented@Eric - my use case happens to be where I am providing some messages for confirmation forms that are based around submitting the content type that is using scheduler. Within these custom messages I wanted to provide tokens for the un/pub data so that when the confirmation comes up it can say something like, "Your content will go live on 'such and such' scheduled date." So really the tokens are being used by a different module than scheduler, but I thought it appropriate to have the tokens for scheduler, within scheduler, rather than my custom module.
@Dave - right you are! Totally missed that. Patch revised.
Comment #5
sirkitree commentedneed to declare $tokens as an array before trying to use +=
Comment #6
eric-alexander schaefer commentedSo you can use the values of those tokens in other modules? Sounds great.
Comment #7
eric-alexander schaefer commentedI can't test this, but it does not seem to break anything.
Is there any reason why we couldn't use a longer prefix like "publish-" and "unpublish-" or even "publish_on-" and "unpublish_on-"? I would like prevent any name clashes. Also if we extend scheduler with more schedules actions it would be good to have some kind of name scheme.
Comment #8
robhamm commentedShould I apply this patch to 6.x dev before sivaji's patch from http://drupal.org/node/598994 to try to beat Scheduler into submission for 7.x? Or is that a Bad Idea that may induce baby-eating behavior?
I mean, yeah... Test site, sure, but I figure if it's something you already know I shouldn't attempt, I can put down the sharp objects now before I hurt myself.
;-)
Comment #9
eric-alexander schaefer commentedI don't know. If tokens are defined in D7 the same way as in D6 you could patch for D7 and just add the two functions in the tokens patch manually.
Comment #10
dave reidTokens are defined differently in D7. Once the D7 port code is committed I can more than help with a patch to help add the token integration there.
Comment #11
eric-alexander schaefer commentedThanks, Dave. Since you seem to know a bit or two about the token module, can you help me out with #7?
Comment #12
dave reidOh absolutely I'd recommend something longer like (un)publish-on- or even scheduler-(un)publish-
Comment #13
eric-alexander schaefer commentedThanks a lot!
Comment #14
eric-alexander schaefer commentedOK, here is a new patch. I changed the token prefixes and also the
scheduler_token_list().Comment #15
eric-alexander schaefer commentedhttp://drupal.org/cvs?commit=457882
Comment #17
eric-alexander schaefer commentedComment #18
sillygwailoComment #19
dave reidComment #20
eric-alexander schaefer commentedOh, great, thank you. I figured out scheduler_token_info() myself but scheduler_tokens() gave me some headaches...
Comment #21
eric-alexander schaefer commentedWorks: http://drupal.org/cvs?commit=492552
Thanks a lot.