FIX Set ShowInSearch db boolean default to true #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for #99
There was a fairly recent change (v3.0.3) that added a 'ShowInSearch' field to the SearchServiceExtension. The change also had a
$defaults
definition to default the value to true, however this only works for new records not existing ones.Consequently for anyone upgrading existing projects, any DataObject (excluding SiteTree based ones) that uses this extension would have the 'ShowInSearch' column added and any existing records would use the database default of
0
which causes them all to become unindexed upon a full reindex.I've added in a database default for the 'ShowInSearch'
boolean
definition to default to1
so that existing records are captured and hopefully no-one else gets caught out.