View Issue Details

IDProjectCategoryView StatusLast Update
0001346Composrcalendarpublic2020-03-05 21:58
ReporterChris GrahamAssigned ToPatrick Schmalstig 
SeverityFeature-request 
Status resolvedResolutionfixed 
Product Version 
Fixed in Version 
Summary0001346: Improve scheduled publishing
DescriptionScheduled 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.
TagsRoadmap: v11
Time estimation (hours)6
Sponsorship open

Activities

Patrick Schmalstig

2019-12-26 17:56

administrator   ~0006264

Last edited: 2019-12-26 17:57

View 2 revisions

Couple questions:

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)?

Chris Graham

2019-12-27 10:08

administrator   ~0006265

Ok...

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.

Issue History

Date Modified Username Field Change
2019-06-27 17:53 Chris Graham Tag Attached: Roadmap: v11
2019-11-26 22:04 Chris Graham Assigned To => Patrick Schmalstig
2019-11-26 22:04 Chris Graham Status non-assigned => assigned
2019-12-26 17:56 Patrick Schmalstig Note Added: 0006264
2019-12-26 17:57 Patrick Schmalstig Note Edited: 0006264 View Revisions
2019-12-27 10:08 Chris Graham Note Added: 0006265
2020-03-05 21:58 Patrick Schmalstig Status assigned => resolved
2020-03-05 21:58 Patrick Schmalstig Resolution open => fixed