Skip to content

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

Closed
luku wants to merge 1 commit intoomeka:masterfrom
luku:placeholder-bug
Closed

Placeholder treated as NULL for item-type/collection search criteria#815
luku wants to merge 1 commit intoomeka:masterfrom
luku:placeholder-bug

Conversation

@luku
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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