Skip to content
Snippets Groups Projects
Commit 182711dc authored by Bojan Živanović's avatar Bojan Živanović
Browse files

Add missing update hooks for the views price fix, change permission names.

parent f7ae70e3
No related branches found
No related tags found
No related merge requests found
<?php
/**
* @file
* Post update functions for Cart.
*/
/**
* Revert Cart views to fix broken Price fields.
*/
function commerce_cart_post_update_1() {
$config_updater = \Drupal::service('commerce.config_updater');
$views = [
'views.view.commerce_cart_block',
'views.view.commerce_cart_form',
'views.view.commerce_carts',
];
$result = $config_updater->revert($views, FALSE);
$success_results = $result->getSucceeded();
$failure_results = $result->getFailed();
if ($success_results) {
$message = t('Succeeded:') . '<br>';
foreach ($success_results as $success_message) {
$message .= $success_message . '<br>';
}
$message .= '<br>';
}
if ($failure_results) {
$message .= t('Failed:') . '<br>';
foreach ($failure_results as $failure_message) {
$message .= $failure_message . '<br>';
}
}
return $message;
}
......@@ -29,7 +29,7 @@ display:
access:
type: perm
options:
perm: 'administer commerce_order'
perm: 'access commerce_order overview'
cache:
type: none
options: { }
......
<?php
/**
* @file
* Post update functions for Checkout.
*/
/**
* Revert Checkout views to fix broken Price fields.
*/
function commerce_checkout_post_update_1() {
$config_updater = \Drupal::service('commerce.config_updater');
$views = [
'views.view.commerce_checkout_order_summary',
];
$result = $config_updater->revert($views, FALSE);
$success_results = $result->getSucceeded();
$failure_results = $result->getFailed();
if ($success_results) {
$message = t('Succeeded:') . '<br>';
foreach ($success_results as $success_message) {
$message .= $success_message . '<br>';
}
$message .= '<br>';
}
if ($failure_results) {
$message .= t('Failed:') . '<br>';
foreach ($failure_results as $failure_message) {
$message .= $failure_message . '<br>';
}
}
return $message;
}
<?php
/**
* @file
* Post update functions for Order.
*/
/**
* Revert Order views to fix broken Price fields.
*/
function commerce_order_post_update_1() {
$config_updater = \Drupal::service('commerce.config_updater');
$views = [
'views.view.commerce_order_item_table',
'views.view.commerce_user_orders',
'views.view.commerce_orders',
];
$result = $config_updater->revert($views, FALSE);
$success_results = $result->getSucceeded();
$failure_results = $result->getFailed();
if ($success_results) {
$message = t('Succeeded:') . '<br>';
foreach ($success_results as $success_message) {
$message .= $success_message . '<br>';
}
$message .= '<br>';
}
if ($failure_results) {
$message .= t('Failed:') . '<br>';
foreach ($failure_results as $failure_message) {
$message .= $failure_message . '<br>';
}
}
return $message;
}
......@@ -28,7 +28,7 @@ display:
access:
type: perm
options:
perm: 'administer commerce_order'
perm: 'access commerce_order overview'
cache:
type: none
options: { }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment