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

Placeholder treated as NULL for item-type/collection search criteria #815

Closed
wants to merge 1 commit into from

Conversation

luku
Copy link
Contributor

@luku luku commented Jun 28, 2017

When un-selecting item-type or collection in advanced item search (by selecting placeholder Select Below) the placeholder is treated as NULL and leads to wrong search results.

Note: Calling only return; inside array_map is treated as NULL, which happens with placeholder for collections. Item-type problem is this: in_array(null, array('')) => true. So in both cases $hasEmpty var is true.

@zerocrates
Copy link
Member

Are you seeing this actually happen, or just inspecting the code? I can't reproduce. (If I'm understanding your report correctly, it would mean a default search would actually be for "in no item set" and "in no collection," and that's not occurring.)

Lone empty-string values (as is the case for the "Select Below" placeholder) are filtered out at the applySearchFilters stage: https://github.com/omeka/Omeka/blob/master/application/models/Table/Item.php#L387

@luku
Copy link
Contributor Author

luku commented Jun 28, 2017

Hmm, you're right, it's not repro in the current master. It happens only after merging my PR #781 with multiple item-type/collection search criteria. Because then the filter value is an array instead of string, so it's passed further. I will include it in the mentioned PR and close this one. Sorry for messing it up

@luku luku closed this Jun 28, 2017
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.

2 participants