inkdropapp / inkdrop-alfred-workflow

A simple Alfred workflow for Inkdrop
MIT License
8 stars 2 forks source link

JSON error #1

Closed picklecillo closed 3 years ago

picklecillo commented 3 years ago

After setting up the local server and credentials, i'm not finding any notes. Through the debugger, this was logged.

...
[01:26:12.965] ERROR: Inkdrop[Script Filter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON:
Warning: Invalid argument supplied for foreach() in /Users/me/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.F742D332-1908-4C42-8946-9B3FB6808D20/search.php on line 25
<?xml version="1.0"?>
<items><item uid="inkdrop" arg="gcp" valid="yes"><arg>gcp</arg><title>No notes found</title><subtitle>No notes found. Search Inkdrop for gcp</subtitle><icon>icon.png</icon></item></items>

Is it just me? 😬

craftzdog commented 3 years ago

That means it looks that you misconfigured the workflow. You can see the access log by running Inkdrop from terminal.

picklecillo commented 3 years ago

Ok. Tried running from command line. Did not get any access logs from the Alfred query, while a simple curl 127.0.0.1:19840/ did generate a xxx GET / 401 1ms - log. From this I would guess Alfred is not even getting to the querying the db part. Anywhere else I could look?

craftzdog commented 3 years ago

Yeah, looks like so. As you can see, the workflow is just a couple of PHP scripts. You can tweak https://github.com/inkdropapp/inkdrop-alfred-workflow/blob/main/src/search.php to output variables with print_r and var_dump, then toggle Alfred's debug mode by clicking the spider button.

picklecillo commented 3 years ago

I've just left a PR with the solution I've found for this -> https://github.com/inkdropapp/inkdrop-alfred-workflow/pull/2

craftzdog commented 3 years ago

Great! I'll roll it out.

craftzdog commented 3 years ago

Landed in v0.1.1🎉 Thanks!