Forums

Model Relation Problem

Fredolino 27 Feb, 2023
Hello

I found a problem with "Model Relation".
Model relation only works if the key of a DB table is linked to the source table.

Example works:

read data: read_table
all matching
SourceTable Model: SourceModel
ID: SourceModel.id

in relation >

relation model name: Model_1
Database table name: #_testtable
Relation to: SourceModel
One matching record, foreign key in related model
SourceModel.id = Model_1.mod_id


Example not working:

read data: read_table
all matching
SourceTable Model: SourceModel
ID: SourceModel.id

in relation >

relation model name: Model_1
Database table name: #_testtable
Relation to: SourceModel
One matching record, foreign key in related model
SourceModel.id = Model_1.mod_id

relation model name: Model_2
Database table name: #_datatable
Relation to: Model_1
One matching record, foreign key in related model
Model_2.data_id = Model_1.mod_id


How does model relation work from the "2nd level"?

F.
Fredolino 28 Feb, 2023
Hello,

is this a bug?? When will it be fixed? Will CF7 ever be fixed?
You're stuck between tree and bark because CC/CF6 doesn't work as well with PHP8 as it hasn't been developed with PHP7 and CF7 for ages...
Fredolino 28 Feb, 2023
it works in the case when the "Related to" field is not filled and the model name is entered in the "Table field name" (Model.table_field_name).

F.
You need to login to be able to post a reply.