GithubHelp home page GithubHelp logo

sugarrepairsmodule's Introduction

Sugar Repairs Module

Build Status Minimum PHP Version

This module is designed to help assist with repairing common issues in a Sugar instance. You should always test the repairs against a cloned enviroment before executing on a production instance. This tool is to be used at your own risk.

Usage

This repo is a module loadable package that can be installed to Sugar through the module loader. Once installed repairs can only be run from the command line. By default, all repairs are run in test mode. Test mode will not make any changes to your system and only output information on changes that will be made. To turn off test mode you will need to pass --test false to the cli command.

When testing mode is off, the repair actions will backup any modified tables to <table name>_srm_<timestamp>. Any files modified or created will have their contents store in a record under the Sugar Repairs module that you can access through the UI. All log messages will be output to your terminal window as well as stored in the Sugar log file. Any items noted as [Sugar Repairs][<cycle>][<action>][Change] are information about file rewrites and database updates. Any items noted as [Sugar Repairs][<cycle>][<action>][Action] will require a manual change to correct from a developer or administrator of the system.

Things to note

  • It is highly recommended to remove the Sugar Repairs module before upgrading.
  • This package can not be installed to the Sugar On-Demand envrionment by customers as it will not pass package scanner and you will not have direct access to the command line. If you are experiencing an issue with your instance, please open a support ticket.

Building Installer Package

To build the installer package, you will need to download the contents on this repository and execute:

php build.php

Once completed, the installer .zip package will be located under ./builds/.

Running Repairs

Repairs will need to be run differently based on your environment and can only be executed from the command line.

For Local & On-Demand ION

For local instances and ION, you will need to change to the supp_SugarRepairs directory and run the cli.php directly.

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair <action>

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair <action> --test false

For On-Demand Mothership

For mothership, you will need to change to the instances directory and run shadow-shell:

Testing Command

$options = array('repair' => '<action>');require_once("./modules/supp_SugarRepairs/cli.php");

Execute Command

$options = array('repair' => '<action>', 'test' => false);require_once("./modules/supp_SugarRepairs/cli.php");

πŸ”§ Language Repairs

Corrects common language file issues. The various issues addressed are shown below:

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair lang

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair lang --test false

Issues Addressed

$app_list_strings['moduleList'] = array(
    'module1' => 'Module 1'
    'module2' => 'Module 2'
);

is converted to:

$app_list_strings['moduleList']['module1'] = 'Module 1';
$app_list_strings['moduleList']['module2'] = 'Module 2';
  • Flags Errors If a flag is thrown, manual intervention will be required. Scenarios that can throw flags are listed below:
  1. All language files are tested for syntax errors and are flagged if they don’t pass.
  2. Any custom logic hook that contains a modified language key will flagged for manual change.
  • Custom Vardef Files are Updated

    • If there is a custom vardef that defines a default value for a field that contains a key that needs to be changed then the VarDef file is updated.
  • Other custom PHP files

    • If a file contains a string of characters that matches a key that needs to be changed it will be flagged for possible Manual updating in the log.
  • Updates the database keys for enum/multienum fields when a correction is made.

  • Runs the vardef repair.

  • Runs the workflow repair.

  • Runs the report repair.

  • Runs the process author repairs

: wrench: Team Set Repairs

Corrects common issues with team sets.

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair team

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair team --test false

Issues Addressed

  • Duplicate teams in a team set

    • Removes any duplicate team relationships to a team set.
  • Incorrect team counts on team sets

    • Correct any team sets with invalid team counts and relationships.

πŸ”§ Workflow Repairs

Corrects common issues with workflows.

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair workflow

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair workflow --test false

Issues Addressed

  • Workflows with invalid fields
    • Disables any workflows with missing or invalid fields.

πŸ”§ Process Author Repairs

Corrects common issues with Process Author Definitions.

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair processAuthor

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair processAuthor --test false

Issues Addressed

  • Event Criteria with invalid fields.
    • Disables any Process Author Definition with criteria referencing missing or invalid fields.
    • Works on Start, Wait, and Receive Message events.
  • Activities and Actions with invalid fields.
    • Disables any Process Author Definition with an activity or action referencing missing or invalid fields.

πŸ”§ Vardef Repairs

Corrects common issues with vardefs.

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair vardef

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair vardef --test false

Issues Addressed

  • Enum/Multienum fields with invalid default values.

    • Attempts to find a valid default value key. If no value is found, field is left alone.
  • Enum/Multienum fields with invalid visibility gird.

    • Attempts to find a valid key. If no key is found, the grid is removed.

πŸ”§ Report Repairs

Corrects common issues with reports.

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair reports

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair reports --test false

Issues Addressed

  • If a report is using a deleted field, it will be marked as broken.
  • If a field has a corrected language key, it will be updated.
  • If a report is using an invalid language key, it will be marked as broken,
  • If a report has a legacy Team Set definition (Bug 72483) in 7.x, it is converted to proper definition.

πŸ”§ Email Address Repairs

Corrects common issues with Email Addresses.

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair emailAddresses

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair emailAddresses --test false

Issues Addressed

  • Bug 75588 - Any Bean that has at least one email address, and no primary designation will get the oldest email address updated to be the primary.
  • Bug 77929 - Opting out from a campaigns does not update opt out email address.

πŸ”§ Forecast Worksheet Repairs

Corrects common issues with Forecast Worksheets by rolling through the user "reports_to" hierarchy and re-commits forecasts in the proper order.

Parameters

  • timeperiod_id -- Required
    • Provide the specific timeperiod id to run the commit on
    • ALL can be passed to run for all timeperiods

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair forecasts --timeperiod_id fd480109-081e-3c71-0941-56f032288e4f

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair forecasts --timeperiod_id fd480109-081e-3c71-0941-56f032288e4f --test false

Issues Addressed

  • Bug 75779 - Forecast worksheets totals are not accurate after making hierarchy changes.

πŸ”§ Metadata Repairs

Corrects common issues with metadata files for Sidecar.

Testing Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair metadata

Execute Command

cd "modules/supp_SugarRepairs/" && php cli.php --repair metadata --test false

Issues Addressed

  • Bug 77005 Modules created in 7.6.x, did not have Buttons definitions in RecordView, after upgrades to 7.7+ these modules would no longer have Change Log button. Places Change Log button, and default button definitions back on Record View if missing.

Contributing

Everyone is welcome to be involved by creating or improving existing Sugar repairs. If you would like to contribute, please make sure to review the [CONTRIBUTOR TERMS](CONTRIBUTOR TERMS.pdf). When you update this README, please check out the contribution guidelines for helpful hints and tips that will make it easier to accept your pull request.

Contributors

Ken Brill

Jerry Clark

Mark Everidge

Anthony Watson

Mike Russell

Licensed under Apache

Β© 2016 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license.

sugarrepairsmodule's People

Contributors

crazytonyi avatar ffeliciano avatar geraldclark avatar kbrill avatar meveridge avatar michaelj2324 avatar mmarum-sugarcrm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.