#1346 - Improve scheduled publishing
| Identifier | #1346 |
|---|---|
| Issue type | Feature request or suggestion |
| Title | Improve scheduled publishing |
| Status | Completed |
| Tags |
Roadmap: v11 (custom) |
| Handling member | PDStig |
| Addon | calendar |
| Description | Scheduled publishing works by putting in custom code to the calendar.
This is rather messy. It should at least go through an API to do it cleanly, probably using hooks. So, you'd have a function like... schedule('publish_news','news',$id,$timestamp); And it would automatically remove prior schedules on that content-type/ID combination, and add this new one. The actual code run would be in the publish_news hook, rather than copied direct into the calendar event. |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".


Comments
1. What kinds of operations should be available in the API / hooks?
2. Should custom code still be allowed to be used (unsafe, but more flexible), or should it strictly only allow defined hook functions to run (safer, but less flexible unless people know how to make hooks)?
The code in the hooks should just directly replace what the current schedulable things are. That is- scheduled news, scheduled topic posting, scheduled forum replying, scheduled newsletters. grep code for 'add_calendar_event'.
I suggest a Commandr command called 'run_scheduled_action', which runs the code from the hooks. E.g. "run_scheduled_action publish_news 10 1234453445"
I suggest a 'schedule' function in maybe global4.php. This should add to the calendar using the Commandr code above. You'd call the function like:
schedule('publish_news',$id,$timestamp);
(I edited slightly from the original text on this issue)
The capability to run arbitrary Commandr code on calendar events should be untouched. But with this we're at least just running Commandr code rather than PHP code running under Commandr (via leading ":" symbol).
Hopefully makes sense.