-
-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't change RTL post direction back to LTR #103
Comments
You could resolve this in either ways:
A couple of useful resources: |
Well, now I'm even more interested, and I must be reading something wrong. Going through
And in
The ("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. SQL's boolean values are "truthy", like Javascript's. 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):
|
Okay, I'll look into how you've done it in account.go and see if I can put this together. |
Previously, once RTL was enabled on a post, you couldn't unset it via the web application. This fixes that. (Fixes #103)
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. |
Originally reported on discuss.write.as:
The text was updated successfully, but these errors were encountered: