MIGX icon indicating copy to clipboard operation
MIGX copied to clipboard

@EVAL binding not working after update

Open BigBlockStudios opened this issue 2 years ago • 2 comments

@eval binding is not working after update to latest: This is just showing the eval statement in the dropdown select box.

 {
        "MIGX_id":156,
        "field":"status",
        "caption":"Project Status",
        "description":"",
        "description_is_code":"0",
        "inputTV":"",
        "inputTVtype":"listbox",
        "validation":"required",
        "configs":"",
        "restrictive_condition":"",
        "display":"",
        "sourceFrom":"config",
        "sources":"",
        "inputOptionValues":"@EVAL return '--- Choose Status ---==||none' . $modx->runSnippet('migxLoopCollection',array('packageName'=>'projects','classname'=>'ProjectStatus','tpl'=>'@CODE:[[+status]]==[[+id]]','outputSeparator'=>'||'));",
        "default":"",
        "useDefaultIfEmpty":"0",
        "pos":3
      },

BigBlockStudios avatar Oct 31 '23 20:10 BigBlockStudios

which MODX version? MODX 3 doesn't support @EVAL Binding any more. But there is a @SNIPPET Binding now or @CHUNK Binding should also work. See MODX documentation about Bindings.

Bruno17 avatar Oct 31 '23 20:10 Bruno17

modx 3.0.4 and migx 3.0.2 - I did not know about the @EVAL being removed.

Yes, thank you the @snippet is working as advertised:

@SNIPPET migxLoopCollection {
    "packageName":"projects",
    "classname":"ProjectCategory",
    "tpl":"@CODE:[[+category]]==[[+id]]",
    "outputSeparator":"||"
    
    }```

BigBlockStudios avatar Oct 31 '23 20:10 BigBlockStudios