Sometimes you just want to validate if 1 value is present in an array of your facet definition or realm properties. The following patch provides that and is a follow-up from http://drupal.org/node/1958362#comment-7365686

Comments

nick_vh’s picture

StatusFileSize
new4.45 KB
nick_vh’s picture

Status: Active » Needs review
cpliakas’s picture

Status: Needs review » Needs work

This overall approach makes sense to me.

Ideally I would like the requirements stuff to be cleaner, but I think you have made it as backwards-compatible and as clean as you possibly can, so I would be in favor of committing this approach to Facet API and improving the over all system in a later major version.

Marking as needs work for a really small reason... in order to be consistent with other keys in the hook_facetapi_widgets() definitions, the "requirements_operator" should be separated by a space and not an underscore.

We should also post a follow-up issue to add tests for the operator.

Great work,
Chris

cpliakas’s picture

Category: bug » feature

#1958362: Implement the ability to customize the date ranges via the UI is dependent on this feature. Marking as a feature because everything works as intended and the API does allow you to create a function that could do this logic, although definitely not ideal.

cpliakas’s picture

Status: Needs work » Needs review
StatusFileSize
new4.45 KB

Attached patch makes the suggested change.

Status: Needs review » Needs work

The last submitted patch, or-requirements-1984490-5.patch, failed testing.

cpliakas’s picture

Status: Needs work » Needs review
StatusFileSize
new4.05 KB

Failed because it conflicted with patch at #1974058: Include ctools plugins for facetapi_facet_display_form_validate that was committed to all branches of Facet API. Patch re-rolled.

cpliakas’s picture

Title: Allow widget requirements to be AND or OR » Add support for OR logic in requirements
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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