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

PATCH: fix issue #8691 - DB Boolean Search #9893

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

sunnysideup
Copy link
Contributor

See: 8691 for details

@unclecheese

@unclecheese
Copy link

LGTM.. Effectively ports over what 3.x did.

@unclecheese unclecheese merged commit 504e203 into silverstripe:4 Mar 23, 2021
@sunnysideup sunnysideup deleted the patch-11 branch March 23, 2021 23:06
$field = new DropdownField($this->name, $title, $source);
$field->setEmptyString("($anyText)");
return $field;
return (new DropdownField($this->name, $title, $source))
Copy link
Contributor

Choose a reason for hiding this comment

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

Would using the injector be better instead of instantiating the class directly?

Choose a reason for hiding this comment

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

It would be. Unfortunately, most DB fields do still circumvent Injector in their scaffoldSearchFields() implementations. I think it's just code from 3.x that survived the upgrade in tact.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it would... Do you mean:

DropdownField::create()

Happy to change it.

Choose a reason for hiding this comment

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

I'd say let's do that in a separate PR that applies injector to all these core implementations, rather than just do a one-off. The problem is, if we have some fields that are responding to Injector overrides and some that aren't, it just creates a confusing dev experience. In my quick assessment, it looks like most fields are still using new, so I'd advocate for just going with the pack, here.

Consistent use of Injector in a separate body of work would be sweet, though.

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

Successfully merging this pull request may close these issues.

3 participants