Placeholder treated as NULL for item-type/collection search criteria#815
Placeholder treated as NULL for item-type/collection search criteria#815luku wants to merge 1 commit intoomeka:masterfrom
Conversation
|
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 |
|
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 |
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;insidearray_mapis treated asNULL, which happens with placeholder for collections. Item-type problem is this:in_array(null, array('')) => true. So in both cases$hasEmptyvar istrue.