zendframework / zend-form

Form component from Zend Framework
BSD 3-Clause "New" or "Revised" License
69 stars 87 forks source link

Fixed the "__clone method called on non-object" error that happens when the targetElement is null. #230

Closed werequireevenmoreminerals closed 5 years ago

werequireevenmoreminerals commented 5 years ago

I was getting the __clone method called on non-object error while populating data in the fieldset and there was no targetElement available (it was null).

I think such a fix should not create regressions in the software since when targetElement is null it errors anyway.

I'll provide the changelog entry and regression text in later commits (since it seems like I need an issue number for the fix which I'm going to get after submitting this pull request).

werequireevenmoreminerals commented 5 years ago

@Ocramius Hey! Could I ask for a re-review? I've added the missing regression test.

Thanks in advance.

werequireevenmoreminerals commented 5 years ago

@Ocramius Requests resolved. :)