MODX 3 and MIGX

Is there a special syntax for using MIGX Management in MODX 3? Using MIGX 3.0.0-beta1.
I generated everything with MIGX, although when I generate the schema, a bunch of default MODX classes get addess as well - AccessActiondom, AccessCategory etc.
Table name is modx_emails_datoteke as in the schema.

Schema:

<?xml version="1.0" encoding="UTF-8"?>
<model package="Emails\Model\" baseClass="xPDO\Om\xPDOObject" platform="mysql" defaultEngine="InnoDB" version="3.0">
	<object class="Datoteke" table="emails_datoteke" extends="xPDO\Om\xPDOSimpleObject">
		<field key="signDate" dbtype="datetime" phptype="datetime" null="false" />
		<field key="name" dbtype="varchar" precision="255" phptype="string" null="false" />
		<field key="company" dbtype="varchar" precision="255" phptype="string" null="false" />
		<field key="email" dbtype="varchar" precision="100" phptype="string" null="true" />
		<field key="deleted" dbtype="tinyint" precision="1" phptype="integer" null="false" />
		<field key="editDate" dbtype="datetime" phptype="datetime" null="false" />
		<field key="hash" dbtype="varchar" precision="50" phptype="string" null="false" />
	</object>
</model>

When setting Package to emails and Classname to Datoteke in the MIGX config editor, and going to Columns → select db fields, it spits out this error:

Path specified for package emails is not a valid or accessible directory: /www/core/components/emails/model/
Could not load class: Datoteke from mysql.datoteke

What could be causing this? I’ve used MIGX for custom tables in MODX 3 before, haven’t had this issue yet…

You should use the fully qualified class name → Emails\Model\Datoteke.

Also apply this PR (or use version migx-3.0.1-beta1) to get rid of the “Path specified for package …” error messages.

2 Likes

Unfortunately, it doesn’t fix the issue.
Could not load class: Emails\Model\Datoteke from mysql. emails\model\datoteke

File structure generates like this:

emails
  schema
    emails.mysql.schema.xml
  src
    Model
      mysql
        Datoteke.php
    Datoteke.php
    metadata.mysql.php
bootstrap.php

However, I’ve noticed this error - if it is connected to the problem.
(ERROR @ /www/core/components/migx/model/migx/migx.class.php : 884) PHP warning: Undefined variable $configpath

What exactly do you do when you get this error?

If you are using $modx->addPackage() in some custom code, remove the line. Your package gets added in the file “core/components/emails/bootstrap.php”.

I’m opening the MIGX “Select db-fields” in the columns tab. Nothing else, since it’s a fresh project.

I can’t reproduce this issue.
All works fine when I test it with your schema and the Classname Emails\Model\Datoteke.

I’ve just done a fresh MIGX install and some weird stuff starter happening …

Unable to load processor for action "mgr/migxdb/getList", it does not exist as an autoloadable class that extends \MODX\Revolution\Processors\Processor, and also not as a file in "/www/core/components/migx/processors/mgr/migxdb/getList.class.php

I’l dive into this a bit. Seems like an issue on my side, but not sure what could cause this, since it’s a fresh install.

Do you use the MIGX package manager to parse the schema?
Create package → parse Schema → create Tables (or something like that)?

Yes, I did use the MIGX package manager.

I’ve got it working.

I completely wiped MIGX from the system, installed the package from the provider, and then “updated” it with 3.0.0-beta1 (will update to 3.0.1 later). After that, everything worked like a charm.

1 Like

How completely wiped MIGX from the system? i have the same problem(

I just removed all packages, the namespace and all tables.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.