Home | Features | Demo | Downloads | About Us | Support | Hosting | Purchase

Quick Fix for USPS Shipping Rates Problem

Those of you using USPS rates may have noticed they broke sometime around Jan. 2. Apparently when USPS rolled out some price changes for the new year, which also typically includes a bunch of changes to the shipping service names, they included registration/trademark symbols in the API responses, which aren't supposed to be there. So shopping carts like CFWebstore that use these to determine which rates to show (since they still don't provide a unique key for each service, DUMB!) aren't able to properly match due to these extra characters. They are supposed to have it fixed later today, but in the meantime, here's the fix to strip those characters out. Add these two lines of code *after* the line for v.ServiceName that is around line 374 of uspostal.cfc, and this should fix the problem.

v.ServiceName = Replace(v.ServiceName, "<sup>®</sup>", "");
v.ServiceName = Replace(v.ServiceName, "<sup>™</sup>", "");

Please note that due to the typical changes to their available services, you may need to update some of the methods in your USPS settings, to match the new names. We do plan to roll out an update for USPS shipping sometime later this year that will no longer use the service names for determining which services are used. While USPS does not provide a unique key for each one, there are only a couple of services that share an ID, so it's felt that to save having to deal with such issues every year, it's preferable to just not have those extra services available. Hopefully at some point USPS will get around to fixing this major issue with their API so we can more easily work with it.

ColdFusion Tools and Resources

Been a while since I posted anything to the blog, so thought I'd pass on some useful links and tools I've been using recently.

The first is the awesome CF411 site maintained by Charlie Arehart. This is a compendium of links to all kinds of ColdFusion tools, blogs, articles, tutorials, just about anything you might need if you are a ColdFusion developer (or if you just dabble). It's a HUGE resource that everyone that works with CF should have bookmarked.

CFQuickDocs is a really nice online ColdFusion documentation reference done using Ajax. Much faster and easier to pull up tag and function reference and easily swap the CF versions as well.

Local Raleigh CF'er Jim Priest gave a presentation at CFUnited on automation for the CF developer. Included many of the tools and tips that I use myself such as Find and Run Robot, AutoHotKey, LastPass, Lazarus, etc. Check it out here.

If you do any development work for clients, learning to use source control is something you should look into. There are a variety of excellent hosting companies that offer SVN and/or Git hosting, Codesion. is one that is very popular and that I use myself. Recently someone pointed me to another option, Unfuddle which not only hosts your repositories, but provides some really top-notch project management and ticket tracking as well, all for very reasonable prices.

Finally, recently I was having a major problem debugging a Flex remoting issue. I ended up solving it by using an HTTP debugging proxy tool. It occurred to me that this may be a really useful tool for many CFWebstore developers as well, if you work with any portions of the code that interact with external servers, like shipping or payment gateways. Basically an HTTP proxy can show you all the data passing back and forth and greatly assists when trying to determine where a problem might be occurring. My favorite proxy tool is Charles which has excellent capabilities and a really nice clean interface, but it does cost $50 to purchase. Under the free category, you'll find Fiddler which is a free proxy done by Microsoft that is fairly widely used and has many plugins available as well.

Well, that's about all I have. Feel free to post your favorite tools in the comments (spam will be removed!)

MySQL Null Null Error

Not long ago I got an email from a customer having a strange problem with his store. Whenever someone checked a box to remove an item from the shopping cart, the store would throw an error. Reviewing the error dump showed a strange null null error. We've seen this in ColdFusion for some time but in the past, they are usually not very reproducible unless there's an error in the code causing a null value. On review though, we could not find anything causing it, the code and all queries involved didn't show any null values anywhere.

We did a fair amount of detective work trying to find the cause, and I tried multiple ways to code around it, but the best I could achieve was to reduce the frequency that the error occurred. There was simply no way to do the function without that update being in there at some point and the database continued to routinely dump a null error when it got to it. We updated ColdFusion to version 9 to see if that helped, and tried a different MySQL connector as well, with no luck.

Finally, we decided to upgrade the MySQL to the latest version. It was already on a fairly recent release, but there didn't seem to be any other possible cause for it. And bingo, the error is gone! We're not sure exactly what MySQL was having an issue with, but it does seem this recalculation error is due to some bug in MySQL.

So if you run across this error, try updating the MySQL version and that should take care of it. We have seen the error in a couple different 5.1.3x versions and it does not seem to occur in 5.1.4x.

More Entries

 
BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.