Skip to content

Commit 370596e

Browse files
Merge branch '4.2.2-develop' of github.com:magento/magento2-phpstorm-plugin into 760-fix-Throwable-when-IOException-is-thrown-during-plugin-generation
2 parents e5109ad + f712cfc commit 370596e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/com/magento/idea/magento2plugin/actions/generation/generator/UiComponentFormGenerator.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ protected PsiFile createForm(
149149
protected void fillAttributes(final @NotNull Properties attributes) {
150150
final PhpClassTypesBuilder phpClassTypesBuilder = new PhpClassTypesBuilder();
151151

152+
if (data.getFields().isEmpty()) {
153+
phpClassTypesBuilder
154+
.appendProperty("PRIMARY_FIELD", "");
155+
} else {
156+
phpClassTypesBuilder
157+
.appendProperty("PRIMARY_FIELD", data.getFields().get(0).getName());
158+
}
159+
152160
phpClassTypesBuilder
153161
.appendProperty("NAME", data.getFormName())
154162
.appendProperty("LABEL", data.getLabel())
@@ -165,7 +173,6 @@ protected void fillAttributes(final @NotNull Properties attributes) {
165173
data.getDataProviderPath()
166174
).getClassFqn()
167175
)
168-
.appendProperty("PRIMARY_FIELD", data.getFields().get(0).getName())
169176
.mergeProperties(attributes);
170177
}
171178

0 commit comments

Comments
 (0)