Closed jlahijani closed 2 years ago
@jlahijani The homepage has no parent, so a parent.name sort couldn't be performed on it. At least, if it were included, I'm not sure where it should appear in that scenario.
At least, if it were included, I'm not sure where it should appear in that scenario.
Still, I think it should be included somewhere. This issue isn't specific to Page Reference fields, it affects PageFinder selectors generally (but not in-memory selectors).
The implication of "sort" is that it determines the order of items but not which items are included.
@ryancramerdesign Any new thoughts on this one now that you're on a binge of fixing various issues?
Note: I've worked around this by hooking into InputfieldPage::getSelectablePages
and just populating the field options that way.
@jlahijani Great, glad you found a way to work around it. I don't see a good way to support this because when you sort by something from another page (in the DB) it performs a join of the page holding the sortable value, and that requires that that page being sorted by is present, otherwise the page cannot participate in the selection, or the sort. So I don't think this is one that we can support in any straightforward way, as it's more an SQL behavior.
Suppose you make a page select field with this selector string:
The "home" page will not appear.
However if you do this, it will appear: