We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23819
    • 37 Posts
    I am learning how to use MIGXdb and I am up against something I'm not getting.

    I have created a TV to edit MIGXDB entries in a custom table. Each database entry needs to contain the ressource ID and the TV id (see shema below).

    When I open the modal window, it works as expected: the entries are saved with the appropriate Template Variable ID, and Resource ID into the custom table.


    But when I edit an entry inline the tv_id field gets saved as 0 in the database.


    I don't understand why, or how to fix this.

    Any ideas?


    SHEMA
    <?xml version="1.0" encoding="UTF-8"?>
    <model package="ardacv" baseClass="xPDOObject" platform="mysql" defaultEngine="InnoDB" version="1.1">
        <object class="Ardacv" table="ardacv" extends="xPDOSimpleObject" >
                <field key="resource_id" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
                <field key="tv_id" dbtype="int" precision="11"  phptype="integer" null="false" default="0" />
                <field key="pos" dbtype="int" precision="11" phptype="integer" null="false" default="0"/>
                <field key="title" dbtype="varchar" precision="255"  phptype="string" null="true" default="" index="index" />
                <field key="image" dbtype="varchar" precision="255" phptype="string" null="true" default="" />
                <field key="rea" dbtype="varchar" precision="255"  phptype="string" null="true" default="" />
                <field key="prod" dbtype="varchar" precision="255"  phptype="string" null="true" default="" />
                <field key="datecasting" dbtype="varchar" precision="255"  phptype="string" null="true" default="" />
                <field key="datesortie" dbtype="varchar" precision="255"  phptype="datetime" null="true" default="" />
                <field key="preciser" dbtype="varchar" precision="255" phptype="string" null="true" default="" />
                <field key="autres" dbtype="varchar" precision="255"  phptype="string" null="true" default="" />
                <field key="url" dbtype="varchar" precision="255"  phptype="string" null="true" default="" />
                <field key="cvindex" dbtype="int" precision="10" phptype="integer" null="true" default="0" />
                <field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0ss" />
                <field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
                <aggregate alias="Resource" class="modResource" local="resource_id" foreign="id" cardinality="one" owner="foreign" />
                <aggregate alias="TV" class="modTemplateVar" local="tv_id" foreign="id" cardinality="one" owner="foreign" />
        </object>
    </model>
    


    MIGXDB TV CONFIG
    {
      "formtabs":[
        {
          "MIGX_id":14,
          "caption":"Entr\u00e9e CV",
          "print_before_tabs":1,
          "fields":[
            {
              "field":"title",
              "caption":"Titre",
              "pos":1,
              "MIGX_id":30
            },
            {
              "MIGX_id":31,
              "field":"image",
              "caption":"Image",
              "description":"",
              "description_is_code":"0",
              "inputTV":"",
              "inputTVtype":"image",
              "validation":"",
              "configs":"",
              "restrictive_condition":"",
              "display":"",
              "sourceFrom":"config",
              "sources":[
                {
                  "MIGX_id":1,
                  "context":"web",
                  "sourceid":3
                }
              ],
              "inputOptionValues":"",
              "default":"",
              "useDefaultIfEmpty":"0",
              "pos":2
            },
            {
              "field":"rea",
              "caption":"R\u00e9al",
              "pos":3,
              "MIGX_id":32
            },
            {
              "field":"prod",
              "caption":"Prod",
              "pos":4,
              "MIGX_id":33
            },
            {
              "field":"datecasting",
              "caption":"Ann\u00e9e casting",
              "pos":5,
              "MIGX_id":34
            },
            {
              "field":"datesortie",
              "caption":"Date de sortie",
              "inputTVtype":"date",
              "pos":6,
              "MIGX_id":35
            },
            {
              "MIGX_id":36,
              "field":"preciser",
              "caption":"Pr\u00e9cision",
              "description":"",
              "description_is_code":"0",
              "inputTV":"precision",
              "inputTVtype":"",
              "validation":"",
              "configs":"",
              "restrictive_condition":"",
              "display":"",
              "sourceFrom":"config",
              "sources":"",
              "inputOptionValues":"||Consultation==Consultation:prcsn_consultation||RDA==RDA:prcsn_rda||RDA Associ\u00e9==RDA Associ\u00e9:prcsn_associe||Casting Enfants==Casting Enfants:prcsn_enfants||Casting Sauvage==Casting Sauvage:prcsn_sauvage||Casting Petits R\u00f4les==Casting Petits R\u00f4les:prcsn_petitsroles||Charg\u00e9 de Figuration==Charg\u00e9 de Figuration:prcsn_figuration||Assistant Casting==Assistant Casting:prcsn_assistant",
              "default":"",
              "useDefaultIfEmpty":"0",
              "pos":7
            },
            {
              "field":"autres",
              "caption":"Autre pr\u00e9cision",
              "pos":8,
              "MIGX_id":37
            },
            {
              "field":"url",
              "caption":"URL ou site du film",
              "pos":9,
              "MIGX_id":38
            },
            {
              "MIGX_id":39,
              "field":"cvindex",
              "caption":"Ordre d'affichage (entre films cast\u00e9s la m\u00eame ann\u00e9e sans date de sortie connue)",
              "description":"Doit \u00eatre un num\u00e9ro entier.",
              "description_is_code":"0",
              "inputTV":"",
              "inputTVtype":"",
              "validation":"",
              "configs":"",
              "restrictive_condition":"",
              "display":"",
              "sourceFrom":"config",
              "sources":"",
              "inputOptionValues":"",
              "default":"",
              "useDefaultIfEmpty":"0",
              "pos":10
            }
          ],
          "pos":1
        }
      ],
      "contextmenus":"update||duplicate||publish||unpublish||recall_remove_delete",
      "actionbuttons":"addItem||bulk||toggletrash||emptyTrash",
      "columnbuttons":"",
      "filters":"",
      "extended":{
        "migx_add":"Ajouter une ligne",
        "disable_add_item":"",
        "add_items_directly":1,
        "formcaption":"",
        "update_win_title":"Editer une ligne",
        "win_id":"ardacv_cinema",
        "maxRecords":"",
        "addNewItemAt":"top",
        "media_source_id":3,
        "multiple_formtabs":"",
        "multiple_formtabs_label":"",
        "multiple_formtabs_field":"",
        "multiple_formtabs_optionstext":"",
        "multiple_formtabs_optionsvalue":"",
        "actionbuttonsperrow":5,
        "winbuttonslist":"",
        "extrahandlers":"",
        "filtersperrow":1,
        "packageName":"ardacv",
        "classname":"Ardacv",
        "task":"",
        "getlistsort":"pos",
        "getlistsortdir":"ASC",
        "sortconfig":[
          {
            "sortby":"datecasting",
            "sortdir":"DESC",
            "sortmode":"string"
          },
          {
            "sortby":"datesortie",
            "sortdir":"DESC",
            "sortmode":"string"
          },
          {
            "sortby":"cvindex",
            "sortdir":"DESC",
            "sortmode":"string"
          },
          {
            "sortby":"pos",
            "sortdir":"ASC"
          }
        ],
        "gridpagesize":100,
        "use_custom_prefix":"0",
        "prefix":"",
        "grid":"",
        "gridload_mode":2,
        "check_resid":1,
        "check_resid_TV":"dbCinema",
        "join_alias":"",
        "has_jointable":"no",
        "getlistwhere":[
          {
            "tv_id":76
          }
        ],
        "joins":"",
        "hooksnippets":"",
        "cmpmaincaption":"",
        "cmptabcaption":"",
        "cmptabdescription":"",
        "cmptabcontroller":"",
        "winbuttons":"",
        "onsubmitsuccess":"",
        "submitparams":""
      },
      "columns":[
        {
          "MIGX_id":1,
          "header":"Titre",
          "dataIndex":"title",
          "width":90,
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.textEditor"
        },
        {
          "MIGX_id":2,
          "header":"Prod",
          "dataIndex":"prod",
          "width":80,
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.textEditor"
        },
        {
          "MIGX_id":3,
          "header":"R\u00e9al",
          "dataIndex":"rea",
          "width":80,
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.textEditor"
        },
        {
          "MIGX_id":6,
          "header":"Pr\u00e9cision",
          "dataIndex":"preciser",
          "width":120,
          "sortable":"false",
          "show_in_grid":"0",
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.listboxEditor"
        },
        {
          "MIGX_id":7,
          "header":"Autre pr\u00e9cision",
          "dataIndex":"autres",
          "width":120,
          "sortable":true,
          "show_in_grid":"0",
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        },
        {
          "MIGX_id":9,
          "header":"URL",
          "dataIndex":"url",
          "width":60,
          "sortable":true,
          "show_in_grid":"0",
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        },
        {
          "header":"Image",
          "width":50,
          "sortable":"false",
          "dataIndex":"image",
          "renderer":"this.renderImage",
          "MIGX_id":8
        },
        {
          "MIGX_id":10,
          "header":"Date",
          "dataIndex":"datecasting",
          "width":60,
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.textEditor"
        },
        {
          "MIGX_id":11,
          "header":"Index",
          "dataIndex":"cvindex",
          "width":44,
          "sortable":"false",
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":"this.textEditor"
        },
        {
          "MIGX_id":12,
          "header":"Publi\u00e9",
          "dataIndex":"published",
          "width":44,
          "sortable":true,
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"this.renderClickCrossTick",
          "clickaction":"switchOption",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        },
        {
          "MIGX_id":15,
          "header":"Deleted",
          "dataIndex":"deleted",
          "width":"",
          "sortable":"false",
          "show_in_grid":"0",
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        },
        {
          "MIGX_id":16,
          "header":"ID",
          "dataIndex":"id",
          "width":"",
          "sortable":"false",
          "show_in_grid":"0",
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        },
        {
          "MIGX_id":17,
          "header":"Position",
          "dataIndex":"pos",
          "width":22,
          "sortable":"false",
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        },
        {
          "MIGX_id":18,
          "header":"TV ID",
          "dataIndex":"tv_id",
          "width":22,
          "sortable":"false",
          "show_in_grid":1,
          "customrenderer":"",
          "renderer":"",
          "clickaction":"",
          "selectorconfig":"",
          "renderchunktpl":"",
          "renderoptions":"",
          "editor":""
        }
      ]
    }
      • 4172
      • 5,888 Posts
      I think I'm missing some informations to reproduce your setup.

      Do you have any special processors?
      Any special TVs, for example how did you setup the dbCinema - TV?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 23819
        • 37 Posts

        Quote from: Bruno17 at Mar 01, 2018, 10:00 AM
        I think I'm missing some informations to reproduce your setup.

        Do you have any special processors?
        Any special TVs, for example how did you setup the dbCinema - TV?

        I do not have any special processors.

        The dbCinema TV uses the migxdb input type, with the ardacv_cinema configuration. Besides a resource-specific media source there is nothing special setup there.

        I posted the wrong configuration (one on which I was trying out some things that didn't work). The behavior I was describing occurs with this configuration, in which the "Check Resource TV" setting refers to the ID of the TV (76) rather than it's name.

        {
          "formtabs":[
            {
              "MIGX_id":14,
              "caption":"Entr\u00e9e CV",
              "print_before_tabs":1,
              "fields":[
                {
                  "field":"title",
                  "caption":"Titre",
                  "pos":1,
                  "MIGX_id":30
                },
                {
                  "MIGX_id":31,
                  "field":"image",
                  "caption":"Image",
                  "description":"",
                  "description_is_code":"0",
                  "inputTV":"",
                  "inputTVtype":"image",
                  "validation":"",
                  "configs":"",
                  "restrictive_condition":"",
                  "display":"",
                  "sourceFrom":"config",
                  "sources":[
                    {
                      "MIGX_id":1,
                      "context":"web",
                      "sourceid":3
                    }
                  ],
                  "inputOptionValues":"",
                  "default":"",
                  "useDefaultIfEmpty":"0",
                  "pos":2
                },
                {
                  "field":"rea",
                  "caption":"R\u00e9al",
                  "pos":3,
                  "MIGX_id":32
                },
                {
                  "field":"prod",
                  "caption":"Prod",
                  "pos":4,
                  "MIGX_id":33
                },
                {
                  "field":"datecasting",
                  "caption":"Ann\u00e9e casting",
                  "pos":5,
                  "MIGX_id":34
                },
                {
                  "field":"datesortie",
                  "caption":"Date de sortie",
                  "inputTVtype":"date",
                  "pos":6,
                  "MIGX_id":35
                },
                {
                  "MIGX_id":36,
                  "field":"preciser",
                  "caption":"Pr\u00e9cision",
                  "description":"",
                  "description_is_code":"0",
                  "inputTV":"precision",
                  "inputTVtype":"",
                  "validation":"",
                  "configs":"",
                  "restrictive_condition":"",
                  "display":"",
                  "sourceFrom":"config",
                  "sources":"",
                  "inputOptionValues":"||Consultation==Consultation:prcsn_consultation||RDA==RDA:prcsn_rda||RDA Associ\u00e9==RDA Associ\u00e9:prcsn_associe||Casting Enfants==Casting Enfants:prcsn_enfants||Casting Sauvage==Casting Sauvage:prcsn_sauvage||Casting Petits R\u00f4les==Casting Petits R\u00f4les:prcsn_petitsroles||Charg\u00e9 de Figuration==Charg\u00e9 de Figuration:prcsn_figuration||Assistant Casting==Assistant Casting:prcsn_assistant",
                  "default":"",
                  "useDefaultIfEmpty":"0",
                  "pos":7
                },
                {
                  "field":"autres",
                  "caption":"Autre pr\u00e9cision",
                  "pos":8,
                  "MIGX_id":37
                },
                {
                  "field":"url",
                  "caption":"URL ou site du film",
                  "pos":9,
                  "MIGX_id":38
                },
                {
                  "MIGX_id":39,
                  "field":"cvindex",
                  "caption":"Ordre d'affichage (entre films cast\u00e9s la m\u00eame ann\u00e9e sans date de sortie connue)",
                  "description":"Doit \u00eatre un num\u00e9ro entier.",
                  "description_is_code":"0",
                  "inputTV":"",
                  "inputTVtype":"",
                  "validation":"",
                  "configs":"",
                  "restrictive_condition":"",
                  "display":"",
                  "sourceFrom":"config",
                  "sources":"",
                  "inputOptionValues":"",
                  "default":"",
                  "useDefaultIfEmpty":"0",
                  "pos":10
                }
              ],
              "pos":1
            }
          ],
          "contextmenus":"update||duplicate||publish||unpublish||recall_remove_delete",
          "actionbuttons":"addItem||bulk||toggletrash||emptyTrash",
          "columnbuttons":"",
          "filters":"",
          "extended":{
            "migx_add":"Ajouter une ligne",
            "disable_add_item":"",
            "add_items_directly":"",
            "formcaption":"",
            "update_win_title":"Editer une ligne",
            "win_id":"ardacv_cinema",
            "maxRecords":"",
            "addNewItemAt":"top",
            "media_source_id":3,
            "multiple_formtabs":"",
            "multiple_formtabs_label":"",
            "multiple_formtabs_field":"",
            "multiple_formtabs_optionstext":"",
            "multiple_formtabs_optionsvalue":"",
            "actionbuttonsperrow":5,
            "winbuttonslist":"",
            "extrahandlers":"",
            "filtersperrow":1,
            "packageName":"ardacv",
            "classname":"Ardacv",
            "task":"",
            "getlistsort":"pos",
            "getlistsortdir":"ASC",
            "sortconfig":[
              {
                "sortby":"datecasting",
                "sortdir":"DESC",
                "sortmode":"string"
              },
              {
                "sortby":"datesortie",
                "sortdir":"DESC",
                "sortmode":"string"
              },
              {
                "sortby":"cvindex",
                "sortdir":"DESC",
                "sortmode":"string"
              },
              {
                "sortby":"pos",
                "sortdir":"ASC"
              }
            ],
            "gridpagesize":100,
            "use_custom_prefix":"0",
            "prefix":"",
            "grid":"",
            "gridload_mode":2,
            "check_resid":1,
            "check_resid_TV":76,
            "join_alias":"",
            "has_jointable":"no",
            "getlistwhere":[
              {
                "tv_id":76
              }
            ],
            "joins":"",
            "hooksnippets":"",
            "cmpmaincaption":"",
            "cmptabcaption":"",
            "cmptabdescription":"",
            "cmptabcontroller":"",
            "winbuttons":"",
            "onsubmitsuccess":"",
            "submitparams":""
          },
          "columns":[
            {
              "MIGX_id":1,
              "header":"Titre",
              "dataIndex":"title",
              "width":90,
              "sortable":true,
              "show_in_grid":1,
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":"this.textEditor"
            },
            {
              "MIGX_id":2,
              "header":"Prod",
              "dataIndex":"prod",
              "width":80,
              "sortable":true,
              "show_in_grid":1,
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":"this.textEditor"
            },
            {
              "MIGX_id":3,
              "header":"R\u00e9al",
              "dataIndex":"rea",
              "width":80,
              "sortable":true,
              "show_in_grid":1,
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":"this.textEditor"
            },
            {
              "MIGX_id":6,
              "header":"Pr\u00e9cision",
              "dataIndex":"preciser",
              "width":120,
              "sortable":"false",
              "show_in_grid":"0",
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":"this.listboxEditor"
            },
            {
              "MIGX_id":7,
              "header":"Autre pr\u00e9cision",
              "dataIndex":"autres",
              "width":120,
              "sortable":true,
              "show_in_grid":"0",
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "MIGX_id":9,
              "header":"URL",
              "dataIndex":"url",
              "width":60,
              "sortable":true,
              "show_in_grid":"0",
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "header":"Image",
              "width":50,
              "sortable":"false",
              "dataIndex":"image",
              "renderer":"this.renderImage",
              "MIGX_id":8
            },
            {
              "MIGX_id":10,
              "header":"Date",
              "dataIndex":"datecasting",
              "width":60,
              "sortable":true,
              "show_in_grid":1,
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":"this.textEditor"
            },
            {
              "MIGX_id":11,
              "header":"Index",
              "dataIndex":"cvindex",
              "width":44,
              "sortable":"false",
              "show_in_grid":1,
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":"this.textEditor"
            },
            {
              "MIGX_id":12,
              "header":"Publi\u00e9",
              "dataIndex":"published",
              "width":44,
              "sortable":true,
              "show_in_grid":1,
              "customrenderer":"",
              "renderer":"this.renderClickCrossTick",
              "clickaction":"switchOption",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "MIGX_id":15,
              "header":"Deleted",
              "dataIndex":"deleted",
              "width":"",
              "sortable":"false",
              "show_in_grid":"0",
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "MIGX_id":16,
              "header":"ID",
              "dataIndex":"id",
              "width":"",
              "sortable":"false",
              "show_in_grid":"0",
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "MIGX_id":17,
              "header":"Position",
              "dataIndex":"pos",
              "width":22,
              "sortable":"false",
              "show_in_grid":1,
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            },
            {
              "MIGX_id":18,
              "header":"TV ID",
              "dataIndex":"tv_id",
              "width":22,
              "sortable":"false",
              "show_in_grid":1,
              "customrenderer":"",
              "renderer":"",
              "clickaction":"",
              "selectorconfig":"",
              "renderchunktpl":"",
              "renderoptions":"",
              "editor":""
            }
          ]
        }



        Besides this, there is an input TV used within the configuration: precision. I use this to setup a standard multi-select list between several defined options:

        ||Consultation==Consultation:prcsn_consultation||RDA==RDA:prcsn_rda||Chargé de Figuration==Chargé de Figuration:prcsn_figuration


        I'm clearly in the process of learning how to use migxdb. So please tell me if I'm missing something obvious here.