Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCHR-3624: Remove warnings on Custom entity edit #17

Merged
merged 1 commit into from
Apr 30, 2018

Conversation

mickadoo
Copy link

Included in CiviCRM 5.2.0
Core PR: civicrm#12033

Overview

Trying to update a custom group or field worked, but it produced warnings about missing indices. This PR fixes those warnings.

Before

Updating an existing CustomGroup or CustomField would work, but produce warnings. This caused some PHPUnit tests to fail if they were updating a CustomGroup or CustomField.

For example:

$params = ['id' => 1, 'is_active' => 0];
civicrm_api3('CustomField', 'create', $params);

Will produce a warning (from a test I wrote for this):

Failure in api call for CustomGroup create:  Undefined index: extends
#0 /repos/civicrm-core/CRM/Core/BAO/CustomGroup.php(64): PHPUnit_Util_ErrorHandler::handleError(8, 'Undefined index...', '/repos/civicrm-...', 64, Array)

After

No warnings are produced.

After

I did some minor cleanup, replacing some arrays with variables and trying to shorten lines. I also deleted one unused variable, $tableName

Copy link
Member

@davialexandre davialexandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mickadoo Approved 👍 Please merge it using the "Rebase and merge" so that it doesn't create a new merge commit

@mickadoo mickadoo merged commit 417fdc6 into 4.7.27-patches Apr 30, 2018
@mickadoo mickadoo deleted the PCHR-3624-fix-warnings branch April 30, 2018 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants