Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Invalid JSON response while retrieving current user #174

Closed
honzabilek4 opened this issue Jun 7, 2018 · 4 comments
Closed

Invalid JSON response while retrieving current user #174

honzabilek4 opened this issue Jun 7, 2018 · 4 comments
Labels
bug Something isn't working

Comments

@honzabilek4
Copy link

honzabilek4 commented Jun 7, 2018

Calling the /_/users/me endpoint gives me the following response, which is an invalid JSON and cannot be parsed. There's some html warning being appended to the end.
It's probably going to be another MariaDB specific behaviour, but this shouldn't be happening normally🤔.
Let me know if you need anything else.

{
    "data": {
        "id": 1,
        "status": 1,
        "first_name": "Admin",
        "last_name": "User",
        "email": "admin@example.com",
        "email_notifications": true,
        "avatar": null,
        "company": null,
        "title": null,
        "locale": "en-US",
        "locale_options": null,
        "timezone": "America\/New_York",
        "last_ip": "24.61.58.0",
        "last_login": null,
        "last_access": "2018-05-25T22:59:28+00:00",
        "last_page": "\/collections\/members",
        "token": "demo",
        "invite_token": "",
        "invite_accepted": false
    }
}<br />
<b>Warning</b>:  count(): Parameter must be an array or an object that implements Countable in <b>/Users/janbilek/Projects/directus-api/src/core/Directus/Database/TableGateway/RelationalTableGateway.php</b> on line <b>1022</b><br />

screen shot 2018-06-07 at 19 50 41

System information:
OS: Mac OS 10.13.4
PHP: 7.2.6
DB: MariaDB 10.2.9. (InnoDB)
SQL Mode: STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION

@rijkvanzanten
Copy link
Member

@wellingguzman Warnings like these should never ever be added to the output, is that something we can disable globally in the API, or is it solely a server setting?

@rijkvanzanten rijkvanzanten added the bug Something isn't working label Jun 11, 2018
@rijkvanzanten
Copy link
Member

@wellingguzman I'm getting a notice on the live demo API in production mode. This needs to go away completely, as it's causing failures in the application.

@rijkvanzanten rijkvanzanten reopened this Jun 14, 2018
@rijkvanzanten
Copy link
Member

This time on PATCH to /fields/members/last_name

{"data":{"id":146,"collection":"members","field":"last_name","type":"VARCHAR","interface":"text-input","options":null,"locked":"0","translation":null,"readonly":"0","required":"0","sort":null,"note":"The user's last name!","hidden_input":"0","hidden_list":"0","view_width":4,"group":null}}<br />
<b>Notice</b>:  Undefined index: column in <b>/var/www/api/vendor/zendframework/zend-db/src/Sql/AbstractSql.php</b> on line <b>419</b><br />

@rijkvanzanten
Copy link
Member

☝️ This particular one is caused by sending an empty object as value for translation

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants