dekkerglen / CubeCobra

An open source web application for building, managing, and playtesting Magic the Gathering cubes.
https://www.cubecobra.com
Apache License 2.0
191 stars 117 forks source link

CSV Import does not respect Color Category column #2458

Open GrimbleFitz opened 4 months ago

GrimbleFitz commented 4 months ago

Describe the bug When uploading a csv file, either to replace the current cube or to add to it, the color category isn't respected in at least one way.

To Reproduce Steps to reproduce the behavior:

  1. Export your cube as a csv file.
  2. Modify the "Color Category" field of some cards. (I changed some basics from 'l' to 'w/u/b/r/g' so that they would appear alongside cards of their color identity.)
  3. Import your csv to replace your existing cube.
  4. Observe that some cards have defaulted to the color category they would normally have. (My basics were back in the Lands category.)

Expected behavior A csv import to respect the "Color Category" column.

Desktop (please complete the following information):

Additional context I'm not sure if it's just basic lands, just lands, or a universal bug. I'll have to test and edit this post when I can.

EDIT: I have confirmed the bug is universal. Changing the "Color Category" field for any card has no effect when using the csv import function. (e.g., Healing Salve defaults to 'w' in csv. Changing it to 'u', saving, then using csv import will put it right back in the 'w' category.)

Furthermore, you can manually modify the color category of as many cards as you like and they'll stick just fine. If you then export as csv and reimport the exact same file, it will revert all your changes and default all color categories for all cards.

dvndrsn commented 2 weeks ago

Hey there, I looked at this and found that there was a typo in the CSV import method (the header name was case sensitive).

I suggested a fix for the maintainers in this PR: https://github.com/dekkerglen/CubeCobra/pull/2464