Fixing-problem answer: if you get rid of the second “when”, your conditions stuck together with “and” should do what you want.
Comprehension answer: I don’t know why that would have changed from working to not-working. I never ever used that syntax myself, and probably would have thought it didn’t work, if asked. But in your place, I’d go check the bug tracker and see if something like that has been mentioned, and if not, file a report. That way Graham can either fix it, if it was intended behavior all along, or refine the problem message to be better about saying you can’t use two whens in conjunction.