summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-08-18 14:18:30 +0200
committerwebchick <webchick@24967.no-reply.drupal.org>2012-08-18 14:18:30 +0200
commitdd1daf8114d1ef33df37b0893774f8793ce777c5 (patch)
tree465d95f7f459018a47faf2f36c308a3892843f68 /modules/node
parented9bee506538094810d6da37c782db230ae57710 (diff)
downloadbrdo-dd1daf8114d1ef33df37b0893774f8793ce777c5.tar.gz
brdo-dd1daf8114d1ef33df37b0893774f8793ce777c5.tar.bz2
Issue #1679594 by sun: Fixed node_requirements() breaks Drupal installer.
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.module37
1 files changed, 19 insertions, 18 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 264816c00..74868341f 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -3891,24 +3891,25 @@ function node_unpublish_by_keyword_action($node, $context) {
*/
function node_requirements($phase) {
$requirements = array();
- // Ensure translations don't break at install time
- $t = get_t();
- // Only show rebuild button if there are either 0, or 2 or more, rows
- // in the {node_access} table, or if there are modules that
- // implement hook_node_grants().
- $grant_count = db_query('SELECT COUNT(*) FROM {node_access}')->fetchField();
- if ($grant_count != 1 || count(module_implements('node_grants')) > 0) {
- $value = format_plural($grant_count, 'One permission in use', '@count permissions in use', array('@count' => $grant_count));
- } else {
- $value = $t('Disabled');
- }
- $description = $t('If the site is experiencing problems with permissions to content, you may have to rebuild the permissions cache. Rebuilding will remove all privileges to content and replace them with permissions based on the current modules and settings. Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed, content will automatically use the new permissions.');
-
- $requirements['node_access'] = array(
- 'title' => $t('Node Access Permissions'),
- 'value' => $value,
- 'description' => $description . ' ' . l(t('Rebuild permissions'), 'admin/reports/status/rebuild'),
- );
+ if ($phase === 'runtime') {
+ // Only show rebuild button if there are either 0, or 2 or more, rows
+ // in the {node_access} table, or if there are modules that
+ // implement hook_node_grants().
+ $grant_count = db_query('SELECT COUNT(*) FROM {node_access}')->fetchField();
+ if ($grant_count != 1 || count(module_implements('node_grants')) > 0) {
+ $value = format_plural($grant_count, 'One permission in use', '@count permissions in use', array('@count' => $grant_count));
+ }
+ else {
+ $value = t('Disabled');
+ }
+ $description = t('If the site is experiencing problems with permissions to content, you may have to rebuild the permissions cache. Rebuilding will remove all privileges to content and replace them with permissions based on the current modules and settings. Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed, content will automatically use the new permissions.');
+
+ $requirements['node_access'] = array(
+ 'title' => t('Node Access Permissions'),
+ 'value' => $value,
+ 'description' => $description . ' ' . l(t('Rebuild permissions'), 'admin/reports/status/rebuild'),
+ );
+ }
return $requirements;
}