mod/reader fix Undefined variable: book when upgrading from Moodle1