Open aaslun opened 10 years ago
This feature have been requested before. Here's my take on how it should be implemented.
Something like that... would that suit your needs as well, Andreas?
Add a new database table for the scheduled versions. Use a wp event to push the scheduled version of the list over to the actual list. Keep current database structure and backend logic intact.
Wordpress scheduled events kinda sucks. This is especially noticeable when having a more complex infrastructure (several production-servers etc..)
Even if you use an ordinary cron-tab for wp-cron you can't say for sure when the scheduled version of the list will become published. It will differ with a couple of minutes everytime depending on the amount of "event listeners" that is invoked when wp-cron is called, and how long it takes for these "event listeners" to get their job done. On the other hand, a feature like this does not require an exact publish time. If you configure a version to be published at 10:00 it's okay if it actually gets published sometime between 10:00 and 10:05...
No major refactoring is required. The added logic this feature requires may fail without screwing too much with the present functionality.
This seems like a good feature and the suggested solution would do the job properly. +1 on this request!
Victor, yes your suggested solution is very close to what I had in mind. I have some additional thoughts; should there be some kind of graphical element indicating that there are future versions of the list that are scheduled to be published? I'm concerned that there may be situations where there are multiple users working on the same list at different times and if one user creates a future version of the list, without communicating this properly to colleagues, it should be obvious by some icon/color/text in the user interface that "this list contains future versions" when the other user takes his/her seat. Also, how should the interface cope when a user wants to update an existing future list without creating a new one? And what happens in the user interface if a user is currently working on an unsaved list the exact moment a future version of the list is scheduled to publish? Should there be some kind of warning like "This list is about to be overwritten by a future list in XX minutes" or something in the interface a couple of minutes before schedule? Or should the admin page just reload to present the new list in case it a scheduled list gets published? In our case the users can have the Arlima admin page on screen for hours (maybe days) without reloading.
That's some great thoughts! :)
Graphical element indicating a future version Maybe a small clock icon to the left of the select list would be enough? When the user hovers with the mouse over the icon a tooltip would say something like "This list has a scheduled version". I also think that we need to reload the lists that's displayed in the list manager once every fifteen minutes, as long as they're not in an unsaved state.
Editing future versions There's currently no support for updating a specific version, you can only add/remove versions. The easy solution here would be to keep the current functionality in the ui.
Would this be good enough? Otherwise we need to implement a new state, something like an "edit" state where we need to remember which versions that's currently open and also add methods on backend for updating versions. It's doable but it requires a lot more work.
Btw, every time you save a future version the latest published version of the list has to be loaded into the list. It would not make any sense to change back to default state and at the same time show the articles from the scheduled version.
How the UI responds when a future version gets published in the background I actually think that this won't be of much trouble if we reload all lists that's in a default state on a regular basis, once every 10-15 minutes. If a future version of a list gets published in the background while someone is editing the list the user will get notified when the list gets saved.
Sounds great! :) My comments:
Graphical element indicating a future version
Editing future versions
How the UI responds when a future version gets published in the background
I have been thinking on what's needed to make this feature possible. Here is what I suggest on backend.
Arlima_AdminAjaxManager
New class: Arlima_VersionScheduler (... or how you want to name it)
Arlima_ListFactory
Arlima_Plugin
Arlima currently supports schedules of individual articles and file includes. Have you considered functionality for scheduled/future publishing of entire Arlima lists? One possible scenario: an editor working on updating a list late one night and want to be able to prepare the list to be published early next morning.
Arlima is kind of prepared for this functionality by allowing to roll back the versions of lists. But one would like to be able to prepare and schedule publication of future versions of these in some way. If you are interested, we could discuss the possibilities and mutual requirements of such implementation?