aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-14 16:25:18 -0700
committerfriendica <info@friendica.com>2013-09-14 16:25:18 -0700
commitd9f3073b60b033eb430ad879fbb414c8ecfcfc65 (patch)
treeea08f2f394691091dbebafe446b12ce15e9c17a9
parent05c8a08ee591feb2f9645c3ea75fb5f6360f73ac (diff)
parentec7b462b1876eb47e38d545bcbcbd05097c31cd5 (diff)
downloadvolse-hubzilla-d9f3073b60b033eb430ad879fbb414c8ecfcfc65.tar.gz
volse-hubzilla-d9f3073b60b033eb430ad879fbb414c8ecfcfc65.tar.bz2
volse-hubzilla-d9f3073b60b033eb430ad879fbb414c8ecfcfc65.zip
Merge pull request #135 from unary/menuedit
allow update of menu_desc, fix bug in duplicate menu_name check
-rw-r--r--include/menu.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/menu.php b/include/menu.php
index 6d614055a..900b48e65 100644
--- a/include/menu.php
+++ b/include/menu.php
@@ -118,6 +118,8 @@ function menu_edit($arr) {
return false;
+ $menu_channel_id = intval($arr['menu_channel_id']);
+
$r = q("select menu_id from menu where menu_name = '%s' and menu_channel_id = %d limit 1",
dbesc($menu_name),
intval($menu_channel_id)
@@ -128,9 +130,6 @@ function menu_edit($arr) {
}
-
- $menu_channel_id = intval($arr['menu_channel_id']);
-
$r = q("select * from menu where menu_id = %d and menu_channel_id = %d limit 1",
intval($menu_id),
intval($menu_channel_id)
@@ -141,14 +140,16 @@ function menu_edit($arr) {
}
- $r = q("select * from menu where menu_name = '%s' and menu_channel_id = %d limit 1",
+ $r = q("select * from menu where menu_name = '%s' and menu_channel_id = %d and menu_desc = '%s' limit 1",
dbesc($menu_name),
- intval($menu_channel_id)
+ intval($menu_channel_id),
+ dbesc($menu_desc)
);
if($r)
return false;
+
return q("update menu set menu_name = '%s', menu_desc = '%s'
where menu_id = %d and menu_channel_id = %d limit 1",
dbesc($menu_name),