Keyword

Bug fix for comment form validation (K2 Version 2.3)

  • Eric Emmrich
  • Eric Emmrich's Avatar Topic Author
  • Offline
  • New Member
More
14 years 1 month ago #86400 by Eric Emmrich
Hi all,I actually wondered that nobody already found this bug but have you ever wondered why you cannot submit a comment in K2 even though there is no error displayed? The solution is quite easy: there probably is an error but the message itself is not displayed at all!This is a bug in the k2.js file found under /components/com_k2/js/Search the following lines:
  // Comments<br/>  if($('comment-form')) {<br/>    $('comment-form').addEvent('submit', function(e){<br/>      new Event(e).stop();<br/>      var log2 = $('formLog').empty().addClass('formLogLoading');<br/>      this.send({<br/>        update: log2,<br/>        onComplete: function(res){<br/>          log2.removeClass('formLogLoading');<br/>                  if(typeof(Recaptcha) != "undefined"){<br/>                        Recaptcha.reload();<br/>                  }<br/>          if (res.substr(13, 7) == 'success') {<br/>              window.location.reload();<br/>          }<br/>        }<br/>      });<br/>    });<br/>  }<br/>
Replace them as follows:
  // Comments  if($('comment-form')) {    $('comment-form').addEvent('submit', function(e){      new Event(e).stop();      var log2 = $('formLog').empty().addClass('formLogLoading');      this.send({        update: log2,        onComplete: function(res){          log2.removeClass('formLogLoading');                  if(typeof(Recaptcha) != "undefined"){                         Recaptcha.reload();                  }          if (res.substr(13, 7) == 'success') {              window.location.reload();          } else {              log2.setProperty('html', res);            }        }      });    });  }
That's it! Now the validation errors are displayed properly.Regards,Eric

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

More
14 years 1 month ago #86401 by Lefteris
Hi. There is no need to do this as the request is always updating the log div. That's what "update: log2," does.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Eric Emmrich
  • Eric Emmrich's Avatar Topic Author
  • Offline
  • New Member
More
14 years 1 month ago #86402 by Eric Emmrich
Replied by Eric Emmrich on topic Bug fix for comment form validation (K2 Version 2.3)
Well, actually it doesn't update the log, even though it should ... at least not for me.
The bug fix I've posted finally works for me.

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

More
14 years 1 month ago #86403 by Nathan Russell
Replied by Nathan Russell on topic Bug fix for comment form validation (K2 Version 2.3)
This indeed is a bug I too ran into. If you attempt to submit your comment it appears as if nothing happens. No comment is posted and the errors are not displayed. After making the change as suggested in this post, the problem is resolved. Both comments and errors are functioning as they should.

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

  • Eric Emmrich
  • Eric Emmrich's Avatar Topic Author
  • Offline
  • New Member
More
14 years 1 month ago #86404 by Eric Emmrich
Replied by Eric Emmrich on topic Bug fix for comment form validation (K2 Version 2.3)
It might be an issue with MooTools 1.2 - just a thought ...

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

More
13 years 11 months ago #86405 by Markus Thiel
Replied by Markus Thiel on topic Bug fix for comment form validation (K2 Version 2.3)
I´m also getting this bug.. but your fix dont work :(

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

More
13 years 11 months ago #86406 by Markus Thiel
Replied by Markus Thiel on topic Bug fix for comment form validation (K2 Version 2.3)
My problem was a plugin called lazyload :P
Should have guessed that K2 was perfect... like most of the time ;)

Markus Thiel said:I´m also getting this bug.. but your fix dont work :(

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


Powered by Kunena Forum