Closed sdrenth closed 6 years ago
Confirming the issue here.
FWIW, TVs always had issues with handling integers (especially "0").
If you change your TV values to be strings, the issue is no more (quick workaround tho, no real fix)
Closing as wontfix because in 3.x @EVAL binding was removed by security reasons. See https://github.com/modxcms/revolution/pull/13865/files
Summary
The issue has to do with this pull request: https://github.com/modxcms/revolution/pull/13378
I manually edited the changed file from the PR above into a 2.5.6 MODX website, because I needed to have a dynamic default TV value.
Step to reproduce
Add select TV, add three options: Default==0||Option 1==1||Option 2==2
Add this code in the default value field: @EVAL return $modx->runSnippet('defaultTVValue');
Create snippet defaultTVValue:
Observed behavior
When creating a resource in the WEB context the following default input value is shown in the TV: @EVAL return $modx->runSnippet('getDefaultBrandsValue');
If i create a resource in another context, so the default TV value is not 0, then the default TV option is set correctly.
This also happens when I set the default TV value to an empty string, so $tvValue = '';
Expected behavior
I expect the TV to show the option Default as default input value when I create a resource for context web.
Environment