summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormoshe weitzman2009-08-09 02:24:28 (GMT)
committer moshe weitzman2009-08-09 02:24:28 (GMT)
commit063bc0a41ef34ead745fa63ba777e7dd9b43fb38 (patch)
treef4386c66059c1046ab0a35dddc955cff381132a1
parent6d939d33c2a60229c6e45a3a10e5fea0e1617329 (diff)
#307980. path alias was attempting to save twice for new Pages. giving duplicate key error on the source. og_panels_form_submit() was calling path_set_alias() twice. once while renumbering, and once again at end of function. Moved code from end of function so it only ran for updates pages. hope thats the right fix. to me it is.
-rw-r--r--modules/og_panels/og_panels.module8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/og_panels/og_panels.module b/modules/og_panels/og_panels.module
index 1876af3..286e7f9 100644
--- a/modules/og_panels/og_panels.module
+++ b/modules/og_panels/og_panels.module
@@ -647,6 +647,9 @@ function og_panels_form_submit($form, &$form_state) {
if ($form_state['values']['did']) {
$sql = "UPDATE {og_panels} SET page_title = '%s', path = '%s', published = %d, show_blocks = %d WHERE did = %d";
db_query($sql, $form_state['values']['page_title'], $form_state['values']['path'], $form_state['values']['published'], $form_state['values']['show_blocks'], $form_state['values']['did']);
+ if ($form_state['values']['path'] != '' && module_exists('path')) {
+ _og_panels_tab_path_alias($form_state['values']['nid'], $form_state['values']['tab_num'], $form_state['values']['path']);
+ }
drupal_set_message(t('Group page updated.'));
}
else {
@@ -660,11 +663,6 @@ function og_panels_form_submit($form, &$form_state) {
drupal_set_message(t('Group page created.'));
$form_state['redirect'] = 'node/'. $form_state['values']['nid']. '/og_panels/'. $display->did .'/panel_layout';
}
-
- // Whether new or an update, we should cycle the path alias.
- if ($form_state['values']['path'] != '' && module_exists('path')) {
- _og_panels_tab_path_alias($form_state['values']['nid'], $form_state['values']['tab_num'], $form_state['values']['path']);
- }
}
/**