Your plugin is listed as being compatible with 3.6+, but causes courses to fail backups in versions before 3.6. Wrapping the backup class in a trait_exists check is not enough - moodle assumes that, if the file exists, a class is defined within it.
To me, the simple thing to do is just backport the trait from 3.8 and include it if it doesn't already exist. I've patched this on my server, it seems to work just fine, but I haven't been able to test it thoroughly.
Your plugin is listed as being compatible with 3.6+, but causes courses to fail backups in versions before 3.6. Wrapping the backup class in a trait_exists check is not enough - moodle assumes that, if the file exists, a class is defined within it.
To me, the simple thing to do is just backport the trait from 3.8 and include it if it doesn't already exist. I've patched this on my server, it seems to work just fine, but I haven't been able to test it thoroughly.