Manufacturer Field Set to Incorrect Reference in Domain-Separated EnvironmentsDescriptionThe article describes the following issues: - In a domain-separated environment, the business rule "Canonicalize Manufacturer Company Model" for cmdb_model (and "Canonicalize Manufacturer Company CI" for cmdb_ci) incorrectly sets the manufacturer field to a domain-specific company record instead of the normalized global company record. - Discovery models for a client domain are tagged with a manufacturer from another client domain due to a mismatch between the product's publisher and manufacturer domains in the software publisher table. In Canonicalize Manufacturer Company Model business rule for cmdb_model, the call to SNC.CanonicalName.normalizeCompany() domain for the model is used so if there are N domains in an instance N core company records will be created for that manufacturer. The business rule is setting the manufacturer to the domain specific company record rather than the normalized one. Ideally the global company record is the normalized one. DEF0391490 was fixed to address domain separation but the fix introduced this issue. Current defects cause the Canonicalize Manufacturer Company ModelBR to incorrectly prioritize domain-specific manufacturer over global. This happens due to a previous fix for DEF0391490which altered the logic to be "domain aware". Ex. When you insert a new model into the table, it asks for both a publisher and a product. The product needs to be tied to the company. When creating a new product, it asks for the company that it is under. If "testCorp" in global already has "testProduct", then "testCorp" in Domain A is unable to make a "testProduct". Because of this, when the defect occurs by the user in domainA selecting testCorp for global, and "testProduct", it errors by giving a mismatch. Steps to Reproduce Core Company Not Handled Correctly for Domain Separated Environment: 1. Ensure the following plugins are installed: - com.glide.domain.msp_extensions.installer - com.glide.data_services_canonicalization.client 2. Create a test domain and confirm the global domain exists. 3. For both the global and test domains, create a core_company record with the "manufacturer" flag set to true (the only difference between the records is the domain). 4. Switch to the global domain. 5. As a global user, create a new record in the cmdb_model table, setting the manufacturer field to the test domain record. Ensure the selected record is in the test domain. 6. Insert the record and observe that the manufacturer field incorrectly references the global record instead of the test domain record. WorkaroundCore Company Not Handled Correctly for Domain Separated Environment: Original issue was that the BR's call to normalizeCompany()did not contain a domainparameter, causing it to potentially return entries from different domains Code: id = SNC.CanonicalName.normalizeCompany(companyName, false); Behavior: Search for canonical company across all visible domains, and returns the first match found, which includes the potential of being from a sibling domain After Fix Code: id = SNC.CanonicalName.normalizeCompany(companyName, false, currentDomain); if (gs.nil(id)) { id = SNC.CanonicalName.normalizeCompany(companyName, false); } Behavior: Strictly prioritizes the record in current domain, otherwise search for canonical company across all visible domains Related Problem: PRB1931854