syntax error on the when condition
Merge pull request #1207 from edx/jarv/defined-syntax-error

syntax error on the when condition