My users report that the body characters counter doesn't work with TinyMCE - the use of non-plain text seems to stop the counter working?

I've searched the old issues and can't find any mention of this from anyone else which seems improbable!!

Does anyone else have this problem and if so is there an easy fix? I thought about disabling it for that body type but it seems to use the standard body so I think I can't do that?

Comments

csc4’s picture

Title: TonyMCe breaks body characters counter? » TinyMCE breaks body characters counter?

TinyMCE/rich text editng breaks counter

mcurry’s picture

Component: Code » User interface
Category: bug » feature
Priority: Normal » Minor

Since this module was never designed or tested to work with TinyMCE module, this is a feature request, not a bug request, and will be treated accordingly.

Please be mindful the issue submission guidelines.

csc4’s picture

Apologies

fgm’s picture

Version: 5.x-1.5-8 » 6.x-3.x-dev

Bumping version: features will only be considered for the latest and next versions (was on 5.x-1.5-8)

fgm’s picture

Title: TinyMCE breaks body characters counter? » Wysiwyg: TinyMCE breaks body characters counter?
Version: 6.x-3.x-dev » 7.x-3.x-dev

Rewording to group with related issues.

worldwidecraig’s picture

I have this problem with out text editors, when you initially create an ad it does have the charactor counter under the body field, but if you go back and edit the text, it lets you type as many charactors as you like. I got around the issue by setting my "body field" format drop down to trimmed and then changed the trimmed length to what I want users to be able to post. It definately would be better if the counter was there even when edited, I guess it needs to be rechecked when editing somehow

fgm’s picture

Status: Active » Postponed (maintainer needs more info)

This seems strange: I did some tests on 7.x-3.x with TinyMCE and did not encounter this problem, although it was present on 5.x alright.

Can you describe how to reproduce it, starting from a clean D7 install: modules installed, order of install, settings, actions... ?

System Lord’s picture

Issue summary: View changes

The counter isn't working exactly right. It doesn't count down as you type every time. Some time it works some time is doesn't. It never works initially. If I save then come back to edit the counter is adjusted to the correct count, but then either works or doesn't after that (the "as you type" count). All works fine when using plain text.

Im using: 7.x-3.1-beta1+1-dev and CKEditor; core js

fgm’s picture

I think the best course of action is to remove this feature from Classified Ads anyway: there is a robust Maxlength Javascript module which does just that, so the current JS doing the maxlength count should be removed, and a dependency added on the Maxlength module to provide this feature. The module is https://drupal.org/project/maxlength

Can you submit a patch along these lines ?

System Lord’s picture

Sorry, I don't know the first thing about making patches :) In fact I'm still installing patches manually. maxlength seems to have the same issues https://drupal.org/node/1415712 Can I suggest perhaps leaving this counter visible without the js function. Allow admin to continue to set max character and rely only on the form API validation. In my opinion this at least keeps the admin control within the same module. Change "Remaining characters: 500" to "Max characters: 500".

Instructions could also suggest admins set their rows closer to their max character. This will help users recognize more accurately how much room they have for text. For example: 2 rows allowed looks closer to 500 characters allowed more than 20 rows. Then form API validation will handle the rest.

Or, at least in my experience, since the count down adjusts after I save the form leave the module and js alone and add something like "Remaining characters: 500 [save to update]". I suggest this because not everyone uses wysiwyg and may not have any issues with this. But, still at least add the tip (instructions) above for the admins.

fgm’s picture

Status: Postponed (maintainer needs more info) » Active

Well, then I think it is best to just drop that functionality and recommend Maxlength module. Since this is MAxlength's sole purpose, the problem is more likely to get fixed over there than here.

In the issue you mention, I see that some settings and editor combinations appear to work, BTW.

System Lord’s picture

I'm all for dropping this in favor of more focus on https://drupal.org/comment/8375163#comment-8375163

:)

fgm’s picture

TBH, my focus is much more on D8 core and MongoDB, so do not expect too much until D8 is released.

System Lord’s picture

Ah, OK

fgm’s picture

Status: Active » Closed (won't fix)

With this module end of life approaching along with Drupal 7 EOL, this issue is now moot.