LPS-37702 Fix metadata check always returning false when publishing.
LPS-37702 Fix metadata fields being backported instead of reverting to the previous version.
LPS-37702 Fix ConstraintViolationException thrown when publishing with no changes twice.
LPS-37702 Simplify the method.
LPS-37702 Sort.