is this a known issue? considering the following c...
# adobe
m
is this a known issue? considering the following code, acf 2025 resolves the ternary different than every other engine
Copy code
bob = 0;
writeOutput(val(bob) ? " <strong>truthy</strong> " : " <strong>falsy</strong> ");
if ( val(bob) ) {
    writeOutput('<strong>i am true</strong>');
} else {
    writeOutput('<strong>i am false</strong>');
}
any other (cf, lucee, bx) = falsy i am false acf 2025 = truthy i am false https://trycf.com/gist/8f25f265335cdf90c03c28d79d951227/acf2025?theme=monokai
b
Trycf isn't feeling well ATM, but that certainly seems wrong!
I know Adobe has royally screwed up how elvis works, but ternary should still be correct 🤔
Did you test against 2023 or 2021?
oh, you actually mentioned "bx" already, sorry, lol
I'd search the bug tracker and report a ticket for it. Does it only happen for 0, or for other falsey values?
b
@Matt Jones this looks like a bug I reported a while ago (CF-4225874)
m
@bdw429s, i tested against bx, all versions of lucee and cf 2018 and up. 2025 was the only one that acted dumb, and only if my compare was val(bob) if i ran without the val(), bob it behaved as expected.
👍 1
🙌 1
@bockensm Thank you, that definitely looks like the same thing.
a
@Matt Jones: This seems to be the same issue that @bockensm has reported, I have shared a patch for this in DM. Kindly apply the patch and see if it works. You can also download the patch from https://tracker.adobe.com/#/view/CF-4225874
❤️ 1
m
@Ashudeep Sharma thank you, that patch does appear to resolve what i was seeing.
👍 1
j
I love how we share!!! This was driving me crazy last night running thru some CF2025 checks as this was not working properly. Now I just need to deal with the CFMX_COMPAT removal.
Copy code
writeDump( val( form.value ?: 0 ) ? true : false );
@Ashudeep Sharma will this be available in the next hot fix?
m
@jc another alternative, before it makes it into an update, if you can't apply the hotfix jar from CF-4225874 this also works writeDump( val( form.value ?: 0 ) != 0 ? true : false );
a
@jc: Yes this bug has been targetted and the fix will be available in the next bugfix update.
j
Thanks @Matt Jones, I had no issues applying the hotfix, just wanted to confirm it was slated for the next bugfix. Thank you for the update @Ashudeep Sharma
👍 1