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

Create Twig File Template Error #281

Open
peregrinodeti opened this issue Jul 8, 2024 · 0 comments
Open

Create Twig File Template Error #281

peregrinodeti opened this issue Jul 8, 2024 · 0 comments
Labels

Comments

@peregrinodeti
Copy link

Describe the bug
Create a Twig File Template with Eclipse Twig Plug-in throws an error if you try to create the file out of the src root folder in an Empty Composer Project.

Describe the eclipse environment
Eclipse Version: 2024-06;
PDT Version: PDT Profiler UI Plug-in 8.2.0.202311292129 org.eclipse.php.profiler;
Plugins: Twig Editor Feature 2.3.0.202309270934 com.dubture.twig.feature.feature.group.

Describe your system

  • OS: Windows;
  • Version: 11;
  • PHP Version: 8.3.9;
  • Webserver Version: Apache 2.4;
  • Utilis: Composer 2.7.6 and Twig 3.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Eclipse Menu File -> New -> Empty Composer Project;
  2. Fill the Basic Composer Configuration, for example: Project Name: test; Vendor Name: Test; Type: project; Click on the Finish Button;
  3. Now that the project has been created, select it and go to Eclipse Menu File -> New -> Other -> Search for Wizard Twig template; Click on Next Button;
  4. Fill in the information about the new Twig template, for example: Source folder: test/src; File name: template.twig (or other name); Click the Finish Button. The Twig Template File was created with no problem;
  5. Now create a new folder in test project, select the project name, and then go to Eclipse Menu File -> New -> Folder;
  6. Fill the Folder name: views (for example);
  7. Repeat these steps:
  • Go to, Eclipse Menu File -> New -> Other -> Search for Wizard Twig template; Click on Next Button;
  • Fill the informations about New Twig Template, for example: Source folder: test/views; File name: template2.twig (or other name); Click on Finish Button. The Twig Template File is not created, and IDE throws a exception: Creation of element failed - Cannot invoke "org.eclipse.dltk.core.IScriptFolder.getSourceModule(string)" because the return value of "org.eclipse.dltk.ui.wizards.NewSourceModulePage.getScriptFolder()" is null.

Expected behavior
Create the Twig File Template with no problem.

Screenshots
Follow the screenshot about the case describe above:

twig_eclipse_error

Additional context
Now if you create a simple PHP Project, in Eclipse Menu File -> New -> PHP Project. Create any folder inside this project and then create a Twig Template File in this folders, this problem will not occur. The scr root folder, a principle, is the origin of the problem. The Twig Wizard only works if you create the files and folders inside this root folder when the project is the kind of Empty Composer Project.

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

1 participant