Link behavior inconsistent

Haven’t been able to pin down whether this is due to a plugin (Assign) or theme component (Custom Header Links) but as they’re both official I decided to split it down the middle and just file this is a #bug

New instance, only has those components installed. Header Links is necessary because Assign doesn’t appear to add Top Menu options for ‘Assigned to me’ ‘Assigned to All’, that kind of thing.

The first time either of those links are clicked, they show the correct assigned posts. If one is clicked after the other, or the same link gets clicked twice, then it flips from /latest?assigned=me or /latest?assigned=* to /latest which means the wrong posts are returned.

So, from / I click “My Tasks” and get /latest?assigned=me and then I click “All Tasks” and instead of being directed to /latest?assigned=* I’m directed to /latest. Also, if I’m already on either page and click the link again I’m directed to /latest.

v2.3.0.beta5 +200

Can you give your custom header links settings please ?

Sure, they’re:

My Tasks,My Tasks,/latest?assigned=me,vdm,self

and

All Tasks,All Tasks,/latest?assigned=*,vdm,self
1 Like

Ok looked at it a little bit, I can say for sure it’s not related “Custom Header links” theme component.

You could for example reproduce multiple times when clicking on the assigned tag under a topic:

36

The issue is probably in Discourse itself, I feel like discourse-assign is generating the correct URL, will dig more later.

1 Like

I ended up doing two commits:

This will now make a full reload but will avoid losing query params

6 Likes

This commit:

Reintroduces this bug:

https://meta.discourse.org/t/link-behavior-inconsistent/112713/

It’s not just clicking the same link where the issue presents. Clicking between links with querystrings is fundamentally broken by this change too.

If I click the link for ‘Assigned to Me’ latest?assigned=me and follow it with a click to ‘All Tasks’ latest?assigned=* it instead takes me to /latest.

The alternative, reloading the page, seems like a small inconvenience in comparison.

2 Likes