Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • CiviCRM Core CiviCRM Core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,460
    • Issues 1,460
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • CiviCRM CoreCiviCRM Core
  • Issues
  • #81
Closed
Open
Created Apr 26, 2018 by michael@michael

Warnings from CustomGroup and CustomField create functions

Both CustomGroup and CustomField seem to treat create as a method only for creating new entities. Although updates do work, a few places in the code expect that you have included some value in the params that you don't intend to update.

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)

https://github.com/civicrm/civicrm-core/pull/12033/files

Edited Apr 30, 2018 by michael
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking