Manual sorting of objects

Enonic version: 6.10.1
OS: Ubuntu 16.04

Hello!

When we do a manual sorting in a content studio and then use it on a front end, it does not happen sometimes. After some investigations, we have found that it does not happen because if you don’t drag and item somewhere, the value “_manualOrderValue” is not written to the object or there was highly negative value. Also system does not allow to save/published an item as it is not modified.

Hi,

To clarify - manual sort works only when you actually rearrange items? But if you just select manual sort and then save it is not actually stored?

Hello,

In our case, we had ~10 items inside the folder and moved one of them. If we rearrange all items, it works.

Hmm, is this an installation that has been though a couple of version, or is it a quite new installation?

I know we had some issues where the manual order value was not set correctly in some previous versions. It will be fixed if setting non-manual order, and then back again to manual, but thats ofc not a very good solution if there are a lot of content.

This installation was updated. At first we were using 6.8.0, then 6.9.0 and finally 6.10.1.

As @rmy suggest, try this:

  • Deactivate manual sort (do date sort), then activate it again.

If not you can also try:

  • unpublish that content branch and then publish it again.

Ok, there where some bugfixes to the 6.9 release, so I guess it could be an error following from 6.8
Please let us know if experiencing more issues regarding this, especially for new sections/content.

Hi, we had a similar issue with manual sorting:

The issue happens when you move one item on admin on manual sort, (it gets ‘modified’ state) and we publish it, but if you do not ‘modify’ and publish again all objects on the same level/folder, the getChildren does not work correcly for the manual sorting.

We also made a test now and forced the “_manualOrderValue” on the code, and the manual sorting then comes correctly from enonic even if you do not modify and publish all objects in the same level.

But when we leave the getChildren without the ‘sort’ parameter, which should get the selected method on admin, the manual sort does not brings the items correctly. We did set ‘manual sort’ and move an item manually, published the modfied item, but then the getChildren, brings the wrong items order.

For the others methods (DisplayName ASC, ModifiedDate ASC, etc) enonic and getChildren works fine, and no need to modify/publish all items.
We also tested on a latest enonic installation (Enonic 6.10.3) and the same issue happened.

Hi.

The childOrder-property is set on the parent. Is the parent published?

Yes, we published again the parent node and the sorting method was set on it. We actually tried different ones “DisplaName ASC”/etc, and it worked, but then still that same issue on the getChildren when get back to the manual sorting.

For now, what we can do when it happens is moving all children on manual sorting, publish all of them, then they get updated and the order is correct.

Ok, to summarize:

You have a parent § with some children.

  1. When doing getChildren§ with order-expression set to “_manualOrderValue” it sorts the children correctly according to the sorting in admin
  2. The children is displayed in correct order when browsing in Content Studio when manual order is selected for parent
  3. When doing getChildren§ with no set order-expression, its not sorted by correctly in api. Is it ordered by something else, or manual but not the correct order?
  4. You have tried to reset the parent order (set it to someting other that manual), published the parent with children, and then set it back to manual order value, published the parent with children?
  1. yes

  2. explained below at 4)

  3. When doing getChildren§ with no set order-expression, and the § was set to “Manually Sorted” on admin, it seems that the result on frontend is the manual, but not the correct/same order showed on admin.

  4. yes, we tried it.

I will explain below each step:

a) Set “Manually Sorted” at § on admin, and move update all items/children, publish the parent and all children. Then the getChildren shows the correct manual order on frontend.
P
C, D, A, B (admin)
C, D, A, B (frontend)

b) We have set the “DisplayName ASC” sorting on §, and and published the parent §. All itens shows correctly on admin and frontend.
P
A, B, C, D (admin)
A, B, C, D (frontend)

c) Then setting § back to “Manually Sorted”, the items on admin still appear in the same position, and the old “Manually Sorted” order is presented on the getChildren/frontend.
P
A, B, C, D (admin)
C, D, A, B (frontend)

And here is the problem, because the editors see different order on the frontend, and they get confused, for example, if they move one item on manual sort, it will have then totally different position on the frontend. And after moving some itens the result is quite different and messy.

Perhaps the adjustment on Enonic Admin, would be just to reorganize/reset the order of the items on Admin, when it is changed to “Manually sorted”.

Hi guys

We are having exactly the same issue as Thiers describes. But if we drag and drop all the items in a list instead of just a few, which are required(I presume all the indexes would be updated for all items), the order is correct on a front end as well.

Hi, thanks for beautiful explanation on how to recreate :slight_smile: It seems like a bug, Ill do some reasearch on what is happening here.

2 Likes

Hi again guys, as suspected there was a bug here.

When changing the childOrder to manual, all the child nodes are infact rewritten with a new manualOrderValue, but the algorithm for detecting stuff that has changed between branches choose to overlook this fact.

Its now fixed, and due for 6.11 release. Hope you can work around the problem for now, it should be ok if you unpublish the children, set the sort order and then publish the parent with children again.

4 Likes

Hello!

We have just updated to Enonic 6.11.1 and it seems like this bug still appears for us. Can it happen because the content is older and was created in earlier versions(I assume it can be 6.9.0)?

Currently, we have tried to sort 16 items and 3 of them got _manualOrderValue, which have values:
-5905580029
-5368709117
10737418235

The rest of objects have no _manualOrderValue and all of them( including objects with _manualOrderValue ) appear correct in admin, but randomly on the page itself. As described earlier, it is possible to move all items and publish them, so they will get correct values and will be displayed as they should.

If you would like to have more details regarding this, I can try to describe it in another words or try to assist somehow. :slight_smile:

Thanks

Ok, have you tried unpublishing the parent and republish it again?

That helped!
Thank you very much :slight_smile:

1 Like