Skip to content

Change Query Does Not Have Editor, EditorEmailHint, or EditorLoginName Fields Populated #1281

Closed Answered by adamfisher
adamfisher asked this question in Q&A
Discussion options

You must be logged in to vote

I came up with a hacky approach to this that involves checking a variety of places for an editor name and then falling back to the author's (creator) name on the item I looked up (denoted by item) if the changeItem did not contain an editor which it never does.

// Editor
if (changeItem.IsPropertyAvailable<IChangeItem>(p => p.Editor) && !string.IsNullOrEmpty(changeItem.Editor))
{
	EditorName = changeItem.Editor;
}
else if (!isFolder && item.File.ModifiedBy != null)
{
	EditorName = item.File.ModifiedBy.Title;
}
else if (item.FieldValuesAsText.Values.TryGetValue("Editor", out object? editor))
{
	EditorName = editor as string;
}
else if(item.FieldValuesAsText.Values.TryGetValue("Author", out o…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by adamfisher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant