dev/core/485 Website type should be required as other type values are #13170
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.
Overview
Strange behavior possible as described in https://lab.civicrm.org/dev/core/issues/485.
A user could save a website record without a 'website type' (applies to any contact type, not just organization as in the ticket). Storing this value without a type, which should be required, causes data to be seemingly mysteriously deleted.
Before
User is able to click the (x) and save a website record with no type
After
User can no longer click an (x) and must instead choose a website type, even if they create their own option value labelled "none", they must choose a type.
Technical Details
Adding the 'placeholder' => NULL option here is what looks standard when looking at the code for IM, Phone, Email, etc. They all require a type to be saved, so website should, too... or we'll run into trouble.