diff --git a/commerce.info b/commerce.info index a9282bf..517d148 100644 --- a/commerce.info +++ b/commerce.info @@ -11,3 +11,10 @@ files[] = tests/commerce_base.test ; Central Entity Controller. files[] = includes/commerce.controller.inc + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/commerce.module b/commerce.module index 0c4ff57..e3c9c02 100644 --- a/commerce.module +++ b/commerce.module @@ -1058,6 +1058,10 @@ function commerce_entity_access_query_alter($query, $entity_type, $base_table = $account = $user; } + // Get the entity type info array for the current access check, needed to be + // able to find the correct base table. + $entity_info = entity_get_info($entity_type); + // Read the base table from the query if available or default to the first // table in the query's tables array. if (!isset($base_table) && !$base_table = $query->getMetaData('base_table')) { @@ -1065,7 +1069,17 @@ function commerce_entity_access_query_alter($query, $entity_type, $base_table = // in an invalid query if the first table is not the table we expect, // forcing the caller to actually properly pass a base table in that case. $tables = &$query->getTables(); - $base_table = key($tables); + // Try to find the table that matches the base table for the entity. + foreach ($tables as $table_name => $table_info) { + if ($table_info['table'] == $entity_info['base table']) { + $base_table = $table_name; + break; + } + } + // Fallback, take the first table. Should never be needed. + if (!isset($base_table)) { + $base_table = key($tables); + } } // Do not apply any conditions for users with administrative view permissions. @@ -1074,9 +1088,7 @@ function commerce_entity_access_query_alter($query, $entity_type, $base_table = return; } - // Get the entity type info array for the current access check and prepare a - // conditions object. - $entity_info = entity_get_info($entity_type); + // Prepare a conditions object. $conditions = db_or(); // Perform bundle specific permission checks for the specified entity type. diff --git a/commerce_ui.info b/commerce_ui.info index 9bd5aca..3855469 100644 --- a/commerce_ui.info +++ b/commerce_ui.info @@ -3,3 +3,10 @@ description = Defines menu items common to the various Drupal Commerce UI module package = Commerce dependencies[] = commerce core = 7.x + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/cart/commerce_cart.info b/modules/cart/commerce_cart.info index 24f3a91..808726b 100644 --- a/modules/cart/commerce_cart.info +++ b/modules/cart/commerce_cart.info @@ -19,3 +19,10 @@ files[] = includes/views/handlers/commerce_cart_plugin_argument_default_current_ ; Simple tests files[] = tests/commerce_cart.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/checkout/commerce_checkout.info b/modules/checkout/commerce_checkout.info index 02faa02..41560ed 100644 --- a/modules/checkout/commerce_checkout.info +++ b/modules/checkout/commerce_checkout.info @@ -11,3 +11,10 @@ configure = admin/commerce/config/checkout ; Simple tests files[] = tests/commerce_checkout.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/customer/commerce_customer.info b/modules/customer/commerce_customer.info index de080ec..1964738 100644 --- a/modules/customer/commerce_customer.info +++ b/modules/customer/commerce_customer.info @@ -20,3 +20,10 @@ files[] = includes/views/handlers/commerce_customer_handler_filter_customer_prof ; Simple tests ; files[] = tests/commerce_customer.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/customer/commerce_customer_ui.info b/modules/customer/commerce_customer_ui.info index 7aa9ffa..a7a5eb4 100644 --- a/modules/customer/commerce_customer_ui.info +++ b/modules/customer/commerce_customer_ui.info @@ -19,3 +19,10 @@ files[] = includes/views/commerce_customer_ui.views_default.inc ; Simple tests files[] = tests/commerce_customer_ui.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/customer/tests/commerce_customer_profile_dummy_type.info b/modules/customer/tests/commerce_customer_profile_dummy_type.info index 25a2461..a9a04be 100644 --- a/modules/customer/tests/commerce_customer_profile_dummy_type.info +++ b/modules/customer/tests/commerce_customer_profile_dummy_type.info @@ -5,3 +5,10 @@ dependencies[] = commerce version = VERSION core = 7.x hidden = TRUE + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/line_item/commerce_line_item.info b/modules/line_item/commerce_line_item.info index bb77874..5b0ee17 100644 --- a/modules/line_item/commerce_line_item.info +++ b/modules/line_item/commerce_line_item.info @@ -21,3 +21,10 @@ files[] = includes/views/handlers/commerce_line_item_handler_field_edit_delete.i ; Simple tests ; files[] = tests/commerce_line_item.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/line_item/commerce_line_item_ui.info b/modules/line_item/commerce_line_item_ui.info index 5e21398..7b6e425 100644 --- a/modules/line_item/commerce_line_item_ui.info +++ b/modules/line_item/commerce_line_item_ui.info @@ -9,3 +9,10 @@ dependencies[] = commerce_line_item dependencies[] = views core = 7.x configure = admin/commerce/config/line-items + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/order/commerce_order.info b/modules/order/commerce_order.info index fdd3136..4aeccc2 100644 --- a/modules/order/commerce_order.info +++ b/modules/order/commerce_order.info @@ -37,3 +37,10 @@ files[] = includes/views/handlers/commerce_order_plugin_argument_validate_user.i ; Tests files[] = tests/commerce_order.rules.test files[] = tests/commerce_order.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/order/commerce_order_ui.info b/modules/order/commerce_order_ui.info index 71353e9..c368507 100644 --- a/modules/order/commerce_order_ui.info +++ b/modules/order/commerce_order_ui.info @@ -16,3 +16,10 @@ files[] = includes/views/handlers/commerce_order_ui_handler_area_view_order_form ; Simple tests files[] = tests/commerce_order_ui.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/payment/commerce_payment.info b/modules/payment/commerce_payment.info index ac799a3..6b72eae 100644 --- a/modules/payment/commerce_payment.info +++ b/modules/payment/commerce_payment.info @@ -29,3 +29,10 @@ files[] = includes/views/handlers/commerce_payment_handler_field_balance.inc ; Tests files[] = tests/commerce_payment.rules.test ;files[] = tests/commerce_payment.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/payment/commerce_payment_ui.info b/modules/payment/commerce_payment_ui.info index 228aa40..d2eac79 100644 --- a/modules/payment/commerce_payment_ui.info +++ b/modules/payment/commerce_payment_ui.info @@ -11,3 +11,10 @@ configure = admin/commerce/config/payment-methods ; Simple tests files[] = tests/commerce_payment_ui.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/payment/modules/commerce_payment_example.info b/modules/payment/modules/commerce_payment_example.info index e9a82f9..2b04de1 100644 --- a/modules/payment/modules/commerce_payment_example.info +++ b/modules/payment/modules/commerce_payment_example.info @@ -4,3 +4,10 @@ package = Commerce dependencies[] = commerce dependencies[] = commerce_payment core = 7.x + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/payment/tests/commerce_payment_dummy_offsite.info b/modules/payment/tests/commerce_payment_dummy_offsite.info index 4fd1616..670458d 100644 --- a/modules/payment/tests/commerce_payment_dummy_offsite.info +++ b/modules/payment/tests/commerce_payment_dummy_offsite.info @@ -4,3 +4,10 @@ package = Testing version = VERSION core = 7.x hidden = TRUE + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/price/commerce_price.info b/modules/price/commerce_price.info index 85fc8f5..b570335 100644 --- a/modules/price/commerce_price.info +++ b/modules/price/commerce_price.info @@ -13,3 +13,10 @@ files[] = includes/views/commerce_price.views.inc ; Views handlers files[] = includes/views/handlers/commerce_price_handler_filter_commerce_price_amount.inc + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/product/commerce_product.info b/modules/product/commerce_product.info index abc14e8..ab0db06 100644 --- a/modules/product/commerce_product.info +++ b/modules/product/commerce_product.info @@ -25,3 +25,10 @@ files[] = includes/commerce_product.translation_handler.inc ; Simple tests files[] = tests/commerce_product.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/product/commerce_product_ui.info b/modules/product/commerce_product_ui.info index 67b808b..f58bcb4 100644 --- a/modules/product/commerce_product_ui.info +++ b/modules/product/commerce_product_ui.info @@ -12,3 +12,10 @@ configure = admin/commerce/products/types ; Simple tests files[] = tests/commerce_product_ui.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/product/commerce_product_ui.module b/modules/product/commerce_product_ui.module index 9904af3..c8f408b 100644 --- a/modules/product/commerce_product_ui.module +++ b/modules/product/commerce_product_ui.module @@ -261,7 +261,7 @@ function commerce_product_ui_entity_info_alter(&$entity_info) { $entity_info['commerce_product']['uri callback'] = 'commerce_product_ui_product_uri'; // Add callbacks and urls for administer translations. - $entity_info['commerce_product']['translation']['entity_translation'] += array( + $entity_info['commerce_product']['translation']['entity_translation'] = array( 'base path' => 'admin/commerce/products/%commerce_product', 'access callback' => 'commerce_product_entity_translation_tab_access', 'access arguments' => array(3), diff --git a/modules/product_pricing/commerce_product_pricing.info b/modules/product_pricing/commerce_product_pricing.info index 9c8654d..68d0d3c 100644 --- a/modules/product_pricing/commerce_product_pricing.info +++ b/modules/product_pricing/commerce_product_pricing.info @@ -8,3 +8,10 @@ dependencies[] = entity dependencies[] = rules dependencies[] = rules_admin core = 7.x + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/product_pricing/commerce_product_pricing_ui.info b/modules/product_pricing/commerce_product_pricing_ui.info index 717a7e1..c13d984 100644 --- a/modules/product_pricing/commerce_product_pricing_ui.info +++ b/modules/product_pricing/commerce_product_pricing_ui.info @@ -9,3 +9,10 @@ dependencies[] = commerce_product_pricing dependencies[] = commerce_product_reference core = 7.x configure = admin/commerce/config/product-pricing + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/product_reference/commerce_product_reference.info b/modules/product_reference/commerce_product_reference.info index cf3f6b4..4e83e42 100644 --- a/modules/product_reference/commerce_product_reference.info +++ b/modules/product_reference/commerce_product_reference.info @@ -14,3 +14,10 @@ files[] = includes/views/handlers/commerce_product_reference_handler_filter_prod ; Simple tests files[] = tests/commerce_product_reference.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/tax/commerce_tax.info b/modules/tax/commerce_tax.info index 8c64167..93f82d0 100644 --- a/modules/tax/commerce_tax.info +++ b/modules/tax/commerce_tax.info @@ -11,3 +11,10 @@ core = 7.x ; Simple tests ;files[] = tests/commerce_tax.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" + diff --git a/modules/tax/commerce_tax_ui.info b/modules/tax/commerce_tax_ui.info index 1978303..3ba6e77 100644 --- a/modules/tax/commerce_tax_ui.info +++ b/modules/tax/commerce_tax_ui.info @@ -9,3 +9,10 @@ configure = admin/commerce/config/taxes ; Simple tests files[] = tests/commerce_tax_ui.test + +; Information added by drupal.org packaging script on 2012-01-25 +version = "7.x-1.2" +core = "7.x" +project = "commerce" +datestamp = "1327528840" +