Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Articles affecting menuindex enumeration #6

Open
MokoJumbie opened this issue Jun 23, 2013 · 6 comments
Open

Articles affecting menuindex enumeration #6

MokoJumbie opened this issue Jun 23, 2013 · 6 comments
Labels
Milestone

Comments

@MokoJumbie
Copy link

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.

@jpdevries
Copy link
Contributor

Provided consistent steps to reproduce this can be debugged further

@jpdevries
Copy link
Contributor

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

@JayCarney
Copy link

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

@MokoJumbie
Copy link
Author

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.

@JoshuaLuckers JoshuaLuckers added this to the v1.8.0 milestone May 31, 2019
@JoshuaLuckers JoshuaLuckers modified the milestones: v1.8.0, v1.9.0 Oct 3, 2020
@rthrash
Copy link
Member

rthrash commented Jan 21, 2022

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

@halftrainedharry
Copy link
Contributor

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.

/**
* Prevent isLazy error since Articles types have extra DB fields
* @param string $key
* @return bool
*/
public function isLazy($key = '') {
return false;
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants