Backported search-form fix to master