We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42049 ☆ A M B ☆
    • 250 Posts
    I've made my CMP, the field names in the columns match the names of my tables, I can add data into my CMP via the form view fine, I can see it in my database, but it doesn't render on the columns view.

    Any ideas?
      GEL STUDIOS
      MODX Professional | MODX Ambassador

      Website | Email | Twitter | Facebook
      • 34109
      • 119 Posts
      You got stuck in quick! I use Chrome developer tools to debug migx cmp grids. If you use the network tab and look at the preview output from connector.php (called a few times normally) it'll show up any PHP errors here.
        Studio Republic
        http://www.studiorepublic.com
        0845 226 3205
        @christodhunter
        • 42049 ☆ A M B ☆
        • 250 Posts
        Quote from: [email protected] at Apr 11, 2013, 05:02 AM
        You got stuck in quick!

        I completely blame you for my unnatural addiction to this!

        I'll give this a go now!
          GEL STUDIOS
          MODX Professional | MODX Ambassador

          Website | Email | Twitter | Facebook
          • 42049 ☆ A M B ☆
          • 250 Posts
          Had a gander, I only get this back...

          results: []
          total: "0"


          But I can definitely see them in my phpMyAdmin - and adding them through the CMP works just fine...
            GEL STUDIOS
            MODX Professional | MODX Ambassador

            Website | Email | Twitter | Facebook
            • 34109
            • 119 Posts
            I'd check a couple of things:

            Have you set up any db filters?
            Are you including the table identifier in the grid (even just as a hidden field)?
              Studio Republic
              http://www.studiorepublic.com
              0845 226 3205
              @christodhunter
              • 42049 ☆ A M B ☆
              • 250 Posts
              Quote from: [email protected] at Apr 11, 2013, 05:14 AM
              I'd check a couple of things:

              Have you set up any db filters?
              Are you including the table identifier in the grid (even just as a hidden field)?

              No DB Filters present, In the grid I currently just have ID => id, and Author => author.

              There are other fields saved with the form, but I just want to get these two showing as a start.
                GEL STUDIOS
                MODX Professional | MODX Ambassador

                Website | Email | Twitter | Facebook
                • 4172
                • 5,888 Posts
                try to debug the generated sql.
                go into the getlist-processor (by default the one under processors/mgr/default/)

                and search for
                //$c->prepare();echo $c->toSql();


                change it to
                $c->prepare();echo $c->toSql();


                and watch again firebugs response.
                what's the generated sql?
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 42049 ☆ A M B ☆
                  • 250 Posts
                  Fixed it... Had a cheeky look in the error log and it presented itself with this...

                   [2013-04-11 11:32:21] (ERROR @ /assets/components/migx/connector.php) Error 42S22 executing statement: 
                  Array
                  (
                      [0] => 42S22
                      [1] => 1054
                      [2] => Unknown column 'listing.deleted' in 'where clause'
                  )


                  I did not know that it was a requirement to have a deleted clause...

                  Thanks for your help Chris, I can't wait to do many many more things with MIGXDB!
                    GEL STUDIOS
                    MODX Professional | MODX Ambassador

                    Website | Email | Twitter | Facebook
                    • 34109
                    • 119 Posts
                    I use the sample xml schema which includes all the migxdb fields from this tutorial:
                    http://rtfm.modx.com/display/ADDON/MIGXdb.Create+a+basic+gallery-management+from+scratch+with+MIGXdb

                    <?xml version="1.0" encoding="UTF-8"?>
                    <model package="mygallery" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
                    	<object class="myGallery" table="migx_gallery" extends="xPDOSimpleObject" >
                    	<field key="title" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
                    	<field key="description" dbtype="text" phptype="string" index="fulltext" />
                            <field key="resource_id" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
                            <field key="resource_ids" dbtype="text" phptype="string" null="false" default="" />
                            <field key="image" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
                            <field key="extended" dbtype="text" phptype="json" null="false" default="" />
                            <field key="pos" dbtype="int" precision="10" phptype="integer" null="false" default="0" />        
                            
                    	<field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
                    	<field key="createdby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
                    	<field key="createdon" dbtype="datetime" phptype="datetime" null="false" />
                    	<field key="editedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
                    	<field key="editedon" dbtype="datetime" phptype="datetime" null="false" />
                    	<field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
                    	<field key="deletedon" dbtype="datetime" phptype="datetime" null="false" />
                    	<field key="deletedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
                    	<field key="publishedon" dbtype="datetime" phptype="datetime" null="false" />
                    	<field key="publishedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
                    
                    	<index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
                    		<column key="id" collation="A" null="false" />
                    	</index>
                            
                            <aggregate alias="Resource" class="modResource" local="resource_id" foreign="id" cardinality="one" owner="foreign" />
                            <aggregate alias="Creator" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign" />
                    	</object>
                        
                    </model>
                      Studio Republic
                      http://www.studiorepublic.com
                      0845 226 3205
                      @christodhunter
                      • 4172
                      • 5,888 Posts
                      you don't need a deleted - field.
                      But then do not check the action-button 'toggletrash'

                      toggletrash (normal view/trashview) does check for deleted
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!