The pattern of having a 'selected' setting of selected options and a 'default' determining whether those options should be excluded or included is pretty common. While we only use it for bundles and languages in our ContentEntity datasource (as far as I can see), providing a helper method for matching against such settings could also be helpful for other contrib modules depending on the Search API. (I used the same pattern in both Autocomplete (where I even had a typo, I just realize) and Saved Searches, for example.)

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new3.42 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2953266-2--selected_default_helper.patch, failed testing. View results

drunken monkey’s picture

Status: Needs work » Needs review
borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Looks like an awesome simplification of the code and this adds the possibility for all those additional comments. RTBC!

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Great to hear, thanks a lot for reviewing!
Committed.

  • drunken monkey committed 8c292fd on 8.x-1.x
    Issue #2953266 by drunken monkey, borisson_: Added a helper method for "...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.