VPN: add boolean fields to advanced search
Posted by sarneil on 26 Oct 2011 in Activity log
AC wanted to be able search for those poems that had the boolean attributes "isAnonymous" or "isUnsigned"
Turns out that if one of those is checked, then the GET array has the value e.g. poem-anonymous=on
Jamie's code in the vpn-search.php file that creates the conditions for the advanced search assumes that the value in the get array is the value to search for in the sql database (which is true for textfield input elements), but false for checkboxes.
So, for each of those checkbox items I had to
1) in plugins/vpn-search/form_advanced.php : add form element
2) in plugins/vpn-search/classes/VPNFormBuilder.php : add item to $_fieldMap array (table.field and element id)
3) if input is not a textfield, then in plugins/vpn-search/vpn-search.php : modify if structure in __getAdvancedConditions() method