We cannot add a relatedlist that's pointing on self module, with custom relation name.
For exemple, I have a module 'Contact', with :
- uitype entity field : mentor (mentor_id) pointing on Contact module
- relatedlist (getDependentList) : mentees (which are contacts)
If I create a relatedlist with relationName="mentees", laravel will trigger an error : Column not found: Unknown column 'contacts.contact_id' in 'where clause' (SQL: select contacts.id from contacts where contacts.contact_id = 7 and contacts.contact_id is not null)
That's because my field is called 'mentor' and not 'contact'.
I could change field's name (even if it's not clean), but I'll encounter the problem again if I need a second relatedlist on this module (for exemple parent and child).
I think, we need to add a param to relatedList which will have an effect on RelatedlistTrait.php on line 81
We cannot add a relatedlist that's pointing on self module, with custom relation name.
For exemple, I have a module 'Contact', with :
If I create a relatedlist with relationName="mentees", laravel will trigger an error : Column not found: Unknown column 'contacts.contact_id' in 'where clause' (SQL: select
contacts.idfromcontactswherecontacts.contact_id= 7 andcontacts.contact_idis not null)That's because my field is called 'mentor' and not 'contact'.
I could change field's name (even if it's not clean), but I'll encounter the problem again if I need a second relatedlist on this module (for exemple parent and child).
I think, we need to add a param to relatedList which will have an effect on RelatedlistTrait.php on line 81