As the title says, I can successfully return the "existing user IDs" from an entry field if the "entries.saveEntry" event is called after saving the entry from the CMS admin area; however, if I save an entry via a front-end form, the same code produces empty results.
I've used xDebug to verify that the objects are the same line by line; somehow the data isn't there for $users->ids() for front-end triggered events.
// get entry
$entry = craft()->entries->getEntryById($entryId); // elementType => "Entry"
// get ALL users related to entry
$users = craft()->elements->getCriteria(ElementType::User); // elementType => Craft\UserElementType
$users->status = null;
$users->relatedTo = [$entry]; // elementType => "Entry"
$userIds = $users->ids(); // elementType => Craft\UserElementType
Example result when triggered from backend (good):
array(
0 => 251,
1 => 252,
3 => 257
)
Example result when triggered from front-end (help!):
array()