Git merges in Moodle 3.1.7 by Jake Dallimore

commit 99b4c8bb10208ee204bd4b62cc1dac998278bf47
Author: Jake Dallimore <jake@moodle.com>
Date:   Fri, 07 Jul 2017 12:10:22 +0800
Tag:    v3.1.7

Merge branch 'install_31_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_31_STABLE