Keyword

Error when adding comment

  • Steven Trooster
  • Steven Trooster's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 7 months ago - 7 years 7 months ago #164576 by Steven Trooster
Error when adding comment was created by Steven Trooster
If one adds a comment to an article and submits, the following message is displayed on a blank page:
{"message":"Comment added! Refresh page...","cssClass":"k2FormLogSuccess","refresh":1}

The comment is saved, but the user is left clueless.

K2 version 2.8.0 on Joomla 3.8.1
Last edit: 7 years 7 months ago by Steven Trooster.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #164579 by william white
Replied by william white on topic Error when adding comment
I get the same errors with the default k2 template and recaptua disabled, and no more with error rerporting set to development.
Will have to look into this as it may need to be reported as an issue
Maybe Krikor has already seen it before

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #164598 by Krikor Boghossian
Replied by Krikor Boghossian on topic Error when adding comment
Hello,

Are you getting any JS errors in browser's developer tools console tab?

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #164604 by william white
Replied by william white on topic Error when adding comment
None

Please Log in or Create an account to join the conversation.

  • Steven Trooster
  • Steven Trooster's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 7 months ago #164612 by Steven Trooster
Replied by Steven Trooster on topic Error when adding comment
On the actual item page itself I get an error. In the k2.frontend.js the first line of code:
var $K2 = jQuery.noConflict();
Can't find variable: jQuery

When comparing this with previous versions of K2, there was a separate file k2.noconflict.js with a single line of code, which is exactly the same.

Please Log in or Create an account to join the conversation.

  • Steven Trooster
  • Steven Trooster's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 7 months ago #164613 by Steven Trooster
Replied by Steven Trooster on topic Error when adding comment
I've narrowed down the problem: when the jQuery handling settings in K2 are set to 'don't load jQuery', the error occurs. If you set jQuery to one of the other options, then it's fine. There is no need to load jQuery in Joomla 3. Turning this option on might result in conflicts between jQuery versions.

It is nice of you to support older versions of Joomla (1.5/2.5) with a feature like this, but we have to move on. We don't need to encourage site owners to stick with old unsupported and unsafe Joomla sites.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #164621 by Krikor Boghossian
Replied by Krikor Boghossian on topic Error when adding comment
If this error occurs, then the template is not loading jQuery, not all J!3 sites load jQuery by default (this is the cause of this issue).
This is why this setting is mandatory across all Joomla! versions.

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #164635 by william white
Replied by william white on topic Error when adding comment
Thanks, that fixed it. I remember having to turn it on before!

Please Log in or Create an account to join the conversation.

  • Steven Trooster
  • Steven Trooster's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 7 months ago - 7 years 7 months ago #164637 by Steven Trooster
Replied by Steven Trooster on topic Error when adding comment
I figured out that the jQuery Easy system plugin was set wrong. Strangely enough I didn't tough the settings for a long time. But maybe I recently set K2 to load no jQuery.
Last edit: 7 years 7 months ago by Steven Trooster.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #164663 by Krikor Boghossian
Replied by Krikor Boghossian on topic Error when adding comment
It was changed a few versions ago, not that long ago though.

Please Log in or Create an account to join the conversation.

  • Steven Trooster
  • Steven Trooster's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 7 months ago - 7 years 7 months ago #164771 by Steven Trooster
Replied by Steven Trooster on topic Error when adding comment
I am still struggling with jquery on my site. When comparing one site with another, I noticed that on the 'problem' site /media/k2/assets/js/k2.frontend.js?v=2.8.0&sitepath=/ is loaded before jQuery scripts are loaded. Thus the K2-javascript can't execute jQuery, because it hasn't found it yet. How can I change this so that k2.frontend.js is the last script loaded, after jQuery?

In addition: I've tried various settings. If I turn off jQuery in the K2 settings, editing an article beaches a mess. The different tabs for images, galleries etc. disappear. Only if I turn on the land Jquery option in K2 it's fine. But then the SIG Pro window overwrites the edit window, and doens't open as a modal window. Thus you loose your text and you can't close the SIG window.
Last edit: 7 years 7 months ago by Steven Trooster.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #164778 by Krikor Boghossian
Replied by Krikor Boghossian on topic Error when adding comment
I would suggest either loading K2 on a template basis (use Joomla"s API) or you can use jQuery Easy.

Please Log in or Create an account to join the conversation.

  • Steven Trooster
  • Steven Trooster's Avatar Topic Author
  • Offline
  • Premium Member
More
7 years 7 months ago #164802 by Steven Trooster
Replied by Steven Trooster on topic Error when adding comment
I did have jQuery Easy already installed, but that doesn't help. I had to turn it off, to make the tabs appear in K2.
Strangely enough I created a testsite from scratch with the same Yootheme template, and there it's fine.
What do you mean with the template and Joomla api?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #164809 by Krikor Boghossian
Replied by Krikor Boghossian on topic Error when adding comment
That would apply if you are building your template from scratch.
Since this is a commercial template, you need to address this issue to YooTheme as well and provide them with both links. This looks more like a template issue rather than an issue with extensions.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum