Fix page error on form cancel after validation fails (Bug #1400511)

Change-Id: I63c4c566504492abb947202f8cf3ba5838770c9f
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
Merge "Fix page error on form cancel after validation fails (Bug #1400511)"