We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10597
    • 31 Posts
    I am having trouble getting data in columns of a joined table to save. What is it I am missing?

    It will save to modUser items fine but not to the joined Profile or UserGroup

    ModX 2.4.2-pl MigX 2.9.6-pl

    {
      "formtabs":"",
      "contextmenus":"",
      "actionbuttons":"",
      "columnbuttons":"",
      "filters":"",
      "extended":{
        "migx_add":"",
        "disable_add_item":"",
        "add_items_directly":1,
        "formcaption":"",
        "update_win_title":"Mentors",
        "win_id":"sc_mentors",
        "maxRecords":"",
        "addNewItemAt":"bottom",
        "multiple_formtabs":"",
        "multiple_formtabs_label":"",
        "multiple_formtabs_field":"",
        "multiple_formtabs_optionstext":"",
        "multiple_formtabs_optionsvalue":"",
        "actionbuttonsperrow":4,
        "winbuttonslist":"",
        "extrahandlers":"this.update||this.handleColumnSwitch",
        "filtersperrow":4,
        "packageName":"",
        "classname":"modUser",
        "task":"",
        "getlistsort":"",
        "getlistsortdir":"",
        "sortconfig":"",
        "gridpagesize":50,
        "use_custom_prefix":"0",
        "prefix":"",
        "grid":"",
        "gridload_mode":1,
        "check_resid":1,
        "check_resid_TV":"",
        "join_alias":"",
        "has_jointable":"yes",
        "getlistwhere":{
          "UserGroup.user_group":3
        },
        "joins":[
          {
            "alias":"Profile"
          },
          {
            "alias":"UserGroup",
            "classname":"modUserGroupMember",
            "on":"UserGroup.member=modUser.id"
          }
        ],
        "hooksnippets":"",
        "cmpmaincaption":"",
        "cmptabcaption":"Mentors",
        "cmptabdescription":"Mentors",
        "cmptabcontroller":"",
        "winbuttons":"",
        "onsubmitsuccess":"",
        "submitparams":""
      },
      "columns":[
        {
          "MIGX_id":1,
          "header":"ID",
          "dataIndex":"id",
          "width":30,
          "sortable":"false",
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        },
        {
          "MIGX_id":2,
          "header":"Full Name",
          "dataIndex":"Profile_fullname",
          "width":"",
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.textEditor"
        },
        {
          "MIGX_id":3,
          "header":"Username",
          "dataIndex":"username",
          "width":"",
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.textEditor"
        },
        {
          "MIGX_id":4,
          "header":"Email",
          "dataIndex":"Profile_email",
          "width":"",
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        },
        {
          "MIGX_id":6,
          "header":"Blocked",
          "dataIndex":"Profile_blocked",
          "width":40,
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"this.renderSwitchStatusOptions",
          "clickaction":"switchOption",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":[
            {
              "MIGX_id":1,
              "name":"blocked",
              "use_as_fallback":"",
              "value":1,
              "clickaction":"switchOption",
              "handler":"",
              "image":"assets\/components\/migx\/style\/images\/cross.png"
            },
            {
              "MIGX_id":2,
              "name":"unblocked",
              "use_as_fallback":"",
              "value":"0",
              "clickaction":"switchOption",
              "handler":"",
              "image":"assets\/components\/migx\/style\/images\/cb_empty.png"
            }
          ],
          "editor":""
        }
      ]
    }

    This question has been answered by Bruno17. See the first response.

    [ed. note: geeble last edited this post 10 years, 10 months ago.]
      Using ModX Revolution
    • discuss.answer
      • 4172
      • 5,888 Posts
      you will need a custom-processor and resolve the joined tables there
      or have a custom-processor like this one:
      https://github.com/Bruno17/migxclientmanager/blob/master/core/components/migxclientmanager/processors/mgr/default/update.php

      which calls security/user/update or security/user/create

      or resolve the joined objects with a aftersave-hook-snippet
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 10597
        • 31 Posts
        Thanks, Bruno!
          Using ModX Revolution