We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37165
    • 89 Posts
    I'm working with Migx in Revolution 2.4.1-pl. I am following this tutorial : https://www.youtube.com/watch?annotation_id=annotation_564194655&feature=iv&src_vid=Dv83iC9iELI&v=jwzx6O7zdaU

    The problem I am having is that Migx doesn't seem to be making a table for my DB. I go MIGX Management and create a package, add a XML Schema, save it, Parse it and then go to create tables. I get success messages at each stage. I can see my Schema created through FTP and the XPDO map. Everything is working except when I log into phpmyadmin, the table that I want is not there. I'm able to create fields and add items, but the "done" button won't save anything. I presume because there is no where to add it in the DB.

    Here is the error's I'm getting in the log.

    [2016-07-07 21:58:02] (ERROR @ /assets/components/migx/connector.php) Could not load class: calendar from mysql.calendar.
    [2016-07-07 21:58:05] (ERROR @ /assets/components/migx/connector.php) Could not load class: calendar from mysql.calendar.
    [2016-07-07 22:12:16] (ERROR @ /assets/components/migx/connector.php) Could not load class: myGallery from mysql.mygallery.
    [2016-07-07 22:21:06] (ERROR @ /index.php) `` is not a valid integer and may not be passed to makeUrl()
    [2016-07-07 22:21:06] (ERROR @ /index.php) `` is not a valid integer and may not be passed to makeUrl()
    [2016-07-07 22:21:57] (ERROR @ /assets/components/migx/connector.php) Could not load class: calendar from mysql.calendar.
    
    


    This is what I'm seeing after parsing my schema.

    <?php
    $xpdo_meta_map['calendar']= array (
      'package' => 'calendar',
      'version' => '1.1',
      'table' => 'my_migx_calendar',
      'extends' => 'xPDOSimpleObject',
      'fields' => 
      array (
        'title-cal' => '',
        'date-cal' => NULL,
        'image-cal' => '',
        'year-cal' => '',
        'copy-cal' => '',
        'link-cal' => '',
        'extendedOne-cal' => '',
        'extendedTwo-cal' => '',
        'extendedThree-cal' => '',
      ),
      'fieldMeta' => 
      array (
        'title-cal' => 
        array (
          'dbtype' => 'varchar',
          'precision' => '255',
          'phptype' => 'string',
          'null' => false,
          'default' => '',
          'index' => 'index',
        ),
        'date-cal' => 
        array (
          'dbtype' => 'text',
          'phptype' => 'string',
          'index' => 'fulltext',
        ),
        'image-cal' => 
        array (
          'dbtype' => 'varchar',
          'precision' => '255',
          'phptype' => 'string',
          'null' => false,
          'default' => '',
        ),
        'year-cal' => 
        array (
          'dbtype' => 'varchar',
          'precision' => '255',
          'phptype' => 'string',
          'null' => false,
          'default' => '',
        ),
        'copy-cal' => 
        array (
          'dbtype' => 'varchar',
          'precision' => '255',
          'phptype' => 'string',
          'null' => false,
          'default' => '',
        ),
        'link-cal' => 
        array (
          'dbtype' => 'varchar',
          'precision' => '255',
          'phptype' => 'string',
          'null' => false,
          'default' => '',
        ),
        'extendedOne-cal' => 
        array (
          'dbtype' => 'text',
          'phptype' => 'string',
          'null' => false,
          'default' => '',
        ),
        'extendedTwo-cal' => 
        array (
          'dbtype' => 'text',
          'phptype' => 'string',
          'null' => false,
          'default' => '',
        ),
        'extendedThree-cal' => 
        array (
          'dbtype' => 'text',
          'phptype' => 'string',
          'null' => false,
          'default' => '',
        ),
      ),
      'indexes' => 
      array (
        'PRIMARY' => 
        array (
          'alias' => 'PRIMARY',
          'primary' => true,
          'unique' => true,
          'columns' => 
          array (
            'id' => 
            array (
              'collation' => 'A',
              'null' => false,
            ),
          ),
        ),
      ),
      'aggregates' => 
      array (
        'Resource' => 
        array (
          'class' => 'modResource',
          'local' => 'resource_id',
          'foreign' => 'id',
          'cardinality' => 'one',
          'owner' => 'foreign',
        ),
        'Creator' => 
        array (
          'class' => 'modUser',
          'local' => 'createdby',
          'foreign' => 'id',
          'cardinality' => 'one',
          'owner' => 'foreign',
        ),
      ),
    );
    


    Any help would be greatly appreciated. I already checked permissions for my FTP user. There are no problems with the database outside of this. Am able to add new plug-ins or content outside of this without issue.
      • 4172
      • 5,888 Posts
      could you post your schema, please?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 37165
        • 89 Posts
        Yes Bruno, here it is:

        <?xml version="1.0" encoding="UTF-8"?>
        <model package="calendar" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
                <object class="calendar" table="my_migx_calendar" extends="xPDOSimpleObject" >
                
                <field key="title-cal" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        
                <field key="date-cal" dbtype="text" phptype="string" index="fulltext" />
        
                <field key="image-cal" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
                
                <field key="year-cal" dbtype="varchar" precision="255" phptype="string" null="false" default=""  />
                
                <field key="copy-cal" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        
                <field key="link-cal" dbtype="varchar" precision="255" phptype="string" null="false" default=""  />
                        
                <field key="extendedOne-cal" dbtype="text" phptype="string" null="false" default="" />
                
               <field key="extendedTwo-cal" dbtype="text" phptype="string" null="false" default="" />
                
               <field key="extendedThree-cal" dbtype="text" phptype="string" null="false" default="" />       
         
         
                 <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>
          • 4172
          • 5,888 Posts
          that's working for me.
          It creates a table modx_my_migx_calendar

          I think, this doesn't matter, but you don't need this part:

                   <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
                          <column key="id" collation="A" null="false" />
                  </index>


          also, the aggregates can be removed.

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

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 37165
            • 89 Posts
            I removed the index tags and the aggregates. I tested this on another install on ModX and had the same problem. Clearly I must be doing something wrong.

            1. Created a new package
            2. pasted the schema into the XML Schema tab
            3. clicked save
            4. Clicked Parse Schema
            5. Confirmed through FTP the Parse worked
            6. Clicked Create Tables

            Am I missing a step here?

              • 4172
              • 5,888 Posts
              sounds good to me.
              Anything in the error-logs?

              Maybe you should try to install the latest version from github (its 2.10.0-beta10 currently)
              https://github.com/Bruno17/MIGX/tree/master/_packages
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!