I’m using code as such in my block controller on_start() method to get the current profile user id:
$userID = 0;
$c = Page::getCurrentPage();
$profile = $c->getPageController()->get('profile');
if (is_object($profile) && $profile->getUserID()) {
$userID = $profile->getUserID();
}
This works as expected in v8, in v9 $userID never gets set. My next check is if($userID >= 1) fails, and the rest of my code does not work properly.
Similarly, if I place the following into my block view.php:
$c = Page::getCurrentPage();
$profile = $c->getPageController()->get('profile');
if (is_object($profile) && $profile->getUserID()) {
echo $profile->getUserID();
}
I get the proper user id output to the page. v8 AND v9.
I’m stumped. Anybody have any ideas what’s happening here? Is there a better way to be doing this now?