Extra entry in Report module tree

Can anyone explain what is happening here? The result is a rogue entry in the module tree of a report:

image

Steps to get here:

  1. Fresh install of SuiteCRM.
  2. New package through Module Builder called TestPackage, prefix TP.
  3. Two new modules TestOwner and TestCars. No fields added.
  4. Relationship one to many, TestOwner to TestCars created.
  5. Save and Deploy.

The LBL_TP_TESTOWNER_TP_TESTCARS_FROM_TP_TESTCARS_TITLE entry will then appear in the Reports - Module tree. Clicking on this displays the fields for TestOwner.

Tested on Versions 7.10.29 (php 7.2), 7.12.6 (php 7.4) & 8.1.0 (php 7.4) and the same result each time.

What is causing this?

UPDATE

It seems to be where there is a dictionary reference to _ida or _idb. For example:

custom\Extension\modules\TP_TestCars\Ext\Vardefs\tp_testowner_tp_testcars_TP_TestCars.php

$dictionary["TP_TestCars"]["fields"]["tp_testowner_tp_testcarstp_testowner_ida"] = array (
 'name' => 'tp_testowner_tp_testcarstp_testowner_ida',
 'type' => 'link',
 'relationship' => 'tp_testowner_tp_testcars',
 'source' => 'non-db',
 'reportable' => false,
 'side' => 'right',
 'vname' => 'LBL_TP_TESTOWNER_TP_TESTCARS_FROM_TP_TESTCARS_TITLE',

I have found that I can stop this from displaying in the Module Tree by looking out for these references in function processTreeData(relData, node) { of AOR_Report_before.js.

var text_end = modulePath.substring(modulePath.length - 4, modulePath.length);
if (text_end != "_ida" && text_end != "_idb") {
    var newNode = {
        id: field,
        label: relData[field].module_label,
        load_on_demand: true,
        type: relData[field].type,
        module: relData[field].module,
        module_path: modulePath,
        module_path_display: modulePathDisplay,
    };
    treeData.push(newNode);
}