rebuildThreadPostPositions =>
UPDATE xf_post
SET position = (@position := IF(message_state = 'visible', @position + 1, GREATEST(@position, 0)))
WHERE thread_id = ?
ORDER BY post_date
I have three posts in thread 59000
If i use the addon with something like:
$threadRepo->rebuildThreadPostPositions($threadId);
i got 0,1, 2 for position like you can see above, so the sort is not done how i await it.
May someone has a hint why this sort is not done like i await it
=> ORDER BY post_date
UPDATE xf_post
SET position = (@position := IF(message_state = 'visible', @position + 1, GREATEST(@position, 0)))
WHERE thread_id = ?
ORDER BY post_date
I have three posts in thread 59000
post_id | post_date | position after use of an changepostdate-addon | position should be |
330884 | 1571529600 | 0 | 2 |
330885 | 1539988589 | 1 | 0 |
330886 | 1540075914 | 2 | 1 |
$threadRepo->rebuildThreadPostPositions($threadId);
i got 0,1, 2 for position like you can see above, so the sort is not done how i await it.
May someone has a hint why this sort is not done like i await it
=> ORDER BY post_date
Last edited: