BUG Prevent unnecessary reconstruction of ClassName field #2916

merged 1 commit into from Mar 15, 2014


None yet

2 participants


DataObject::database_fields ensures that any ClassName of obsolete classes with existing records are maintained when determining the classes for the 'ClassName' Enum field.

The problem is that the ClassName values retrieved from the database are unnecessarily triggering a re-order of the ClassName field on every dev/build. This results in the occasional ClassName regeneration, with no changes other than the order of the enum values. This is most apparent in a new website, where the database is generated, and default records are created. Those default records then necessitate the rebuild of that field, depending on the order they were created. Anyone who's started a new blank project and run two concurrent dev/builds will know what I'm talking about.

This fix ensures that for all known classes, these values will always be present at the beginning of the spec, and the order is determined by the code, rather than the much more volatile values stored in the database.

@simonwelsh simonwelsh merged commit ccaca9a into silverstripe:3.1 Mar 15, 2014

1 check passed

Details default Scrutinizer: No new issues — Travis: Passed
@tractorcow tractorcow deleted the tractorcow:pulls/fix-classname-generation branch Apr 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment