Skip to content

Commit bb25894

Browse files
Merge pull request #1047 from magento/fixed-path-suggestion
Fixed Magento installation path suggestion
2 parents 4d54cb7 + 73fca64 commit bb25894

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

resources/META-INF/pluginIcon.svg

Lines changed: 2 additions & 0 deletions
Loading

src/com/magento/idea/magento2plugin/project/SettingsForm.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.magento.idea.magento2plugin.indexes.IndexManager;
1919
import com.magento.idea.magento2plugin.init.ConfigurationManager;
2020
import com.magento.idea.magento2plugin.magento.packages.MagentoComponentManager;
21+
import com.magento.idea.magento2plugin.project.util.GetProjectBasePath;
2122
import com.magento.idea.magento2plugin.project.validator.SettingsFormValidator;
2223
import com.magento.idea.magento2plugin.util.magento.MagentoVersionUtil;
2324
import java.awt.event.MouseAdapter;
@@ -197,13 +198,22 @@ private void addPathListener() {
197198
"Magento Root Directory",
198199
"Choose Magento root directory",
199200
this.magentoPath,
200-
null,
201+
project,
201202
descriptor,
202203
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
203204
) {
204205
@Nullable
205206
@Override
206207
protected VirtualFile getInitialFile() {
208+
209+
final String text = getComponentText();
210+
if (text.length() == 0) {
211+
final VirtualFile file = GetProjectBasePath.execute(project);
212+
if (file != null) {
213+
return file;
214+
}
215+
}
216+
207217
return super.getInitialFile();
208218
}
209219
};

0 commit comments

Comments
 (0)