Has anyone seen this error when trying to use both set_relation_n_n() and set_relation() to the same table?
I've got a 1-to-many and a many-to-many relationship to a 'contacts' table that I need to define. The many-to-many is for partners contacts and the 1-to-many is for a related vendor.
$crud->set_relation('vendor_id', 'contacts', '{contacts.first_name} {contacts.last_name} ({contacts.company})'); $crud->set_relation_n_n('contacts', 'collections_contacts', 'contacts', 'collection_id', 'contact_id', '{contacts.first_name} {contacts.last_name} ({contacts.company})', 'priority');
The column names seem to be prefixed with the table name and the "as" name. Note: j96b1f972.contacts.first_name
Error Number: 1054 Unknown column 'j96b1f972.contacts.first_name' in 'field list' SELECT `collections`.*, CONCAT('', COALESCE(j96b1f972.contacts.first_name, ''), ' ', COALESCE(j96b1f972.contacts.last_name, ''), ' (', COALESCE(j96b1f972.contacts.company, ''), ')') as s96b1f972 FROM (`collections`) LEFT JOIN `contacts` as j96b1f972 ON `j96b1f972`.`id` = `collections`.`vendor_id`
I assume I could just create my own custom field dropdown for the "vendor_id" field as it's not as special as the many-to-many relationship. Any suggestions?