update to D 7.17

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy
2012-12-08 11:35:42 +01:00
parent 975d758599
commit 5396b3e2b5
284 changed files with 3674 additions and 1854 deletions

View File

@@ -9,8 +9,8 @@ files[] = forum.test
configure = admin/structure/forum
stylesheets[all][] = forum.css
; Information added by drupal.org packaging script on 2012-10-17
version = "7.16"
; Information added by drupal.org packaging script on 2012-11-07
version = "7.17"
project = "drupal"
datestamp = "1350508567"
datestamp = "1352325357"

View File

@@ -330,10 +330,12 @@ function forum_node_presave($node) {
$langcode = key($node->taxonomy_forums);
if (!empty($node->taxonomy_forums[$langcode])) {
$node->forum_tid = $node->taxonomy_forums[$langcode][0]['tid'];
$old_tid = db_query_range("SELECT f.tid FROM {forum} f INNER JOIN {node} n ON f.vid = n.vid WHERE n.nid = :nid ORDER BY f.vid DESC", 0, 1, array(':nid' => $node->nid))->fetchField();
if ($old_tid && isset($node->forum_tid) && ($node->forum_tid != $old_tid) && !empty($node->shadow)) {
// A shadow copy needs to be created. Retain new term and add old term.
$node->taxonomy_forums[$langcode][] = array('tid' => $old_tid);
if (isset($node->nid)) {
$old_tid = db_query_range("SELECT f.tid FROM {forum} f INNER JOIN {node} n ON f.vid = n.vid WHERE n.nid = :nid ORDER BY f.vid DESC", 0, 1, array(':nid' => $node->nid))->fetchField();
if ($old_tid && isset($node->forum_tid) && ($node->forum_tid != $old_tid) && !empty($node->shadow)) {
// A shadow copy needs to be created. Retain new term and add old term.
$node->taxonomy_forums[$langcode][] = array('tid' => $old_tid);
}
}
}
}
@@ -1328,7 +1330,7 @@ function _forum_get_topic_order($sortby) {
* The ID of the node to update.
*/
function _forum_update_forum_index($nid) {
$count = db_query('SELECT COUNT(cid) FROM {comment} WHERE nid = :nid AND status = :status', array(
$count = db_query('SELECT COUNT(cid) FROM {comment} c INNER JOIN {forum_index} i ON c.nid = i.nid WHERE c.nid = :nid AND c.status = :status', array(
':nid' => $nid,
':status' => COMMENT_PUBLISHED,
))->fetchField();

View File

@@ -197,6 +197,14 @@ class ForumTestCase extends DrupalWebTestCase {
$this->drupalGet('forum/' . $this->forum['tid']);
$this->drupalPost("node/$node->nid/edit", array(), t('Save'));
$this->assertResponse(200);
// Make sure constructing a forum node programmatically produces no notices.
$node = new stdClass;
$node->type = 'forum';
$node->title = 'Test forum notices';
$node->uid = 1;
$node->taxonomy_forums[LANGUAGE_NONE][0]['tid'] = $this->root_forum['tid'];
node_save($node);
}
/**