Skip to Content Skip to Menu

Error in Jlex avatar

  • Leobici
  • Leobici
  • OFFLINE
  • Posts: 67
  • Thanks: 14
  • Karma: 0
1 week 23 hours ago #340313 by Leobici
Error in Jlex avatar was created by Leobici
Hi,
i've just updated my website to joomla v4 and almost everything is working well.
one problem that i have is with CB avatar used in jlex comment.
I have an error:
Call to a member function avatarFilePath() on null

I asked to jlex comment developer and they said:

it's related to the "Community Builder" extension. It seems they updated their framework so the old functions might be outdated and not working. Could you help me ask their team if this function still works?
$thumb = CBuser::getInstance($userid)->avatarFilePath();

Could you help me please?
Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48830
  • Thanks: 8344
  • Karma: 1449
1 week 2 hours ago #340324 by krileon
Replied by krileon on topic Error in Jlex avatar
That API has been deprecated for a few years now since CB 1.9. The function still exists, but it might not work with newer avatar field features. The correct way to get the avatar field is the same way all fields are obtained via the getField API below.

www.joomlapolis.com/documentation/127-community-builder/279-tutorials/18361-obtaining-field-values-through-getfields-api

However that's not their issue. CBuser::getInstance will return NULL if the $userid doesn't exist. There's a second parameter on that function that can be set to false so it never returns NULL otherwise they need to check for NULL before calling avatarFilePath (or ideally getField).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • Leobici
  • Leobici
  • OFFLINE
  • Posts: 67
  • Thanks: 14
  • Karma: 0
6 days 23 hours ago #340327 by Leobici
Replied by Leobici on topic Error in Jlex avatar
Thanks a lot,
 i will forward your answer and see what they can do.

 

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum