Umbraco 8 - GetDirtyProperties() and IsPropertyDirty() methods do not work as expected

61 views Asked by At

When some content node is saved in Umbraco, I want to catch the ContentService.Saving event and append the next logic:

  1. Check if at least one property from a list of properties I defined in advance, is dirty (the value changed during the save).
  2. If there are any, do something like logging.

In order to achieve the behavior of the first point, I'm trying to use Umbraco's GetDirtyProperties() or IsPropertyDirty() methods, to check which properties are dirty or now.
The problem is that even without making any changes, some properties are marked as dirty, even though their values weren't changed at all!

From what I noticed, those problematic properties are especially empty textstrings / multinode pickers data typed properties (and maybe there are more types which I didn't noticed).
I've found this bug that may be related, however no one addressed it - https://github.com/umbraco/Umbraco-CMS/issues/11683.

This problem is crucial for me and prevents me from achieving the logic I need for my system requierments.
Is there something I can do? Any workaround?

Umbraco version - 8.2.2

1

There are 1 answers

0
Nurhak Kaya On

Have you tried upgrading your Umbraco v8 website to the latest version of Umbraco v8 (8.18.9)?

After the upgrade, if you still see the same problem, then I'd recommend you to raise a new issue on GitHub for Umbraco CMS v8, work on your issue yourself after pulling the latest version of Umbraco CMS v8 source code, and then create a PR in the end.

Umbraco HQ and Umbraco Community have stopped implementing new features for Umbraco v8 for a long time now, and starting in February 2024, they will only fix security issues and release security updates. Also, the EOL(End of Life) for v8 is February 2025, which is another important thing to consider for v8 websites.