magento / magento/magento2-phpstorm-plugin

Fatal error: Class 'Vendor\Module\Block\Form\Entity\GenericButton' not found in app/code/Vendor/Module/Block/Adminhtml/Form/Button.php

Open
#2,555 2 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
Java
Stars
463
Forks
98
Avg merge
1h 6m
Merged PRs (30d)
3

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
wrapButtonSettings(
__('Save')->getText(),
'save primary',
'',
[
'mage-init' => ['button' => ['event' => 'save']],
'form-role' => 'save'
],
30
);
}
}

```

**To Reproduce** (*)

Steps to reproduce the behavior:
1. Go to New
2. Click on Magento 2 UI Compoent form
3. Make sure to add a button
4. Try to visit the controller URL to render the form
5. 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**

Contributor guide

Open the contributing guide

Research direction

Start with the generated app/code/Vendor/Module/Block/Adminhtml/Form/Button.php and compare its GenericButton import and parent class with the Magento 2 UI component form generation flow. Reproduce the issue by rendering the controller URL after adding a button. Done means the generated form button no longer references a missing GenericButton class and the form renders without a fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, php
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.