Fix multi edit relation reference #57342
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue when the attribute form mode is set to multi editing whereas relation referencing editor widget value is wrongly marked as "edited" upon opening the attribute form (i.e. prior to actually editing the widget value).
Note the wrong "value changed" red button in the feature form upon opening the form
It's a bit of a rabbit hole to follow here, but basically what happens is that the relation referencing editor widget sets the foreign keys value, which is first consumed as a non-found feature as the feature picker model gathers features. Upon having successfully gathered the feature, the model reports that the feature is found. Until now, it was using the feature changed signal, which bubbled back up to the relation referencing editor widget as a "foreign key changed" even though it clearly isn't.
The way around this without a significant refactoring is to add another signal that identifies a feature found state change (vs. using feature changed for both an actual feature values change and a feature values found).