Problem/Motivation
Imagine a situation where you have a constantly changing station schedule, with scheduled items being added or removed every other week. Though, you would like the website to be able to display the schedule of the station, on a particular date in the past.
Normally, the drupal node structure allows for node revisions, which are actually different historical states of the same node (like it happens with wikis). In the case of the schedule, one would expect the schedule node to be able to get a new revision, every time one or more schedule items change.
Unfortunately this is not the case. Schedule items always point to the initial node id and not the node revision id. So, according to the current implementation, there is no clean way for somebody to store the changes of a schedule, in one particular node structure.
Of course there are workarounds for this. E.g. one could create a new schedule, every time there are substantial changes and attach this to the same station, then set the new schedule as default. Although things become complicated, when somebody wants to know the exact days a schedule used to be active (can be done e.g. by adding a date CCK field to the schedule node).
Proposed resolution(s)
The quickest solution would be to change the schedule item entry, in order to point to the revision id, and then modify the schedule display queries accordingly.
The cleanest solution would be to re-implement the schedule items as node CCK (multi-)fields, attached to the schedule node. This way, revision creation and display would be handled automatically through the CCK mechanism. Although this would also require manipulation of all the functions that use/process schedule items...
Comments
Comment #1
frederickjhI worked with a major international broadcaster that had software developed for handling broadcast schedule on multiple transmitters at multiple locations with 2 major schedule changes and 2 minor ones.. The way it handled it was to have validity dates for each schedule item. A valid from and a valid to. This even allowed for changes in between the schedule ones if needed.
However the current schedule for the Station module is stored as a pointer to the 1440 minutes in a week and then this repeats. None of it is hooked to a date but only to the day of the week and time of day.
I think that Station would need a major overhaul for this to happen. It might also be nice to move the displays all to views if a module could be written for views that would add a new display type to views that could be used to display the week schedule in Station.
Comment #2
radiobuzzer commentedA validity CCK field is probably the easiest way to overcome the problem, as you mentioned. Though, the "drupal way" to do that is to use a revision, as a revision essentially stores the information about when it was submitted and when it got deactivated.
The fact that current schedule is not hooked to a date but only to the day of the week and time of day shouldn't be a problem, because the display function would consider this relative time pointer within the viability of the revision.
Therefore, I assume that the modifications required on the module, in order to support revisions are not so big as they mainly relay to anchoring the schedule items on the revision id, instead of the node id. This would yield some changes on the submission of the schedule items (submitting a new revision) and on the display functions of the schedules (deriving schedule items only from the latest revision(s) of the given schedule).
Moving schedule display to views would also be the cleanest option. But it's matter of whether you want to do one step at a time or design a full re-implementation
Comment #2.0
radiobuzzer commentedIssue template headings added