This module aims to make creating grids and forms in the Magento 2 adminhtml area joyful and fast.
BSD 3-Clause "New" or "Revised" License
168
stars
39
forks
source link
Using included columns in the grid definition throws an exception if no data is present #85
Open
renttek opened 6 days ago
Using included columns will result in an
\OutOfBoundsException
being thrown, if the grid source does not return rows/data. I looked into this issue in the scope of this issue: https://github.com/element119/module-admin-opcache-report/issues/1#issuecomment-2431668301The cause of this is, that when
Hyva\Admin\Model\GridSource::extractColumnDefinitions()
calls the methodvalidateConfiguredKeys
, it checks the included columns against all existing ones from the provider. (See: https://github.com/hyva-themes/magento2-hyva-admin/blob/main/Model/GridSource.php#L77)A simple workaround/hack I've been using (via a composer patch), is to ignore the validation if no data is present: