Skip to content

Relatedlist : custom relation name on same module #50

Description

@jerome-savin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions