I've defined the baseUrl and basePath. Aside from the wrong source name bug (
http://tracker.modx.com/issues/6577), Media Sources seem to be working for TVs.
What I'm trying to understand is why the user is presented with a choice to select a different Media Source other that what's defined for the TV. It's a false choice, because choosing a different source has no effect on the Media Source attached to that particular TV instance.
For example:
For an MODx install in the root of the HTTP server, given a media source of 'Images' with a basePath and baseUrl of 'images/', we define a TV 'ImageTV' of type 'Image' which uses that media source.
Now, when a user invokes the file browser for that TV, they are presented with a list of files in img/, which is fine. But there are two issues. Firstly, they are incorrectly shown that the Media Source they are looking at is what is defined in default_media_source which is 'Filesystem' by default. Secondly, they are presented with the ability to choose a different Media Source from which to select their file.
If the user simply ignores the fact that the wrong Media Source name is displayed and selects a file, the TV value is saved as 'image.jpg' and is correctly rendered on the front end as 'img/image.jpg'.
But if the user selects a different media source, then the path to the file relative to THAT media source's baseUrl is saved in the TV value.
i.e. It's possible for the user to explicitly select 'Filesystem' which causes the file list to show the files in that source. Now, if they then navigate to img/ to select the desired file, the TV value is saved as 'img/image.jpg' causing the path to be rendered as 'img/img/image.jpg'
The value newly selected Media Source is never saved to the DB, so it's a false choice. If it were actually saved and then used to render out the correct path then it might be a useful option for the user.
But then what is the point of defining the Media Source for the TV? All it currently does is control the source initially displayed to the user. And even that is not currently being displayed correctly.