thoughts on writingSubscribe Now

Inputs in Firefox storing previous values

Today’s problem came as a result of a Firefox anomaly. It’s one of those problems that comes up after launching because we were too lax in testing. Here’s how it broke down, without going into great detail about the application.

We’re building a CRM that stores asks and closes of our sales reps. The application shows recent asks and closes on the main screen, with the ability for the user to update said activities. The update option are in input fields, named the same, and updated via javascript behind the scenes.

When adding a new activity, the application inserts that entry into the table of current asks and closes. On reload, Firefox was showing old data in those fields, but if the user clicked on a different page and came back to the dashboard, they would see the correct data. Upon inspection, the value of the input was correct. Meaning the browser was replacing the input with what it believed to be good data.

Unfortunately this bug wasn’t caught until production. The answer was simple. We only needed to turn off autocomplete on each of the inputs. This immediately solved the problem.


Add that line to the input and the problem disappeared.

How to Force Javascript File Updates onto Users

Wonka wonka wonka cache busting memeThe question came up when working with a new application that relies heavily on Javascript, How can we force users to renew the javascript file? This is especially important for single page applications that rely heavily on Javascript for everything from authentication to storing data.

In researching this problem, I found there to be a great deal many options at hand. Some suggested using a paramater in the overall application which could be used to version the javascript.

This would work, but it also requires a paramater in the URL, which I didn’t like for our needs.

Instead we opted to use a very similar method but in the file include statement, where it would be updated for future versioning. So where we call the javascript in the template files, we added a parameter to that javascript file, like so…

<script src="/js/custom.js?v=19228" type="text/javascript">

Let me know in the comments how you handle this problem and if there are any issues you find with our way of solving it.


Magento update breaks site

Magento is open-source software for e-commerce

I helped a friend update their Magento site from version 1.9.1 to The software has a few ways to update, one using a command line utility and the other a web based service called Magento Connect. We used the latter to update and ran into a few issues before finally getting the site to update.

The first problem was the update process failed in Magento Connect with a message that there were conflicts between all the packages being updated. The root cause of this was inside the /public_html folder on the server was a folder called pkginfo which had a Latest_Mage_All.txt folder and another file. We needed to manually delete these and the updates ran as expected.

Once we got the updates to run, then the site returned a white screen. This was caused by an error in the Apache configuration on the server. Because Magento overwrites the .htaccess files, we needed to modify the file to suit the local configuration needs of the server. In this case, that meant SymLinksIfOwnerMatch. This resolved the issue and allowed the pages to load.

Once that was complete, we did need to delete the var/cache folder, as the site was having trouble showing a query that was no longer available in the latest version. That fix could have been prevented by turning off caching prior to updating, but was an easy enough fix nonetheless.

The final fix was template specific and cost us a new support fee with the good people at RocketTheme. The site for this nonprofit uses a module call RokMage HomePageGrid. The grid stopped working after the update, but the fix was simple. By adding the block to the allowed blocks permission page, the frontpage again populated with the necessary information.

The Scream

The clapboard shutters banged against the cedar planks. The wind dislodged debris from the barn that ratcheted against the house. Dan sat motionless on the couch in the living room. He muted the TV so he could listen again for the scream.

This time it sounded like a cave woman being beaten. The scream was piercing, like a nail dragging down aluminum siding. Sally down the road would have called for him by name. His mother would have screamed for a moment, then remembered her son would be terrified and stopped, sucking up whatever death and despair lay ahead. No, it couldn’t be anyone he knew.

On TV, a fat man in a tank top stood on top of a beat-up car. Dan watched as the car’s hood flipped up and knocked the man from the car. He lay on his back, supine, shaking a fist at his luck.

Outside the cat-like scream etched itself across Dan’s reality. He sat bolt upright. He could ignore it no longer. He thought for a moment about what he’d need to protect whoever was outside suffering such horrors at the hands of what — an animal? Dan wasn’t a fighter. Christ, he’d barely been able to manage the twenty pushups for his P.E. Final. How was he supposed to fight off an aggressor?

