Simple localized one-liner patch attached which fixes this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wesley Tanaka’s picture

Status: Active » Reviewed & tested by the community

sorry if the patch doesn't apply automatically properly -- I edited out the irrelevant parts of a much larger diff and saved that edit job as this patch file.

Dries’s picture

That code should probably use the new comment.module directives.

Wesley Tanaka’s picture

FileSize
450 bytes

What does that mean? I'm pretty unfamiliar with the codebase.

My one guess is that you mean it should be using these defined constants instead of 0 and 1:

/**
 * Constants to define a node's comment state
 */
define('COMMENT_NODE_DISABLED', 0);
define('COMMENT_NODE_READ_ONLY', 1);
define('COMMENT_NODE_READ_WRITE', 2);

Patch applied to do that. Uses defined() to test if COMMENT_NODE_DISABLED has been set.

chx’s picture

Status: Reviewed & tested by the community » Needs work

no need to check whether the constant is defined, forum does not work without comment.

And if "I'm pretty unfamiliar with the codebase" then please do not set ready to be commited for yourself, let others review your patch. (I sometimes set this for my own patches because I am too unpatient but that's definitely not good practice)

Thanks for your activity.

Wesley Tanaka’s picture

Status: Needs work » Needs review
FileSize
414 bytes

Thanks for the pointer on process.

I believe that the constant should be checked for, but anyway here's another patch without the check. I changed '==' to '===' to try to help mitigate this extra assumption.

Wesley Tanaka’s picture

FileSize
412 bytes

Oops, I thought I had tested the === condition, but it was actually a cached page I was looking at (drupal's caching behavior still confuses me a bit).

This time it works.

Wesley Tanaka’s picture

so is this code okay?

Dries’s picture

Looks perfect. Committed to HEAD. Thanks.

Dries’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)