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

Fix missing UID handling in Dependency Editor #73131

Merged
merged 1 commit into from Jun 13, 2023

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Feb 11, 2023

Fixes #63366
When the scene had UID and path as a dependency, it preferred listing the UID. This can however fail if the UID does not path to any path (not sure if possible normally; it's definitely a problem when copying files between projects).

I made the text loader add path as an optional dependency field and Dependency Editor will use it if UID fails.

Comment on lines 905 to 881
if (!fallback_path.is_empty()) {
path += "::" + fallback_path;
}
Copy link
Member

@akien-mga akien-mga Feb 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will code using this differentiate between type and fallback_path when reading what comes after ::, in case both p_add_types on/off and non-empty fallback_path can happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there is no way to differentiate that 🙃
But given how fallback_path is used, it's not a big problem if it's invalid. Maybe I should add more comments about its caveats? It doesn't need to be super robust for now, as it does its job.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I changed it to just add another :: if p_add_types is false, so type and fallback are at fixed positions and can be retrieved reliably.

@akien-mga akien-mga modified the milestones: 4.0, 4.1 Feb 20, 2023
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tentatively approving, would be good to merge for wider testing (that was the plan originally with postponing it to 4.1, but it went under the radar again...).

Could you rebase for good measure? (And double check if this is still the way you think this bug should be solved.)

@KoBeWi KoBeWi force-pushed the decency_editor branch 2 times, most recently from 85afb2a to 237ee80 Compare June 12, 2023 21:25
@KoBeWi
Copy link
Member Author

KoBeWi commented Jun 12, 2023

Rebased and made a minor tweak related to the review comment.

@akien-mga
Copy link
Member

Needs a rebase to fix CI, the doc checks were broken temporarily yesterday by another PR.

@akien-mga akien-mga merged commit 4177f26 into godotengine:master Jun 13, 2023
13 checks passed
@akien-mga
Copy link
Member

Thanks!

@YuriSizov
Copy link
Contributor

This PR seems to be too risky to include into the stable 4.0 branch at the moment, as it requires further fixes from follow-up PRs and more time dedicated to battle-testing it. We are not going to cherry-pick it, but if there is a strong need to have this fixed in a future 4.0.x release, please make a dedicated PR with all the follow-up fixes applied once it has been tested for at least a few months. Otherwise, we recommend updating to Godot 4.1 if this fix is important to your project.

I'll remove the cherry-pick label.

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

Successfully merging this pull request may close these issues.

Dependency editor doesn't work after editor restart
3 participants