"|" means OR, and it was working as it should (or is it different with textfields?) the first to find will be returned.
1. That behavior is only useful when doing something like $page->get("headline|title"); where you'd like the headline, but will settle for the title if there's no headline. Literally saying I'll take
headline OR
title, but I prefer
headline." That behavior works there because we're not talking about retrieving pages, we're just talking about retrieving the first non-empty value. Order matters here because we're stating a preference for headline since it is mentioned first.
2. When you use OR "|" in a selector to retrieve pages, you can use "|" between field names, like "title|body*=something". That literally translates to "Find all pages that have the word 'something' in either the
title OR
body. Order here means nothing, because if it matches in either title or body, you are going to get the page in the results either way. It may match the word 'something' in the
title field on some pages, and in the
body field on others.
3. You can also use OR "|" in the selector value, like "body*=this|that". That translates to "Find all pages that have the word 'this' OR 'that' in the
body field. Some of the returned pages will match 'this' and some will match 'that'. It doesn't matter what the order is either (I'm not sure how it could).
Getting back to this: "modified_users_id|created_users_id=1020" -- that translates to exactly the same thing as #2 above, as it should. Literally meaning "Find all pages that were either modified OR created by user 123". When I execute that find on my machine, here is what I get:
- page: 1, created_user_id: 1020, modified_user_id: 2
- page: 4459, created_user_id: 1020, modified_user_id: 41
- page: 4601, created_user_id: 41, modified_user_id: 1020
- page: 4602, created_user_id: 1020, modified_user_id: 1020
- page: 4615, created_user_id: 1020, modified_user_id: 41
- page: 6674, created_user_id: 1020, modified_user_id: 40
- page: 6683, created_user_id: 1020, modified_user_id: 41
- page: 6705, created_user_id: 1020, modified_user_id: 1020
This is the expected behavior. At least, it is on my machine. Before yesterday (or if you haven't replaced your PageFinder.php file with the one attached above), you would have gotten this:
- page: 1, created_user_id: 1020, modified_user_id: 2
- page: 4459, created_user_id: 1020, modified_user_id: 41
- page: 4602, created_user_id: 1020, modified_user_id: 1020
- page: 4615, created_user_id: 1020, modified_user_id: 41
- page: 6674, created_user_id: 1020, modified_user_id: 40
- page: 6683, created_user_id: 1020, modified_user_id: 41
- page: 6705, created_user_id: 1020, modified_user_id: 1020
Note it would only catch the 'created_user_id' part (or whichever you specified first), because fields native to the 'pages' table didn't consider ORs in the fields part of the selector.
If you are getting something other than the expected result, can you post the selector you are using and the list of matching pages like above? Here's the code I used to do it if it helps:
$results = $pages->find("created_users_id|modified_users_id=1020");
echo "<ul>";
foreach($results as $result) {
echo "<li>page: {$result->id}, created_user_id: {$result->created_users_id}, modified_user_id: {$result->modified_users_id}</li>";
}
echo "</ul>";Also just to reiterate, this will only work if you are running the latest PW and have installed the PageFinder.php file attached above.