Post a work.
Add a chapter with chapter notes at the end; after posting, you are redirected to the new chapter 2.
Follow "Entire Work".
Under chapter 2, follow the link in "(See the end of the chapter for notes.)"
You arrive at chapter 2's end notes, but on the chapter 2 page, not on the entire work page.
What should happen
You arrive at chapter 2's end notes on the entire work page.
There can be even more weirdness depending on whether the user has the "Show the whole work by default" preference set.
The easiest way to fix this is to make the chapter end notes links contain only the fragments and not the full paths.
Since chapter contents are cached, we need to bump the version of the cache key.