Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fulltext search doesn't work #529

Closed
imonteiro opened this issue Jan 18, 2013 · 2 comments
Closed

Fulltext search doesn't work #529

imonteiro opened this issue Jan 18, 2013 · 2 comments

Comments

@imonteiro
Copy link
Member

Original author: Vlad.Ovc...@gmail.com (July 09, 2010 09:08:17)

What steps will reproduce the problem?

  1. Create grid for table users with the company field
  2. Update column: $grid->updateColumn('company', array(
    'title' => 'Company',
    'search' => array('fulltext' => true),
    ));
  3. Load page with grid and make search.
                Zend Framework version: 1.10.5

ZFDatgrid Version (Bvb_Grid::getVersion()): 1310
Operating system: Windows Vista
PHP Version: 5.2
Database Server and version: MySQL 5.1
Source Adatapter: PDO_MYSQL

Any search throws exception like:

Unrecognized value in extra key
Exception information:

Message: Unrecognized value in extra key
Stack trace:
#0 ...\library\Bvb\Grid.php(1049): Bvb_Grid_Source_Zend_Select->addFullTextSearch('adfa', 'company', Array)
#1 ...\library\Bvb\Grid.php(2317): Bvb_Grid->_buildFiltersValues()
#2 ...\library\Bvb\Grid\Deploy\Table.php(1604): Bvb_Grid->deploy()
#3 ...\application\controllers\AdminController.php(99): Bvb_Grid_Deploy_Table->deploy()
#4 ...\library\Zend\Controller\Action.php(513): AdminController->usersAction()
#5 ...\library\Zend\Controller\Dispatcher\Standard.php(289): Zend_Controller_Action->dispatch('usersAction')
#6 ...\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#7 ...\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#8 ...\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#9 ...\index.php(26): Zend_Application->run()
#10 {main}

Request Parameters:

array (
'controller' => 'admin',
'action' => 'users',
'order' => 'fio_ASC',
'company' => 'adfa',
'module' => 'default',
)

During debugging the file bvb/grid/source/zend/select.php in the code "$extra = isset($full['extra']) ? $full['extra'] : 'boolean';

    if ( ! in_array($extra, array('boolean', 'queryExpansion', false)) ) {
        throw new Bvb_Grid_Exception('Unrecognized value in extra key');
    }"

the variable $extra for some reason has value "c"

Original issue: http://code.google.com/p/zfdatagrid/issues/detail?id=373

@imonteiro
Copy link
Member Author

From Vlad.Ovc...@gmail.com on July 09, 2010 10:20:16
That helped me:

Bvb/Grid.php

//Old code:
$this->getSource()->addFullTextSearch($filter, $key, $this->_data['fields'][$key]);

// My code:
$this->getSource()->addFullTextSearch($filter, $this->_data['fields'][$key]);

@imonteiro
Copy link
Member Author

From bento.vi...@gmail.com on July 12, 2010 15:56:18
Hi,

You are completely right.

Thanks for the report and fix

Best Regards,
Bento Vilas Boas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant