Fixing warnings when user has no views

See https://github.com/catalyst/moodle-assignsubmission-mahara/issues/12

I missed a few parts the first time I tried to cherry-pick this...

Conflicts:

	locallib.php