In some circumstances, the content type edit form (ie. /admin/content/node-type/TYPE) does not display existing Comment Closer settings - making it impossible to tell how the content type is currently set up. This is because the the form's #default_value keys sometimes aren't being set correctly.

I narrowed this down to comment_closer_form_alter, where the code pulls out the content type ($type) from the $form['identity']['type'] array. The code currently looks for $form['identity']['type']['#value']. This is correct when the content type is locked, but not when it is unlocked. In this case we need to pull $type from $form['identity']['type']['#default_value'].

I have written a patch that checks for the both #value and #default_value keys in setting $type, removing this problem.

Thanks, David.

CommentFileSizeAuthor
comment_closer-type-settings-fix.patch588 bytesdbassendine

Comments

rjmackay’s picture

Status: Active » Needs review

Any comment on this?
We're running this on a production site and its doing fine.
RTBC??

rmiddle’s picture

Status: Needs review » Fixed

Commit to 6.x branch. Not needed in 7.x branch.

Thanks
Robert

Status: Fixed » Closed (fixed)

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