mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 00:06:55 +02:00
Add exception to warn of unsupported OR condition in PageFinder per processwire/processwire-issues#1428
This commit is contained in:
@@ -459,10 +459,16 @@ class PageFinder extends Wire {
|
|||||||
|
|
||||||
foreach($selectors as $key => $selector) {
|
foreach($selectors as $key => $selector) {
|
||||||
|
|
||||||
$fieldName = $selector->field;
|
/** @var Selector $selector */
|
||||||
|
$fieldName = $selector->field;
|
||||||
|
|
||||||
|
if(is_array($fieldName) || is_array($selector->value)) {
|
||||||
|
throw new PageFinderException("OR-condition not supported in '$selector'");
|
||||||
|
}
|
||||||
|
|
||||||
if($fieldName == 'status') {
|
if($fieldName === 'status') {
|
||||||
$value = $selector->value;
|
// @todo add support for array value,i.e. `status=hidden|unpublished`
|
||||||
|
$value = $selector->value();
|
||||||
if(!ctype_digit("$value")) {
|
if(!ctype_digit("$value")) {
|
||||||
// allow use of some predefined labels for Page statuses
|
// allow use of some predefined labels for Page statuses
|
||||||
$statuses = Page::getStatuses();
|
$statuses = Page::getStatuses();
|
||||||
|
Reference in New Issue
Block a user