bbeer Posted May 31, 2018 Posted May 31, 2018 Hi all would need to exclude children of the trash to appear in queries. Tried it with ("parent!=49") where parent id is the trash. Does not work with find nor get. Your help is much appreciated.
kongondo Posted May 31, 2018 Posted May 31, 2018 The ID of trash is 7, not 49. Depending on your need, you could do: $untrashedPages = $pages->find("template=some-template, status<" . Page::statusTrash); //$untrashedPages = $pages->find("template=some-template, has_parent!=7"); //$untrashedPages = $pages->find("template=some-template, has_parent!=" . $config->trashPageID); FYI, statusTrash = 8192 7
adrian Posted June 1, 2018 Posted June 1, 2018 I am surprised you are seeing trashed pages returned in a find call in the first place. Are you using "include=all" in the selector as well - I think that is the only way it will return trashed items.
bbeer Posted June 4, 2018 Author Posted June 4, 2018 Hi adrian sorry for the late reply. Well the problem was not directly that the page itself was listet. We output information from the page, if not there we check in the pages parent field for the content. The problem was, even though the page was in the trash, the values where still taken from that page, and not from the new, actually copy of that page. As soon as the trash was emptied, the problem was solved. Excluded the the trash now from the query, so hopefully we won't have that kind of occurrence again.
cpx3 Posted January 5, 2023 Posted January 5, 2023 @adrianI just had the same problem, which took me hours to figure it out... 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now