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 |
Jump to:
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
Same issue here. In need of a fix.
#2
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
Thanks, drewish. Added a special case for the preview button. Duh. This should be fixed in beta4.
#4
Automatically closed -- issue fixed for 2 weeks with no activity.