Multi enum search on custom module does not seem to work I looked at the source code include/SearchForm/SearchForm2.php
and find this
there is even a comment regarding using the like syntax but only on Oracle and MSSQL.Code:if($GLOBALS['db']->dbType != 'mysql' && !empty($this->seed->field_name_map[$field]['isMultiSelect']) && $this->seed->field_name_map[$field]['isMultiSelect']) { // construct the query for multenums // use the 'like' query for all mssql and oracle examples as both custom and OOB multienums are implemented with types that cannot be used with an 'in' $operator = 'custom_enum'; $table_name = $this->seed->table_name ; if ($customField) $table_name .= "_cstm" ; $db_field = $table_name . "." . $field; foreach($parms['value'] as $key => $val) { if($val != ' ' and $val != '') { $qVal = $GLOBALS['db']->quote($val); if (!empty($field_value)) { $field_value .= ' or '; } $field_value .= "$db_field like '$qVal' or $db_field like '%$qVal^%' or $db_field like '%^$qVal%' or $db_field like '%^$qVal^%'"; } }
I tried changing the top line to this
if(!empty($this->seed->field_name_map[$field]['isMultiSelect']) && $this->seed->field_name_map[$field]['isMultiSelect']) {
and now it seems to work. What is it I am missing here, it seems way to obvious to be a bug? Why has this been commented out for mysql?
Anyone?
Regards
Kenneth Thorman


LinkBack URL
About LinkBacks



Reply With Quote
.

Bookmarks