Join GitHub today
Can't change RTL post direction back to LTR #103
Originally reported on discuss.write.as:
You could resolve this in either ways:
A couple of useful resources:
referenced this issue
May 17, 2019
Well, now I'm even more interested, and I must be reading something wrong.
("on" is the default value for an unvalued, checked checkbox in HTML. You can test this in the web console by opening the "Edit Metadata" page and logging
In either case,
Instead it's coming back as
In the meantime, a first step is to edit
Stream-of-consciousness comments, sorry for the spam emails if I forget myself and hit Ctrl-Enter.
In my database (Sqlite 3), which is quite small at the moment,
Note that Sqlite uses dynamic typing, not strict, so
So I changed it to a 0 - and my post returned to LTR.
So what if, when we're posting the value, what we're submitting gets coerced into an integer - since by my reading we're not actually submitting a boolean value, we're submitting JSON that has a boolean value encoded in it - and then, when our database code asks for the boolean value back, SQL is saying "uh sure, that integer looks True to me"?
I'm gonna fiddle with this some more.
Okay, the integer value was a red herring - as noted elsewhere, that's how MySQL and Sqlite store boolean values. But I've done some additional digging, and this time I suspect I have the answer.
In posts.go on line 611 - and this is not the only time this happens, but I think it's the salient time this happens - we use
In my mind, the answer is to check
Also in my mind, because this change is being made to the API and should support multiple clients, the best tactic is:
but another tactic, keeping the current web interface in mind, is:
Is modifying PostForm the preferred approach? And if so, which tactic should we use?
And, in addition, should we update the web client to use a radio button or dropdown, to address the bug from both ends?
Modifying PostForm isn't the right approach, because then we have to duplicate effort for parsing JSON (note that both operations parse data into the
We should follow something similar to what we do with signups, shown in account.go (note: untested code):
Alright, feel free to study it, but I went ahead and implemented the fix in #110, as I didn't want you spinning your wheels on this particular task. If anything's unclear about how that fixes this, please feel free to ask and I'll be happy to explain.
Otherwise if we can, on Monday let's chat about a similarly small task you can start tackling.