Redirects to archives is not working if a last major version is missing
When a new major GitLab version is released, we tend to not include the last major in the last_majors
list in versions.json
, because that would cause duplicate entries in the main site's dropdown.
Here how it was done in the 16.0 release !3864 (comment 1400673875).
However, with that change, the redirection to the archives docs when you land on a version that doesn't exist in the main site, doesn't work.
How to reproduce
- Visit https://docs.gitlab.com/15.1/, you see the 404 page.
- Open a browser console and reload the page.
- You see the following error:
Uncaught (in promise) TypeError: e.last_major[1] is undefined