- Posts: 3
COMMUNITY FORUM
Bug fix for comment form validation (K2 Version 2.3)
- Eric Emmrich
-
Topic Author
- Offline
- New Member
Less
More
14 years 9 months ago #86400
by Eric Emmrich
Bug fix for comment form validation (K2 Version 2.3) was created 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:Replace them as follows:That's it! Now the validation errors are displayed properly.Regards,Eric
// 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/>
// 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); } } }); }); }
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
14 years 9 months ago #86401
by Lefteris
Replied by Lefteris on topic Bug fix for comment form validation (K2 Version 2.3)
Hi. There is no need to do this as the request is always updating the log div. That's what "update: log2," does.
Please Log in or Create an account to join the conversation.
- Eric Emmrich
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 3
14 years 9 months 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.
The bug fix I've posted finally works for me.
Please Log in or Create an account to join the conversation.
- Nathan Russell
-
- Offline
- New Member
Less
More
- Posts: 1
14 years 9 months 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
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 3
14 years 9 months 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.
- Markus Thiel
-
- Offline
- Premium Member
Less
More
- Posts: 149
14 years 8 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.
- Markus Thiel
-
- Offline
- Premium Member
Less
More
- Posts: 149
14 years 8 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 :(
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.