Add the form set mapping, fix #2787

It is a duplicate of #2112 that I have closed.