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

Error when creating a new project with specific steps (Create Folder manipulation) #101528

Open
zedqwee opened this issue Jan 14, 2025 · 2 comments · May be fixed by #101609
Open

Error when creating a new project with specific steps (Create Folder manipulation) #101528

zedqwee opened this issue Jan 14, 2025 · 2 comments · May be fixed by #101609

Comments

@zedqwee
Copy link

zedqwee commented Jan 14, 2025

Tested versions

  • Reproducible in: v4.3.stable.official [77dcf97], v4.4.dev7.official [46c8f8c]

System information

Godot v4.3.stable - Windows 10.0.26100 - Vulkan (Forward+) - dedicated Radeon (TM) RX 480 Graphics - AMD Ryzen 7 2700 Eight-Core Processor (16 Threads)

Issue description

When trying to create a new project in Godot, if I leave the "Project Name" field empty and uncheck the "Create Folder" option, then check it again and attempt to enter a project name, I encounter the following errors:

  • "You cannot save a project at the selected path." (if saving in Documents)
  • "The selected path is not empty." (if saving in any other folder)

Steps to reproduce

  1. Open Godot.
  2. Click on "Create"
  3. Leave the "Project Name" field empty.
  4. Uncheck the "Create Folder" option.
  5. Check the "Create Folder" option again.
  6. Enter a project name.

Minimal reproduction project (MRP)

N/A

@DubiousDuck
Copy link
Contributor

DubiousDuck commented Jan 15, 2025

I followed the steps above to try and replicate it on MacOS (Godot v4.3.stable - macOS 13.1.0 - Vulkan (Forward+) - integrated Apple M2 - Apple M2 (8 Threads)).

While I did get the first error "You cannot save a project at the selected path. Please create a subfolder or choose a new path." after following the steps, the warning did not appear when I used the "Browse" button and selected another folder. Instead, it behaved normally and showed "The project folder will be automatically created". The warning the selected path is not empty only occurred when I left the "Create Folder" option unchecked.

With regard to why the error occurs, I tested an alternate but similar procedure that does not produce an error (which is probably the intended behavior):

  1. Open Godot.
  2. Click on "Create"
  3. Uncheck the "Create Folder" option.
  4. Leave the "Project Name" field empty.
  5. Check the "Create Folder" option again.
  6. Enter a project name.

I also looked into editor/project_manager/project_dialog.cpp. It seems that when "Create Folder" is toggled off and "Project Name" is empty, the script will remove the original home path and save it as the last custom target directory. When "Create Folder" is toggled on again and the script adds the last save path back, since the target path is now equal to the original home path, the script throws an error as it's an invalid path to create a project in.

This doesn't happen when "Create Folder" is toggled off before clearing "Project Name" because, I'm guessing, the auto directory generated by "Project Name" input is saved and removed instead of the home path. So when it's added back in when "Create Folder" is toggled back on, the restored path is a valid one.

This is my guess of how this bug happened, but I'm not sure how the code should be modified. Please let me know if I'm missing anything and give any suggestions on how to approach the fix. Thanks!

@DubiousDuck
Copy link
Contributor

I think I figured it out.

Made PR #101609 to address the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants