If the comment module is disabled and you go to admin/appearance/settings you will still see "User pictures in comments" and "User verification status in comments" in the "Toggle display" section, which doesn't make a whole lot of sense.

The code for adding these should ideally live in the comment module.

This is somewhat complicated by the fact that these toggles appear because they are "theme features" (hardcoded in http://api.drupal.org/api/function/_system_rebuild_theme_data/7). If we removed them from there, then as far as I can tell with the way the code currently works, this would make things a lot more difficult for themes that want to communicate that they are either including or excluding these particular features in their theme. If we can't get around this limitation in D7, we might have to leave them as a hardcoded theme feature, but still move the UI toggle code to the comment module where it belongs, so that it doesn't appear in the UI when the comment module is disabled.

CommentFileSizeAuthor
#2 629826.patch836 bytesjody lynn

Comments

jody lynn’s picture

Status: Active » Needs review
StatusFileSize
new836 bytes

Disabling them when comment module is not enabled seems consistent with what happens when user pictures are not set on.

David_Rothstein’s picture

Doesn't completely solve the issue, but it's an improvement over the current situation. And the patch seems to work fine.

The module_exists('comment') check makes me slightly uneasy because in theory someone could write an alternative to the core comment module which expects to be able to respect those theme settings. I'm holding off on marking RTBC to see if anyone has any thoughts on that, but otherwise it's RTBC.

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

The code is similar to the one present in the Drupal 6 version of the function, which contained the following code

  if (!module_exists('search')) {
    $disabled['toggle_search'] = TRUE;
  }

I understand the argument about a third-party module that replaces comment.module; as far as I can see, Drupal core code doesn't check the presence of a third-party module, though.

dries’s picture

I can't think of another solution, except for moving these settings to comment module and form_altering it it -- sounds a little bit complex so I'm quite OK with this patch.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

Status: Fixed » Closed (fixed)

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