ActiveCampaign / activecampaign-api-php

MIT License
115 stars 76 forks source link

Bug with PHP Wrapper - list_field_view - doesn't return any results #75

Closed DanHarrison closed 6 years ago

DanHarrison commented 7 years ago

I found an issue where the list_field_view ('list/field_view') command didn't return any data, and originally thinking it was an API bug, it's actually bug with this wrapper. The issue is purely that parameters are not being passed on to the API due to a small error in the code.

More details here: https://community.activecampaign.com/t/looks-like-a-bug-with-list-field-view-api-call/3243

In List.class.php, here's where $post_data is missing:

function field_view($params) { $request_url = "{$this->url}&api_action=list_field_view&api_output={$this->output}&{$params}"; $response = $this->curl($request_url); return $response; }

And now added, where it works perfectly:

function field_view($params, $post_data) { $request_url = "{$this->url}&api_action=list_field_view&api_output={$this->output}&{$params}"; $response = $this->curl($request_url, $post_data); return $response; }

Sharing in the hope that this fix will get added to the wrapper :)

Thanks Dan

cristiangrama commented 6 years ago

See https://github.com/ActiveCampaign/activecampaign-api-php/issues/82#issuecomment-348665349