Skip to content
Snippets Groups Projects
Commit c36b1847 authored by Ryan Szrama's avatar Ryan Szrama
Browse files

Issue #1207242 by rfay, rszrama: fix the product form submission routine to...

Issue #1207242 by rfay, rszrama: fix the product form submission routine to check the access type on the revision checkbox when determining whether or not to create a new revision.
parent 17aa7739
No related branches found
No related tags found
No related merge requests found
......@@ -171,7 +171,10 @@ function commerce_product_product_form_submit($form, &$form_state) {
$product->uid = $user->uid;
}
if ($form_state['values']['revision'] || !empty($form_state['values']['log'])) {
// Trigger a new revision if the checkbox was enabled or a log message supplied.
if ((user_access('administer commerce_product entities') && !empty($form_state['values']['revision'])) ||
(!user_access('administer commerce_product entities') && !empty($form['change_history']['revision']['#default_value'])) ||
!empty($form_state['values']['log'])) {
$product->revision = TRUE;
$product->log = $form_state['values']['log'];
}
......
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