Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null empty_option should result in no empty option being included, not a "NULL" select list option #247

Closed
wants to merge 1 commit into from

Conversation

mjhca
Copy link
Contributor

@mjhca mjhca commented Jul 1, 2013

Expected behavior: According to ZF2 docs, setting empty_option to NULL instructs a \Zend\Form\Element\Select that it should not add an "empty option" to a select list.

Current behavior: DoctrineORMModule's ElementAnnotationListener ignores a NULL value and includes an empty option (with display string "NULL") in all select lists generated from annotations. This is because of the use of isset() which causes an intentionally set NULL value to be overwritten.

Solution: Replace isset() with array_key_exists().

@Ocramius
Copy link
Member

Ocramius commented Jul 7, 2013

@mjhca any chance to get a failing test for this (separate PR is better, so I can merge this on top of that one)

Ocramius added a commit that referenced this pull request Feb 6, 2014
Forced failing unit test for #247
@Ocramius Ocramius added the BREAK label Feb 6, 2014
@Ocramius Ocramius added this to the 0.9.0 milestone Feb 6, 2014
@Ocramius
Copy link
Member

Ocramius commented Feb 6, 2014

Handled in #281

@Ocramius Ocramius closed this Feb 6, 2014
@gianarb gianarb mentioned this pull request Apr 24, 2015
oprokidnev pushed a commit to oprokidnev/DoctrineORMModule that referenced this pull request Apr 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC Break Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants