Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

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

Merged
merged 5 commits into from
Feb 26, 2019

Conversation

werequireevenmoreminerals
Copy link
Contributor

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).

src/Element/Collection.php Outdated Show resolved Hide resolved
@werequireevenmoreminerals
Copy link
Contributor Author

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

Thanks in advance.

test/Element/CollectionTest.php Outdated Show resolved Hide resolved
test/Element/CollectionTest.php Outdated Show resolved Hide resolved
test/Element/CollectionTest.php Outdated Show resolved Hide resolved
src/Element/Collection.php Outdated Show resolved Hide resolved
@werequireevenmoreminerals
Copy link
Contributor Author

@Ocramius Requests resolved. :)

Copy link
Member

@Ocramius Ocramius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Ocramius Ocramius added this to the 2.14.1 milestone Feb 21, 2019
@Ocramius Ocramius added the bug label Feb 21, 2019
@weierophinney weierophinney merged commit dad31e9 into zendframework:master Feb 26, 2019
weierophinney added a commit that referenced this pull request Feb 26, 2019
Expands the description to make it more clear that this affects
`Collection` instances only, and what the new behavior is.
weierophinney added a commit that referenced this pull request Feb 26, 2019
weierophinney added a commit that referenced this pull request Feb 26, 2019
Forward port #230

Conflicts:
	CHANGELOG.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants