preview button not hidden

walden - June 8, 2009 - 21:47
Project:UC Node Checkout
Version:6.x-2.0-beta3
Component:User interface
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The preview button is not hidden on the node creation form even though I ticked the disable box on admin/store/settings/node-checkout/registrant_profile. Is there another setting somewhere that overrides this? or maybe something else is wrong?

#1

matthewn - July 15, 2009 - 23:24

Same issue here. In need of a fix.

#2

drewish - July 24, 2009 - 00:58
Category:support request» bug report

Looks like it's storing the field here:

  if ($form_state['values']['disable_preview']) {
    $fields[] = 'preview';
  }

  variable_set('uc_node_checkout_'. $form_state['values']['type'] .'_restrictions', $fields);

But when we go to unset the fields:

      // Remove restricted fields for users without access.
      $fields = variable_get('uc_node_checkout_'. $type .'_restrictions', array());

      if (!empty($fields) && !user_access('edit any '. $type .' content')) {
        foreach ($fields as $field) {
          $form[$field]['#access'] = FALSE;
        }
      }

We're missing the preview button because we're looking at $form['preview'] rather than $form['buttons']['preview'].

#3

rszrama - July 30, 2009 - 17:23
Status:active» fixed

Thanks, drewish. Added a special case for the preview button. Duh. This should be fixed in beta4.

#4

System Message - August 13, 2009 - 17:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.