Articles icon indicating copy to clipboard operation
Articles copied to clipboard

Articles affecting menuindex enumeration

Open MokoJumbie opened this issue 11 years ago • 6 comments

After installing Articles, I have experienced issues on several sites with the menuindex value being set incorrectly. The menuindex of certain resources somehow ends up being a duplicate of the menuindex in another resource. This causes one of the affected resources to be invisible from the tree.

I can cause it to reappear by manually editing the menuindex value in the DB but that's not a great solution, of course. And the problem reappears once I begin rearranging the items in the tree again.

It's difficult to isolate the steps necessary to reproduce this initially, but once it manifests, it's fairly persistent.

MokoJumbie avatar Jun 23 '13 21:06 MokoJumbie

Provided consistent steps to reproduce this can be debugged further

jpdevries avatar Jul 13 '13 00:07 jpdevries

Two resources with the same menu index should not prevent one of them from appearing in the tree

jpdevries avatar Oct 26 '13 23:10 jpdevries

I can confirm this issue on every site have that runs articles. This appears to occur when the ID of the articles container is lower than the ID of a document that you attempt to move "above" the articles container in the tree.

Manually editing menuindex values in the database does not appear to have any effect on resolving the issue. It basically becomes impossible to move the articles container, moving it appears to work fine, but then if you refresh the tree view it's actually hidden

JayCarney avatar May 01 '14 05:05 JayCarney

Thanks for chiming in, Jay. I am really surprised to hear so few people reporting this issue as it crops up every time I implement Articles. Yet I can't reliably identify the steps to reproduce it.

MokoJumbie avatar May 01 '14 22:05 MokoJumbie

This issue has been mentioned on MODX Community. There might be relevant details there:

https://community.modx.com/t/one-resource-and-children-missing-from-resource-tree/4868/15

rthrash avatar Jan 21 '22 11:01 rthrash

The problem seems to be, that MODX adds objects differently to a collection depending on if they are lazy or not.

https://github.com/modxcms/revolution/blob/d8202a381dfe8a3c8ab9d8699198d8fe4d87ff45/core/model/modx/modaccessibleobject.class.php#L69-L73

If there is a mixture between lazy and non-lazy objects, values may get overwritten.

https://github.com/modxcms/Articles/blob/380b387e2077961e77c09350b10616fc085747ad/core/components/articles/model/articles/articlescontainer.class.php#L222-L229

There is a more detailed explanation in the MODX forum: https://community.modx.com/t/one-resource-and-children-missing-from-resource-tree/4868/11

halftrainedharry avatar Jan 21 '22 12:01 halftrainedharry