Fixes #81911 by adding a restriction so we retrieve only publicized layers for the virtual "others" folder.

Also, improved sorting of layers by centralizing the adding of sorting statements.
Merge pull request #78 from luisromangz/8.5-SNAPSHOT-81911

Fixes #81911 by adding a restriction so we retrieve only publicized laye...