This plugin is the last step to upgrade Drupal 7 Blog. I've tried really hard to get it working.

The first think was trying to enable with with adding a disqus comment field and follow all the nessacary steps. I have the Disqus comment setting when I edit a article, but that's it. No disqus when i'm viewing the article.

I've tried to use it with Blocks. I have the Links for Disqus on my Sidebar in Block settings, but when I click on it the spinning wheel is there for a second and ...nothing. I see a AJAX-Request error in my javascript console

Fatal error: Class 'Drupal\block\BlockBase' not found in /www/htdocs/drupal8/sites/all/modules/disqus/src/Plugin/Block/DisqusBaseBlock.php on line 19

It seems there's a Namespace change and its Drupal\Core\Block\BlockBase instead Drupal\block\BlockBase now.

I've tried to fix this but there are still more broken things. Sadly I'm not that deep in Drupal8 yet.
Anyone can help me to track it down?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PESTO3567’s picture

Title: Broken with Drupal beta9 » Broken with Drupal8 beta9
camoa’s picture

Same here, I enable the field but noting shows in the content view. Trying to figure out why.

camoa’s picture

Assigned: Unassigned » camoa

I have identified the problem, it is related to this change record: https://www.drupal.org/node/2457769

Also the use of theme function and drupal_render is deprecated so I am adding a basic template for the "noscript" tag.

Patch coming soon.

camoa’s picture

Status: Active » Needs review
FileSize
16.1 KB

This patch adds/changes:

- A template and preprocess function for the tag.
- Changes the disqus.js code to reflect the change noted in https://www.drupal.org/node/2457769 for JQuery.once.
- Some coding standards for the disqus.module (added by phpstorm but it does not harm to add them there, right?)

Please review. Disqus is now loading in my Drupal 8 Beta 9 installation.

PESTO3567’s picture

I've tried your patch with a fresh Drupal 8 installation and can confirm Disqus is loading if you add the disqus comment field.
But adding Disqus with Block still fails, seems there's more broken. Anyway, this was a step forward, thank you!

camoa’s picture

I checked on the blocks, minor errors including this change record: https://www.drupal.org/node/2344683 and this issue: https://www.drupal.org/node/2412229

Patch attached with blocks working.

PESTO3567’s picture

I can add Disqus Blocks now. But the website is completly broken and doesnt load anymore. I've tried "Top Comments" and "Combination Widget".

I'm sorry for the HTML Entities, but thats how it displays in Drupal's Database logger:
<em class="placeholder">Twig_Error_Runtime</em>: An exception has been thrown during the rendering of a template (&quot;The URI &quot;//disqus.com/forums/dotmagic/combination_widget.js&quot; is invalid. You must use a valid URI scheme.&quot;) in &quot;core/themes/bartik/templates/page.html.twig&quot; at line 155. in <em class="placeholder">Twig_Template-&gt;displayWithErrorHandling()</em> (Zeile <em class="placeholder">328</em> von <em class="placeholder">/home/www/DEV/drupal8/core/vendor/twig/twig/lib/Twig/Template.php</em>).

camoa’s picture

mmmm just tried the DisqusComments block in my site, I am trying the rest soon.

camoa’s picture

It seem to be a little change needed in DisqusBlockBase. This should do it but I did not have much time for tests.

Can you please check if the problems are gone?

Thanks!

PESTO3567’s picture

Thanks for your fast response and the time to fix the incompatibilities. I'm glad to test for you and sorry because that's all I'm doing :)

The Blocks are displayed now, but just the Headlines. My Disqus content is missing, I guess because I'm running it from my local server with different Domain? I will try a test setup on live server soon.

camoa’s picture

please do!

camoa’s picture

Ok, the problem was in the way the blocks are rendered, I could not find how to do the actual widget, but just passing the markup will do it. For this case I think this will work right.

PESTO3567’s picture

That's it! I didn't test all functionality yet but it looks fine so far!
I'll take a closer look this weekend and report here.

JayeshSolanki’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
21.36 KB
398 bytes

Thanks for the patch. I have tested it, and blocks were working fine.
Added a patch with a minor fix in indentation.

hugronaphor’s picture

I confirm that the patch #14 work well.

slashrsm’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

  • slashrsm committed 7f6fd6f on 8.x-1.x authored by camoa
    Issue #2476065 by camoa, JayeshSolanki: Broken with Drupal8 beta9
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.