Embedded discourse never stops loading discussion

(Christoph Holtermann) #1

I’ve begun embedding discourse plugins on my typo3 website. One is on a cal base calendar event page the other on a tt_news page. I had to work quite a lot to find working embedUrls. The calendar usually works. When someone visits the page a new topic is being created. But sometimes the discussion plugin never stops loading. With the event page it is rarely that it finishes loading. I found sidekiq and the are a lot of retries.


The error message goes:

Jobs::HandledExceptionWrapper: Wrapped NoMethodError: undefined method `author' for nil:NilClass


{"user_id"=>6, "embed_url"=>"http://www.jungmedizinerforum.org/nc/content-elements/neuigkeiten-einzelansicht/article/hausarztpraxis-frankfurt-sucht-ab-sofort-eine-unterstuetzung/", "author_username"=>nil, "referer"=>"http://www.jungmedizinerforum.org/news/article/hausarztpraxis-frankfurt-sucht-ab-sofort-eine-unterstuetzung/", "current_site_id"=>"default"}

the embed code on the event page is (as typo3 fluid template):

<div id='discourse-comments-wrap'>
<div id='discourse-comments-before'></div>
  <div id='discourse-comments'></div>

<script type="text/javascript">
        DiscourseEmbed = { discourseUrl: "",
                           discourseEmbedUrl: "" };

        DiscourseEmbed.discourseUrl = '{discourseUrl}';
        DiscourseEmbed.discourseEmbedUrl = '<f:uri.page absolute="TRUE" additionalParams="{tx_ttnews: {tt_news: '{newsuid}'}}" noCacheHash="TRUE" noCache="TRUE" />';
        (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);

An example calendar entry: Jungmedizinerforum: Internationale Jahreskonferenz der Medizinischen Sektion
An example event entry: Jungmedizinerforum: Hausarztpraxis Frankfurt sucht ab sofort eine Unterstützung

I thought it was the long url with square brackets and prettified it but that didn’t solve the problem as the ugly url of the dates usually works while the prettier one of events usually doesn’t.

maybe someone can help ?

(Quim Gil) #2

Hi @Christoph_Holtermann, did you solve this problem? I am interested in the potential of embedding Discourse in a Typo3 based website.

(Christoph Holtermann) #3

Hi @quimgil. I have working dicourse discussions now. The problem seems to be that the links for the cal or news pages are too complex. I shortened them with realurl. When it is just a conventional url without additional parameters embedding works fine. I just thought about posting an issue in the bugtracker about complex urls.