[SOLVED] Very strange date comparison in Auto Action

6 years 6 months ago - 6 years 5 months ago #297208 by fribse2011
I have a simple auto-action that checks todays date against the birthday for the user, and if it matches, it creates a salute that is shown in the activity stream.
I found a small error in the setup yesterday, and got it fixed, today there is a birthday, but for some reason it misses the date comparison.
It's an activity that has the Users trigger.

In Debug it reads:
Action 164 :: Conditional 2 failed for 407: 09-11 Equal To 09-12

The Conditional 2 reads:
[cb:parse function="date" date-format="m-d" time="false"][cb_birthday][/cb:parse] Equal To [cb:date format="m-d" /]
So the latter value is todays date, and the first is from the profile.

User 407's birthday is set to
12 - 09 - 1970

Looking in the databaase user 407 reads
cb_birthday 1970-09-12

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 6 months ago #297219 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action
Looks like it's being offset. Try adding offset="UTC" to your date format function usage.


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.

6 years 6 months ago - 6 years 6 months ago #297249 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
Ok, I updated to v7 of AA, just to be sure that it wasn't that.
Then I changed the comparison to
[cb:parse function="date" date-format="m-d" time="false"][cb_birthday][/cb:parse]
Equal To
[cb:date format="m-d" offset="UTC"/]
But I don't get why that should be necessary, I was testing it 7 am, that is a HUGE offset if that was the case???
I've rerun it with debug activate for that action, but with v7, debug doesn't show anything in the output.

If the date comparison suddenly starts failing, it's going to be catascrophic for my site, I have a lot of date automations for the members.
Again, I can just reiterate, this has worked previously...

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 6 months ago #297259 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action
The cb:date substitution has always worked that way and passes the current datetime through server offset unless you tell it not to. The cb:parse usage should already be in UTC as by default it doesn't server offset. Basically what your cb:date usage is doing is taking the current datetime and formatting it to month and day after being server offset. By setting offset to UTC it won't offset.


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.

6 years 6 months ago #297292 by fribse2011
Replied by fribse2011 on topic Very strange date comparison in Auto Action
Yes, and it still behaves differently than when it was last used a year ago, this is not new auto-actions I've built, they were built last year, and tested extensively.

Now what about the issue that makes it impossible to debug it now? I've activated debug, but no debug is shown when testing it?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

Please Log in to join the conversation.

6 years 6 months ago #297299 by krileon
Replied by krileon on topic Very strange date comparison in Auto Action
This behavior has never changed. The CB date substitution has always offset. My guess is you've never noticed it.

Now what about the issue that makes it impossible to debug it now? I've activated debug, but no debug is shown when testing it?

Debugging outputs to the Joomla message queue. Should output the error on the next page load as a error message wherever your Joomla template displays its message queue. Ensure debugging is enabled in the Auto Action then ensure within Joomla global configuration you've debug mode and maximum error reporting configured. Previously it'd just randomly var dump the error message when it happened which was unreliable.


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.286 seconds

Facebook Twitter LinkedIn