Closed (fixed)
Project:
Webform
Version:
6.x-2.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jul 2009 at 10:03 UTC
Updated:
24 Feb 2010 at 05:30 UTC
The teardown method in tests/webform.test removes all nodes for a certain user ID and then deletes the user account. Somehow, running the test script as user 1 all nodes that do not belong to user 1 are deleted regardless of their type.
I tried a fix of the query:
foreach ($this->webform_users as $user) {
$uid = $user->uid;
$result = db_query('SELECT nid FROM {node} WHERE uid = %d', $uid);
while ($node = db_fetch_array($result)) {
node_delete($node['nid']);
}
user_delete(array(), $uid);
}
to
foreach ($this->webform_users as $user) {
$uid = $user->uid;
$result = db_query("SELECT nid FROM {node} WHERE uid = %d AND type = '%s'", $uid, 'webform');
while ($node = db_fetch_array($result)) {
node_delete($node['nid']);
}
user_delete(array(), $uid);
}
but this still results in existing webform nodes with uid 3 to be deleted.
I'll try to retrieve the cause to this and will report anything I find. Thanks in advance for any fixes!
Comments
Comment #1
teezee commented-update Sorry forgot the most important word NOT in the title :S
Comment #2
quicksketchI believe I fixed this problem as part of getting our tests working again in #678618: SimpleTest for webform in drupal 6. The key being I moved the parent:tearDown() call to the bottom of Webform's tearDown() method. Previously SimpleTest was tearing down first and removing a lot of information we needed in our own tearDown() call.