Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

FIX: Build correct assign tag links when using subfolders #420

Merged
merged 1 commit into from
Jan 5, 2023

Conversation

Drenmi
Copy link
Contributor

@Drenmi Drenmi commented Jan 5, 2023

Meta topic.

What's the problem?

The tag links added to the topic header extras aren't aware of subfolder usage, e.g. the topic URL would be generated as a vanilla /t/:id URL. The same applies to post assignments.

How does this fix it?

This change fixes that by passing the link URL through the getURL helper.

What about tests?

I searched around for tests that simulate subfolders, but couldn't find any. If anyone know these exist and can point me to them, that'd be great.

The tag links added to the topic header extras aren't aware of
subfolder usage. This change fixes that.
Copy link
Contributor

@martin-brennan martin-brennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one. I did find this core test using setPrefix to test subfolder support, though I am not sure its worth the time spent to do tests for this. Up to you:

https://github.com/discourse/discourse/blob/8c0643ef942cffb3ed1ab8966a00718795ceebf9/app/assets/javascripts/discourse/tests/unit/models/email-log-test.js#L17-L43

@Drenmi
Copy link
Contributor Author

Drenmi commented Jan 5, 2023

I am not sure its worth the time spent to do tests for this.

Turns out to do this for acceptance tests is not straightforward. The hole goes quite deep. Will merge this for now and see if we can replace some of this with system tests. 🙏

@Drenmi Drenmi merged commit 31389d7 into discourse:main Jan 5, 2023
@Drenmi Drenmi deleted the fix/assign-tags-url-for-subfolders branch January 5, 2023 08:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants