ExtraBuilder + MIGX CMP Walkthrough Video

Hey all,

I took a stab at recording a walkthrough on using these two extras together to create some custom table and manager page goodness. Hope it helps someone. Thanks to Bruno and Jared for the great tools they have built for us.

Link to the MIGX TV types mentioned in the video:

10 Likes

I should note - I have not yet been able to get this process to work yet in MODX 3 - Bruno does have a beta of MIGX working in MODX 3, however it does not seem to work with the package keys/setup that is outlined in this video.

Also - I neglected to include an important step when you build your transport package. You need to include ā€œCreate Tableā€ and ā€œRemove Tableā€ resolvers by running the two actions BEFORE you build your transport package. These will create the new table on the target system after install, and remove the table if you choose to uninstall the package. Important to remember :slight_smile:

Hi @robcarey ā€¦

First off - you have a fabulous voice / accent :grin:

I just wanted to say thanks for the time youā€™ve taken to make this video.

Iā€™ve just followed it through and I now have a shiny CMP hooked up to a custom db table.

I have never made a CMP before and Iā€™ve never created a package before without having to manually create an XML schema.

Two excellent firsts!

Thanks also to @jaredfhealy and @bruno17

Chris

5 Likes

Hey @dejaya ! Thanks for the message and the kind words. The voice / accent is 100% pure Southwestern Ontario Canada rural :slight_smile:

Glad to hear you were able to follow my ramble and get something useful!

Cheers!

1 Like

thanks for sharing , this post helps me.

1 Like

Thank you for the video. You should start your own series called The MODX Ape!

4 Likes

Is it working now with MODX 3.0?
My db-fields in mix doesnt populateā€¦

With MIGX 3.0.0-alpha5 on MODX 3, you canā€™t use the package manager or class files created in MODX 3 (schema version ā€œ3.0ā€).

It should be possible with MIGX 3.0.0-beta1, but at the moment you have to load the package from here:

MIGX/migx-3.0.0-beta1.transport.zip at master Ā· Bruno17/MIGX (github.com)


Another possibility is to create the class files for the custom table in MODX 2 (with schema version ā€œ1.1ā€) and then move them to a MODX 3 installation.

1 Like

yeah, I think it should work with MIGX 3.0.0-beta1

Thanks, I will try. For now It gives me this error in log:

[2023-02-17 15:15:31] (ERROR @ C:\xampp\htdocs\core\components\migx\model\migx\migx.class.php : 881) PHP warning: Undefined variable $configpath
[2023-02-17 15:15:31] (ERROR @ C:\xampp\htdocs\core\vendor\xpdo\xpdo\src\xPDO\xPDO.php : 472) Path specified for package test is not a valid or accessible directory: C:\xampp\htdocs/core/components/test/model/
[2023-02-17 15:15:31] (ERROR @ C:\xampp\htdocs\core\vendor\xpdo\xpdo\src\xPDO\xPDO.php : 666) Could not load class: testclass from mysql.testclass

I tested it with this schema

<?xml version="1.0" encoding="UTF-8"?>

<model package="Testpackage\Model\" baseClass="xPDO\Om\xPDOObject" platform="mysql" defaultEngine="InnoDB" phpdoc-package="" phpdoc-subpackage="" version="3.0">
    <object class="testpackageItem" table="testpackage_items" extends="xPDO\Om\xPDOSimpleObject">
        <field key="title" dbtype="varchar" phptype="string" precision="100" null="false" default="" />
    </object>
</model>

and used these settings in the config ā†’ tab ā€œMIGXdb-Settingsā€

  • Classname = Testpackage\Model\testpackageItem
  • Package ( ā† I left this field empty)

and this seems to work.

@bruno17 Can you confirm that this is the correct way to use MIGXdb with namespaced classes?

2 Likes

Thanks. This works with version beta1

Something happened with my MIGX. Reinstall doesnt helpā€¦

Had this exact issue, wiping everything regarding MIGX, then installing the version from package manager and afterwards the beta1 package made everything work as intended :slight_smile:

Thats what I didā€¦ clear all migx folders from assets, core, mysql database migx tables, removed package.
But nothing helpedā€¦

What version of PHP are you using?
The code probably has to be fixed on the lines that are displayed on the page.

Also, setting display_errors to Off probably avoids that these deprecation messages get displayed on the page and therefore break the processing.

8.2.0
display_errors setting can be found where?

I also have this on dashboard (nut sure if it is related)

Should be in the ā€œphp.iniā€ of the server.
Maybe you can also exclude E_DEPRECATED in the ā€œerror_reportingā€ setting.


This is unrelated to MIGX (but possibly a bug in MODX).

display_errors=Off in php.ini
Doesnt helpā€¦
remove E_DEPRECATED helped!
error_reporting=E_ALL & ~E_STRICT