• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Sorting topics by newest to oldest doesn't change data-index

Scheduled Pinned Locked Moved Bug Reports
newestpost orderdata-index
8 Posts 2 Posters 2.9k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    a_5mith
    wrote on last edited by a_5mith
    #1

    So, I'm testing having new posts first, which doesn't work as expected. It assigns the posts in order as if they were the other way around, so the newest post is data-index:1 every time. This makes it impossible to link to a topic, as each new post would be tid/2. It also means that, when you click from a category "last replied 7 hours ago" for example, it takes you to the highest data-indexed post, which is the first post in the topic, at the bottom, when what you actually wanted was the most recent (so in most cases you go to completely the wrong post).

    I think that the data-index should work the same way as it does with oldest to newest, newest posts getting the higher ID, but they just display backwards. So first post in that topic is 1, but is displayed at the bottom.

    Or is it supposed to do that and it doesn't work? 🙂

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #2

    Yeah this is a known problem, the current data-index assignment only works for oldest to newest.

    1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    wrote on last edited by
    #3

    Good stuff, least you're aware of it. 👍

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #4

    Did plenty of work on this on the 0.5.1 branch here, here and here.

    Ended up refactoring and fixing notifications as well, since they were pointing to wrong posts if sorting was changed. One last thing to fix is the index in the url since changing the data-index causes it to go from highest to lowest 😆

    A 1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    replied to <baris> on last edited by a_5mith
    #5

    @baris Is that last point what's causing this?

    http://35hz.co.uk/topic/2117/aphex-twin-lp-coming-this-year%20categories.posts.user.userslug%20--%3E/user/roguetrooperENDIF%20--%3E#%3C!--

    Edit: And this: Which stops new posts displaying. 😞

    Aphex_Twin_LP_coming_this_year_35hz_Drum_n_Bass_Community_-_2014-08-17_14.21.08.png

    Both issues have turned up after a git pull. 🙂

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #6

    Are you on master? The changes I made are on the 0.5.1 branch so they shouldn't effect you unless you switched to that branch. Try downgrading templates.js to 0.0.10 or 0.0.8 and see if it helps.

    1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    wrote on last edited by
    #7

    Yeah did a pull on master. Will try downgrading templates.

    1 Reply Last reply
    0
  • A Offline
    A Offline
    a_5mith
    wrote on last edited by
    #8

    0.0.8 solved it. Thanks.

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development