Closed mattiasmaahl closed 3 years ago
So far I'm having problems with Yeast, Hops and Misc. all with the above error. Fermentables was OK to add to inventory for some reason.
This could be because of my database as well, have to do more testing tomorrow.
I can reproduce this. Will have a look.
OK, I have a fix for this. Will backport it to Brewtarget and submit in the next day or so. (Need a couple of tweaks for the backport as NamedEntityWithInventory
doesn't yet exist in BT :o>)
Nice, I'll continue my work with inventory printout using fermentables for now then awaiting your fix. 😊
The crash was caused by an invalid property name in YeastTabelModel.cpp (and equivalent places for other things with inventory). I've changed the hard-coded string property names for symbolic ones (so we should get compiler errors in the future for bad property names), as has already been done in most other parts of the code. I also pulled out the common inventory functions from Yeast, Hop, etc to an intermediate parent class (NamedEntityWithInventory). So the crashing seems to stop now...
However, there is still an issue that we're not always setting the inventory ID, which means inventory amounts aren't getting stored. There may be some small fix in Brewtarget that addresses this, and I'm just not instantly seeing it. Otherwise, when I bring the new DB layer back, there's new code (in a new Inventory class) that does all the right things.
So the error has been solved. I'll close this issue. Solved in #602
I'm trying to add inventory to the Yeasts, one of the included ones (Danstar - Nottingham). But Brewtarget crashes abruptly with the following error:
can anyone shed some light on this as I don't fully follow the redo/undo methods?