New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editing post dates would be useful #411
Comments
Agree completely. Editing them to be in the future also seems like a handy feature. |
+1 Set post order would be much appreciated |
" Editing them to be in the future also seems like a handy feature." |
Is this "feature request" for past and future, or should we have 2 feature requests? |
Past and future are different problems - past is simply a different On Thursday, December 31, 2015, Pierre Ozoux notifications@github.com
Ben Werdmuller +1 (312) 488-9373 |
Can this be done in the database now? |
Yes, but it's quite tedious from what I remember (done it over a year ago), There are actually two dates, you need to change both (or just the one that |
Yeah agree editing the database directly would be a hassle -- you'd need to edit the timestamp in entities.created as well as the "created" value in the JSON blob in entities.contents, and probably also update the metadata table for queries to work properly. I backdated a few posts last night with a short php script that I put in the known directory and ran from the command line... <?php
$_SERVER['SERVER_NAME'] = 'kylewm.com';
$_SERVER['SERVER_PORT'] = 80;
define('KNOWN_UNIT_TEST', true);
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/Idno/start.php';
$site = \Idno\Core\Idno::site();
$user = \Idno\Entities\User::getByHandle('kyle');
$site->session()->logUserOn($user);
$slug_to_date = [
['farkling', '2016-01-23T02:13:39.000Z'],
['oh-murphy', '2016-01-23T01:24:05.000Z'],
['the-craftsman-at-work', '2016-01-24T19:25:51.000Z'],
];
foreach ($slug_to_date as $arr) {
$entity = \Idno\Common\Entity::getBySlug($arr[0]);
$entity->created = strtotime($arr[1]);
$entity->save();
}
$site->session()->logUserOff(); |
This topic came up today in IRC / Slack, and I do think its something we should roadmap for 1.0. What do you think @mapkyca and @benwerd? I'm happy to take a crack at it with some guidance. Ideally, I'd like to do this by updating a default template for editing an entity. What would the appropriate template be? I see:
Guidance would be super helpful! |
So, date editing is actually a fairly involved subject to do correctly, and isn't just a simple matter of changing the create time. Most entities save methods do listen for the "created" input, but this isn't passed by any of the forms, so at first glance all you'd need to do is make this editable. However, it's not the whole story. From the data model point of view created != publish, so I actually think we need a third date column on the entities table, and then modify stream functions to only show things with a publish date in the past. Additionally, there's the issue of how we handle urls if an entity is modified after it has already been published. Do we modify the slug, or do we preserve the old url? The answer to this, I think, is "yes". We create the new url, but implement entity tombstoning to redirect the old url magically (#1742) So, we need to:
Even without scheduling for future dates, simply editing the past dates actually represents a fair amount to think about. |
Definitely more complex than I assumed! Thanks for the rundown. I do think its worth pursuing. |
I don't disagree |
Just wanted to bring this fairly old issue up. To me Known seems to be nearly feature-complete, but this is essential for anyone (like me) who is trying to migrate from another software. |
A key use case is gathering in items that have previously been published earlier - not being able to edit the post date means that order of posts can't be changed, and that they all look current rather than historic. eg andrewmarks.media and the music mixes
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: