I want to make a item:saving
pipeline processor that will perform some operations when a item field is reset. I thought this would be simple, but it turned out to be trickier than I thought. Maybe I'm just missing something.
When the item:saving
processor is triggered, I can get the modified fields by savingItem.Fields.Where(f => f.IsModified)
. I found that, when resetting a field, the fields Value
is an empty string, HasValue
is true
and ResetBlank
is false
.
I expected the opposite (Value
to be null
, HasValue
to be false
and ResetBlank
is true
) during the item:saving
, but the reset operation is eventually performed properly.
How do I distinguish a field reset from storing an empty string in the item:saving
pipeline? (This is on Sitecore 9.0.1)
savingItem
?savingItem
from theEventArgs
parameter.