The join field must be included as a regular field in the Editor instance. error
The join field must be included as a regular field in the Editor instance. error
ziv@kpmbro.com
Posts: 73Questions: 28Answers: 4
in General
Hey Allan.
Im performing this join :
$this->editor_instance->join(
Mjoin::inst( 'general_data_countries' )
->link('publishers_offers_feed.publisher_original_offer_id,offers_target_geos.offer_id')
->link( 'general_data_countries.iso_2_letter_code,offers_target_geos.country_id')
->order( 'name asc' )
->fields(
Field::inst( 'iso_2_letter_code' )
->validator( 'Validate::required' )
->options( 'general_data_countries,iso_2_letter_code,name' ),
Field::inst( 'name' ))
);
this my json to init the table fields:
[
{
"label": "Geos",
"name": "general_data_countries[].iso_2_letter_code",
"type": "select2",
"opts": {
"placeholder": "Select Geos",
"multiple": true,
"allowClear": true
}
}
]
but i get this error:
DataTables warning: table id=publishers_offers_feed - Join was performed on the field 'publisher_original_offer_id' which was not included in the Editor field list. The join field must be included as a regular field in the Editor instance.
what did i miss?
tanks
This discussion has been closed.
Answers
This looks wrong:
It should be passing in two strings to the function - not a single one:
Likewise with the second
link
call.Allan
Hi Allan
yeah i just echo it wrong... but the issue is still the same.
this is my code:
When i debug the query i see they query runs good and bring results, but something in the UI have some missmatch with the table fields...
In that case, the error suggests that
publishers_offers_feed.publisher_original_offer_id
is not included in the field list in the parent table's fields.Allan
mmmmm but i can see it when i print the editor fields:
Can you show me your full PHP code please?
Thanks,
Allan
I'm afraid I don't see where the
publishers_offers_feed.publisher_original_offer_id
field is defined in theeditor_instance
there.Allan