omusico / zfdatagrid

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

Providing extra configuration for export breaks "isExport"-method #801

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. $grid->setExport(array('csv'));
2. $grid->setExport(array('csv' => array('caption' => 'csv')));

What is the expected output? What do you see instead?
expected:
$grid->isExport() should return true if the grid is being exported
instead:
true is only returned if no extra configuration is provided
'1.' works ok, '2.' is broken

Please insert the appropriate values;
                    Zend Framework version: 1.11.11
ZFDatgrid Version (Bvb_Grid::getVersion()): 0.8
                          Operating system: Linux
                               PHP Version: 5.3.6
               Database Server and version: Mysql 5
Source Adatapter:

Please provide any additional information below.
Grid.php: return in_array($this->getParam('_exportTo'), $this->_export);
works only if $this->_export is a "flat" array

this will fix it:
return (in_array($this->getParam('_exportTo'), $this->_export) || 
in_array($this->getParam('_exportTo'), array_keys($this->_export)));

Original issue reported on code.google.com by buegelfa...@gmail.com on 8 Dec 2011 at 10:15

GoogleCodeExporter commented 9 years ago
Hi,

I'm using 2. and all works fine. However, to avoid issues with no "flat" array 
I will change the code.

Fixed and committed.

Thanks.

Best Regards
Ivo Monteiro

Original comment by ivomonte...@gmail.com on 28 Feb 2012 at 8:50