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

I am having issues with Hyva_Admin. Can I use it only with Hyva_Admin? #1

Open
levelzero-magento opened this issue Oct 21, 2024 · 7 comments

Comments

@levelzero-magento
Copy link

1 exception(s):
Exception #0 (OutOfBoundsException): Column(s) not found on source: log_id, admin_name, flushed_at

@magtools
Copy link

I have the same issue:
1 exception(s):
Exception #0 (OutOfBoundsException): Column(s) not found on source: log_id, admin_name, flushed_at

Exception #0 (OutOfBoundsException): Column(s) not found on source: log_id, admin_name, flushed_at

#1 Hyva\Admin\Model\GridSource->extractColumnDefinitions() called at [vendor/hyva-themes/module-magento2-admin/ViewModel/HyvaGridViewModel.php:159]
#2 Hyva\Admin\ViewModel\HyvaGridViewModel->buildColumnDefinitions() called at [vendor/hyva-themes/module-magento2-admin/ViewModel/HyvaGridViewModel.php:149]
#3 Hyva\Admin\ViewModel\HyvaGridViewModel->getAllColumnDefinitions() called at [vendor/hyva-themes/module-magento2-admin/ViewModel/HyvaGridViewModel.php:176]
#4 Hyva\Admin\ViewModel\HyvaGridViewModel->getColumnDefinitions() called at [vendor/hyva-themes/module-magento2-admin/ViewModel/HyvaGridViewModel.php:254]
#5 Hyva\Admin\ViewModel\HyvaGridViewModel->getNavigation() called at [vendor/hyva-themes/module-magento2-admin/view/adminhtml/templates/grid.phtml:9]
#6 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#7 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#8 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#9 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#10 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:23]
#11 Magento\Framework\View\TemplateEngine\Php\Interceptor->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#12 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#13 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1128]
#14 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1132]
#15 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:676]
#16 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [generated/code/Hyva/Admin/Block/Adminhtml/HyvaGrid/Interceptor.php:23]
#17 Hyva\Admin\Block\Adminhtml\HyvaGrid\Interceptor->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#18 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]
#19 Magento\Framework\View\Layout->renderNonCachedElement() called at [vendor/magento/framework/View/Layout.php:510]
#20 Magento\Framework\View\Layout->renderElement() called at [vendor/magento/framework/View/Element/AbstractBlock.php:523]
#21 Magento\Framework\View\Element\AbstractBlock->getChildHtml() called at [vendor/element119/module-admin-opcache-report/view/adminhtml/templates/flush-log.phtml:26]
#22 include() called at [vendor/magento/framework/View/TemplateEngine/Php.php:71]
#23 Magento\Framework\View\TemplateEngine\Php->render() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#24 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]
#25 Magento\Framework\View\TemplateEngine\Php\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#26 Magento\Framework\View\TemplateEngine\Php\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/View/TemplateEngine/Php/Interceptor.php:23]
#27 Magento\Framework\View\TemplateEngine\Php\Interceptor->render() called at [vendor/magento/framework/View/Element/Template.php:263]
#28 Magento\Framework\View\Element\Template->fetchView() called at [vendor/magento/framework/View/Element/Template.php:293]
#29 Magento\Framework\View\Element\Template->_toHtml() called at [vendor/magento/module-backend/Block/Template.php:141]
#30 Magento\Backend\Block\Template->_toHtml() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1128]
#31 Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() called at [vendor/magento/framework/View/Element/AbstractBlock.php:1132]
#32 Magento\Framework\View\Element\AbstractBlock->_loadCache() called at [vendor/magento/framework/View/Element/AbstractBlock.php:676]
#33 Magento\Framework\View\Element\AbstractBlock->toHtml() called at [generated/code/Magento/Backend/Block/Template/Interceptor.php:23]
#34 Magento\Backend\Block\Template\Interceptor->toHtml() called at [vendor/magento/framework/View/Layout.php:578]
#35 Magento\Framework\View\Layout->_renderBlock() called at [vendor/magento/framework/View/Layout.php:555]

@nmarcy-del
Copy link

Hello,

I faced the same problem.
It seems that this exception occurs if the table e199_opcache_admin_flush_history is empty.
I've manually created a row in the table (with an existing admin user id) and everything now works (for a workaround)

@levelzero-magento
Copy link
Author

Hello,

I faced the same problem. It seems that this exception occurs if the table e199_opcache_admin_flush_history is empty. I've manually created a row in the table (with an existing admin user id) and everything now works (for a workaround)

Perfect, and thank you for your suggestion. I confirm that I did the same, and now it works. Indeed, the table was empty.

@renttek
Copy link

renttek commented Oct 23, 2024

The problem is the method Hyva\Admin\Model\GridSource::extractColumnDefinitions(), which validates the included columns against the available columns of the source.

In Line 77, the method validateConfiguredKeys is called, which throws the exception: https://github.com/hyva-themes/magento2-hyva-admin/blob/main/Model/GridSource.php#L77

A quick hack is to simply not validate the included columns if no data is present:

+        if ($allColumnKeys !== []) {
            $this->validateConfiguredKeys(keys($configuredColumns), $allColumnKeys);
+        }

This will result in the following behavior if no data is present:
image

After a flush is done/data is present, the grid will display like normal.

I don't think just skipping the validation is not a good "fix" (without knowing what else could break) to contribute back to hyvä admin grids.
If I find a better solution, I'll create a PR for it, but until then, a composer patch does the trick for me.
(If someone else wants to create a PR for hyvä admin, please do so 🙂)

@renttek
Copy link

renttek commented Oct 23, 2024

I created an issue in the hyvä admin repository: hyva-themes/magento2-hyva-admin#85

@pykettk
Copy link
Member

pykettk commented Oct 23, 2024

@renttek Thanks for digging into this and posting such a helpful explanation! I can probably use a grid processor to avoid this issue but I'll dig into this a little more when I have time - hopefully I can make some time before the end of this week but, failing that, it'll likely be after Meet Magento NL and Mage Unconference.

@renttek
Copy link

renttek commented Oct 23, 2024

Probably, yes 🙂

If you won't find time, there is also a hackathon before the Mage Unconference and I'll try to place the topic there then 😁

But I think a fix in the admin module would be better in the grand scheme

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

No branches or pull requests

5 participants