I’ve been looking into an issue for @crossingthethreshold, who is using my Drafts action for posting to M.b., and I’m a bit stuck and hoping that somebody might be able to help. In the action I present a list of categories to be assigned to a post. However, the categories are no longer showing up for him. I added a logging step to capture the response from the request and it is returning a 202 status code with an Unknown error message.
The properties that I’m using for the request are:
Is there something that I’m doing wrong with the request body or is there something else that we can check, on why the categories are not returning properly?
So, maybe there’s a problem with a category name that contains special characters that break stuff in some cases? For example, I’m just guessing here.
Update: never mind, I just saw that the categories are there. They are just hidden with CSS. Hmm.
Can you share the actual HTTP request and response that happened, @donnydavis? I.e., not the JavaScript code, but the HTTP communication that goes over the network.
Previously he said that one of the categories had a hyphen in it. I have not been able to actually add a category with that, and he has since removed that, but it still breaks. So far, this is the only issue like this that has been reported to me. I have not been able to reproduce it myself.
Just to add that I also use this Drafts action to post to Micro.blog and it successfully lists categories. It has done for years, and also makes use of a script. Just sharing in case this is of any help in debugging the problem. @donnydavis
That other script does not make use of mp-destination and instead relies on the currently selected blog in the Micro.blog web interface. So, maybe something is up there? It could be interesting to modify your script to also skip mp-destination, @donnydavis, and see what happens.
@crossingthethreshold I pushed an update, to the test action, to try and log a little more data from the response. Can you try that and share the response data in our forum thread?
After you get the response from that I’ll make another change to remove the mp-destination, as @sod suggested.
Sorry, I should have mentioned that you don’t actually have to post anything. You can cancel out after you select the blog and it loads the screen with the categories.
I went ahead and removed the mp-destination from the request as @sod had suggested. This will force the script to request the categories from the blog that is selected on the website and not the one that you select at the beginning of my the Drafts action. After updating the action, you can verify the update by going in to edit the action. Under the first script step, at line 124, you should only see one parameter for "q": "category", there should be no `mp-destination’ at this point.
If that works, one other thing that I wanted to see if you could check. In the website, which blog do you have selected? If you go under Posts, then you can see it at the top. This will probably only be relevant if you have the test blog enabled.
I checked the first script and line 124 is as you say.
Just to say that mp-destination is mentioned in line 125: mp-destination: this.post.selectedDomain
I deleted the action, quit Drafts, started it up again, installed the updated action, ran it against a blank draft, and cancelled it at that point…and same again. Same Log.