Time error - Change Post Time
Time error
Strange error I am getting. If I change a post time so that two posts are reversed, viewtopic shows them in the new order, viewforum doesn't.
Scooters post was first (and in another topic) Jazz Club started a new topic and I moved Scooters post, adjusting the time to place them in the correct time order.
I tried purging the cache, but it didn't make any difference.
Any thoughts on this?
phpBB 3.1.9
Scooters post was first (and in another topic) Jazz Club started a new topic and I moved Scooters post, adjusting the time to place them in the correct time order.
I tried purging the cache, but it didn't make any difference.
Any thoughts on this?
phpBB 3.1.9
-
- Community Team Member
- Posts: 6817
- Joined: Wed May 14, 2014 9:10 am
- Location: Swearing at the PC, UK
- Name: James
Re: Time error
It might very well be a limitation on the extension. Unfortunately, I do not have the time (and energy) to try such changes.
Sorry I cannot be of more help.
-javiexin
Sorry I cannot be of more help.
-javiexin
-
- Code Contributor
- Posts: 1157
- Joined: Wed Oct 12, 2011 11:46 pm
- Location: Madrid, Spain
- Name: Javier
Re: Time error
Probably happening because viewforum is looking at the post numbers, not the post times.
Using latest version of PHPBB
-
- Registered User
- Posts: 604
- Joined: Thu Jan 16, 2003 7:59 pm
- Location: Australia
Re: Time error
Ok, I have now tracked down the issue, and it definitely comes from a core function not working as expected (specifically, theHiFiKabin wrote:Strange error I am getting. If I change a post time so that two posts are reversed, viewtopic shows them in the new order, viewforum doesn't.
Scooters post was first (and in another topic) Jazz Club started a new topic and I moved Scooters post, adjusting the time to place them in the correct time order.
I tried purging the cache, but it didn't make any difference.
Any thoughts on this?
phpBB 3.1.9
sync
function in includes/functions_admin.php
.From my point of view, the extension code is ok, IF the core would behave as expected/documented.
Now, I will try to see what the is the core change required, and propose it for evaluation.
-javiexin
-
- Code Contributor
- Posts: 1157
- Joined: Wed Oct 12, 2011 11:46 pm
- Location: Madrid, Spain
- Name: Javier
Re: Time error
Thanks for your persistence Javier.
-
- Community Team Member
- Posts: 6817
- Joined: Wed May 14, 2014 9:10 am
- Location: Swearing at the PC, UK
- Name: James
Re: Time error
Your welcome. Unfortunately, not very good news to share. I have seen now what is the issue.HiFiKabin wrote:Thanks for your persistence Javier.
Precisely, but not in viewforum, but in the internal sync method (the last post is stored in the forums table).mamba wrote:Probably happening because viewforum is looking at the post numbers, not the post times.
The core is assuming that the highest post_id is the latest, and hence, updating the forums with this information. If a post is moved in the time sequence (as done by this extension), this assumption might not be true any longer, as a post with a lower post_id might have been moved after the highest post_id, and the highest post id might have been moved before the next highest post id.
I have seen two possible solutions, both of them not quite what I would like. Here they go, with the big issues they might bring:
- Change the core to use the latest post_time instead of the highest post_id to select the last post for a forum. This would be ok, except for the fact that doing so, the actual query to sync the posts would be much less performant, as it would not be possible to use the post_id index. Adding an extra index to the posts table just for this would be overkill.
- Change the post id of the post that should be latest, to increase it. This might be ok, except for the fact that this would require to sync the whole set of tables that refer to posts, and also, it would break any external links that point to that post; creating a copy of this post with a new id would have almost the same issues as changing the post itself.
So, given the situation, I think the best solution is not doing anything... Let it stay as is, as the cases where this might happen are very rare, and usually, they would solve themselves as soon as a new post is written in the "unsync" forum. Otherwise, we would compromise performance (long query without index to resync), or reliability (risk of something going out of order when updating, and most importantly, external links would not be kept).
Now, if anyone propose a viable alternative, I would be glad to look at it, and if feasible, implement it, either as a change in this extension, or as a proposal for change to the core.
Nothing else I can do unfortunately
Regards,
-javiexin
PS: One thing that I can do, with relative ease, is checking if the proposed change would create this issue, and either give a warning, or forbid it completely. Opinions?
EDIT: Looking at it again, I have seen that the index on post time already exists, so it might not be as bad as I figured first... Let me check.
-
- Code Contributor
- Posts: 1157
- Joined: Wed Oct 12, 2011 11:46 pm
- Location: Madrid, Spain
- Name: Javier
Re: Time error
Hi. I also just noticed this issue. I changed the order of a thread with three posts from 1, 2, 3 to 1, 3, 2 but 3 is still showing as the last post in viewforum instead of 2. Have you had any more luck with this?
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: Time error
No luck, this is core behaviour.
-
- Code Contributor
- Posts: 1157
- Joined: Wed Oct 12, 2011 11:46 pm
- Location: Madrid, Spain
- Name: Javier
Re: Time error
Oh well. Thanks anyway.javiexin wrote:No luck, this is core behaviour.
-
- Registered User
- Posts: 1383
- Joined: Thu Sep 25, 2014 10:36 am
Re: Time error
Oakie dokie. Thanks for trying
-
- Community Team Member
- Posts: 6817
- Joined: Wed May 14, 2014 9:10 am
- Location: Swearing at the PC, UK
- Name: James