As of the 4.7.x branch, API Basic Get ignores entity definitions.
EG: When the array key used in defining an entity field, doesn't match the column name. AFter discussion with Coleman, he decided that it was not a core bug, and that flexibility would not be added to API Basic Get to support using the array key vs the column name.
As far as I can tell, the only place we are using this is in VolunteerNeed with ProjectId. the column name is project_id where the array key is volunteer_need_project_id. We refer to this column in other places as "volunteer_need_project_id" instead of project_id and in 4.7 that causes api's related to needs to break.
We need to replace all instances of "volunteer_need_project_id", including computed values, to "project_id" and probably add an api alias in the need functions to support other scripts that still use the old name.
Original Core Issue: https://issues.civicrm.org/jira/browse/CRM-18295
The VolunteerNeed.get API doesn't recognize the project_id field/parameter. Failures manifest to end users as follows:
- On 4.7, if you create two projects with one opportunity each, both opportunities will display in the "Define" UI for either project as well as either project's "Assign" screen.
- On 4.7, if you create two projects with one opportunity each, then go to the Volunteer Opportunity Search screen:
- Initially, nothing will load
- If you click Search, you will get an error: