-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with disqus-comment-system plugin #2035
Comments
I ran into this problem, or a very similar one, when trying to fix a problem with Disqus comments on another site. From what I recall, the issue boils down to this line in $this->loader->add_filter( 'comments_template', $plugin_public, 'dsq_comments_template' ); That line attempts to run this: public function dsq_comments_template($file) {
global $post;
if ( $this->dsq_embed_can_load_for_post( $post ) ) {
do_action( 'dsq_before_comments' );
do_action( 'dsq_enqueue_comments_script' );
return plugin_dir_path( dirname( __FILE__ ) ) . 'public/partials/disqus-public-display.php';
}
} The problem is that this then returns a file that Blade is unable to load, and it complains. The solution I ultimately used was to just manually include the HTML element and JS embed code Disqus is trying to insert, right in my Blade: <div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = '{{ get_permalink() }}';
this.page.identifier = '{{ $post->ID }} {{ $post->guid }}';
};
(function() {
var d = document, s = d.createElement('script');
s.src = '//droidlife.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script> It's possible there's a way to remove Disqus's hook on |
I've ran into this problem too. I decided to drop the plugin in favor of this Laravel / Disqus setup. Only issue is I'm struggling to get it installed...
From what I gather that's about it if you're using Blade 5.5 but I'm not having any luck. Have I undertaken the right process?? Any help appreciated :-) |
@Ojay I'm not sure you'll be able to make that work. The Laravel/Disqus plugin you linked to seems to require the Laravel framework (specifically service providers and middleware). Sage is only using Blade, which is just Laravel's templating system. There's been some interest in adding app containers and service providers to Sage, as discussed in this issue, but right now it doesn't exist. I think the simplest solution is probably some variation on the one I posted. |
Ahh, schoolboy error on my part... thanks for letting me know, haha! Thanks |
closing since we're unable to do anything to fix this noted on https://roots.io/sage/docs/sage-compatibility/ - hopefully they'll make changes upstream in the future |
Submit a feature request or bug report
What is the current behavior?
When activating disqus-comment-system plugin, some pages return
and the page does not load
What is the expected or desired behavior?
disqus-comment-system plugin should not affect the theme behaviour
Bug report
Please provide steps to reproduce, including full log output:
I am using builder beaver plugin and the error raises when I am seeing or editing a global component
http://www.wpbase.dev/es/blog/fl-builder-template/clients/
Please describe your local environment:
WordPress version: 4.9.4
OS: ubuntu 16.04
NPM/Node version: 6.11
Where did the bug happen? Development or remote servers?
development and remote servers
Is there a related Discourse thread or were any utilized (please link them)?
https://discourse.roots.io/t/uncaught-invalidargumentexception/9956/2
The text was updated successfully, but these errors were encountered: