Skip to content

Commit 5404d11

Browse files
committed
2527: Fix Magento folder handling and update plugin version.
Refactored logic to handle Magento folder paths more robustly, ensuring design paths are added without overwriting existing ones. Updated plugin version to 2025.1.1 and added relevant changelog entry for bug fix #2527. Incremental version changes made in plugin metadata and build properties.
1 parent c6610a4 commit 5404d11

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

7+
## 2025.1.1
8+
9+
### Fixed
10+
11+
- The themes select is empty [#2527](https://github.com/magento/magento2-phpstorm-plugin/pull/2527)
12+
713
## 2025.1.0
814

915
### Added

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pluginGroup = com.magento.idea.magento2plugin
22
pluginName = Magento PhpStorm
33
pluginRepositoryUrl = https://github.com/magento/magento2-phpstorm-plugin
4-
pluginVersion = 2025.1.0
4+
pluginVersion = 2025.1.1
55
pluginSinceBuild = 243.3
66
pluginUntilBuild = 258.*
77
platformType = PS

src/main/java/com/magento/idea/magento2plugin/util/magento/IsFileInEditableModuleUtil.java

+16-20
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.intellij.openapi.vfs.VirtualFile;
1010
import com.intellij.psi.PsiFile;
1111
import com.magento.idea.magento2plugin.project.Settings;
12+
import java.util.ArrayList;
1213
import java.util.List;
1314

1415
public final class IsFileInEditableModuleUtil {
@@ -37,31 +38,26 @@ public static boolean execute(final PsiFile file) {
3738
*/
3839
public static boolean execute(final Project project, final VirtualFile virtualFile) {
3940
final Settings settings = Settings.getInstance(project);
40-
List<String> magentoToFolders = settings.getMagentoFolders();
41-
final String magentoPathUrl = MagentoPathUrlUtil.execute(project);
42-
final String magentoDesignUrl = MagentoPathUrlUtil.getDesignPath(project);
43-
if (magentoPathUrl != null) {
44-
if (magentoToFolders == null) {
45-
magentoToFolders = List.of(
46-
magentoPathUrl,
47-
magentoDesignUrl
48-
);
49-
} else {
50-
magentoToFolders.add(
51-
magentoPathUrl
52-
);
53-
}
54-
}
41+
List<String> editablePaths = settings.getMagentoFolders();
42+
final String magentoRootPath = MagentoPathUrlUtil.execute(project);
43+
final String magentoDesignPath = MagentoPathUrlUtil.getDesignPath(project);
5544

45+
if (magentoRootPath == null) {
46+
return false;
47+
}
5648

49+
if (editablePaths == null) {
50+
editablePaths = new ArrayList<>();
51+
}
5752

58-
if (magentoToFolders == null) {
59-
return false;
53+
editablePaths.add(magentoRootPath);
54+
if (magentoDesignPath != null) {
55+
editablePaths.add(magentoDesignPath);
6056
}
6157

62-
final String filePath = virtualFile.getUrl();
63-
for (final String editablePath : magentoToFolders) {
64-
if (normalizeUrl(filePath).startsWith(normalizeUrl(editablePath))) {
58+
final String currentFilePath = virtualFile.getUrl();
59+
for (final String editablePath : editablePaths) {
60+
if (normalizeUrl(currentFilePath).startsWith(normalizeUrl(editablePath))) {
6561
return true;
6662
}
6763
}

src/main/resources/META-INF/plugin.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<idea-plugin require-restart="true">
88
<id>com.magento.idea.magento2plugin</id>
99
<name>Magento PhpStorm</name>
10-
<version>2025.1.0</version>
10+
<version>2025.1.1</version>
1111
<vendor url="https://github.com/magento/magento2-phpstorm-plugin">Magento Inc.</vendor>
1212

1313
<description><![CDATA[

0 commit comments

Comments
 (0)