Update transfer ownership to handle when the metadata workflow is enabled the approved version of the metadata with a working copy #6144
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.
Similar to the changes done in #5811, but for transfer ownership.
When the workflow is enabled the transfer ownership works fine in these cases:
But it's not working fine If the metadata is approved and has a working copy. In this case it's processing all the records, but updating only the working copy version, not the approved version.
This PR updates the transfer ownership API to handle both versions of the metadata. For now, in the total number of records are counted the approved and draft versions. This is something to improve in the report, but will require some refactor of the current report.
Test case:
Without the change the UI displayed the old ownership.
With the changes the ownership is updated for the approved and working copy.