I have a MIGXdb CMP with a grid of Events and am attempting to add a combobox Db-Filter to show Events belonging to a specific Family. The main Events table stores the Family id and has an alias to a second table which stores the Family name.
The commbobox lists the Family names however selecting one does not filter the Events grid. I can see a network request to connector.php with payload getFamilyName: Concert
which I think is correct - I expected this to match the joined field Family_name.
I tried setting getlist-where:
to getlist-where: {"Family_name":"[[+getFamilyName]]"}
and getlist-where: {"name":"[[+getFamilyName]]"}
, also getlist-where: {"Family":"[[+getFamilyName]]"}
(because Family is the Header of the field Family_name in the grid Columns) but none is correct.
There are no errors in the MODX Error Log.
Can anyone help me with the correct Db-Filters configuration please?
My Db-Filters configuration is
filter Name: getFamilyName
Label: Family Name
Empty Text: --filter by name–
Filter Type: combobox
getlist-where: {“Family_name”:“[[+getFamilyName]]”}
getcombo processor: getcombo
getcombo textfield: name
getcombo classname (optional): VenueEvent
getcombo packageName (optional): venue
getcombo joins (optional): [{“alias”:“Family”}]
Schema is below (I removed several Objects to save space)
<?xml version="1.0" encoding="UTF-8"?>
<model package="venue" baseClass="xPDOObject" platform="mysql" defaultEngine="INNODB" version="1.1">
<object class="VenueFamily" table="venue__family" extends="xPDOSimpleObject">
<field key="name" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
<!-- used by MIGX -->
<field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="pos" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
<!-- good practice for tracking -->
<field key="createdon" dbtype="datetime" phptype="datetime" null="true"/>
<field key="createdby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="editedon" dbtype="datetime" phptype="datetime" null="true"/>
<field key="editedby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<!-- track createdby and editedby -->
<aggregate alias="CreatedBy" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign" />
<aggregate alias="EditedBy" class="modUser" local="editedby" foreign="id" cardinality="one" owner="foreign" />
<composite alias="Parents" class="VenueParent" local="id" foreign="family" cardinality="many" owner="local" />
<composite alias="Experiences" class="VenueExperience" local="id" foreign="family" cardinality="many" owner="local" />
<composite alias="Events" class="VenueEvent" local="id" foreign="family" cardinality="many" owner="local" />
</object>
<object class="VenueParent" table="venue__parent" extends="xPDOSimpleObject">
<field key="family" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="name" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
<!-- used by MIGX -->
<field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="pos" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
<!-- good practice for tracking -->
<field key="createdon" dbtype="datetime" phptype="datetime" null="true"/>
<field key="createdby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="editedon" dbtype="datetime" phptype="datetime" null="true"/>
<field key="editedby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<index alias="family" name="family" primary="false" unique="false" type="BTREE">
<column key="family" length="" collation="A" null="false" />
</index>
<index alias="name" name="name" primary="false" unique="false" type="BTREE">
<column key="name" length="" collation="A" null="false" />
</index>
<!-- track createdby and editedby -->
<aggregate alias="CreatedBy" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign"/>
<aggregate alias="EditedBy" class="modUser" local="editedby" foreign="id" cardinality="one" owner="foreign"/>
<aggregate alias="Family" class="VenueFamily" local="family" foreign="id" cardinality="one" owner="foreign"/>
<composite alias="Event" class="VenueEvent" local="id" foreign="parent" cardinality="many" owner="local" />
</object>
<object class="VenueEvent" table="venue__event" extends="xPDOSimpleObject">
<field key="parent" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="family" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="title" dbtype="varchar" precision="150" phptype="string" null="false" default="" />
<field key="date" dbtype="datetime" phptype="datetime" null="true" default="2022-12-01 00:00:00" />
<field key="host" dbtype="varchar" precision="150" phptype="string" null="false" default="" />
<field key="host_img" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
<field key="guest" dbtype="varchar" precision="150" phptype="string" null="false" default="" />
<field key="guest_img" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
<field key="general_admission_url" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
<!-- used by MIGX -->
<field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="pos" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
<!-- good practice for tracking -->
<field key="createdon" dbtype="datetime" phptype="datetime" null="true"/>
<field key="createdby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="editedon" dbtype="datetime" phptype="datetime" null="true"/>
<field key="editedby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<index alias="parent" name="parent" primary="false" unique="false" type="BTREE">
<column key="parent" length="" collation="A" null="false" />
</index>
<index alias="family" name="family" primary="false" unique="false" type="BTREE">
<column key="family" length="" collation="A" null="false" />
</index>
<index alias="title" name="title" primary="false" unique="false" type="BTREE">
<column key="title" length="" collation="A" null="false" />
</index>
<index alias="date" name="date" primary="false" unique="false" type="BTREE">
<column key="date" length="" collation="A" null="false" />
</index>
<!-- track createdby and editedby -->
<aggregate alias="CreatedBy" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign"/>
<aggregate alias="EditedBy" class="modUser" local="editedby" foreign="id" cardinality="one" owner="foreign"/>
<aggregate alias="Family" class="VenueFamily" local="family" foreign="id" cardinality="one" owner="foreign"/>
<aggregate alias="Parent" class="VenueParent" local="parent" foreign="id" cardinality="one" owner="foreign"/>
<composite alias="Experiences" class="VenueEventExperience" local="id" foreign="event" cardinality="many" owner="local"/>
</object>
</model>
Related Docs and Forum posts I’ve found are
- MIGXdb.Manage Events-Resources in a CMP with help of MIGXdb - Tutorials | MODX Documentation
- MIGXdb.Create doodles manager with help of MIGXdb - Tutorials | MODX Documentation
- Filter (combobox) Migx DB CMP based on Value Existing in connected table
- https://forums.modx.com/thread/89773/migx-db-combobox-filter-using-distinct-values-from-custom-table-field