# Course Unit Database Auto-fill Update

## Updated page
`modules/academics/unit_assignment.php`

## Behaviour
- Selecting a unit loads its saved course, assessment type, year level and module from the `units` table.
- When that unit already has a mapping for the selected course, the existing `course_units` values take priority.
- The form shows matching classes for the loaded course, module and year where classes already exist.
- A **Load** button on every existing mapping restores that mapping into the form.
- Staff may change the auto-filled values before saving when a unit is intentionally reused for a different course or period.
- Server-side fallback fills missing posted values from the saved unit record, so the feature remains reliable when browser JavaScript is disabled.
- No database migration is required.
- If the same unit has several saved mappings for one course, the page uses the Unit Setup defaults rather than guessing the period. The exact mapping can be restored with its **Load** button.
