Multiple links found for relationship x within module y

We just upgraded an instance from 8.0.1 to 10.0.3 and we are now testing the instance. All seems to be good but for some reason when we open a contact or a lead we do get multiple messages stating that there are multiple links found for relationship x within module y. For instance: 

"Multiple links found for relationship contact_tasks within module Contacts"

I checked to see if there are any definitions in the custom directory for this specific relationship. The only mention of this relationship can be found in the modules/Contacts/vardefs.php which is the place I would expect it to be. After removal of the cache, quick repair & rebuild and even a repair relationships I couldn't get these messages away. Can someone point me in the right direction where to watch? 

  • Check in the cache/modules directory for the relationship and see how many times it shows up there. That'll give you an idea and also it might also tell you where it is defined. Also, try to run repair roles and run repair relationships a couple more times.

  • This is one of those horrible 'error' messages.  You will not be able to get rid of it because it is completely normal.  I used xDebug to find a relationship that would trigger this and this is what I found

    xDebug Breakpoint 1

    In some built in/stock relationships there are 2 definitions to find.  The code works it out in the end and you should not see this in a custom relationship made in studio but for stock relationships it is almost standard.  Do you see in the example above one is to be displayed on the Contact and the other is for the Lead.  Look at the VNAMEs.

    I finally got tired of it and changed the log level on that one to 'warning'.  It should be line 54 of data/Relationships/M2MRelationship.php