API call to resource by id returns an error

Affected version
2.1.3

sub_ubi

Active member
a call to api/resources/{id} returns the following error,
Code:
{
    "errors": [
        {
            "code": "server_error_occurred",
            "message": "A server error occurred during the API request. Please try again later.",
            "params": []
        }
    ],
    "exception": {
        "type": "Error",
        "message": "Cannot use object of type stdClass as array",
        "file": "src/addons/XFRM/Entity/ResourceItem.php",
        "line": 1360,
        "trace": [
            "XFRM\Entity\ResourceItem->setupApiResultData() - src/XF/Mvc/Entity/Entity.php on line 518",
            "XF\Mvc\Entity\Entity->toApiResult() - src/addons/XFRM/Api/Controller/ResourceItem.php on line 21",
            "XFRM\Api\Controller\ResourceItem->actionGet() - src/XF/Mvc/Dispatcher.php on line 321",
            "XF\Mvc\Dispatcher->dispatchClass() - src/XF/Api/Mvc/Dispatcher.php on line 31",
            "XF\Api\Mvc\Dispatcher->dispatchFromMatch() - src/XF/Mvc/Dispatcher.php on line 100",
            "XF\Mvc\Dispatcher->dispatchLoop() - src/XF/Mvc/Dispatcher.php on line 50",
            "XF\Mvc\Dispatcher->run() - src/XF/App.php on line 2177",
            "XF\App->run() - src/XF.php on line 390",
            "XF::runApp() - index.php on line 16"
        ]
    }
}
 

kick

Active member
@Chris D, I confirm such an error exists, as well as when creating a resource by API.
api/resources
1565682391159.png
Error:
JSON:
{
    "errors": [
        {
            "code": "server_error_occurred",
            "message": "A server error occurred during the API request. Please try again later.",
            "params": []
        }
    ],
    "exception": {
        "type": "Error",
        "message": "Cannot use object of type stdClass as array",
        "file": "src\\addons\\XFRM\\Entity\\ResourceItem.php",
        "line": 1360,
        "trace": [
            "XFRM\\Entity\\ResourceItem->setupApiResultData() - src\\XF\\Mvc\\Entity\\Entity.php on line 518",
            "XF\\Mvc\\Entity\\Entity->toApiResult() - src\\addons\\XFRM\\Api\\Controller\\ResourceItems.php on line 83",
            "XFRM\\Api\\Controller\\ResourceItems->actionPost() - src\\XF\\Mvc\\Dispatcher.php on line 321",
            "XF\\Mvc\\Dispatcher->dispatchClass() - src\\XF\\Api\\Mvc\\Dispatcher.php on line 27",
            "XF\\Api\\Mvc\\Dispatcher->dispatchFromMatch() - src\\XF\\Mvc\\Dispatcher.php on line 100",
            "XF\\Mvc\\Dispatcher->dispatchLoop() - src\\XF\\Mvc\\Dispatcher.php on line 50",
            "XF\\Mvc\\Dispatcher->run() - src\\XF\\App.php on line 2178",
            "XF\\App->run() - src\\XF.php on line 390",
            "XF::runApp() - index.php on line 16"
        ]
    }
}
1360 line:
$result->description = $description['message'];
 
Top