You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really tried to figure this out for myself, changed all the names to avoid conflicts, tried "Join Alias" and "Joins", … I'm really stuck and ask for your help.
I want to nest two MIGXdb. I can provide you with more informations like JSON-configs, etc. But I really think they are ok. So here are only the main points:
Problem:
Every time a new "Child" is created, this error is logged: (ERROR @ /assets/components/migx/connector.php) No foreign key definition for parentClass: lbParent using relation alias: Resource
I really tried to figure this out for myself, changed all the names to avoid conflicts, tried "Join Alias" and "Joins", … I'm really stuck and ask for your help.
I want to nest two MIGXdb. I can provide you with more informations like JSON-configs, etc. But I really think they are ok. So here are only the main points:
###
On a CMP
Schema:
<?xml version="1.0" encoding="UTF-8"?> <model package="lb_test" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1"> <object class="lbParent" table="lb_parent" extends="xPDOSimpleObject" > <field key="title" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <composite alias="Children" class="lbChild" local="id" foreign="parent" cardinality="many" owner="local" /> </object> <object class="lbChild" table="lb_child" extends="xPDOSimpleObject" > <field key="title" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <field key="parent" dbtype="int" precision="11" phptype="integer" null="false" default="0" /> <aggregate alias="Parent" class="lbParent" local="parent" foreign="id" cardinality="one" owner="foreign" /> </object> </model>
Config "lb_parent":
Config "lb_children":
Problem:
Every time a new "Child" is created, this error is logged:
(ERROR @ /assets/components/migx/connector.php) No foreign key definition for parentClass: lbParent using relation alias: Resource
Everything else seems to work fine.
###
On Resources as a TV
Schema:
<?xml version="1.0" encoding="UTF-8"?> <model package="lb_test" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1"> <object class="lbParent" table="lb_parent" extends="xPDOSimpleObject" > <field key="title" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <field key="resource_id" dbtype="int" precision="11" phptype="integer" null="false" default="0" /> <aggregate alias="Resource" class="modResource" local="resource_id" foreign="id" cardinality="one" owner="foreign" /> <composite alias="Children" class="lbChild" local="id" foreign="parent" cardinality="many" owner="local" /> </object> <object class="lbChild" table="lb_child" extends="xPDOSimpleObject" > <field key="title" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <field key="parent" dbtype="int" precision="11" phptype="integer" null="false" default="0" /> <aggregate alias="Parent" class="lbParent" local="parent" foreign="id" cardinality="one" owner="foreign" /> </object> </model>
Config "lb_parent":
Config "lb_children":
Problem:
As soon as there is a second "Child" created, a new "Parent" is created in the database with a blank "title" and "resource_id" incrementing.
###
MODX 2.2.7
MIGX 2.4.3
The text was updated successfully, but these errors were encountered: