Hi,
I have a strange problem with getResources sorting the results. I want to sort them by menuindex. Let's say I have:
Slide 1 - menuindex: 1
Slide 2 - menuindex: 2
Slide 3 - menuindex: 3
Slide 4 - menuindex: 4
Slide 5 - menuindex: 5
It works correctly until I change the order of two slides. Let's say I change it to:
Slide 1 - menuindex: 1
Slide 2 - menuindex: 2
Slide 3 - menuindex: 3
Slide 4 - menuindex: 5
Slide 5 - menuindex: 4
After that Slide 5 seems to appear randomly (sometimes it on 3rd position, sometimes it stays where it was), then I have to unpublish the slide, save it, and then publish it again - then the order is correct.
Has anyone had a similar problem to mine?
Cheers,
Tomasz
Yes, I had the same issue a few months ago using GetResources. I updated modx and GetResources to the lates versions and it fixed itself. Which version of both are you using?
...
Hi,
Thanks for the reply.
I'm using Modx Revo 2.2.4 and I've just updated getResources from 1.4.2 to 1.5.1 but the problem still exists.
The only thing I can suggest would be to delete and recreate the problematic slides. I had a similar sorting issue in the past and that helped. Just backup your stuff first.
...
Hi,
Thanks for the tip, I guess that's the only thing I can do right now.
Cheers,
Tomasz
Are you changing the menuindex by dragging-and-dropping resources in the tree? That will renumber all the menuindexes and might (or might not) be more reliable.
Is you're getResources call uncached?
(You probably don't want it uncached when you're finished, but you might while you're working).
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
Thanks for the kind words. I'm sorry I can't be more help here.
You don't have MySQL 5.0.51 by any chance? It has trouble with sorting.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html
Could you file that as a bug at
http://bugs.modx.com?
Be sure to list all your environment settings (PHP version, MySQL version, MODX, version, etc.).
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html