Topic silently failing to be moved to a specific category

(Pierre-Olivier Latour) #1

Using v1.3.0.beta4 +18

This topic is currently in the “Support” category. If I try to move it to the “Feedback” category, it works. However, if I try to move it to the “Documentation” category (from the home page using an admin account), nothing happens on the page. Reloading the page still shows it in the “Support” category.

I see this error in the log:

Uncaught TypeError: Cannot read property 'set' of undefined
Line: 13
Column: 69
Window Location:

How to set a default category for a new topic?
(Pierre-Olivier Latour) #2

Ah well, it looks like after trying several times continuously trying to move it between categories, it is finally in the “Documentation” one. Still would be useful to know what this error is.

(Jeff Atwood) #3

See if you can produce repro steps, otherwise not a fan of topics like this.

(Pierre-Olivier Latour) #4

I understand, but I tried at least 4 times before posting here. Reloading the page and all. Every time it failed to move and there was this error in the log each time as well. So the steps to repro were just: “try to move to topic, observe it doesn’t work”.

I just tried creating a topic again directly in Documentation and no dice: there’s no category tag on it:

Furthermore, there’s a strange error where if the post is too short Discourse reports an error but it also complains about no category being set even though there’s one set:

Creating a topic in another category appears to work.

For context:

  • Creating topics without category is disabled
  • The documentation category is read-only except for admins

(Pierre-Olivier Latour) #5

OK I found what triggers the bug:

  1. Click on create new topic
  2. The default category is “Documentation”, do NOT change it
  3. Fill-in topic and create topic
  4. New topic has no category

To work around:

  1. Click on create new topic
  2. Change the category to anything else then back to “Documentation”
  3. Fill-in topic and create topic
  4. New topic has “Documentation” category

(Pierre-Olivier Latour) #6

And there are no errors reported in the log by the way.

(Jeff Atwood) #7

There is no such thing as a default category in Discourse. Did you rename or otherwise mess with Uncategorized?

(Pierre-Olivier Latour) #8

By default category, I mean the one shown by default in the category menu when you create a new topic. Right now it says “Documentation” if logged-in as an admin and “Select a category…” if logged-in as a regular user.


Regular user:

I only changed these settings as far as I can remember:

(Kane York) #9

That’s the category with the most topics in it.

I have been seeing this on Meta, too. So it’s happening, but I can’t provide steps because I just keep trying until it goes through.

(Pierre-Olivier Latour) #10

I think it’s 100% reproducible on my install, I can grant access if needed.

(Jeff Atwood) #11

@sam you should see if you can repro this using these steps with uncategorized disabled, etc.

(Sam Saffron) #12

I am tired of this site setting it is just causing trouble.

(Mittineague) #13

I don’t know your pain, but from what I’ve seen I’m beginning to think some type of “Error” message might be the preferable way to go

(Pierre-Olivier Latour) #14

I obviously can’t comment on the complexity of the implementation, but for sites that really want to be organized, not letting users create uncategorized topics is really useful. Of course this means not letting people shoot themselves in the foot by offering 25 overlapping categories. With uncategorized allowed, it behaves more like a mailing list, where everything is “dumped” into a single level, than a hierarchical forum. Anyway, I hope this setting is here to stay :smile:

(Pierre-Olivier Latour) #15

In this case, how come when I’m logged as a regular user, it shows “Select a category…” by default vs “Feedback” which is the most popular (see screenshots above)?

Is the heuristic "select by default most popular category unless this category is not writable for the user in which case show “select a category…”?

IMO it makes more sense to always show “Select a category…” and not pick the most popular one. There are as many chances for it to be the wrong one anyway and also user might just not think of changing it, and then the topic is just in the wrong category.

(Jeff Atwood) #16

As I recall, it used to be that uncategorized was kind of treated as a hidden category when disabled, sort of like permissions on a category would, but then staff could still post in it and lost their collective minds at the prospect of any topic ever possibly being allowed to not have a “proper” category, even from a mod or admin.

It seems to me the underlying problem is that this behavior (NEVER show this category to any user, even if they are mod, admin, or Jesus Himself) can’t be captured in the permission system.

(Sam Saffron) #17

I think we should simply start respecting permissions on categories, if admin has no “Create” permissions on a category then they should not be allowed to create topics until they have that permission. Then admins can simply set permission to what they want on the uncategorized and they don’t need a site setting.

A pile of these if uncategorized magic code paths just need to die, they are causing too much pain.

(Pierre-Olivier Latour) #18

So could it this bug is only affecting admins (or mods maybe)? In the screenshots above, for regular users it shows “Select a category…” by default and things appear to work fine i.e. you can select a category and it works and if you don’t select any, you get an error.

What’s puzzling to me is why when logged in as an admin the UI shows “Documentation” in place of “Select a category…” but it’s not even properly rendered with the background color. So something seems wrong already at this level.

(Jeff Atwood) #19

I think aligning it with permissions is the only sane way to go here.

Still people will bitch that they see uncategorized in a list somewhere as admin, so blocking topic create with a permission is not enough. You need to nuke it from orbit or they will not be satisfied. Because OCD.

(Mittineague) #20

Personally I don’t understand why so many have trouble with the concept of “uncategorized”. But obviously the the problem persists and it is pervasive enough that something should be done.

IMHO if it can be done without breaking a lot of interconnections removal might be best. else a “HEY ADMINS, HANDS OFF THIS” message might help, or simply make it unreachable?