ColdBox BE - CookieStorage Plugin lost default value on getVar()

10 views
Skip to first unread message

br...@bradwood.com

unread,
Jun 4, 2012, 4:23:13 PM6/4/12
to ColdBox List
I was just trying out the bleeding edge dev branch, and I noticed a change that broke my app.  The getVar() method in the CookieStorage plugin use to have a default attribute of "" on the "default" argument.  That meant that

gePlugin("CookieStorage").getVar("ITotallyDontExist")

used to return an empty string.  Now, it throws an error.

I can put in an internal ticket to go back and modify my app to either pass in the default value explicitly, or to always call exists() first, but I wanted to check and see if this change was intentional or not, and if it was to ensure it makes it in the compatibility guide.

Here's the commit that introduced the change in behavior:

Thanks!

~Brad

Luis Majano

unread,
Jun 4, 2012, 4:33:08 PM6/4/12
to col...@googlegroups.com
Yes, this was reported Brad.  I just think this maybe should be the desired effect, as you are requesting a non-existent variable but receiving an empty string.  
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org

Brad Wood

unread,
Jun 4, 2012, 5:07:28 PM6/4/12
to col...@googlegroups.com
> you are requesting a non-existent variable but receiving an empty string. 

Well yes, you just described the behavior of a default value in action.  The real question is whether or there should be a default "default" value.  :)

I'm fine with the new approach.  I think it's cleaner and a bit less presumptuous.  Just make sure it makes it in the compatibility guide and we'll be good.

Thanks!

~Brad

Luis Majano

unread,
Jun 4, 2012, 5:42:51 PM6/4/12
to col...@googlegroups.com
Ok, sounds good! Also, it has to be consistent across all storage plugins. So maybe this is a candidate for the 3.5.2 release plus your instance issues.
Reply all
Reply to author
Forward
0 new messages