Today I released a giant code refactor I've been working on for a few months. It doesn't result in any new features for the site, but the short version is that I'm now using PHP's pdo abstraction to talk to the database, which puts us in a position to swap it out entirely (I've got my eye on MariaDb... sorry, MySql). The bad news is that to do something like this I had to meddle with almost every piece of code on the site, so as is traditional on shmax.com, chances are good that I broke lots of stuff.
The good news is that I took this opportunity to write up hundreds of test cases, and as I was going through everything I discovered and fixed lots of creepy little bugs that nobody has noticed on the site (some of them go back years). I can't remotely remember them all, but here are some highlights:
- breadcrumb links in the "reissue of" and "reissued as" product summaries on product details pages didn't work
- the "reissued as" items would stack up multiple times if the item has multiple releases
- the faction symbol link on part details pages didn't work
- "submitted by" link on part details pages didn't work
- breadcrumb links on the "Missing Info" page didn't work
- when filtering by photo on the "contribute info" page, was considering the photo submitter, and not photo credit
- the "color" attribute in tech data tags wasn't doing anything. Now you can use it to override colors.
- if you use the "Move here" or "More to new mold" in the mold input, the mold path wouldn't update on the part details page
- the material prefixes ("Translucent", "Metallic") weren't showing up in the descriptive color strings
- on the part details page, if you checked the "delete" box for all items that a part is linked to and submitted the form, a validation error was not being thrown (thus allowing you to get around the requirement that a part must always be linked to at least one product)
- duplicate product and part names weren't being checked (although Ed and I think we may have disabled that at some point on purpose--can't remember why)
- UPC code input wasn't validating properly
- on the modify product page, if you blanked out the little text input on a breadcrumb widget in the "Toylines" input and submitted the form, when the page reloaded the widget would be broken and not in a salvageable state
- checking "delete" for all toylines was not getting caught by the validation logic
- typing garbage characters in the MSRP field was not throwing a validation error
- and lastly, a nasty one: whenever a new part is created, I run through all your collections and add that part to your checklists. Only I wasn't--there was a bug. This has been broken for a very long time. We didn't notice because the code is designed to deal with it on the fly when you uncheck parts, but it means that things like mold completion figures and product completion percentages are subtly off. I've fixed the bug, but I'll have to repair the data at some point.
If you see any other bugs please don't be shy about calling 'em out. Thanks, guys. I'ma go play Watch Dogs, now.