The whole of the house took on a sinister glow to it. There was not light enough in the kitchen to find the flashlight that must have been there — black as the darkened storm outside. Of course, he couldn’t turn on the light. Sure there was power, but what if the muscle-bound thug saw the light come on and decided to get his ass out of the cold and slashing rain.

Why would someone be outside his house attacking a woman? It really didn’t make sense. He’s just imagining it, Dan tried his best to convince himself. It would pass and he would see. Maybe he should just go to bed. Get up in the morning and check for blood splatter. Maybe look for footprints heading back to the main road, out to Route 17. Then he could call Sheriff Black and have him come take a look at the evidence. Sure it was circumstantial — no he couldn’t prove the blood was that of a woman, but just look at the bootprints; they practically scream aggression, fat, blocky wedges of mud separated by thick lines, with a massive V at the base. A work boot, sure. But couldn’t he see, this was a man’s boot who had done something unspeakable to a sweet woman.

Outside a lightning strike lit up the night sky. Dan crouched down instinctively just as he heard a moaning sound, coming from around the corner of the house, off the patio, down a small flight of wooden steps, and near his mother’s geranium plants. His father had pulled a rather large bush from the area several years earlier, and the geraniums were a recent addition. Dan imagined them getting beaten by the hectic rain outside. He wondered how quickly flowers recovered from such abuse.

The moaning continued with the wind and the sounds seem to coincide with increased gusts, like the injured person was somehow speaking in concert to the aggravating increase in wind speeds. Of course, they would. It was terrible outside.

If he could just find the flashlight, he would be able to shine it out the window and see exactly what was out there. He could cast a light into the darkness and identify it. He thought for a moment that that sounded a bit poetic, like he was terrified of the unknown and could suddenly end the hysteria. He could lance it like a  boil, ending it’s power over him. In the vernacular of his peers, he could make it his bitch.

Then he found it, a pen like wand of a flashlight, cold and gritty from caked on mud around the handle. It was stuffed in the back of the drawer, just behind a refrigerator bulb and tucked underneath an old atlas.

Dan held that tiny pen flashlight and with anxious breath turned it on against his leg, so the light would only illuminate the coin sized spot on his jeans, not the entire room. Again, he didn’t want some thug realizing salvation was coming for him. He wanted to keep the element of surprise.

A crack of lightning confirmed Dan’s suspicion that the person outside was indeed groaning and moaning with the increased severity of the storm. The glowing golden coin of light on Dan’s leg confirmed that the flashlight was in working order. Now he could make his way to his parent’s bedroom window, where the moaning sounds seemed to be directed, and shine the flashlight into the bush-less area outside, where the geraniums would bound to be beaten and bruised by the storm.

He crept to the windowsill, listening for any sounds. He found his parents room to smell like the familiar scent of mothballs — the white, stinky resistance.

In the corner between the narrow edge of his father’s sturdy dresser and the tan colored wall, rested a 12 gauge shotgun loaned to his father from his grandfather. It was a pump shotgun, the kind used to fell deer from a hundred yards. He knew a box of shells lay secured in a box in the top dresser drawer. They were slugs, again used in the act of killing deer. His father wasn’t a hunter though. He fenced in college, but hunting was beneath him. It was due to the house, the new job, and making a name for himself. He was the marketing director of a hunting apparatus manufacturer. He needed to practice and Dan’s grandfather gave him the means to do so.

Dan thought he saw a spark of light outside the window that stretched underneath those geranium petals. It wasn’t bright, not a flash or reflection from lightning either. It was stronger than a firefly. It was more like a solid gleam of green, an emerald purchase against the darkened velvet of night. He positioned himself on the edge of the curtain, off to the side, nearest the corner with the gun and the buckshot secured in a box near his shoulder. He could reach into the dresser and pull that box out if whatever was outside came crashing through the window, into the house.

Dan positioned the flashlight’s lens against the glass. He realized too late that the exterior storm window pane would reflect back the light and make the entire operation moot. In fact, he was so startled by the light bouncing back at him that he could only faintly hear the startled scurry of a raccoon, or opossum, or tiny deer as it kicked and hurtled itself back into the bosom of the crashing storm.

How to get a larger album cover image from iTunes API