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

Duplicate empty string values in dropdown #27

Open
mak001 opened this issue Jan 5, 2018 · 0 comments
Open

Duplicate empty string values in dropdown #27

mak001 opened this issue Jan 5, 2018 · 0 comments

Comments

@mak001
Copy link

mak001 commented Jan 5, 2018

screenshot from 2018-01-05 13-47-10

This seems to be caused by DropdownField::Field() adding the empty value after DependentDropdownField::getSource() adds it to the actual source array.

if ($this->getHasEmptyDefault()) {
return array('' => $this->getEmptyString()) + (array) $source;
} else {
return $source;
}

Changing these lines to return $source seems to fix the problem.

PortableSteve added a commit to PortableSteve/silverstripe-dependentdropdownfield that referenced this issue Dec 3, 2018
PortableSteve added a commit to PortableStudios/silverstripe-dependentdropdownfield that referenced this issue Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant