summaryrefslogtreecommitdiff
path: root/modules/field_ui
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-10-09 07:55:41 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-10-09 07:55:41 -0700
commit4c90f539bde6a0b635c18b20dc592ef4cab8f268 (patch)
tree12c1acb37534155d2b4e570caeb39203962d8c0b /modules/field_ui
parentf429c2716ee22754e3fcccc91ad1818b9fda3785 (diff)
downloadbrdo-4c90f539bde6a0b635c18b20dc592ef4cab8f268.tar.gz
brdo-4c90f539bde6a0b635c18b20dc592ef4cab8f268.tar.bz2
Issue #1115106 by Damien Tournoud: Fixed Failures to update a field are not properly handed in SQL Storage and Field UI.
Diffstat (limited to 'modules/field_ui')
-rw-r--r--modules/field_ui/field_ui.admin.inc14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/field_ui/field_ui.admin.inc b/modules/field_ui/field_ui.admin.inc
index ce84d83e5..f4fd3d7ba 100644
--- a/modules/field_ui/field_ui.admin.inc
+++ b/modules/field_ui/field_ui.admin.inc
@@ -1597,10 +1597,8 @@ function field_ui_field_settings_form_submit($form, &$form_state) {
drupal_set_message(t('Updated field %label field settings.', array('%label' => $instance['label'])));
$form_state['redirect'] = field_ui_next_destination($entity_type, $bundle);
}
- catch (FieldException $e) {
+ catch (Exception $e) {
drupal_set_message(t('Attempt to update field %label failed: %message.', array('%label' => $instance['label'], '%message' => $e->getMessage())), 'error');
- // TODO: Where do we go from here?
- $form_state['redirect'] = field_ui_next_destination($entity_type, $bundle);
}
}
@@ -1671,7 +1669,7 @@ function field_ui_widget_type_form_submit($form, &$form_state) {
field_update_instance($instance);
drupal_set_message(t('Changed the widget for field %label.', array('%label' => $instance['label'])));
}
- catch (FieldException $e) {
+ catch (Exception $e) {
drupal_set_message(t('There was a problem changing the widget for field %label.', array('%label' => $instance['label'])));
}
@@ -1999,7 +1997,13 @@ function field_ui_field_edit_form_submit($form, &$form_state) {
// Update any field settings that have changed.
$field_source = field_info_field($instance['field_name']);
$field = array_merge($field_source, $field);
- field_update_field($field);
+ try {
+ field_update_field($field);
+ }
+ catch (Exception $e) {
+ drupal_set_message(t('Attempt to update field %label failed: %message.', array('%label' => $instance['label'], '%message' => $e->getMessage())), 'error');
+ return;
+ }
// Handle the default value.
if (isset($form['instance']['default_value_widget'])) {