Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    Bug-reports    Topic: [solved] Comment Too Long - when +30 symbols left
Pages: [1]   Go Down
  Print  
Author Topic: [solved] Comment Too Long - when +30 symbols left  (Read 3386 times)
0 Members and 2 Guests are viewing this topic.
spproductions
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« on: January 12, 2011, 05:15:41 »

I run a news site with about 20,000 visits a day.

I have gotten a complaint several times from different readers that they receive a "Comment Too Long" error even when they have 30-40 symbols left.

I have been unable to recreate the problem on my own to trouble shoot. So, I'm really just stuck.
I've asked readers what environment they use and have gotten a mixed response, IE, Firefox etc.

Has anyone else run into this problem? Any recommendations on how to test or fix?

Joomla 1.5.20
JComments 2.2.0.2
« Last Edit: February 21, 2012, 17:21:59 by smart » Logged
smart
Administrator
Hero Member
*****

Karma: 160
Offline Offline

Gender: Male
Posts: 2559



WWW
« Reply #1 on: February 21, 2012, 04:20:40 »

This issue fixed in JComments 2.3.0... If you're still using 2.2.0.2 you can fix this:

1. Open file /components/com_jcomments/js/jcomments-v2.1.js:
2. Find code
Code: (javascript)
updateCounter: function(){if(this.counter!=null){var ta=this.ta,e=this.counter.e;try{var n=document.createElement(e.tagName),v=this.counter.max-ta.value.length;n.innerHTML=(v>=0)?v:0;e.parentNode.replaceChild(n,e);this.counter.e=n;}catch(ex){}}},
3. Replace with
Code: (javascript)
updateCounter: function(){if(this.counter!=null){var ta=this.ta,e=this.counter.e;try{var n=document.createElement(e.tagName),v=this.counter.max;if(ta.value.length>0){v=v-ta.value.length;var ln=ta.value.match(/[^\r]\n/g);if(ln){v=v-ln.length;}}n.innerHTML=(v>=0)?v:0;e.parentNode.replaceChild(n,e);this.counter.e=n;}catch(ex){}}},
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
spproductions
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #2 on: March 31, 2012, 00:54:20 »

I just tried the javascript fix on a 2.2.0.2 installation and tested it using a comment with lots of line breaks. I still get the comment too long when there are +30 characters left.  I tested on a couple browsers to make sure the javascript file did not cache.

I also installed 2.3.0 on another site and tested a comment with lots of line breaks. Again, I got the comment too long response with +30 characters left.

I really appreciate you getting back to me on this. Thank you for your time. I do need to let you know that this problem does not actually appear to be fixed either in 2.3.0 or in 2.2.0.2 with the javascript change.
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    Bug-reports    Topic: [solved] Comment Too Long - when +30 symbols left
 
Jump to: