Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Connection field validation (possibly using CB Auto Action)

  • newlog
  • newlog
  • OFFLINE
  • Posts: 35
  • Thanks: 6
  • Karma: 1
11 years 9 months ago - 11 years 8 months ago #219857 by newlog
[probably for for Kyle]

I need to implement the following feature:

When a frontend user edits the connection tab in his profile and hits the Save button:
  • If the selected connection types match a given custom criterion, eg. there should be exacty one non-empty connection type selected, the user's profile is saved
  • Else saving is cancelled and the connection tab is re-displayed with a language-dependent warning
What is the best way to achieve this?
I tried with an Auto Action but could not figure out how to cancel a save, nor display a warning.

Thanks in advance.
Last edit: 11 years 8 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #219873 by krileon
No trigger is fired during the connection save so there is no way to do this using CB Auto Actions. Options are to edit the comprofiler.php file directly and add validation for the connection type input or use a Joomla system plugin that does some POST variable checks after router has passed you the connections save URL.


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.

  • newlog
  • newlog
  • OFFLINE
  • Posts: 35
  • Thanks: 6
  • Karma: 1
11 years 9 months ago #219881 by newlog
Thank you.

I would very much appreciate some guidance, however.

Solution A

Options are to edit the comprofiler.php file directly and add validation for the connection type input.

Which function is best appropriate for this?

Solution B

Use a Joomla system plugin that does some POST variable checks after router has passed you the connections save URL.

I would rather work at the CB level than at the Joomla level. Is it possible to implement this with a CB plugin? If so is there a template plugin I could start from?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #219891 by krileon

Which function is best appropriate for this?

I can't help you with core edits, we do not support them. You'll need to review comprofiler.php and make modifications as needed.

Is it possible to implement this with a CB plugin?

No, no trigger fires during the connection save process. A Joomla plugin would be needed so you can act on the form POST URL and redirect back to manage connections with a redirect error message.


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.

  • newlog
  • newlog
  • OFFLINE
  • Posts: 35
  • Thanks: 6
  • Karma: 1
11 years 9 months ago #219911 by newlog

I can't help you with core edits, we do not support them.


What is this???

You DO provide guidance to core edits, eg. in this thread

This is paid support, please provide help. Obviously you can.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48454
  • Thanks: 8280
  • Karma: 1443
11 years 9 months ago #219942 by krileon

What is this???

We do not support core edits. This means I can not help you modify CBs core code unless it's a bug, which this is not. Again, you will need to review comprofiler.php; the functions are rather self explanatory (e.g. saveConnections).

You DO provide guidance to core edits, eg. in this thread

No we do not. That is a bug in CB Auto Actions that I provided a quickfix for.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum