We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47795
    • 16 Posts
    Hi everyone

    I am looking to implement MIGXdb into my site (I already use just MIGX for image galleries, which works fine) to help me manage, and publish tables of data.

    I have gone through with the templates provided in the documentation, but realised that my MIGX was heavily out of date and was missing some important files. Of which I had to perform a manual update.

    Anyway, it works to the point of bringing up the Template Variable form, but as soon as I press the Done button it throws this error:

    (Chrome Console Window)
    Uncaught SyntaxError: Unexpected token <                 index.php?=a30&id575:1


    To me this means that some where something had an unclosed tag/bracket ("<") which is tripping up the code, problem is that I am not sure which file is causing this problem.

    I am currently using Revo. 2.2.14-pl (hope to update later today), but was wondering if anyone else has had this problem?

    This question has been answered by computer-legacy. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Most likely a double <?php line in a .php file somewhere.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 4172
        • 5,888 Posts
        I think, the request does return some html instaed of json, because of an error somewhere in the process.

        Can you read the response?
        Anything in the error-log?

        Clean the error-log and view it after starting this action.
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 47795
          • 16 Posts
          Hi All

          This is what appears in the error log:

           [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class: myGallery from mysql.mygallery.
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class: myGallery from mysql.mygallery.
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) myGallery::getSelectColumns() is not a valid static method.
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) No class specified for loadClass
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class 
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) No class specified for loadClass
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class !
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) No class specified for loadClass
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) No class specified for loadClass
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) No class specified for loadClass
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class 
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) No class specified for loadClass
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class !
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) No class specified for loadClass
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) No class specified for loadClass
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class: myGallery from mysql.mygallery.
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class: myGallery from mysql.mygallery.
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class myGallery
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) Could not load class: myGallery from mysql.mygallery.
          [2014-08-10 12:46:13] (ERROR @ /assets/components/migx/connector.php) myGallery::loadCollection() is not a valid static method.
          [2014-08-10 12:46:15] (ERROR @ /assets/components/migx/connector.php) Could not load class: myGallery from mysql.mygallery.
          [2014-08-10 12:46:16] (ERROR @ /assets/components/migx/connector.php) Could not load class: myGallery from mysql.mygallery.
          


            • 47795
            • 16 Posts
            I tried this process in Firefox, and it gave this result in the console...

              • 4172
              • 5,888 Posts
              seems the class myGallery could not be loaded in the processor

              is it the getlist - processor here?

              what is your xpdo-schema?
              what is your MIGX-configuration?
              you can post the whole configuration - json - string and your xpdo-schema here.

                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 47795
                • 16 Posts
                Okay sure, I have also just upgraded to the latest version of Revo - and it seems to be OK (few hitches, needed to reinstall MIGX, but all is good now).


                I am using the Schema and JSON straight from the RTFM:

                http://rtfm.modx.com/extras/revo/migxdb/migxdb.tutorials/migxdb.create-a-basic-gallery-management-from-scratch-with-migxdb

                Schema:
                <?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>


                JSON:

                {
                  "formtabs":[
                    {
                      "MIGX_id":1,
                      "caption":"Image",
                      "fields":[
                        {
                          "MIGX_id":2,
                          "field":"title",
                          "caption":"Title",
                          "inputTV":"",
                          "inputTVtype":"",
                          "configs":""
                        },
                        {
                          "MIGX_id":1,
                          "field":"image",
                          "caption":"Image",
                          "inputTV":"",
                          "inputTVtype":"image",
                          "configs":""
                        },
                        {
                          "MIGX_id":3,
                          "field":"pos",
                          "caption":"Position",
                          "inputTV":"",
                          "inputTVtype":"",
                          "configs":""
                        }
                      ]
                    },
                    {
                      "MIGX_id":2,
                      "caption":"Description",
                      "fields":[
                        {
                          "MIGX_id":1,
                          "field":"description",
                          "caption":"Description",
                          "inputTV":"",
                          "inputTVtype":"textarea",
                          "configs":""
                        }
                      ]
                    }
                  ],
                  "contextmenus":"update||publish||unpublish||recall_remove_delete",
                  "actionbuttons":"addItem||toggletrash",
                  "columnbuttons":"",
                  "filters":"",
                  "extended":{
                    "migx_add":"Add Image",
                    "packageName":"mygallery",
                    "classname":"myGallery",
                    "task":"",
                    "prefix":"",
                    "grid":"",
                    "check_resid":1,
                    "check_resid_TV":""
                  },
                  "columns":[
                    {
                      "MIGX_id":1,
                      "header":"ID",
                      "dataIndex":"id",
                      "renderer":"",
                      "sortable":"false",
                      "show_in_grid":1
                    },
                    {
                      "MIGX_id":2,
                      "header":"Title",
                      "dataIndex":"title",
                      "renderer":"",
                      "sortable":true,
                      "show_in_grid":1
                    },
                    {
                      "MIGX_id":3,
                      "header":"image",
                      "dataIndex":"image",
                      "renderer":"this.renderImage",
                      "sortable":"false",
                      "show_in_grid":1
                    },
                    {
                      "MIGX_id":4,
                      "header":"Published",
                      "dataIndex":"published",
                      "renderer":"this.renderCrossTick",
                      "sortable":true,
                      "show_in_grid":1
                    },
                    {
                      "MIGX_id":5,
                      "header":"Position",
                      "dataIndex":"pos",
                      "renderer":"",
                      "sortable":true,
                      "show_in_grid":1
                    },
                    {
                      "MIGX_id":6,
                      "header":"",
                      "dataIndex":"deleted",
                      "renderer":"",
                      "sortable":"false",
                      "show_in_grid":"0"
                    }
                  ]
                }


                I was hoping to use this, and then work backwards to get to what I need.
                  • 4172
                  • 5,888 Posts
                  you did parse the schema and all class and map-files was created under

                  core/components/mygallery/ ?
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 47795
                    • 16 Posts
                    Hi yeah I've just parsed the schema, which was successful.

                    There is no directory called mygallery under core/components

                    I looked at the Firefox error log, which points to ext-all.js. I have just replaced these files with fresh copies from the latest version of MODx available on the website. Still no joy.
                      • 4172
                      • 5,888 Posts
                      if this is your xpdo-schema above, where did you store it, if there isn't a folder core/components/mygallery ?

                      this folder should be created with the step 'Create Package'


                      Click 'Create Package' This should create a directory under your core-path with an empty schema-file in its correct place.
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!