MDL-42452 actionmenu: improved constraint code