Bug Fixes

Providing a Bug Fix

  • To provide a code contribution for an issue you will need to set up your own fork of the SuiteCRM repository, make your code changes, commit the changes and make a Pull Request to the appropriate branch on the SuiteCM repository. See our Quick Guide to Fork SuiteCRM. Once you have set up your forked repository you can begin making commits to the project.

  • When creating a PR to SuiteCRM, you should always direct it to the hotfix branch.

  • When creating a PR to SuiteCRM 8 you should also direct it to the hotfix branch.

The hotfix branch will then be merged into develop which, in turn, will be merged into master.

graph TD; Bugfix{Bugfix}-->|Your PR|hotfix; hotfix-->|Merged Into|7.12.x hotfix-->|Merged Into|develop; develop-->|Merged Into| master;
  • Separate each issue fix into a new branch in your repository and name it with the issue ID e.g. bugfix_3062 or issue-1234.

    e.g. to create the branch from hotfix with the following git command:

    git checkout -b bugfix_3062 upstream/hotfix

    e.g. for SuiteCRM 8 this would also be:

    git checkout -b bugfix_3062 upstream/hotfix

  • When committing to your individual bugfix branch, it helps to follow the message format below:

    Fix #1234 - <the subject of the issue>

    e.g of a commit command

    git commit -m "Fix #1436 - Reports with nested Parentheses are removing parameters"

    This commit message format allows us to easily include all bug fixes within major and minor Release notes.

    If you are new to Writing Commit Messages in git follow the guide here.

  • When pushing a branch that has been created from an upstream branch to your remote fork, you will need to specify "origin", e.g.

    git push origin bugfix_3062

Changing your Pull Request from 7.10.x to hotfix

As of the 31st January 2022 extended support for 7.10.x has ended. However, that does not mean that the Pull Request you created to fix a specific issue or to add a feature is not still applicable!

If the issue you face is still present in 7.12.x but your Pull Request is for 7.10.x there are some steps below showing how you can point your Pull Request towards the hotfix branch.

  1. Checkout your branch that has the intended fix. git checkout <your-branch>

  2. Get the hash for the first commit you made from the branch then work your way through until the most recent via: git log -1 --format=format:"%H"

    When using the command above, in order to get the hashes from all commits you have made to the branch, you must change the number 1 to how many commits you have made.

  3. Checkout the hotfix branch. git checkout hotfix

  4. Checkout a new branch that you will then update the PR to. git checkout -b <new-branch>

  5. Cherry-pick your commits across. git cherry-pick commit1 commit2

    commit1 will be replaced with the hash’s from your commits.

When pushing up a new branch with the same changes as a previous PR made, please reference the newly created Pull Request in the old Pull Request and then close.

However, if you feel comfortable with git, and you are able to then you can re-push to the same branch and change the base branch on the PR to hotfix providing you have rebased.

Make a Bug Fix Pull Request

  • After you have made your commits and pushed them up to your forked repository you then create a Pull Request to be reviewed and merged into the SuiteCRM repository. Make a new Pull Request for each issue you fix – do not combine multiple bugfixes into one Pull Request.

  • Ensure that in your Pull Request that the base fork is salesagility/SuiteCRM and base branch is hotfix. For SuiteCRM 8 ensure that the base fork is salesagility/SuiteCRM-Core and the base branch is hotfix. with the head fork being your repository and a base branch of your unique bugfix branch e.g. bugfix_1234

  • We will automatically reject any Pull Requests made to the wrong branch!

CLA Check

If you have not signed our CLA (Contributor License Agreement) then your Pull Request will fail a check and won’t be able to be merged into the project. You will only be required to sign this once.

Travis CI

When a new Pull Request is opened, Travis CI will test the merging of the origin and upstream branch and update the Pull Request. If this check fails you can review the test results and resolve accordingly. To test prior to making a Pull Request install PHPUnit via composer into your develop environment then cd into the tests directory and run:

sh runtests.sh

Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.