Commit 10a5ba71 authored by Dries's avatar Dries

- Patch #482920 by Razorraser: fixed typo in node_access_rebuild().

parent f8dace9c
......@@ -789,7 +789,7 @@ function node_type_set_defaults($info = array()) {
* @param $hook
* A string containing the name of the hook.
* @return
* TRUE iff the $hook exists in the node type of $node.
* TRUE if the $hook exists in the node type of $node.
*/
function node_hook($node, $hook) {
$base = node_type_get_base($node);
......@@ -2870,7 +2870,7 @@ function node_access_rebuild($batch_mode = FALSE) {
}
else {
// Not using any node_access modules. Add the default grant.
db_insert('node_accesss')
db_insert('node_access')
->fields(array(
'nid' => 0,
'realm' => 'all',
......@@ -3392,7 +3392,7 @@ function node_requirements($phase) {
$requirements['node_access'] = array(
'title' => $t('Node Access Permissions'),
'value' => $value,
'description' => $description . ' ' . l('Rebuild Permissions', 'admin/reports/status/rebuild'),
'description' => $description . ' ' . l('Rebuild permissions', 'admin/reports/status/rebuild'),
);
return $requirements;
}
......@@ -833,3 +833,59 @@ class NodeTypeTestCase extends DrupalWebTestCase {
$this->assertEqual($node_types['page']->base, node_type_get_base('page'), t('Correct node type base has been returned.'));
}
}
/**
* Rebuild the node_access table.
*/
class NodeAccessRebuildTestCase extends DrupalWebTestCase {
function getInfo() {
return array(
'name' => t('Node access rebuild'),
'description' => t('Ensures that node access rebuild functions work correctly.'),
'group' => t('Node'),
);
}
function setUp() {
parent::setUp();
$web_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports'));
$this->drupalLogin($web_user);
$this->web_user = $web_user;
}
function testNodeAccessRebuild() {
$this->drupalGet('admin/reports/status');
$this->clickLink(t('Rebuild permissions'));
$this->drupalPost(NULL, array(), t('Rebuild permissions'));
$this->assertText(t('Content permissions have been rebuilt.'));
}
}
/**
* Rebuild the node_access table.
*/
class NodeAccessRebuildTestCase extends DrupalWebTestCase {
function getInfo() {
return array(
'name' => t('Node access rebuild'),
'description' => t('Ensures that node access rebuild functions work correctly.'),
'group' => t('Node'),
);
}
function setUp() {
parent::setUp();
$web_user = $this->drupalCreateUser(array('administer site configuration', 'access administration pages', 'access site reports'));
$this->drupalLogin($web_user);
$this->web_user = $web_user;
}
function testNodeAccessRebuild() {
$this->drupalGet('admin/reports/status');
$this->clickLink(t('Rebuild permissions'));
$this->drupalPost(NULL, array(), t('Rebuild permissions'));
$this->assertText(t('Content permissions have been rebuilt.'));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment