Skip to Content Skip to Menu

CB Activity: Linked Names through "@Peter Smith" does link to "@Peter Smith Smith"

9 years 3 months ago - 9 years 3 months ago #267429 by avateamcom
Hello,

the subject already says it: linking to users with full names in my activity stream does duplicate the lastname. Do I do something wrong here or is it a bug?

Example:
Text I enter:
This goes to @Peter Smith my buddy...

Text shown in stream:
This goes to @Peter Smith Smith my buddy...

Only the first "Smith" is linked, the second is plain text.

Thanks for a short reply.

Best regards,
Stefan
Last edit: 9 years 3 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 3 months ago #267447 by krileon
The way the parsing works is it breaks the post up into individual words and does its matching from there, but in this case it should be adding the last name and replacing the entire name even though it has a space separating it. Will look into fixing for stable release.


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.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 3 months ago #267448 by krileon
Ok, was able to find the cause. It's due to the string replacement order. Have fixed for stable. It'll now properly replace in the following order.

User ID
User Name
Username
Matched Word

Before it was replacing the matched word first which is why it only replaced the first word.


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.

9 years 3 months ago #267460 by avateamcom
Hello Kyle,

thanks for checking that!
Can you say when the stable release will arrive?

If not this week, I have to fix this until release in my site, too.
Could you give me a hint, where to fix this temporarily?

Best regards,
Stefan

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48435
  • Thanks: 8275
  • Karma: 1443
9 years 3 months ago #267467 by krileon

Can you say when the stable release will arrive?

Probably today or tomorrow. Just hit some last minute bugs, but was able to get them fixed. Assuming no major issues delay it it should be out no later than tomorrow.

Could you give me a hint, where to fix this temporarily?

The below will fix it.

IN: components/com_comprofiler/plugin/libraries/CB/Plugin/Activity/Parser.php
ON: Line 131
FROM:
Code:
$this->parsed = str_replace( array( $word, '@' . $user->get( 'id' ), '@' . $user->get( 'username' ), '@' . $user->get( 'name' ) ), '<a href="' . $_CB_framework->userProfileUrl( (int) $user->get( 'id' ) ) . '" rel="nofollow">@' . htmlspecialchars( getNameFormat( $user->get( 'name' ), $user->get( 'username' ), Application::Config()->get( 'name_format' ) ) ) . '</a>', $this->parsed );
TO:
Code:
$this->parsed = str_replace( array( '@' . $user->get( 'id' ), '@' . $user->get( 'name' ), '@' . $user->get( 'username' ), $word ), '<a href="' . $_CB_framework->userProfileUrl( (int) $user->get( 'id' ) ) . '" rel="nofollow">@' . htmlspecialchars( getNameFormat( $user->get( 'name' ), $user->get( 'username' ), Application::Config()->get( 'name_format' ) ) ) . '</a>', $this->parsed );


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.

9 years 3 months ago #267471 by avateamcom
Hi Kyle,

thanks for the release-information and the fixing-code. If you release CB Activita Final tomorrow, I don't fix it on my own, theres enough time left for me.. :)

Thanks for help!

Best regards,
Stefan

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

Moderators: beatnantkrileon
Powered by Kunena Forum