ExtraBuilder + MIGX CMP Walkthrough Video

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

Thank you. This Classname and Package name entries were the key for both working CMP and use of migxLoopCollection snippet. (Until now, after creating a simple table, I was using phpmyadmin for adding data and rowboat to display it lol) Now both works in my test environment (NGINX1.18.0, PHP7.4.33, ModX3.0.3 and migx 3.0.1-beta1 )

1 Like

Very nice tutorial @robcarey, thank you! :slight_smile:

Regarding “easy package building”, is there a similar easy way to make a package from the resources in a context, to be able to quickly make a “dummy content” package?

1 Like