diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-03-27 05:13:55 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2007-03-27 05:13:55 +0000 |
commit | f7440d4d73ec57219af232c135be3b2567dda45f (patch) | |
tree | a6b7d947eda1c7bfc2197bfb584f7b17143c97a5 /modules/path | |
parent | f2ca29071fe33603cf22f1603a3e6a61ee9c0814 (diff) | |
download | brdo-f7440d4d73ec57219af232c135be3b2567dda45f.tar.gz brdo-f7440d4d73ec57219af232c135be3b2567dda45f.tar.bz2 |
#130971: Kitchen sink (E_NOTICE compliance / Code style / Bugfix in book toc)
Diffstat (limited to 'modules/path')
-rw-r--r-- | modules/path/path.module | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/path/path.module b/modules/path/path.module index f78300f1c..b00f7b998 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -184,7 +184,7 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL, $language = '' /** * Return a form for editing or creating an individual URL alias. */ -function path_form($edit = '') { +function path_form($edit = array('src' => '', 'dst' => '', 'pid' => NULL)) { $form['#submit']['path_form_submit'] = array(); $form['#validate']['path_form_validate'] = array(); $form['#theme'] = 'path_form'; @@ -272,7 +272,7 @@ function path_nodeapi(&$node, $op, $arg) { * Implementation of hook_form_alter(). */ function path_form_alter(&$form, $form_id) { - if (isset($form['type']) && $form['type']['#value'] .'_node_form' == $form_id) { + if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) { $path = isset($form['#node']->path) ? $form['#node']->path : NULL; $form['path'] = array( '#type' => 'fieldset', @@ -362,7 +362,7 @@ function path_load($pid) { function path_form_validate($form_id, $form_values) { $src = $form_values['src']; $dst = $form_values['dst']; - $pid = $form_values['pid']; + $pid = isset($form_values['pid']) ? $form_values['pid'] : 0; // Language is only set if locale module is enabled, otherwise save for all languages. $language = isset($form_values['language']) ? $form_values['language'] : ''; @@ -376,7 +376,7 @@ function path_form_validate($form_id, $form_values) { */ function path_form_submit($form_id, $form_values) { // Language is only set if locale module is enabled - path_set_alias($form_values['src'], $form_values['dst'], $form_values['pid'], isset($form_values['language']) ? $form_values['language'] : ''); + path_set_alias($form_values['src'], $form_values['dst'], isset($form_values['pid']) ? $form_values['pid'] : 0, isset($form_values['language']) ? $form_values['language'] : ''); drupal_set_message(t('The alias has been saved.')); return 'admin/build/path'; |