Problem/Motivation
In #2831274: Bring Media entity module to core as Media module a refined version of the Media Entity module was moved into core.
In that patch, some renaming happened, and as a consequence the necessary code was adapted.
There is one place though that there is still reference to the old terminology:
In the file /core/modules/media/src/MediaTypeForm.php we have:
...
'#submit' => [[static::class, 'rebuildSubmit']],
'#required' => TRUE,
// Once the media type is created, its source plugin cannot be changed
// anymore.
'#disabled' => !empty($source),
];
if (!$source) {
$form['type']['#empty_option'] = $this->t('- Select media source -');
}
if ($source) {
// Media source plugin configuration.
$form['source_dependent']['source_configuration'] = [
...
Once there is no $form['type'] element anymore (the new element is called $form['source'], that snippet adding the empty option is useless now.
Proposed resolution
Remove the code:
if (!$source) {
$form['type']['#empty_option'] = $this->t('- Select media source -');
}
from the /core/modules/media/src/MediaTypeForm.php file.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #2
marcoscanoLet's try to save this to the sprint on Fri
Comment #3
benjifisherComment #4
msankhala commentedHere is a patch.
Comment #5
kporras07 commentedPretty straightforward. Looks good!
Comment #6
marcoscano+1 RTBC, thanks!
Comment #7
alexpottCrediting @marcoscano for creating the issue.
Committed 77e3a5c and pushed to 8.6.x. Thanks!