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

[relations] Fix problematic polymorphic relation's generated relation IDs #57792

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

nirvn
Copy link
Contributor

@nirvn nirvn commented Jun 18, 2024

Description

This PR fixes #47445 by insuring that polymorphic relations' generated relations rely on generated IDs that will remain valid if users change the referenced layer name.

To avoid breaking preexisting projects, relations using the weaker IDs (using layer name instead of layer ID) are also generated with a (deprecated) suffix added to their names. A //TODO is added to remove this whenever we hop onto QGIS 4 where we can break things ;) The relation ID is automatically updated by the relation manager, insuring projects saved prior to this change don't break.

I'd suggest backporting to LTR, IMHO a worthy fix. Among other things, it allows for polymorphic relationships to not go broken with translated projects.

@github-actions github-actions bot added this to the 3.38.0 milestone Jun 18, 2024
Copy link

github-actions bot commented Jun 18, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 73c4282)

@nirvn nirvn force-pushed the polymorphicrelation_generated_id_fix branch from 57e68e0 to 5b61e2e Compare June 19, 2024 07:53
@nirvn nirvn force-pushed the polymorphicrelation_generated_id_fix branch from 5b61e2e to 73c4282 Compare June 19, 2024 08:49
@nirvn
Copy link
Contributor Author

nirvn commented Jun 19, 2024

@m-kuhn , thanks for the review, comments added.

@nyalldawson nyalldawson merged commit b221228 into qgis:master Jun 19, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Polymorphic relation is lost in form if the referencing layer is renamed
3 participants