References should be resolved relative to the document the sheet is applied to.
Follow this steps to reproduce the problem:
- create two pages in two difference spaces: A.Test and B.TestSheet
- set the content of the sheet to: [[Foo]]
- apply the sheet using the URL: /bin/view/A/Test?sheet=B.TestSheet
The link points to B.Foo instead of A.Foo which is wrong.