Cannot create chat channel due to blank auto-generated slug

Hello, I tried to create a channel on a catogory but received 422 in response. The log shows slug is invalid and I find that following code will always return a blank string no matter the title is in english or other characters.

# chat/app/models/category_channel.rb

  def generate_auto_slug
    return if self.slug.present?
    self.slug = Slug.for(self.title.strip, "")  # missing method: :encoded
    self.slug = "" if duplicate_slug?
  end

I add the missing method and it seems to works fine.

Hi, I added some comments on the PR, let’s keep the discussion going there.

1 Like

Oh, I see. The reason is that my SiteSetting.slug_generation_method is none. When I change to encoded, everything is ok.

This is not a bug. Sorry to bother.

2 Likes