diff --git a/auto_nodetitle.admin.inc b/auto_nodetitle.admin.inc index db4b92b..2643ed6 100644 --- a/auto_nodetitle.admin.inc +++ b/auto_nodetitle.admin.inc @@ -10,7 +10,8 @@ */ function auto_nodetitle_settings_form($form, $form_state, $entity_type, $bundle_arg) { $entity = entity_get_info($entity_type); - $key = $entity_type . '_' . $bundle_arg->{$entity['bundle keys']['bundle']}; + $bundle_name = isset($bundle_arg->{$entity['bundle keys']['bundle']}) ? $bundle_arg->{$entity['bundle keys']['bundle']} : $bundle_arg; + $key = $entity_type . '_' . $bundle_name; $default_value = auto_nodetitle_get_setting($key); $form['auto_nodetitle'] = array( '#type' => 'fieldset', diff --git a/auto_nodetitle.module b/auto_nodetitle.module index 6197ab7..0bac57a 100644 --- a/auto_nodetitle.module +++ b/auto_nodetitle.module @@ -320,7 +320,7 @@ function _auto_nodetitle_get_settings($entity, $entity_type) { $entity_info = entity_get_info($entity_type); if ($entity_info['entity keys']['bundle']) { $result['key'] = $entity_type . '_' . $entity->{$entity_info['entity keys']['bundle']}; - $result['title'] = $entity_info['entity keys']['label']; + $result['title'] = isset($entity_info['entity keys']['label']) ? $entity_info['entity keys']['label']: 'none'; return $result; } return FALSE;