Fix/menu item title validation

WP [#14787](https://www.openproject.org/work_packages/14787)
I like to be explicit. Since it's not necessary, though, I could of course drop it in favour of a mere `var msg;`.