OK, so I found the answer to my problem and thought I'd share in case someone else comes across it.
My issue was with a plugin that I had created by copying an existing one and changing the name through all the files.
The error was caused by the setting FEATURE_BACKUP_MOODLE2 being set to true on the lib.php file of my plugin and although that was correct, I realised it was something erroring in the backup/restore process.
In the backup_<pluginname>_activity_task.class.php and the restore_<pluginname>_activity_task.class.php files, when I had done a Find/Replace it had replaced the VIEWBYID preg_replace (in backup) and in the new restore_decode_rule code (in restore) to lowercase <pluginname> rather than uppercase.
Setting this to all uppercase worked and fixed my problem.
Hope that makes sense to anyone who comes across this.