AshishJoshi-asj / zfdatagrid

Automatically exported from code.google.com/p/zfdatagrid
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

PostgreeSQL II #176

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. model
in my model i have this:
public function gridinfo(){
   $select = $this->select()
   ->setIntegrityCheck(false)
   ->from(array('table'), array('field1', 'field2'));
   return $select;
}

2. controller
in my controller i have this:

$mymodel = new Model_Mymodel();

$db = Zend_Registry::get("db");
$grid = new Bvb_Grid_Deploy_Table($db,'Document
Title','/',array('save','download'));
$grid->imagesUrl = $this->view->baseUrl () . '/images/';
$grid->query($mymodel->gridinfo());
$this->view->grid = $grid->deploy();

(actually i have a helper, but to make easy the explanation i decide to
make it this way)

3. view
in my view i have this:
echo $this->grid;

What is the expected output? What do you see instead?

expected: grid with data.
i see: Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with
message 'SQLSTATE[42803]: Grouping error: [...]

What version of the product are you using? On what operating system?
version: 0.5.1
php 5.2.11
PostgreSQL 8.4.1
Apache 2.2.14

Please provide any additional information below.
Ok, reading the "postgresql" post from pao.fresco, i did almost the same to
make the grid work for me:

in file DataGrid.php, found: (+- line 2752)
$selectZendDb->reset ( Zend_Db_Select::GROUP );
$selectZendDb->reset ( Zend_Db_Select::ORDER );

write just before:
$selectZendDb->reset ( Zend_Db_Select::COLUMNS );

so the part of the code become:
$selectZendDb->reset ( Zend_Db_Select::COLUMNS );
$selectZendDb->reset ( Zend_Db_Select::GROUP );
$selectZendDb->reset ( Zend_Db_Select::ORDER );
$selectZendDb->columns ( array ('TOTAL' => new Zend_Db_Expr ( "COUNT(*)" ) ) );
[...]

i have the same notices from pao.fresco about the table indexes, but for me
works well, and i wish this can help others with the same problem.

sorry my bad english.

cheers!!!!

Original issue reported on code.google.com by hug...@gmail.com on 18 Feb 2010 at 1:34

GoogleCodeExporter commented 9 years ago
about the notices:

if you are using a grid without filter ($grid->noFilters (1);), you can put 
this in
your datagrid.php, (+- line 2270):

if (null === $table) {
   if (isset($this->data ['table']))  // ### added line
   $table = $this->data ['table'];
}

with this will be no more notices (but only with the nofilters).

Original comment by hug...@gmail.com on 18 Feb 2010 at 3:39

GoogleCodeExporter commented 9 years ago
Hi,

This was fixed on version 0.6

Thanks

Best Regards,
Bento Vilas Boas

Original comment by pao.fre...@gmail.com on 18 Feb 2010 at 6:30

GoogleCodeExporter commented 9 years ago

Original comment by bento.vi...@gmail.com on 3 Mar 2010 at 4:56