PROFILE BOOK RATING

5 years 7 months ago #306584 by fruhling
PROFILE BOOK RATING was created by fruhling
Hello - I am adding additional rating fields to a site, using the Profile Book plugin I purchased.

I have managed to edit the php code to allow for additional voting sections (i.e. overall rating, visual appearance, etc.)

(components/com_comprofiler/plugin/user/plug_cbprofilebook/templates/default/guestbook.php)

However, when the user leaves a rating in one of these new fields it is not saved to the database.

If I manually enter the rating into my backend database the ratings display as desired on the main guestbook display. It is simply an issue of the form data not saving to the database - as the new table column IS being created when the form is submitted.

I am sure I am missing a variable or have overlooked something. Can you please advise?

Thank you!

Please Log in to join the conversation.

5 years 7 months ago #306597 by krileon
Replied by krileon on topic PROFILE BOOK RATING
There's no storage behavior in CB ProfileBook for the additional rating HTML you've added. You can't just add HTML and it suddenly start saving it to the database as that'd be a vulnerability. You'll have to implement storage behavior for your HTML changes. Easiest approach is to probably just create a Rating field then use getFields API to output it in CB ProfileBook. See the below on how to use getFields API.

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


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 to join the conversation.

5 years 7 months ago #306605 by fruhling
Replied by fruhling on topic PROFILE BOOK RATING
Thank you for the reply - I should clarify a bit more.

The only groups that have access to the ProfileBook/Guestbook are superusers - basically rating the entries in a contest. I am not concerned about security with these users.

Also, I have set up my new rating fields to completely mimic the 'postervote' item with its associated classes, including validation. I would only need to extend the validation that is already happening for the 'postervote' item to the new items (postervote2, postervote3, etc.)

Can you perhaps let me know where the validation code resides?

Again, I appreciate your response - but this is the best fit for me if possible.

Please Log in to join the conversation.

5 years 7 months ago #306622 by krileon
Replied by krileon on topic PROFILE BOOK RATING

The only groups that have access to the ProfileBook/Guestbook are superusers - basically rating the entries in a contest. I am not concerned about security with these users.

You certainly should be. Regardless we don't design plugins with such vulnerabilities in mind. So what you're wanting to do is not possible without also implementing storage behavior for your new rating display.

Also, I have set up my new rating fields to completely mimic the 'postervote' item with its associated classes, including validation. I would only need to extend the validation that is already happening for the 'postervote' item to the new items (postervote2, postervote3, etc.)

Don't understand what you're asking here. The rating in CB ProfileBook is basically just a profile rating. So a single rating field. Rating fields you can create in CB > Field Management already behave this way. What validation rules you can change for rating fields is available within its parameters. Any further changes would require changing core code, which I can not help you with as we do not support core edits.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.204 seconds

Facebook Twitter LinkedIn