Skip to Content Skip to Menu

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

[#4119] Creating an autoaction that won't fire if a field is empty

11 years 3 months ago - 11 years 3 months ago #230989 by andrewheritage
I have an auto action that triggers when a user changes a field on their profile. However what I am trying to achieve is for it to not trigger if they change the field to nothing (it is a list of choices so they can select one or just select the blank line at the top to clear it.)

I have tried conditions of :

[var1_cb_test] NOT EMPTY

[var1_cb_test] DOES NOT CONTAIN ""

[var1_cb_test] IS NOT REGEX ^$

but none of these stop it from triggering - how should a detect when a field is 'blank'

Thanks
Last edit: 11 years 3 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #231005 by krileon
Was able to confirm your issue as a bug and have created the below bug ticket for further investigation.

forge.joomlapolis.com/issues/4119

A fixed release should be out by end of today.


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: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #231019 by krileon
Have released 5.1.2 implementing better handling of blank conditionals. Tested your scenario as working fine now.


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 3 months ago #231042 by andrewheritage
Thanks that gets it to work now, however I'm now seeing another odd behaviour.

I have this variable (the one that if changed by the user triggers an auto action) set with Ajax enabled and I then display it on a page using the CB Content module. If the user changes it to a blank entry (from the drop down) the animated timer is shown and this stays their without the screen ever updating (see attached.)

If I turn off the AutoAction entry it works fine in terms of updating on the screen after the user changes it, so there seems to be something going on. (the change does actually happen as if you reload the page it shows the field was changed.)
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #231063 by krileon
CB Core Fields Ajax and latest CB Ajax Text both fire the profile update triggers. So if you're doing for example a redirect action on those triggers you're probably going to break the Ajax response. I've no idea what action you're using so I've no idea what you're altering the Ajax response to.


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 3 months ago - 11 years 3 months ago #231068 by andrewheritage
I am essentially copying what is explained in the Tutorial example for CB Autoactions but with an extra check, since otherwise if a user selects the top (blank) entry for their current their mood (field) CB Activity displays that the "mood is " so I added an extra condition (before the check for the change of variable) to check the new value is not blank.

I display the Mood field in a CB Content module to allow the user to edit it from that page (so I have enabled Ajax on that field.)

The page they are on does have the activity stream showing but as the condition is set to not trigger if they change the field to blank then, if anything, I would have expected if there was any conflict it would happen the other way around?

If they change the field from one value to another value rather than to set it as blank/empty, then it all works fine.
Last edit: 11 years 3 months ago by andrewheritage.

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

Moderators: beatnantkrileon
Powered by Kunena Forum