Skip to content

Commit 694913d

Browse files
authored
Merge pull request #529 from magento/incorrect-warning-in-for-disabled-plugin
Fixed incorrect duplication warning for disabled plugin in di.xml
2 parents 27fb74b + ede1d08 commit 694913d

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

src/com/magento/idea/magento2plugin/inspections/xml/ObserverDeclarationInspection.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,25 +121,21 @@ public void visitFile(final PsiFile file) {
121121
file
122122
);
123123

124-
if (observerDisabledAttribute != null
125-
&& observerDisabledAttribute.getValue() != null
126-
&& observerDisabledAttribute.getValue().equals("true")
127-
&& modulesWithSameObserverName.isEmpty()
128-
) {
129-
problemsHolder.registerProblem(
130-
observerNameAttribute.getValueElement(),
131-
inspectionBundle.message(
132-
"inspection.observer.disabledObserverDoesNotExist"
133-
),
134-
errorSeverity
135-
);
136-
}
137-
138124
if (observerDisabledAttribute != null
139125
&& observerDisabledAttribute.getValue() != null
140126
&& observerDisabledAttribute.getValue().equals("true")
141127
) {
128+
if (modulesWithSameObserverName.isEmpty()) {
129+
problemsHolder.registerProblem(
130+
observerNameAttribute.getValueElement(),
131+
inspectionBundle.message(
132+
"inspection.observer.disabledObserverDoesNotExist"
133+
),
134+
errorSeverity
135+
);
136+
} else {
142137
continue;
138+
}
143139
}
144140

145141
for (final HashMap<String, String> moduleEntry:

src/com/magento/idea/magento2plugin/inspections/xml/PluginDeclarationInspection.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,18 @@ public void visitFile(final PsiFile file) {
118118
if (pluginTypeDisabledAttribute != null
119119
&& pluginTypeDisabledAttribute.getValue() != null
120120
&& pluginTypeDisabledAttribute.getValue().equals("true")
121-
&& modulesWithSamePluginName.isEmpty()
122121
) {
123-
problemsHolder.registerProblem(
124-
pluginTypeNameAttribute.getValueElement(),
125-
inspectionBundle.message(
122+
if (modulesWithSamePluginName.isEmpty()) {
123+
problemsHolder.registerProblem(
124+
pluginTypeNameAttribute.getValueElement(),
125+
inspectionBundle.message(
126126
"inspection.plugin.disabledPluginDoesNotExist"
127-
),
128-
errorSeverity
129-
);
127+
),
128+
errorSeverity
129+
);
130+
} else {
131+
continue;
132+
}
130133
}
131134

132135
for (final Pair<String, String> moduleEntry: modulesWithSamePluginName) {

0 commit comments

Comments
 (0)