As far as I can see, the following method needs some extension work.
AFAIK, the function is meant to receive the same field from two objects and compare them. However, if the type/ftType is any of the following, the function skips it and always return “they are not different”, regardless of the actual values:
Boolean
Image
List
Numeric (but not an integer)
And a number of more obscure field types.This is noticeable in the webtop when, after editing a piece of versioned content, the overview incorrectly displays a “The draft is identical, discard?” message as described here: Difference between DRAFT and APPROVED.
Even with this irritation, it is an awesome feature
Yeah, I get confused with the boolean one all the time. I’ll have a active (or disabled) boolean for a content type. Set it. Assuming it’s a versioned content type, the overview page will say that the draft page is identical to the approved page and it is safe to delete the draft page.
PRs that can be merged quickly are always welcome. Release each isolated improvement if its likely you’ll need a lot of time to get the whole thing done.
Maybe there’s option for serialising stobj and comparing the entire object minus datetimelastupdated, lockedby and any other system properties that might generate false positives.
All formtools need to be covered, but there will be many formtools that are just strings (image, file, state, country, etc) and could probably be handled by a single case inside getPropertyDiff(), e.g. they could be added to the existing “string,longchar” case:
Some could be ignored such as creditcard* since it’s unlikely those are ever stored, they are usually used in components which extend farcry.core.packages.forms.forms and so are transient.