If the body field doesn't exist and Maxlength is set on some other CCK field, WYSIWYG doesn't work. Attached patch fixes.

Comments

mrfelton’s picture

StatusFileSize
new793 bytes
dawehner’s picture

Status: Needs review » Needs work
+++ maxlength.module	(working copy)
@@ -59,9 +59,10 @@
+  if (is_array($form['body_field']['body'])) {

Wouldn't be a isset be enough?

Powered by Dreditor.

mrfelton’s picture

@dereine: I imagine it would. Are there performance implications using is_array vs isset?

dawehner’s picture

Not really, but php should be logic fine, if you just read the code. There isset is more what the value of the array is, and should be checked.

mrtoner’s picture

Status: Needs work » Needs review
StatusFileSize
new661 bytes

I confirmed this independently while trying to fix an issue with Better Formats module. The attached patch is identical to #1, but uses isset.

noel.rivas’s picture

I found the same issue while working with nodecomment and maxlength. I created issue #836168: Altering body field causes conflicts with other modules whose proposed fix is almost identical to the one found here, the only difference being altering the comment before the conditional, which I find trivial. The issue is now marked as duplicate.

The isset fix is working for me as well.

Suscribing the patch on #5

dawehner’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.