What are the files in Sugar 11 that are called orderMapping.php?

& -

Sugar 11 has added a bunch of new files in the custom directory with the name orderMapping.php. Can you explain what these files are used for? Do they get rebuilt via QRR? 

They causing havoc with Source Code Control.

Example custom/Extension/modules/Opportunities/Ext/LogicHooks/orderMapping.php

<?php
// created: 2021-03-26 10:56:52
$extensionOrderMap = array (
  'modules/Opportunities/Ext/LogicHooks/DeleteOpportunity.php' =>
  array (
    'md5' => '38db1da780d6b18f38b7cb5472758c17',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
  'modules/Opportunities/Ext/LogicHooks/FixWorksheetAccountAssignment.php' =>
  array (
    'md5' => '9aa1f6f0d6be9066c4f142f9af8db4ea',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
  'modules/Opportunities/Ext/LogicHooks/GenerateRenewalOpportunity.php' =>
  array (
    'md5' => '207fa6307d110a83eba589f7ed82082d',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
  'modules/Opportunities/Ext/LogicHooks/OpportunitySalesStatus.php' =>
  array (
    'md5' => 'c35c3364902925e5a15e2cc82e38062e',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
  'modules/Opportunities/Ext/LogicHooks/OpportunitySyncWorksheet.php' =>
  array (
    'md5' => '97276a801d4a0c4d0b40e0dca02a6ca4',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
  'modules/Opportunities/Ext/LogicHooks/QueuePurchaseGeneration.php' =>
  array (
    'md5' => 'de3fe02382aacc28473b01b831b74814',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
  'modules/Opportunities/Ext/LogicHooks/SetCommitStageForClosedWon.php' =>
  array (
    'md5' => 'bf9f44d5d332a045ceeddb7c2557ed14',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
  'modules/Opportunities/Ext/LogicHooks/SetForecastCommitStage.php' =>
  array (
    'md5' => '5c1669e98c87c034c284be74b061e5bf',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
  'modules/Opportunities/Ext/LogicHooks/SyncBestWorstWithLikely.php' =>
  array (
    'md5' => 'cff052a0a6215992ef2e9004f9983c36',
    'mtime' => 1612792956,
    'is_override' => false,
  ),
);

Parents
  • The explanation on the page https://sugarclub.sugarcrm.com/dev-club/w/dev-tutorials/414/sugar-11-0-q2-2021-customization-guide; is unclear. Can you please provide full details? It appears that the files are only referenced in the ModuleInstall/ModuleInstaller.php

  • ,

    This functionality was developed as part of a bug fix for #72177. In some conditions (especially when conflicting customisations were developed) there was the risk that the merging order of files might change when an instance's file system is copied/moved, depending on the type of file system used.

    These new files store the order of the first time the customisation file is found (and should not be messed with), so that going forward, the customisations are merged in the order on which are first encountered, independently from the file timestamp.

    My take is that you should version those files, so that your system's merging consistency is kept intact

    Cheers

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

  •  the bug you have identified, https://portal.sugarondemand.com/#supp_Bugs/6875dd3f-76c8-f5da-9329-54c0a5568bf1, was flagged in 2015. The issue with the order has been in place since 2004 (founding of SugarCRM). Adding orderMapping should have been a major discussion at both the PRB (Product Review Board) and the Developers webinar!

    The general workflow would be to build customization in dev. The orderMapping would then be updated in dev. The new orderMapping is now in conflict with both UAT and PROD. 

    What is your advice on the development workflow with this new file? When we build a package, what is your advice for including the orderMapping file? Does the Module Loader flag this file and remove it? Does Module Loader indicate that there could be a conflict? Does uninstalling a package via Module Loader remove this file, update the file?

  • ,

    These are auto-generated files which you should not modify manually nor include into module loadable packages in any way.

    I am a little confused on why you would have conflicts. Are you mixing the full versioning of your code base with Studio/Module Loadable Packages changes by any chance? Or how are you working today?

    As you would understand there are two approaches based on Module Loadable Packages (cloud or on-site) and full system versioning (on-site).

    These are the approaches I see going forward:

    • Sugar Cloud: you should not worry about their existence, they are there to help the system have a fixed order of merging that will not change. New files added, will be merged last. Never include those files into Module Loadable Packages, modify them, nor delete them
    • On site: you should version them as part of your code tree as those files will evolve automatically (if today your approach is to version the full code or even just the custom directory). These files should not be modified or deleted manually. If instead your approach is to just use Module Loadable Packages, you would follow the same approach as Sugar Cloud above

    When copying/promoting an instance (eg: from Dev to UAT), you should copy those files as any other file across, and not modify them manually in any way.

    They are really a system's reference point on when a file was first seen/merged, so that the order of merge is consistent. They are not supposed to be changed manually.

    Hope that answers your questions

    --

    Enrico Simonetti

    Sugar veteran (from 2007)

    www.naonis.tech


    Feel free to reach out for consulting regarding:

    • API Integration and Automation Services
    • Sugar Architecture
    • Sugar Performance Optimisation
    • Sugar Consulting, Best Practices and Technical Training
    • AWS and Sugar Technical Help
    • CTO-as-a-service
    • Solutions-as-a-service
    • and more!

    All active SugarCRM certifications

    Actively working remotely with customers based in APAC and in the United States

  • I have to agree here with Jeff why wasn't this discussed in great detail other then just a blogpost? We for instance make a release that contains ALL the customisations of a specific instance and we will install that big release whenever we do a project. Now that I know that I need to exclude these files from the release I will to so but why are these files in the custom directory in the first place? Shouldn't these be in the database or somewhere else but certainly not in my opinion, in the custom directory which is a place for partners to play around in. 

    What happens if we do a release and install the version that we have locally over the those on the cloud? 

  • there is a HUGE issue. Every time a QRR is done. the orderMapping.php files are updated. The date at the top is updated. If there are no changes in the orderMapping.php the files should not be updated. 

    I have conflicts all over the place.

    local dev

    client dev

    client uat

    client production

    I have no idea which files are correct or incorrect. There are a few thousand orderMapping.php files that are updated with each QRR. 

    When doing a QRR; the date should not be part of the file. Can you remove the date? Then only if the data in the files change would the files be different!!!!

Reply
  • there is a HUGE issue. Every time a QRR is done. the orderMapping.php files are updated. The date at the top is updated. If there are no changes in the orderMapping.php the files should not be updated. 

    I have conflicts all over the place.

    local dev

    client dev

    client uat

    client production

    I have no idea which files are correct or incorrect. There are a few thousand orderMapping.php files that are updated with each QRR. 

    When doing a QRR; the date should not be part of the file. Can you remove the date? Then only if the data in the files change would the files be different!!!!

Children