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] Problem with autoactions...

11 years 6 months ago - 11 years 6 months ago #225979 by zaratustra27
[SOLVED] Problem with autoactions... was created by zaratustra27
I have a site where I want users to save their data but it shouldn't be available for public until approval, so I built the following:

A registered tab with all fields user can save
A special tab with a single checkbox for approval [cb_approval]
A public tab with 'copies' of fields in registered tab

The process is as follows (user is already active):

User saves its data
An administrator reviews profile, approves changes and saves profile again
A field autoaction, triggered by 'save' action, checks if approval field is checked and then copies registered field value into respective public field

Bad thing it doesn't work, I attach a screen of current autoaction settings.

Other features that may be relevant (I disable them in order to ease things but it didn't help and doubt persists):

All public fields are text ones, registered ones vary (there are checkboxes, radios, lists, etc.)
Public fields are read-only

My system info is:

J2.5.9
CB 1.9
AA 3.5.1

Thanks in advance for your valuable help.
Attachments:
Last edit: 11 years 6 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
11 years 6 months ago #225990 by krileon
Replied by krileon on topic Problem with autoactions...
Checkbox values are not "Yes" and "No", but are "1" and "0" (usually when 0 it nulls it). I suggest setting your Conditional as follows.

[cb_approval] Not Empty

or

[cb_approval] Equal To 1

Either of the above should give the desired affect. Always remember to test your actions without a conditional before saying they don't work as configuration of the conditional is the common place users misconfigure.

Also if you're updating multiple fields you're probably best using a Query action instead of say 20 Field actions. Example as follows with a query.
Code:
UPDATE `#__comprofiler` SET `cb_myfield1` = '[VALUE]', `cb_myfield2` = '[VALUE2]' WHERE `id` = '[user_id]'


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.

11 years 6 months ago #226030 by zaratustra27
Replied by zaratustra27 on topic Problem with autoactions...
Thanks, worked like a charm

Also, thanks for the suggestion about using a mysql autoaction instead of multiple field ones. I'll try it

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

Moderators: beatnantkrileon
Powered by Kunena Forum