I have a simple fix for MDL-56893: Can't edit grade item if grade_report_showmin is false and item has grades. The bug is cause by checking for a variable that doesn't exist. The fix is pretty much a one-liner. Could someone take look at my fix and peer review it.
Here is the diff between master and my fix on github.