If users has an underscore in their nickname they can't use the banner function. It gets the "Whoops, can't find user"
Instead of "user_name" it gets "user-name" in the URL. I guess that's why it's not working there.
Without looking at the code, I am assuming the profile name is getting passed through the URL function which replaces special symbols with a -.
-
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
public function ProfileController_AfterAddSideMenu_Handler($Sender) { $SideMenu = $Sender->EventArguments['SideMenu']; $BannerUserID = Gdn::Session()->UserID; $IsAdmin = Gdn::Session()->CheckPermission('Garden.Users.Edit'); if (($Sender->User->UserID == $BannerUserID) || ($IsAdmin)) { $SideMenu->AddLink('Options', T('Banner de Usuario'), '/profile/userbanner/' . $Sender->User->UserID . '/' . Gdn_Format::Url($Sender->User->Name), FALSE, array('class' => 'Popup')); } }
Will that be the one? Any idea how can it be fixed @hgtonight ?
Change line 94 to $Sender->GetUserInfo($BannerUserID, $BannerUserName, $BannerUserID);.
$Sender->GetUserInfo($BannerUserID, $BannerUserName, $BannerUserID);
Then comment out lines 90 and 92.
Let me know if that works.
It worked!!! Thanks @hgtonight for your time.
Comments
Without looking at the code, I am assuming the profile name is getting passed through the URL function which replaces special symbols with a
-
.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
public function ProfileController_AfterAddSideMenu_Handler($Sender) { $SideMenu = $Sender->EventArguments['SideMenu']; $BannerUserID = Gdn::Session()->UserID; $IsAdmin = Gdn::Session()->CheckPermission('Garden.Users.Edit'); if (($Sender->User->UserID == $BannerUserID) || ($IsAdmin)) { $SideMenu->AddLink('Options', T('Banner de Usuario'), '/profile/userbanner/' . $Sender->User->UserID . '/' . Gdn_Format::Url($Sender->User->Name), FALSE, array('class' => 'Popup')); } }
Will that be the one?
Any idea how can it be fixed @hgtonight ?
Change line 94 to
$Sender->GetUserInfo($BannerUserID, $BannerUserName, $BannerUserID);
.Then comment out lines 90 and 92.
Let me know if that works.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
It worked!!!
Thanks @hgtonight for your time.