api-library icon indicating copy to clipboard operation
api-library copied to clipboard

Error 500 on listing ContactFields with a filter

Open MikeDaniel18 opened this issue 6 years ago • 0 comments

Where

On the API, when accessing as a system admin user. End point is contactFields List.

Mautic version is 2.15.1

Installation using Docker

Expected

Currently, despite the docs having no information on how to use filters (this needs to be remedied) I've seen in tests that filters follow the format $search = "id:45"; or $search = "alias:myalias";.

Using them would make the code look like this:

$fieldsApi = $this->api->newApi("contactFields", $this->auth, $this->api_url);
$search = "id:45";
$response = $fieldsApi->getList($search);

Using this on a Contact Field List function should return Fields filtered to ID 45.

Actual

API returns a 500 error. Error log in Mautic is as follows:

[2019-07-20 15:15:19] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function trans() on null" at /var/www/html/app/bundles/CoreBundle/Entity/CommonRepository.php line 1727 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function trans() on null at /var/www/html/app/bundles/CoreBundle/Entity/CommonRepository.php:1727)"} []

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

MikeDaniel18 avatar Jul 20 '19 15:07 MikeDaniel18