Bruno17 / MIGX

MIGX for revo 2.2 and above
83 stars 78 forks source link

Enable basic Package Manager functionality for MODX 3 #401

Closed halftrainedharry closed 1 year ago

halftrainedharry commented 1 year ago

Adds some changes, so that the basic functionality of the Package Manager works in MODX 3.


With a schema like this

<?xml version="1.0" encoding="UTF-8"?>
<model package="mypackage" baseClass="xPDO\Om\xPDOObject" platform="mysql" defaultEngine="InnoDB" version="3.0">
    <object class="Myclass" table="mypackage_myclass" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="150" phptype="string" null="false" default="" />
    </object>
</model>

and the buttons "Create Package", "save Schema", "parse Schema" and "create Tables", it is then possible to create a config with Package = mypackage and Classname = mypackage\Myclass in the "MIGXdb-Settings" tab and successfully add/edit data in a CMP (if the PRs #394 and #395 are applied as well).

Bruno17 commented 1 year ago

@halftrainedharry could you get create Tables running with the schema like yours? This doesn't seem to work for me. createObjectContainer can't get a instance with $this->xpdo->newObject($className);

halftrainedharry commented 1 year ago

I just now tested it, and it created the database table successfully. On MODX 3.0.2, I installed MIGX, replaced the 2 files from this PR and used the schema I posted above.

Bruno17 commented 1 year ago

Thanks @halftrainedharry! My issue was, I had still version="1.1" in my schema