Permission inconsistency and others


(Tempest) #1

So in categories.json the permission value for every section is always null.

{
  "id": 1,
  "name": "bug",
  "color": "e9dd00",
  "text_color": "000000",
  "slug": "bug",
  ...
  "permission": null
}

However in the JSON stored in the HTML the values are correct.

{
  "id": 1,
  "name": "bug",
  "color": "e9dd00",
  "text_color": "000000",
  "slug": "bug",
  ...
  "permission": 1
}

Also what is can_create_topic supposed to represent? I noticed it’s value is always true when I access a category’s JSON eg. I loaded category/blog.json and I can’t post under there but the value is still true.

  "topic_list": {
    "can_create_topic": true,
    ...
  }

The draft system doesn’t seem to be working(at least not for topics). Upon refreshing this page my draft wasn’t loaded into the composer.

I noticed under the networks tab in Chrome there was a POST request to draft.json containing my post title and contents.

This (below) also showed up when I accessed categories.json however when I refresh the page the draft is not loaded into the composer. The draft is also still there (in categories.json) when I refresh the page.

"draft": "{\"reply\":\"So in <code>categories.json</code> the <code>permission</code> value for every section is always null.\\n\\n    {\\n      \\\"id\\\": 1,\\n      \\\"name\\\": \\\"bug\\\",\\n      \\\"color\\\": \\\"e9dd00\\\",\\n      \\\"text_color\\\": \\\"000000\\\",\\n      \\\"slug\\\": \\\"bug\\\",\\n      ...\\n      \\\"permission\\\": null\\n    }\\n\\nHowever in the JSON stored in the HTML the value is 1.\\n\\n    {\\n      \\\"id\\\": 1,\\n      \\\"name\\\": \\\"bug\\\",\\n      \\\"color\\\": \\\"e9dd00\\\",\\n      \\\"text_color\\\": \\\"000000\\\",\\n      \\\"slug\\\": \\\"bug\\\",\\n      ...\\n      \\\"permission\\\": 1\\n    }\",\"action\":\"createTopic\",\"title\":\"Permission inconsistancy\",\"archetypeId\":\"regular\",\"metaData\":null}",
"draft_key": "new_topic",

There weren’t any errors under the console when I opened the composer or loaded the forum.

Weird thing is I tried the draft system on another Discourse forum and it worked fine there. I noticed on that forum the composer pops out with the draft but here the composer doesn’t do that.

Thanks


Permission value bugged in categories.json
(Jeff Atwood) #2

Note that we don’t save topic drafts until the length of the new topic body is sufficient to warrant saving.

However, I tested on http://try.discourse.org and you might be right.

  1. Created a new user
  2. Created a new topic with long enough title and body
  3. Navigated to different topics, topic draft still present at bottom of browser
  4. Minimize topic draft via down chevron icon, topic draft still present at bottom of browser.
  5. Navigate to google.com in browser, click back button… topic draft gone, no way to get it back.

so TL;DR topic drafts are saved as long as you are on the forum itself somewhere, but once you visit another website, the topic draft is lost?

@sam this does not seem correct, is it a regression? edit: I confirmed that this also happens for reply drafts, too!

At the very least clicking or tapping “create topic” should IMO bring back your last unsubmitted topic draft that you did not explicitly cancel.

I don’t like that users can lose their work in creating topics.


(Sam Saffron) #3

definite severe regression, looking at it now.


(Sam Saffron) #4

Fixed now:


(Jeff Atwood) #5