# Kanban is incompatible with the new-topic URL

**URL:** https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887
**Category:** Bug
**Tags:** kanban-board
**Created:** [May 11, 2020, 5:12pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887 "2020-05-11T17:12:50Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 11, 2020, 5:12pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/1 "2020-05-11T17:12:50Z")

</div>

It seems that kanban is incompatible with the `new-topic` URL.

```
 https://mysite.com/new-topic?title=this%20is%20a%20test&body=this%20too&category=staff&tags=todo

```

works just fine but

```
 https://mysite.com/new-topic?title=this%20is%20a%20test&body=this%20too&category=kanban&tags=todo

```

doesn’t open up the composer.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [May 11, 2020, 5:39pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/2 "2020-05-11T17:39:34Z")

</div>

Do you mean a category called `kanban` is incompatible?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 11, 2020, 6:09pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/3 "2020-05-11T18:09:48Z")

</div>

Mine is actually callled “projects,” so it’s not something special about the name"kanban". The first URL opens up the composer with the title, text, tag, and category selected. The second URL doesn’t open up the composer. A work-around is to have a URL that requires only changing the category rather than setting it.

Another issue that I have is that I created a theme component that does this:

```plaintext
.discourse-kanban-container .discourse-kanban-list {
    width: calc((1110px - (4*4px))/5)
}

```

It would seem like being able to set the desired number of columns in a theme component would be useful for more than just me. I put on my list to submit a PR, but you might be able to do it nearly as fast as you’d accept a PR. 😉

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 11, 2020, 11:56pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/4 "2020-05-11T23:56:47Z")

</div>

This is a fresh site.

I added an “issues” category. I set it up in “tags” mode:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/5/e533a1b2ebeaae54ae1cbab747eeaea2831f15c4.png)

And it’s doing this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/b/1bdbe9f3d01ebd4f5c0ea994c41d6c7928d317fd.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [May 12, 2020, 8:46am UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/5 "2020-05-12T08:46:38Z")

</div>

Do you have a javascript error in the console? (I suspect the answer is yes)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 12, 2020, 4:28pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/6 "2020-05-12T16:28:07Z")

</div>

Doh! Yes. Sorry about that.

```
Uncaught TypeError: Cannot read property 'slugFor' of undefined

```

I’m still looking and will try to update this post with more info shortly.

IDEA: I bet that the tags are undefined. But then I went and created a tag group with all of them and I’m still getting the same error.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 12, 2020, 11:44pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/7 "2020-05-12T23:44:20Z")

</div>

And then I thought it might work in category mode, but I’m still getting

```plaintext
Uncaught TypeError: Cannot read property 'slugFor' of undefined

```

mostly anything I do.

---

<div class="post-metadata">

### Author: ![theopen-institute](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/theopen-institute/32/141988_2.png) [@theopen-institute](https://meta.discourse.org/u/theopen-institute)
#### Post date: [May 16, 2020, 4:33pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/8 "2020-05-16T16:33:03Z")

</div>

Any luck figuring this out @pfaffman? I’m getting the same issue since upgrading to 2.5.0.beta4

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 16, 2020, 6:35pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/9 "2020-05-16T18:35:05Z")

</div>

Not yet. I thought that it worked on some other mode for a bit, but I’ve still not got it working on that new site. I’m now worried any upgrading the other…

But it would seem that enough people are using this that more others would report problems by now…

---

<div class="post-metadata">

### Author: ![theopen-institute](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/theopen-institute/32/141988_2.png) [@theopen-institute](https://meta.discourse.org/u/theopen-institute)
#### Post date: [May 17, 2020, 8:54am UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/10 "2020-05-17T08:54:25Z")

</div>

Thanks Jay!

I did a bit more digging. The issue is this line:

> <https://github.com/discourse/discourse-kanban-theme/blob/56a6f42cb6addcb0edec6aa7d0012257cfcdb318/javascripts/discourse-kanban/services/kanban-helper.js.es6#L9>

For some reason, in some circumstances, `slugFor` is returning nothing. There was a change to the slugFor method released with 2.5.0.beta4, which might be related:  
[https://github.com/discourse/discourse/commit/fd39c85c1aea29bc396836ea7a9626a5b1793cb0](https://github.com/discourse/discourse/commit/fd39c85c1aea29bc396836ea7a9626a5b1793cb0)

I can’t say much more than that unfortunately, since my understanding of the architecture is very poor. I suspect this is related to the problem, though, because when I bypass the slugFor method the kanban board works fine again.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 17, 2020, 1:04pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/11 "2020-05-17T13:04:19Z")

</div>

Great work! I left a comment in a github issue.

I think that there is a “depth =” before the 2. If you look at the second change you’ll see a “depth = 3”.

If you don’t have a development environment set up, What you can do, I think, is edit that file locally inside the container, and then do an

```
 sv restart unicorn

```

(I sometimes forget the order of restart and unicorn).

That should fix it for you. My guess is that someone will see my github comment tomorrow and this will be fixed shortly.

If I get to my desk today I’ll try to check myself and maybe submit a PR.

EDIT: Well, it looks like it’s not quite as simple as I thought. Or, at least, my trying to hot-fix it isn’t working.

EDIT2: Yeah, I think that my change is wrong, but I can’t see how it is that `slugFor` would be failing.

EDIT 3: Well, what I did is changed the line that you marked to:

```
        const slug = category.slug;

```

It seems to work, at least for `default_modes` set to `todo:tags:today,todo,waiting,idea,done`.

---

<div class="post-metadata">

