Topic: Export not using correct card name & genreral DB question
It took me all week to to input inventory and now I am exporting to backup my labor (to a degree). Problem is that the export is listing at least one card with the wrong name and I only caught it because of the weird multiple entry for same Name+Edition. I have not vetted all of the export yet to see if this is the only discrepancy.
12 Swamp Mercadian Masques Basic Land - Swamp
1 Swamp Mercadian Masques Basic Land - Swamp
My guess is that the single card is in fact http://deckbox.org/mtg/Subterranean%20Hangar
This brings up the question of just how much "cooking" are you doing to the DB queries since the card lists correctly as Inventory but not as Export? I assume you are storing index values in the main table and using lookup tables for the text but then clearly doing the lookup differently for inventory vs. export.
On same thought path I discovered while looking into this that Filter for Color DOES NOT work for land cards, rather it considers them to have Color = colorless and on same token searching for non-numerical cost can not be done i.e. Cost = x yields no results. There are likely more examples that did not jump out at me. My guess that it's an oversight that Land should have color values or that Cost is more than integer values?
Not sure what the DB backend is but I'm aware from my Coldfusion developer days the peril of using the UI strings directly in backend SQL queries w/o exposing yourself to code injection but mitigating it increases the work load on developers trying to prevent inevitable user frustration over "lost in translation" or "can't express".
That said, the question on everyone's mind seems to be why import still does not do the natural reverse of export for the 3 key unique values of a record: Qty, Name, Edition much less the 2 lesser values of Language & Condition? Seems to me there's no difference in the complexity of site code or the SQL statement for using Qty & Name from user input while defaulting to latest Edition (or leaving it blank) vs. going the extra mile to use the user supplied values! Sure it takes a sanity check (as it does for card name anyway) to verify the card exists in the edition listed but it just makes it a multi-criteria lookup. As it stands I'm doing all this data entry and the best I can hope for if I have to import from this "backup" is that all my card names & total numbers will be there but I will still have to do the tedious (lacking SQL like access or batch commands never mind a proper import function) card by card edit to set Edition, Condition, Language by hand. Heck it seems that the code for Inventory and Export might even benefit from working on this if they are currently producing different results for seemingly the same lookups.
Thank you for this free solution and please consider integrating these changes into the site's functionality.