<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="wiki">
<p>Hi folks,<br>
</p>
<p>There is "strange relationship" between Contacts and Potetials.
It's actually a dual relationship that is treated as a special
case throughout the code.</p>
<p>Potentials has a field for the related Contact:
vtiger_potential.contact_id</p>
<p>But also there is a dedicated relation table:
vtiger_contpotentialrel</p>
<p>So, we have 2 ways to connect a Contact to Potentials: </p>
<ol>
<li>In the Edit form, selecting one Contact. In this case the
contact id is saved as field in vtiger_potential table, and
shown in the relation list with a trick<br>
</li>
<li>In the relation list view, selecting as many Contacts you
want (data saved in vtiger_contpotentialrel)</li>
</ol>
<p>How to reproduce the bug:</p>
<ol>
<li>Create a Potential (P) connecting a Contact (C1) in the Edit
form. Save</li>
<li>Add a second Contact (C2) in the related list </li>
<li>Add a comment to P</li>
<li>Open C1 and toggle Roll up on - you don't see P's comment</li>
<li>Open C2 and toggle Roll up on - you see P's comment</li>
<li>Bonus track: unlink C1 from P's related contacts list. Link
it again. You will see P's comment in C1 Roll up.</li>
</ol>
<p>The error is in the <code>public function
getRelatedModuleRecordIds</code> in <code>modules/Vtiger/models/Module.php</code></p>
<p>I'm providing a patch for it.</p>
<p>It's funny I checked VT 7.1.0 and the bug was reversed: you see
comment at point 4. and not at 5 (looking ad diff between the
two versions of file is clear why) <br>
</p>
<p><br>
</p>
<p>I opened a Issue and pushed a commit + merge request</p>
<p><a class="moz-txt-link-freetext" href="https://code.vtiger.com/vtiger/vtigercrm/issues/1749">https://code.vtiger.com/vtiger/vtigercrm/issues/1749</a></p>
<p>Have a nice day<br>
</p>
<p>Vincenzo<br>
</p>
</div>
<p></p>
<pre class="moz-signature" cols="72">--
Vincenzo Bruno (cell. 328-7252923)
Coopyleft (<a class="moz-txt-link-abbreviated" href="http://www.vinsoft.it/coopyleft">www.vinsoft.it/coopyleft</a>)
Digital Polis (<a class="moz-txt-link-abbreviated" href="http://www.digitalpolis.it">www.digitalpolis.it</a>)
Hacklab Cosenza (<a class="moz-txt-link-abbreviated" href="http://www.hlcs.it">www.hlcs.it</a>)
</pre>
</body>
</html>