Best way to create feedback mechanism on user profile

9 months 1 week ago #320291 by boyjahq
That worked perfectly to bring over original comments.

Is there a similar way to bring over the feedback comments that are associated with the original wall posts so that they show as replies in CB Activity comments?

comprofiler_plug_profilebook "feedback" field

Please Log in to join the conversation.

9 months 1 week ago #320294 by krileon
Those are stored in the `feedback` column of _comprofiler_plug_profilebook. Comment replies are stored with an Asset of "comment.PARENT_ID". Something like the below might work by trying to find the comment that matches the `feedback` then making it a reply.

INSERT INTO `TABLE_PREFIX_comprofiler_plugin_activity_comments` ( `user_id`, `asset`, `message`, `date` ) SELECT b.`userid`, CONCAT( 'comment.', ( SELECT `id` FROM `TABLE_PREFIX_comprofiler_plugin_activity_comments` WHERE `asset` = CONCAT( 'profile.', b.`userid`, '.field.FIELD_ID' ) AND `message` = b.`feedback` LIMIT 1 ) ), b.`feedback`, b.`date` FROM `TABLE_PREFIX_comprofiler_plug_profilebook` AS b WHERE b.`posterid` > 0 AND b.`mode` = 'w' AND ( b.`feedback` != '' AND b.`feedback` IS NOT NULL )

Like before be sure to replace TABLE_PREFIX and FIELD_ID. Be sure to check the resulting rows that were inserted either in _comprofiler_plugin_activity_comments directly or in CB Activity > Comments to be sure they created correctly. Again, I can't guarantee this will work and is untested.


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.
The following user(s) said Thank You: boyjahq

Please Log in to join the conversation.

9 months 4 days ago #320352 by boyjahq
I appreciate SO MUCH your efforts on our behalf! This time, the code that you have provided does not seem to do everything necessary. When I run the code you provided (after replacing the TABLE_PREFIX and FIELD_ID with appropriate information), it completes several hundred records but gives the error message:

Warning: #1048 Column 'asset' cannot be null

And sure enough, all fields are completed but the Asset column is empty.

I have tried everything that this non-programmer can think of to modify the code for correct results, but am unable to get the right answer.

This is the sql query that I am running:

INSERT INTO `y2vfp_comprofiler_plugin_activity_comments` ( `user_id`, `asset`, `message`, `date` ) SELECT b.`userid`, CONCAT( 'comment.', ( SELECT `id` FROM `y2vfp_comprofiler_plugin_activity_comments` WHERE `asset` = CONCAT( 'profile.', b.`userid`, '.field.118' ) AND `message` = b.`feedback` LIMIT 1 ) ), b.`feedback`, b.`date` FROM `y2vfp_comprofiler_plug_profilebook` AS b WHERE b.`posterid` > 0 AND b.`mode` = 'w' AND ( b.`feedback` != '' AND b.`feedback` IS NOT NULL )

I know that this is probably outside of the realm of expected customer support, but is there any place in the code you can think of that I might be able to modify that would fix the Asset issue?

Please Log in to join the conversation.

9 months 4 days ago #320359 by krileon
It's probably the `message` = b.`feedback` part of the query. Change that as follows.

FROM:
`message` = b.`feedback`
TO:
`message` = b.`postercomment`


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.
The following user(s) said Thank You: boyjahq

Please Log in to join the conversation.

9 months 3 days ago #320378 by boyjahq
Success! Thank you so much for your assistance with this!
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

5 months 4 weeks ago #321906 by boyjahq
After going through the process that you so kindly explained to me, I find some problems. Specifically, the count of comments that is shown is sometimes wildly different from the actual comments that can be viewed. For example, on one member of many years, it shows a total of 84 comments:



But only 9 comments are actually visible in the list. It seems perhaps that comments from members who are no longer active members (and their profiles have been deleted) are showing in the total comments but their comments are not actually visible?

How can we get it to show all comments, even if the users who made the comments are no longer in the comprofiler/user database?
Attachments:

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.465 seconds

Facebook Twitter LinkedIn