diff --git a/code/MemberTableField.php b/code/MemberTableField.php index 9e0284c2..6f9b3790 100755 --- a/code/MemberTableField.php +++ b/code/MemberTableField.php @@ -135,8 +135,8 @@ class MemberTableField extends ComplexTableField { $SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null; if(!empty($_REQUEST['MemberSearch'])) { $searchFilters = array(); - foreach($SNG_member->stat('searchable_fields') as $fieldName => $fieldSpec) { - $searchFilters[] = "`$fieldName` LIKE '%{$SQL_search}%'"; + foreach($SNG_member->searchableFields() as $fieldName => $fieldSpec) { + if(strpos($fieldName,'.') === false) $searchFilters[] = "`$fieldName` LIKE '%{$SQL_search}%'"; } $this->sourceFilter[] = '(' . implode(' OR ', $searchFilters) . ')'; } @@ -392,6 +392,7 @@ class MemberTableField extends ComplexTableField { // We use the group to get the members, as they already have the bulk of the look up functions $start = isset($_REQUEST['ctf'][$this->Name()]['start']) ? $_REQUEST['ctf'][$this->Name()]['start'] : 0; + $this->sourceItems = $this->group->Members( $this->pageSize, // limit $start, // offset diff --git a/javascript/MemberTableField.js b/javascript/MemberTableField.js index e82089f4..3dcc4ba9 100755 --- a/javascript/MemberTableField.js +++ b/javascript/MemberTableField.js @@ -214,7 +214,7 @@ MemberFilterButton.prototype = { initialize: function() { this.inputFields = new Array(); - var childNodes = this.parentNode.getElementsByTagName('input'); + var childNodes = this.parentNode.parentNode.getElementsByTagName('input'); for( var index = 0; index < childNodes.length; index++ ) { if( childNodes[index].tagName ) { @@ -246,9 +246,7 @@ MemberFilterButton.prototype = { var updateURL = ""; updateURL += Event.findElement(e,"form").action; - // we can't set "fieldName" as a HiddenField because there might be multiple ComplexTableFields in a single EditForm-container - updateURL += "&fieldName="+$('MemberFieldName').value; - updateURL += "&action_callfieldmethod&methodName=ajax_refresh&"; + updateURL += '/field/' + $('MemberFieldName').value + '/ajax_refresh?ajax=1&'; for( var index = 0; index < this.inputFields.length; index++ ) { if( this.inputFields[index].tagName ) { updateURL += this.inputFields[index].name + '=' + encodeURIComponent( this.inputFields[index].value ) + '&';