Open
Description
Describe the bug (*)
I've created a form with the form ui component tool however the form is not usable due to a Fatal Error.
The button added tries to extend Block\Form\Entity\GenericButton but that class is not created by the plugin.
THis is what the button code looks like
<?php
/**
* Copyright (c) 2025. YourCompanyName
*/
namespace Vendor\ModuleName\Block\Adminhtml\Form;
use Vendor\ModuleName\Block\Form\Entity\GenericButton;
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
/**
* Save entity button.
*/
class Button extends GenericButton implements ButtonProviderInterface
{
/**
* Retrieve Save button settings.
*
* @return array
*/
public function getButtonData(): array
{
return $this->wrapButtonSettings(
__('Save')->getText(),
'save primary',
'',
[
'mage-init' => ['button' => ['event' => 'save']],
'form-role' => 'save'
],
30
);
}
}
To Reproduce (*)
Steps to reproduce the behavior:
- Go to New
- Click on Magento 2 UI Compoent form
- Make sure to add a button
- Try to visit the controller URL to render the form
- See the Fatal Error
Expected behavior (*)
There's no error and the Generic Button class exists.
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following information: (*)
- OS: Windows 11 x64
- PhpStorm/Intellij version: 2025.1.1
- Plugin Version: 2025.1.1
Additional context