summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2010-06-02 12:56:20 (GMT)
committer Gábor Hojtsy2010-06-02 12:56:20 (GMT)
commita875e2dadd96a685c38414c364056c4e8bb9e863 (patch)
treeedea9e43125e0f3e8ae8169b6f1035006dbda947
parent920333ba883b56a9a43dda30a50600bbfe1332ad (diff)
#682784 by andrewfn, naxoc, Island Usurper: make it possible to remove query strings and fragments from menu items after added
-rw-r--r--modules/menu/menu.admin.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc
index a8e8b49..1092afb 100644
--- a/modules/menu/menu.admin.inc
+++ b/modules/menu/menu.admin.inc
@@ -344,9 +344,17 @@ function menu_edit_item_validate($form, &$form_state) {
if (isset($parsed_link['query'])) {
$item['options']['query'] = $parsed_link['query'];
}
+ else {
+ // Use unset() rather than setting to empty string
+ // to avoid redundant serialized data being stored.
+ unset($item['options']['query']);
+ }
if (isset($parsed_link['fragment'])) {
$item['options']['fragment'] = $parsed_link['fragment'];
}
+ else {
+ unset($item['options']['fragment']);
+ }
if ($item['link_path'] != $parsed_link['path']) {
$item['link_path'] = $parsed_link['path'];
}