• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

API Source as URL not processing

Status
Not open for further replies.

Baraka

Chevereto Member
Just wanted to report a small issue with the API well its not technically the api but i was just testing the api and noticed when doing a URL upload i.e : http://mysite.com/api/1/upload/?key...ttps://www.google.com/images/srpr/logo11w.png

it would output


{"status_code":400,"error":{"message":"SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'image_nsfw' cannot be null","code":400,"context":"CHV\\ImageException"},"status_txt":"Bad Request"}

So i had a look at the CHV\Image class towards ::uploadToWebsite and noticed on line 542 via $params['nsfw'] its just set as that so it can't be NULL as in the table's structure its looking for a int() or in this case a tinyint so what i did to fix it was used a ternary operator; changed

$params['nsfw'] to :

PHP:
($params['nsfw']) ? $params['nsfw'] : 0

and all is good now and i am not sure if its the same if the source is a normal file uploaded in a form as i haven't tested it but yeah
 
Status
Not open for further replies.
Back
Top