Auto-complete in repeatable group does not respect "Auto-complete how" setting

softforge

Member
I have set "Auto-complete how" to "Starts with" which worked great until I made the group repeatable which then caused it to work in the "Contains" way.

I tracked the problem down to this line (around 209) in databasejoin.php:

Code:
                $this->_autocomplete_where = $label . ' LIKE ' . $db->quote('%' . JRequest::getVar('value') . '%');
I fixed the problem by replacing it with this which was a slightly modified version of the code at around line 2526:

Code:
                // $$$ hugh (and Joe) - added 'autocomplete_how', currently just "starts_with" or "contains"
                // default to "contains" for backward compat.
                $params = $this->getParams();
                if ($params->get('dbjoin_autocomplete_how', 'contains') == 'contains')
                {
                    $this->_autocomplete_where = $label . ' LIKE ' . $db->quote('%' . JRequest::getVar('value') . '%');
                }
                else
                {
                    $this->_autocomplete_where = $label . ' LIKE ' . $db->quote(JRequest::getVar('value') . '%');
                }
Now the Auto-complete works as expected in the repeatable group.

I hope this fix can make it into Fabrik. :)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top