·
Added a discussion

Home page shows error 500 after login.

error_log: 

[04-Mar-2021 12:02:46 UTC] PHP Fatal error:  Uncaught Error: Call to a member function getIcon() on bool in /home/kinkycco/kinkyc.com/modules/boonex/messenger/classes/BxMessengerTemplate.php:773

[04-Mar-2021 12:08:01 UTC] PHP Fatal error:  Uncaught Error: Call to a member function getDisplayName() on bool in /home/kinkycco/kinkyc.com/modules/boonex/messenger/classes/BxMessengerTemplate.php:774

 $aIcons[] = array(

                'id' => $iProfileId,

                'icon' => BxDolProfile::getInstance($iProfileId)->getIcon(),

                'name' => BxDolProfile::getInstance($iProfileId)->getDisplayName(),

            );

After commenting out these lines and applying empty value to icon and name everything (?) works.

  • 1817
Comments
    • Hello!

      Fix for this problem will be included to the nearest update.

      The correct fix is: 

      Replace code from your example with:

      if ($oProfile = BxDolProfile::getInstance($iProfileId))
      $aIcons[] = array(
      'id' => $iProfileId,
      'icon' => $oProfile->getIcon(),
      'name' => $oProfile->getDisplayName(),
          );
      • Thank you! Will give it a try.

        Login or Join to comment.