askvortsov1/flarum-categories

Accessing profile from discussion list breaks SPA

Closed this issue · 10 comments

When clicking on a user avatar picture from a discussion list, the SPA will fully break and not display either the profile header (hero), nor any content. The profile menu will appear though. This does not happen when accessing a users profile from a discussion, or via direct link.

Flarum beta16, Categories v2.1.0

It throws following stacktrace:

TypeError: r.groups().find is not a function
    y index.js:20
    exports index.js:62
    e extend.js:27
    a render.js:30
    l render.js:155
    l render.js:160
    l render.js:66
    u render.js:50
    l render.js:134
    l render.js:63
    l render.js:162
    l render.js:66
    u render.js:50
    h render.js:374
    f render.js:444
    f render.js:415
    f render.js:488
    f render.js:419
    h render.js:302
    exports render.js:964
    a mount-redraw.js:14
    c mount-redraw.js:25
    c mount-redraw.js:23
    v router.js:111
    promise callback*t router.js:126
    S router.js:95
    f setImmediate.js:40
    f setImmediate.js:69
    a setImmediate.js:109
    core setImmediate.js:114
    core setImmediate.js:186
    core forum-f37283d9.js:25

I'm having trouble replicating this locally. What extensions do you have enabled?

Turns out the culprit is the flarum-ext-circle-groups extension! Not sure who would have to fix this though.

Essentially:

  • By default, users are loaded in with groups
  • This extension loads in the last posted user of each tag, without the groups (since the BasicUserSerializer is used there)
  • When we go to the user page, circle groups assumes that groups have been loaded, when they actually haven't.

When the next version of tags is released, the last posted discussion (and user) will only be attached on the tags page. At that point, I can also include groups.

So this will be fixed with the next release of Flarum?

So this will be fixed with the next release of Flarum?

It should, when I update categories for that release.

I have just updated to Flarum stable and am still facing this issue.

@askvortsov1 pinging you since you seemingly missed this. The problem still persists even on v3.0.4!

Sorry, I've been very busy lately. Reopening, but not sure when I'll get around to fixing it.

The incompatiblity with color-circles has been fixed from their side with v1.0.1

Excellent, thanks for letting me know!