### Author: ![jerry0](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerry0/32/94523_2.png) [@jerry0](https://meta.discourse.org/u/jerry0)
#### Post date: [May 19, 2020, 10:55am UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/12 "2020-05-19T10:55:53Z")

</div>

I just got this problem too today after upgrading to latest version of Discourse (2.5.0.beta4) from 2.5.0beta3.

 ![image](https://global.discourse-cdn.com/meta/original/3X/9/9/991ae12b1fd8683d2346b658c48aee23ddf78bbe.png)

In error logs - TypeError: Cannot read property ‘slugFor’ of undefined

Am about to try @pfaffman 's fix (EDIT: which worked!)

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [May 19, 2020, 5:42pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/13 "2020-05-19T17:42:16Z")

</div>

I am getting another error lately, where the subcategory I had enabled for Kanban boards now doesn’t render the category listing beyond rendering the row where the category and sub-category dropdowns are, as shown in the image in the post above. The following error is generated:

## Message (2 copies reported)

```
TypeError: Discourse.Category is undefined
Url: https://discourse.example.org/theme-javascripts/f32bb95e4546f7b589d94cac68824c840c3744fd.js?__ws=discourse.example.org
Line: 469
Column: 20
Window Location: https://discourse.example.org/c/categoryname/subcategoryname/44/l/latest?board=default

```

## Backtrace

```
hrefForCategory@https://discourse.example.org/theme-javascripts/f32bb95e4546f7b589d94cac68824c840c3744fd.js?__ws=discourse.example.org:469:20
href@https://discourse.example.org/theme-javascripts/f32bb95e4546f7b589d94cac68824c840c3744fd.js?__ws=discourse.example.org:385:32
d/<@https://discourse.example.org/assets/application-d69ccaa9a8d21fd7f40b18692a4d5240d02c1a5a4bbf6f25b44bafdf1dbd8e2f.js:1:38925
nt</t.get@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:202038
Ke@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:199024
Z</t.compute@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:114737
$</e.prototype.value@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:113727
U</t.flush@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:430769
@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:424675
o</t.evaluate@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:415589
Fe</t.evaluateSyscall@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:449837
Fe</t.evaluateInner@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:449423
Fe</t.evaluateOuter@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:449332
pt</e.next@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:475087
dt</e.prototype.next@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:476136
e/this.render@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:143407
H@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:188637
Jt</t._renderRoots@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:146752
Jt</t._renderRootsTransaction@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:147058
Jt</t._renderRoot@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:146446
Jt</t._appendDefinition@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:145571
Jt</t.appendOutletView@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:145292
f</t.invoke@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:490268
f</t.flush@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:489266
p</t.flush@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:491273
t</t._end@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:496669
t</t.end@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:493225
t</t._run@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:497197
t</t._join@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:496982
t</t.join@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:493933
f@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:360451
e.bind/<@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:360675
e@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:30015
l/</t<@https://discourse.example.org/assets/ember_jquery-3a388c5a0562670ed1eea762f12e041d92b4a418316d3f9f83e793d3ba6be5d7.js:1:30339

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [May 20, 2020, 8:38pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/14 "2020-05-20T20:38:59Z")

</div>

I just upgraded my support site and it broke this too, so it’s not a configuration issue.

I’ve created a fork here: [GitHub - literatecomputing/discourse-kanban-theme: A Discourse theme component providing basic kanban-board functionality · GitHub](https://github.com/literatecomputing/discourse-kanban-theme).

I it has my (perhaps naive) fix here:

> <https://github.com/literatecomputing/discourse-kanban-theme/blob/master/javascripts/discourse-kanban/services/kanban-helper.js.es6#L11>

And also adds a “num columns” theme setting to adjust the width of the kanban columns for the number set there. If I were clever, I’d `split` the `default modes` setting and get it from there, but I suppose there could be a reason that you want those to be different.

@david, should I submit a PR? Is there a better solution than my naive fix?

---

<div class="post-metadata">

### Author: ![pacharanero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pacharanero/32/500583_2.png) [@pacharanero](https://meta.discourse.org/u/pacharanero)
#### Post date: [May 22, 2020, 11:03am UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/15 "2020-05-22T11:03:47Z")

</div>

I can report having same issue across a few small Discourse instances that use Kanban.  
`Uncaught TypeError: Cannot read property 'slugFor' of undefined`  
Would be nice if we can get this fixed via @pfaffman’s PR @david

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [May 22, 2020, 3:42pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/16 "2020-05-22T15:42:40Z")

</div>

Sorry for the delay in investigating this!

> [@pfaffman](#):
>
> I it has my (perhaps naive) fix here

The fix is good, but I think it will only work for top-level categories, not subcategories. This should do it:

[https://github.com/discourse/discourse-kanban-theme/commit/5ab2d5e7b6240293a0bf6825aa614e06d9f720f3](https://github.com/discourse/discourse-kanban-theme/commit/5ab2d5e7b6240293a0bf6825aa614e06d9f720f3)

> [@pfaffman](#):
>
> And also adds a “num columns” theme setting

I like it, merged here:

[https://github.com/discourse/discourse-kanban-theme/commit/e340f3b73c6aaa9f08dfa102720a52aa37ed2025](https://github.com/discourse/discourse-kanban-theme/commit/e340f3b73c6aaa9f08dfa102720a52aa37ed2025)

I think a global setting for this is fine - needing to set it per-category seems unlikely.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 11, 2023, 1:47pm UTC](https://meta.discourse.org/t/kanban-is-incompatible-with-the-new-topic-url/281887/17 "2023-10-11T13:47:22Z")

</div>


