Affected version: 0.7.0
Last good version: 0.6.4
If you define a getColumns() method in your ArrayProvider, it's called when the grid is rendered the first time. After that however, \Loki\AdminComponents\Component\Grid\GridViewModel::getAvailableColumns first tries to retrieve columns from the bookmarks and if that succeeds, skips the provider:
https://github.com/LokiExtensions/Loki_AdminComponents/blob/0.7.0/Component/Grid/GridViewModel.php#L198
public function getAvailableColumns(): array
{
$columns = $this->columnLoader->getColumnsFromNamespace($this->getNamespace());
if (!empty($columns)) { // true the second time
return $columns;
}
$providerHandler = $this->getRepository()->getProviderHandler();
$provider = $this->getRepository()->getProvider();
$columns = $providerHandler->getColumns($provider); // called the first time, skipped the second time
I noticed this because suddenly my cell templates and column labels were being ignored. For example:
https://github.com/LBannenberg/magento2-composer-dashboard/blob/main/src/Provider/InstalledPackagesArrayProvider.php#L22
public function getColumns(): array
{
return [
$this->columnFactory->create([
'code' => 'package',
'label' => 'Package',
'cell_template' => 'Corrivate_ComposerDashboard::grid/cell/package-name.phtml'
]),
When the column is created from the bookmark, it doesn't use the same data:
https://github.com/LokiExtensions/Loki_AdminComponents/blob/0.7.0/Grid/ColumnLoader.php#L85
$columns[] = $this->columnFactory->create([
'code' => $columnName,
'visible' => $visible,
'position' => (isset($positions[$columnName])) ? $positions[$columnName] : 99,
]);
Which visually looks like this on first load:
And on reload:

Affected version: 0.7.0
Last good version: 0.6.4
If you define a getColumns() method in your ArrayProvider, it's called when the grid is rendered the first time. After that however, \Loki\AdminComponents\Component\Grid\GridViewModel::getAvailableColumns first tries to retrieve columns from the bookmarks and if that succeeds, skips the provider:
https://github.com/LokiExtensions/Loki_AdminComponents/blob/0.7.0/Component/Grid/GridViewModel.php#L198
I noticed this because suddenly my cell templates and column labels were being ignored. For example:
https://github.com/LBannenberg/magento2-composer-dashboard/blob/main/src/Provider/InstalledPackagesArrayProvider.php#L22
When the column is created from the bookmark, it doesn't use the same data:
https://github.com/LokiExtensions/Loki_AdminComponents/blob/0.7.0/Grid/ColumnLoader.php#L85
Which visually looks like this on first load:
And on reload: