Problem/Motivation

The comment module depends on the node module but is missing that definition in its .info file.

This became problematic when running Simpletest tests that use the standard installation profile - that is every case that extends DrupalWebTestCase without specifying a non-standard installation profile - within a non-standard Drupal installation.
Install for example https://www.drupal.org/project/paddle, enable the Simpletest Drupal module and try to run for example the Drupal core 'Block caching' test.
You'll get

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'kanooh.simpletest237647node' doesn't exist: INSERT INTO {node_comment_statistics} (last_comment_timestamp, last_comment_uid, nid, comment_count, last_comment_name) SELECT n.created AS last_comment_timestamp, n.uid AS last_comment_uid, n.nid AS nid, 0 AS comment_count, NULL AS last_comment_name FROM {node} n LEFT OUTER JOIN {node_comment_statistics} ncs ON ncs.nid = n.nid WHERE (ncs.comment_count IS NULL ) ; Array ( ) in comment_enable() (line 48 of /Users/Sites/paddle/modules/comment/comment.install).

Proposed resolution

Define node module dependency in comment.info

User interface changes

The dependency will show up on the modules list.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

PieterDC’s picture

Assigned: PieterDC » Unassigned
Status: Active » Needs review
FileSize
404 bytes

Attaching patch.

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Wow, it is incredibly weird that this patch applies. :-)

Thanks!

angel.h’s picture

I tested this and it looks fine.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: node_dependency_in_comment_info_file-2376437-1.patch, failed testing.

Berdir’s picture

node is a required module in D7, I'm not sure how exactly you can get this?

Status: Needs work » Needs review