The related courses were only including the courses from the subject areas.
Fault
This was due to those courses which were manually related using the id of the course rather than the 'instance_id'
In the past the concept of 'Instance ID' (the ID of the first instance of a programme) was introduced to provide a stable ID between the same programme running across different years.
Fixes
Update Tests to use Instance ID rather than ID
The tests were using ID of the programme in their sample data. This effectively hid this problem from the tests.
When adding related programmes, relate them via 'Instance ID'
This fix updates the edit programme screen to use the instance_id for the related courses select.
Updating Existing Incorrect Relations
Also included is an artisan task to review the current state of the related courses and to update them so that related courses refer to the instance ID rather than the ID.
php artisan related-courses:view year=<year> level=<level>
to view the existing relationships
php artisan related-courses:update year=<year> level=<level>
to update related courses so that they use the instance ID rather than ID
Problem
The related courses were only including the courses from the subject areas.
Fault
This was due to those courses which were manually related using the id of the course rather than the 'instance_id'
In the past the concept of 'Instance ID' (the ID of the first instance of a programme) was introduced to provide a stable ID between the same programme running across different years.
Fixes
Update Tests to use Instance ID rather than ID
The tests were using ID of the programme in their sample data. This effectively hid this problem from the tests.
When adding related programmes, relate them via 'Instance ID'
This fix updates the edit programme screen to use the instance_id for the related courses select.
Updating Existing Incorrect Relations
Also included is an artisan task to review the current state of the related courses and to update them so that related courses refer to the instance ID rather than the ID.
php artisan related-courses:view year=<year> level=<level>
to view the existing relationshipsphp artisan related-courses:update year=<year> level=<level>
to update related courses so that they use the instance ID rather than ID