Skip to content

Commit e34731a

Browse files
committed
Do not adding the sequence attribute, if no sequence has been selected
1 parent cc3a94b commit e34731a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ protected void fillAttributes(final Properties attributes) {
7575
if (moduleXmlData.getSetupVersion() != null) {
7676
attributes.setProperty("SETUP_VERSION", moduleXmlData.getSetupVersion());
7777
}
78-
attributes.setProperty("SEQUENCES", this.getSequencesString(moduleXmlData.getModuleSequences()));
78+
79+
String sequences = this.getSequencesString(moduleXmlData.getModuleSequences());
80+
if (!sequences.isEmpty()) {
81+
attributes.setProperty(
82+
"SEQUENCES",
83+
sequences
84+
);
85+
}
7986
}
8087

8188
private String getSequencesString(final List sequences) {
@@ -90,7 +97,8 @@ private String getSequencesString(final List sequences) {
9097

9198
for (Object o : dependencies) {
9299
String dependency = o.toString();
93-
result = result.concat("<module name=\"" + dependency + "\"/>");
100+
String moduleSequence = "<module name=\"%s\"/>";
101+
result = result.concat(String.format(moduleSequence, dependency));
94102
}
95103

96104
return result;

0 commit comments

Comments
 (0)