summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBojan Zivanovic2013-08-15 17:12:32 (GMT)
committer Bojan Zivanovic2013-08-15 17:12:32 (GMT)
commit0677956d6b018976d90dfe03ea823786304a8572 (patch)
treec3f3747164b855f0d3f714b8cc2f3f4b71562c32
parent221357c313ecff6bd585172ac5d816cdcc29bf0f (diff)
Issue #2066109: Disable SQL rewriting for the Files view.
-rw-r--r--commerce_file.install9
-rw-r--r--includes/views/commerce_file.views_default.inc5
2 files changed, 3 insertions, 11 deletions
diff --git a/commerce_file.install b/commerce_file.install
index b8e8f61..c23b0cc 100644
--- a/commerce_file.install
+++ b/commerce_file.install
@@ -103,15 +103,6 @@ function commerce_file_install() {
'default' => 0,
);
db_change_field('file_managed', 'filesize', 'filesize', $spec);
-
- // Grant the "view any commerce_product entity" permission to all
- // authenticated roles, since it's needed for the My Files view to work.
- // Most installations already have this done, but doing it here explicitly
- // ensures an easier initial setup.
- $roles = user_roles(TRUE);
- foreach ($roles as $rid => $name) {
- user_role_change_permissions($rid, array('view any commerce_product entity' => TRUE));
- }
}
/**
diff --git a/includes/views/commerce_file.views_default.inc b/includes/views/commerce_file.views_default.inc
index 57b87f7..4098485 100644
--- a/includes/views/commerce_file.views_default.inc
+++ b/includes/views/commerce_file.views_default.inc
@@ -29,6 +29,7 @@ function commerce_file_views_default_views() {
$handler->display->display_options['access']['perm'] = 'view own licenses';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
+ $handler->display->display_options['query']['options']['disable_sql_rewrite'] = TRUE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '20';
@@ -98,7 +99,7 @@ function commerce_file_views_default_views() {
$handler->display->display_options['relationships']['commerce_file_fid']['field'] = 'commerce_file_fid';
$handler->display->display_options['relationships']['commerce_file_fid']['relationship'] = 'product';
$handler->display->display_options['relationships']['commerce_file_fid']['required'] = TRUE;
- /* Field: Commerce License: Commerce license ID */
+ /* Field: Commerce License: License ID */
$handler->display->display_options['fields']['license_id']['id'] = 'license_id';
$handler->display->display_options['fields']['license_id']['table'] = 'commerce_license';
$handler->display->display_options['fields']['license_id']['field'] = 'license_id';
@@ -179,7 +180,7 @@ function commerce_file_views_default_views() {
$handler->display->display_options['menu']['weight'] = '0';
$handler->display->display_options['menu']['context'] = 0;
$handler->display->display_options['menu']['context_only_inline'] = 0;
- $translatables['licensed_files'] = array(
+ $translatables['commerce_license_my_files'] = array(
t('Master'),
t('Files'),
t('more'),