Commerce default Mediasource

Hello
When can I define a default media source for Commerce ?

A default media source ID 2 is defined in MODX settings and it works fine when I go to Modx menu Media > Media browser (the default Media source is selected)

But when I want to select an image in product matrix, the default mediasource is ID 1 after a clic on Matrix > Edit > “select” (image)

There’s a commerce.media.source system setting to configure which one it uses by default.

commerce.media.source setting is 2
Additionally I get an err. 500 when I choose an image, but only with a specific user group having Content Editor and Commerce Full policies (Admin connection in mgr is OK)

Err 500
https://dev.xxxxx.com/connect_xxxxx/system/phpthumb.php?src=assets/project/urbanspree/mediasource/jim-avignon-im-urban-spree.jpeg&h=200

The path is ok but phpthumbs bugs

If it still shows 1 in the media source dropdown, that suggests the value of that setting may be getting overwritten somewhere. Perhaps in a context setting?

There is no media source setting in my web context settings. But I’think about a policy/right management because it occurs only for “Limited admin” users (group).

Now I can switch the media source in the modal window browser but the default medias source is not selected.

For an image TV, the default media source is selected when the media browser opens.

Below a screenshot with the media browser opened from image TV (left) and from Commerce/Matrix/select (right)

Regarding the matrix product modal window I fixed the problem for a non-admin user with:

to show image after selection

web/assets/components/commerce/backend/dist/commerce.js
line 1469
thumbUrl = MODx.config.connectors_url + ‘system/phpthumb.php?src=’ + url + ‘&h=200’,
thumbUrl = MODx.config.connectors_url + ‘system/phpthumb.php?src=/’ + url + ‘&h=200’,

To show image on open modal

omponents/commerce/src/Admin/Widgets/Form/ImageField.php
line 14
$thumb .= ‘?src=’ . $value;
$thumb .= ‘?src=/’ . $value;

Without this fix thumb is not created by phpthumb

Rather than changing core files, please adjust your media source configuration to return absolute URLs. Those changes you made will be reverted when upgrading.