NPE in Gradebook2ComponentServiceImpl.doUpdateItem

Description

Simple avoidable NPE; patch pending. To replicate:

1.) Create a course site w/ GB2 included; weight by categories.
2.) Create a single category, name it anything you want, do not let it be extra credit.
3.) Create a grade item, name it anything, leave at defaults.
4.) Duplicate course site.
5.) Go into the duplicate site and try to change the graded item to be included in the grade.
6.) You'll receive a 500 error on clicking Save; a bug report will be generated with a stacktrace pointing to the problem code line.

Attachments

1

Activity

Show:

Sean Baker June 19, 2014 at 3:52 PM

I'll try a 1.8x branch next to see if we can replicate there (and, if necessary, will push trunk against 2.9x to see if I can make that flake). Will update with results after I get it going.

Test server is my local VM :). Took a bit to get it to compile, but a few tweaks to POM version #s and a bunch of 'singleton="true"'s later it was working well enough to test with. I didn't do any extended validation, but I wasn't noticing anything out of the ordinary in quick testing either.

Jon Gorrono June 19, 2014 at 1:07 PM

Your attention to the issue is very much appreciated.... this may be a useful patch for 1.8.x, perhaps? I just started working on getting GB2 to compile nicely with 10 and will prob setup a maven profile for it. Where is the test server with 10 and gb2?

Sean Baker June 19, 2014 at 11:16 AM

Finally managed to get on the 10 test server, and I agree - my test case fails on this release. Will see if I can track down what changed in the duplication code that the 'null's aren't persisted (if anyone has suggestions, I'm all eyes), suffice the test case doesn't apply to trunk, and this should probably just be a minor / 'nice to have' sort of bug rather than how I originally classified. Sorry 'bout that!

Sean Baker June 16, 2014 at 6:59 PM

Best guess is that it's something which was changed in the site replication code - I can only test against Sak 2.9.x / GB2 1.8.x right now, but will try to get on a .10x / trunk build tomorrow to see if I can replicate there. Suffice, I think the fix stands independent as NPE-protective and more consistent with the surrounding code, but I'll try to get a better test procedure in place which won't just work on my local prod box ;).

Jon Gorrono June 16, 2014 at 5:19 PM

Thanks for adding detail. Unfortunately it still didn't fail. For me.. one thing I noticed is that the item was already 'included in the grade' (checkbox checked)... I tried uncheck with no error, but the polarity was different than what your #5 made me think. So I wonder what the diff was

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created June 16, 2014 at 1:11 PM
Updated June 19, 2014 at 3:52 PM