You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The former had this function to implement the action:
function civicrm_api3_job_PruneActionLog($params)
I then filled in the implementation.
On installing the module, the API explorer listed the new action pruneactionlog for entity Job. However on trying to run this, I got:
[error_code] => not-found
[entity] => Job
[action] => pruneactionlog
[is_error] => 1
[error_message] => API (Job, pruneactionlog) does not exist (join the API team and implement it!)
To get I working, I changed the function name to:
function civicrm_api3_job_prune_action_log($params)
API Explorer then showed action prune_action_log for entity Job and this runs successfully.
All lowercase without underscores, i.e. civicrm_api3_job_pruneactionlog, did not work. This SE answer suggests that the issue occurs on Linux but not Mac OS X and that changing the filename to first letter caps only also works. It suggests a core commit that may have brought about the change in behaviour.
So it looks as though the code that civix generates is not in line with what Civi now expects, at least on Linux.
I used civix to generate boilerplate code for an API action in a module extension as follows:
civix generate:api --schedule=Daily Job PruneActionLog
This generated these files (paths redacted):
The former had this function to implement the action:
I then filled in the implementation.
On installing the module, the API explorer listed the new action pruneactionlog for entity Job. However on trying to run this, I got:
To get I working, I changed the function name to:
API Explorer then showed action prune_action_log for entity Job and this runs successfully.
All lowercase without underscores, i.e. civicrm_api3_job_pruneactionlog, did not work. This SE answer suggests that the issue occurs on Linux but not Mac OS X and that changing the filename to first letter caps only also works. It suggests a core commit that may have brought about the change in behaviour.
So it looks as though the code that civix generates is not in line with what Civi now expects, at least on Linux.
Civix version: v16.10.1-1-gdaaa8a0
CiviCRM version: 4.6.21
The text was updated successfully, but these errors were encountered: