diff --git a/CHANGELOG.md b/CHANGELOG.md index bd0d34a67..94452dddc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). - Compatibility with PhpStorm/IntelliJ 2025.* [#2495](https://github.com/magento/magento2-phpstorm-plugin/pull/2495) - "Copy Path/Reference" does not show the preview value [#2497](https://github.com/magento/magento2-phpstorm-plugin/pull/2497) +- Must not start write action from within read action in the other thread [#2498](https://github.com/magento/magento2-phpstorm-plugin/pull/2498) ## 2025.0.0 diff --git a/src/main/java/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java b/src/main/java/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java index 02b9b4ba5..db17694d6 100644 --- a/src/main/java/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java +++ b/src/main/java/com/magento/idea/magento2plugin/inspections/php/fix/PhpModuleNameQuickFix.java @@ -7,6 +7,7 @@ import com.intellij.codeInspection.LocalQuickFix; import com.intellij.codeInspection.ProblemDescriptor; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.project.Project; import com.jetbrains.php.lang.psi.elements.StringLiteralExpression; @@ -38,7 +39,9 @@ public void applyFix( ) { final StringLiteralExpression expression = (StringLiteralExpression) descriptor.getPsiElement(); - applyFix(expression); + if (ApplicationManager.getApplication().isDispatchThread()) { + applyFix(expression); + } } private void applyFix(final StringLiteralExpression expression) {