Categories Sorting

Ralf Member
edited April 2021 in General support

Hi,
just encountered a strange problem with 1.58RC.

I have the following categories for examples:

  1. News
  2. Graphics with a few sub-categories
    • Editors
    • Rendering
  3. Photography (also with sub -categories)
    • Technics
    • RAW Converter

Now when adding a new category and move it into a existing category (for example Graphics) i end with "scrambled" categories.

RAW Converter and Technics are now sub-categories of news - for example.

Re-Sorting and applying does not solve the problem - nor does manually editing the sort order in the news_categories table fix the problem.

Ralf

Comments

  • fretzl Administrator, Developer

    I cannot reproduce it. Any errors? Any specific settings?

  • acrylian Administrator, Developer

    I also cannot reproduce this. Look for error not only in the debug log/PHP error log but also your brower's console.

    Also which browser are you using?

  • Ralf Member

    Strange, because in the database table the sorting looks ok. But in the backend (and frontend of course) it is displayed wrong.

  • acrylian Administrator, Developer

    On the backend it could have been a JS error with the nested sorting. But the frontend does use any of that.

    Also try force clearing your browser cache. This can play all sorts of tricks as it is so persistent nowadys (not sure why it would here…)

  • acrylian Administrator, Developer
    edited April 2021

    Does sorting of albums and pages work for you? That all uses the same base principle… To my memory there has been no change in this area from 1.5.7.

  • Ralf Member

    Sorting of albums and pages are working ok.
    Also sorting of the existing categories works. The problem only occurs when:
    Creating a new category and move it as a sub-category to an existing category.

  • acrylian Administrator, Developer
    edited April 2021

    If that is a general problem it should also happen with pages… YOu did check the database sortorder values. They really were incorrect? Just to rule out a plain display issue.

    Also again, what browser (+ version + system) please ?

  • Ralf Member

    The database sort order looks fine. Only the display is wrong.
    Reproducable in:
    Chrome 90.0.4430.85
    Firefox 87

  • acrylian Administrator, Developer

    Just tried with Firefox 88 and Chrome 90 and sadly all works as expected for me…

  • Ralf Member

    Here is what happens:

    Example:
    'News' is category id 1 and sort order 000.
    'CMS' is category id 2 and sort order 001.
    'Wordpress' is category id 3 and sort order is 001-000.

    This will display 'Wordpress' as a sub-category of 'CMS'' which is right.
    After adding a new category and move it as a sub-category, 'Wordpress' has still the sort orderof 001-000, but is now displayed unter 'News'.

  • Ralf Member

    One additional thing I have noticed: Creating a new category has the sort-order NULL in the database table.
    This will change if I move the catogory around. Not sure of this is related to the error.

  • acrylian Administrator, Developer
    edited April 2021

    That is weird. Because 001-000 is the correct sortorder for the first child of the 2nd entry… Did you try reploading the page several times without applying? Just to rule out any browser page cache doing unwanted things. I've seen it cause a lot unecessary trouble…

    That is correct actually. Before you save on the list a new item technicaly has no order.

  • Ralf Member

    Yes I reloaded the page multiple times - after deleting browser cache.
    It does not change anything.
    No idea what happens here.

  • acrylian Administrator, Developer

    Unless we find a save way to reproduce this we can't do much sadly…

  • Ralf Member

    What I found out:
    When i delete an existing category and create a new one, sorting works as it should be. This works until I have a total of 16 categories.
    If I create 17 categories, sorting goes wrong.

    I

  • fretzl Administrator, Developer
    edited April 2021

    Thanks for the specifics. I can confirm this happening starting with category 17 but only one time. As soon as I delete and add some more categories the sort order is correct again. However every new category indeed gets sortorder NULL after saving.
    The sortorder is only set when categories are moved and saved again.

  • Ralf Member

    Hi Fretzl,
    thanks a lot for reproducing it.
    Now i am sure that there is nothing wrong with my database/installation.

    and thanks for the tipp with the deleting and adding categories again. This will solve my problem with adding more categories.

    Ralf

  • acrylian Administrator, Developer
    edited April 2021

    Sadly I can also reproduce this with 17 categories.Null is the default value of the database field. Perhaps we can workaround by setting it to an explicit 000 value on creating new items.

    In any case this issue should really also happen with all other nested sorting like page as they all use the same principle.

  • acrylian Administrator, Developer

    1.5.8RC now has a change that should fix this. New items now get the next toplevel sortorder on creation so they are correctly at the end of the list.

  • fretzl Administrator, Developer

    Works for me :-)

  • Ralf Member

    Hi,
    works for me too.

  • Ralf Member

    BTW: Thanks for your help with this one!

  • acrylian Administrator, Developer

    No, thank you, it was a bug after all.

Sign In or Register to comment.