예제 #1
0
        protected virtual bool HasConsequentialChanges(ItemChanges changes)
        {
            // properties, e.g. template, etc are always consequential
            if (changes.HasPropertiesChanged)
            {
                return(true);
            }

            foreach (FieldChange change in changes.FieldChanges)
            {
                if (change.OriginalValue == change.Value)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.Revision)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.Updated)
                {
                    continue;
                }
                if (!_fieldPredicate.Includes(change.FieldID).IsIncluded)
                {
                    continue;
                }

                return(true);
            }

            _logger.SaveRejectedAsInconsequential(_serializationProvider.LogName, changes);

            return(false);
        }
예제 #2
0
        protected virtual bool HasConsequentialChanges(ItemChanges changes)
        {
            // properties, e.g. template, etc are always consequential
            // NOTE: sometimes you can get spurious 'changes' where the old and new value are the same. We reject those.
            if (changes.HasPropertiesChanged && changes.Properties.Any(x => !x.Value.OriginalValue.Equals(x.Value.Value)))
            {
                return(true);
            }

            foreach (FieldChange change in changes.FieldChanges)
            {
                if (change.OriginalValue == change.Value)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.Revision)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.Updated)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.UpdatedBy)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.Originator)
                {
                    continue;
                }
                if (!_fieldPredicate.Includes(change.FieldID).IsIncluded)
                {
                    continue;
                }

                return(true);
            }

            _logger.SaveRejectedAsInconsequential(_serializationProvider.LogName, changes);

            return(false);
        }
예제 #3
0
        protected virtual bool HasConsequentialChanges(ItemChanges changes)
        {
            // properties, e.g. template, etc are always consequential
            // NOTE: sometimes you can get spurious 'changes' where the old and new value are the same. We reject those.
            if (changes.HasPropertiesChanged && changes.Properties.Any(x => !x.Value.OriginalValue.Equals(x.Value.Value)))
            {
                return(true);
            }

            foreach (FieldChange change in changes.FieldChanges)
            {
                // NOTE: we do not check for old and new value equality here
                // because during package installation Sitecore will set item fields using
                // identical old and new values in the changes - for fields that have never been set before.
                if (change.FieldID == FieldIDs.Revision)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.Updated)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.UpdatedBy)
                {
                    continue;
                }
                if (change.FieldID == FieldIDs.Originator)
                {
                    continue;
                }
                if (!_fieldFilter.Includes(change.FieldID.Guid))
                {
                    continue;
                }

                return(true);
            }

            _logger.SaveRejectedAsInconsequential(_targetDataStore.FriendlyName, changes);

            return(false);
        }