Created
March 9, 2010 01:11
-
-
Save sminnee/326033 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: sapphire/core/model/SiteTree.php | |
| =================================================================== | |
| --- sapphire/core/model/SiteTree.php (revision 100671) | |
| +++ sapphire/core/model/SiteTree.php (working copy) | |
| @@ -1313,6 +1313,14 @@ | |
| $this->syncLinkTracking(); | |
| + // Check to see if we've only altered fields that shouldn't affect versioning | |
| + $fieldsIgnoredByVersioning = array('HasBrokenLink', 'Status', 'HasBrokenFile', 'ToDo'); | |
| + $changedFields = array_keys($this->getChangedFields(false, 2)); | |
| + if(!array_diff($changedFields, $fieldsIgnoredByVersioning)) { | |
| + // This will have the affect of preserving the version | |
| + $this->migrateVersion($this->Version); | |
| + } | |
| + | |
| parent::onBeforeWrite(); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment