Could we please have a findOneID() that works like getID() / has() except that it respects exclusions ?
Current vs. suggested behavior
Currently you can't use getID() or has() to actually check if a page exists and is published, not hidden, not trashed, so it's not that useful in most scenarios. The idea behind has() (if I am correct) was to provide a very performant way to know if there are any results for a selector - faster than count() which many of us have used for this purpose. But when it doesn't respect exclusions, it really doesn't work like count().
Short description of the enhancement
Could we please have a
findOneID()
that works likegetID()
/has()
except that it respects exclusions ?Current vs. suggested behavior
Currently you can't use
getID()
orhas()
to actually check if a page exists and is published, not hidden, not trashed, so it's not that useful in most scenarios. The idea behindhas()
(if I am correct) was to provide a very performant way to know if there are any results for a selector - faster thancount()
which many of us have used for this purpose. But when it doesn't respect exclusions, it really doesn't work likecount()
.Why would the enhancement be useful to users?
More details here: https://processwire.com/talk/topic/25237-pages-has-with-exclusions-or-maybe-a-findoneid/?tab=comments#comment-211902
Thanks for considering.