Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not save project: unknown macro $PROJECT_CONFIG_DIR$ in storage spec $PROJECT_CONFIG_DIR$/symfony2.xml #122

Closed
mtal opened this issue Jul 21, 2013 · 9 comments
Labels

Comments

@mtal
Copy link

mtal commented Jul 21, 2013

Idea 12 after activating plugin constantly throws message "Could not save project: unknown macro $PROJECT_CONFIG_DIR$ in storage spec $PROJECT_CONFIG_DIR$/symfony2.xml"

sym2plugin

@Haehnchen
Copy link
Owner

mmh.. looks like a broken ide installation. reinstall possible, which version of phpstorm or IntelliJ?

@mtal
Copy link
Author

mtal commented Jul 29, 2013

Idea 12.1.5 (build 129.961).
It's not an IDE bug. The problem persists in the latest build IDEA 13 build 130.1365 clean installation with installed php-plugin and php-symfony2-plugin.

It is easy to reproduce.

  1. Install the latest 64-bit JRE if not already installed.
  2. Download zip archive from http://confluence.jetbrains.com/display/IDEADEV/IDEA+13+EAP, unzip it, run idea64.exe
  3. Install php-plugin and php-symfony2-plugin
  4. Restart IDE
  5. Open any project, make changes to any text file and try to save

@fadorator
Copy link

I can confirm this for IDEA 12.1.4. But it does not happen with every project. I noticed it after opening a grails project. I don't think the dialog appears after opening a symfony2 project with active symfony2 plugin.

BTW: @Haehnchen Nice name/image combination. :)

@mtal
Copy link
Author

mtal commented Jul 30, 2013

@fadorator, no it happens with symfony2 projects too.

@Haehnchen, I suspect the error occurs only with file-based format project.
IDEA has two types of project's configuration storage: directory-based (.idea directory with files) and file-based (single .ipr file).

The fault is on 13-18 lines of https://github.com/adrienbrault/idea-php-symfony2-plugin/blob/master/src/fr/adrienbrault/idea/symfony2plugin/Settings.java

@State(
       name = "Settings",
       storages = {
               @Storage(id = "default", file="$PROJECT_CONFIG_DIR$/symfony2.xml", scheme = StorageScheme.DIRECTORY_BASED)
       }
)

This code is not support file-based storage for settings.

@mtal
Copy link
Author

mtal commented Jul 30, 2013

@Haehnchen please read this http://devnet.jetbrains.com/thread/275801

@fadorator
Copy link

@mtal I think you could be right, this grails project I was talking about is file-based too. My symfony2 projects are directory-based and they work fine.

@mtal
Copy link
Author

mtal commented Jul 30, 2013

The solution is

@State(
    name = "Settings",
    storages = {
      @Storage(id = "default", file = StoragePathMacros.PROJECT_FILE),
      @Storage(id = "dir", file = StoragePathMacros.PROJECT_CONFIG_DIR + "/symfony2.xml", scheme = StorageScheme.DIRECTORY_BASED)
    }
)

Haehnchen added a commit that referenced this issue Jul 30, 2013
@Haehnchen
Copy link
Owner

thx for support

@mtal
Copy link
Author

mtal commented Jul 30, 2013

@Haehnchen storage name "Settings" is not good for file-based format. It must be unique.
It's name of the component and may be overlapped by another component .

Now section of the php-symfony2-plugin configuration in .ipr looks like:

 <component name="Settings">
    <option name="pathToUrlGenerator" value="app/cache/dev/appDevUrlGenerator.php" />
    <option name="pathToTranslation" value="app/cache/dev/translations" />
    <option name="directoryToWeb" value="web" />
    <option name="directoryToApp" value="app" />
    <option name="pluginEnabled" value="true" />
    <option name="containerFiles">
      <list>
        <container_file path="app/cache/dev/appDevDebugProjectContainer.xml" />
      </list>
    </option>
  </component>

I suppose you should rename "Settings" to something like "Symfony2PluginSettings" or "fr.adrienbrault.idea.symfony2plugin.Settings" or something related to plugin name.

Haehnchen added a commit that referenced this issue Jan 16, 2014
…nSettings", edit component of ".idea/symfony2.xml" if you dont want reconfigure plugin #209 #122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants