I have a (sandbox) solution with some custom forms.
If I deploy it to a site that never had this solution installed before, everything works fine. However, every time I deploy it again, custom forms get "doubled". That is, a "new foo" custom form will have the save and cancel buttons on top, then the input fields, then the save and cancel buttons again on the bottom. But below those, another set of save and cancel buttons, all the input fields again, and then another set of buttons.
I've checked with a colleague that simply deactivating and reactivating the feature containing the form causes it to re-append to itself.
In other words, for the first time the feature is activated, the form looks like this:
[Save] [Cancel]
Fields
[Save] [Cancel]
If after that I deploy the solution, say, two more times, it'll look like this:
[Save] [Cancel]
Fields
[Save] [Cancel]
[Save] [Cancel]
Fields
[Save] [Cancel]
[Save] [Cancel]
Fields
[Save] [Cancel]
How can I avoid this behavior? I am aware that deleting the list that contains the custom forms prior to a new feature activation will fix the form (double checked). However, our customers will receive versions of our solution in iterations, and it's just not feasible for us to delete all their data every time a new version is rolled out.