DEV Community

ginger
ginger

Posted on • Updated on

the time I had to bodge

At my job we use a cms called modx, which I love; it’s open source, it’s php, and you’re able to make it do a lot of things with very little effort. But the one issue I have with this system is that plugins that exist for it exist in a dichotomy, ‘has documentation’ vs. ‘no documentation’.

A client had a book on teaching, they wanted to include a glossary of all their terms in their website.

Sure, why not?

So we added a plugin called... Glossary. It worked great, not a lot of documentation, but we figured it out still. And then we noticed something weird.

Why was Developmental Difficulties lower than Distance Theory (these aren’t actually related to the client they’re just an example).

For whatever reason, they weren’t sorting in an ascending order. For this client that was gonna be an issue.

I’m not great at php, my few forays into it have been less than successful, but I gave it a shot. I read through some of the code, since like I said, documentation was lacking. But I couldn’t really make heads or tails of it.

Deadline is maybe a week out, and with thanks giving coming up, that means we have like four more days of development left before the site needs to be ready to go live. Another developer found a plugin that would sort them into alphabetical order, but had way less documentation than the first plugin. And we would have to throw out work we had already done on and do it all over again.

So I sat down and spent maybe 15 minutes studying the layout of the page, changed a couple lines of the chunks that the glossary app used, and built a small javascript function to grab all the categories, sort each item in the category, and the. Put them back together as html elements and put it back in place.

All in all, 45 minutes of coding, maybe an hour of total development time.

Is it a perfect solution? No, if someone doesn’t have javascript turned on, it will just say loading indefinitely. Whatever, I’ll fix it on Monday. It’s good enough to go live, and we don’t have to spend anymore man hours on it than we already have. It’s a bodge, it’s a temporary fix. It’s not elegant, its certainly not impervious, but it’s maybe 16 lines of code, and it works and doesn’t break responsiveness, and it saved us maybe 8 hours of rebuilding what we already have. So I’m proud of that!

I’m interested to hear what other bodges people have come up with?

Top comments (2)

Collapse
 
roninio profile image
Roninio

I enjoy playing casino games, so I wanted an app to play on my phone. After some searching, I downloaded download apk from this site, and it works perfectly. The site has plenty of bonuses listed for mobile users, including welcome offers and regular rewards. They make it simple to understand how to claim these deals. With everything explained step-by-step, it’s been easy for me to get started with online gaming on the go. The app’s a good choice for casino fans like me.

Collapse
 
amirkabra profile image
Amir Kabra

Many people have a misconception that it is very difficult to start betting or gambling. But this is not true, and Indian betting site mostbetonline.in/registration/ will convince you of this. Here you will find a lot of instructions on various aspects of betting and gambling, which will make it easy for you to learn and start playing. And thanks to the user-friendly and stylish interface, betting and gambling will be even more enjoyable. Be sure to try this platform and you'll be surprised at how easy it is to start betting.