When editing content with a text field set to UNLIMITED, even if you don't enter anything in the text box when you edit the content, a new blank box is added below the previous blank text box. You end up with loads of blank text boxes, one below the other. And there is no REMOVE/DELETE option to get rid of them once created. The only module that does that has bugs still (as of this date).

I have investigated this and found that the reason is (on my site) that the apparently blank text box actually has hidden HTML in it, which Drupal Core 7.14 believes indicates the box is not blank (when in fact it is).

Cause: Maybe use of editor like wysiwyg and/or text types that include rich text.

How I isolated problem: If you manually change the last blank text box to Plain Text instead of a rich text type before saving, it does not add the new blank text box.

Solution: Strip all HTML out of the box before assessing if it is blank or not.

A "remove" button for text fields at least would be great (wish list)!!! :)

Comments

Magiclogix’s picture

I was unable to reproduce the bug on a clean Drupal 7.14 install with the unlimited text field or unlimited text boxes (user chooses text format).

Your explanation is probably correct because wysisyg editors may start adding wrapper HTML or empty paragraphs when they are initialized.

I'd be interested to see a screenshot.

den33775’s picture

Sure. I'll put it into full HTML and hit the wysiwyg SOURCE button too, so I can show you what HTML is in the apparently blank box (although of course different editors may put different HTML into a 'blank' box. Will be Wednesday probably as I have to go into town tomorrow. I can think of 3 potential culprits off the top of my head: the editor (ckeditor), the front end (wysiwyg) or the html filter security module. Will try to isolate. Whatever is causing it though, other similar modules will probably do the same thing with different code (invisible html) so I reckon to cure cause rather than symptoms, solution is simply to strip out all html from text box along with leading spaces, and see if anything is left. Just a thought. I'll post more on Wednesday.

den33775’s picture

Did a whole lot of tests before work today. Tried Android browser on smart phone, Chrome and IE on wife's PC. Couldn't get fault to repeat. Even tried manually entering HTML in SOURCE mode to fool it into the fault, but it all worked perfectly.

On my main dev pc I have all main browsers, so will test on that later on my main dev PC. If it goes wrong there but not on my wife's PC or smart phone, then must be javascript related?

So far then, two possibilities I can think of - got fixed when I switched default text format to plain and stayed fixed when I changed it back to filtered HTML (doubt this but possible), or is browser related (javascript plus browser settings/security involved?).

Thought it'd be quick, this re-test! More later.

den33775’s picture

Hmmm. It's been completely behaving since I changed default text type to plain text then back to original filtered. Can't get it to go wrong now. Could have related to an OG group field privilege being set to not allow edit access or something. I've had the OG privileges module affect quite a few other modules in the past. Will report more if I can get it to repeat.

dcam’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)

Closing old issues.

It sounds like this ultimately wasn't reproducible.