MDL-35146 mod_wiki: fixed issue where pages for deleted groups caused an error on restore
MDL-35146 mod_wiki: fixed variable typo and altered code to conform to Moodle guidelines