# Links without sub-folder path in embedded comments (Continue Discussion and user links)

**URL:** https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836
**Category:** Bug
**Created:** [January 12, 2016, 3:08pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836 "2016-01-12T15:08:54Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [January 12, 2016, 3:08pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/1 "2016-01-12T15:08:54Z")

</div>

I’ve just found a bug with combination of embedded comments and sub-folder installation:  
‘Continue Discussion’ button and user links does not respect subfolder path.  
But ‘Start Discussion’ button does respect subfolder path.  
So I can only post once on embedded thread.

Here is the example: [http://nsr24.com/football/game/705041](http://nsr24.com/football/game/705041)  
Discourse installed into: [http://nsr24.com/social/en/](http://nsr24.com/social/en/)  
‘Start Discussion’ url is [http://nsr24.com/social/en/t/bournemouth-west-ham-united-new-sports-rating/13](http://nsr24.com/social/en/t/bournemouth-west-ham-united-new-sports-rating/13)  
‘Continue Discussion’ url is just /t/bournemouth-west-ham-united-new-sports-rating/13

Discourse Version v1.5.0.beta8 +11 (Docker + subfolder official guide)

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [January 12, 2016, 5:22pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/2 "2016-01-12T17:22:35Z")

</div>

A quick and dirty work-around I can come up with is the following:  
add this javascript to Discourse embedded code so the full Discourse code will be:

```
DiscourseEmbed = { discourseUrl: 'http://nsr24.com/social/en/',
                   discourseEmbedUrl: window.location.href };

(function() {
    var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
    d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);

    // Temporary work around
    setTimeout(function () {
        $('#discourse-embed-frame').contents().find("a").each(function () {
            var value = $(this).attr('href');
            if (!value.startsWith('http')) {
                $(this).attr('href', 'http://nsr24.com/social/en' + value);
            }
        })
    }, 3000);
})();

```

Hope this help later in debugging this problem.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [January 12, 2016, 5:39pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/3 "2016-01-12T17:39:56Z")

</div>

I think this commit should fix you up:

[https://github.com/discourse/discourse/commit/1f8586168bc37d04ebca7653f4d672f600bb0d97](https://github.com/discourse/discourse/commit/1f8586168bc37d04ebca7653f4d672f600bb0d97)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 12, 2016, 6:12pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/4 "2016-01-12T18:12:47Z")

</div>



---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 12, 2016, 7:49pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/5 "2016-01-12T19:49:48Z")

</div>



---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [January 12, 2016, 7:54pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/6 "2016-01-12T19:54:25Z")

</div>

Thank you very much!  
I apply this patch in my installation, and during application figured out two more places with similar problems:  
You forget to fix `/users/` links at `app/views/embed/comments.html.erb` lines 19 and 23

---

<div class="post-metadata">

### Author: ![Strikki\_Strik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strikki_strik/32/121984_2.png) [@Strikki\_Strik](https://meta.discourse.org/u/Strikki_Strik)
#### Post date: [January 13, 2016, 9:34am UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/7 "2016-01-13T09:34:53Z")

</div>

I created a Pull Request, it should completely fix this issue.  
[https://github.com/discourse/discourse/pull/3958](https://github.com/discourse/discourse/pull/3958)

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [January 13, 2016, 3:23pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/8 "2016-01-13T15:23:15Z")

</div>

Merged it in, thanks!

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [January 13, 2016, 3:23pm UTC](https://meta.discourse.org/t/links-without-sub-folder-path-in-embedded-comments-continue-discussion-and-user-links/37836/9 "2016-01-13T15:23:24Z")

</div>


