Patch issue 6263

This patch fixes issue #6263. It checks whether the target element of a form collection implements `Fieldset` before trying to access the property `$object` and adds a fallback if it does not.